netatalk-2.2.2/0000777000175200017500000000000011704770433010335 500000000000000netatalk-2.2.2/Makefile.am0000644000175200017500000000040511655731126012305 00000000000000# Makefile.am for top level of netatalk package SUBDIRS = libatalk bin config etc man contrib distrib include sys doc macros test EXTRA_DIST = CONTRIBUTORS COPYRIGHT COPYING NEWS VERSION services.atalk ACLOCAL_AMFLAGS = -I macros AUTOMAKE_OPTIONS = foreign netatalk-2.2.2/config/0000777000175200017500000000000011704770424011602 500000000000000netatalk-2.2.2/config/Makefile.am0000644000175200017500000001074711655731243013564 00000000000000## Makefile.am for config/ SUBDIRS = pam SUFFIXES = .tmpl . TMPLFILES = afpd.conf.tmpl AppleVolumes.default.tmpl GENFILES = afpd.conf AppleVolumes.default CLEANFILES = $(GENFILES) EXTRA_DIST = \ AppleVolumes.default.tmpl \ AppleVolumes.system \ afp_ldap.conf \ afpd.conf.tmpl \ atalkd.conf \ netatalk.conf \ papd.conf OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ if USE_DEBIAN CONFFILES = AppleVolumes.system else CONFFILES = AppleVolumes.system netatalk.conf endif if HAVE_ACLS CONFFILES += afp_ldap.conf endif if USE_APPLETALK CONFFILES += atalkd.conf papd.conf endif pkgconfdir = @PKGCONFDIR@ webminpath = @WEBMIN_PATH@ webminuser = @WEBMIN_USER@ webminversion = @WEBMIN_VERSION@ webminpass = @WEBMIN_PASS@ webminport = @WEBMIN_PORT@ # # rule to parse template files # .tmpl: sed -e s@:UAMS_PATH:@${UAMS_PATH}@ \ -e s@:ETCDIR:@${pkgconfdir}@ \ -e s@:COMPILED_BACKENDS:@"$(compiled_backends)"@ \ -e s@:DEFAULT_CNID_SCHEME:@$(DEFAULT_CNID_SCHEME)@ \ <$< >$@ # # install configuration files # install-data-local: install-config-files install-webmin uninstall-local: for f in $(CONFFILES) $(GENFILES); do \ echo rm -f $(DESTDIR)$(pkgconfdir)/$$f; \ rm -f $(DESTDIR)$(pkgconfdir)/$$f; \ done if USE_DEBIAN rm -f $(DESTDIR)/etc/default/netatalk endif install-config-files: $(CONFFILES) $(GENFILES) $(mkinstalldirs) $(DESTDIR)$(pkgconfdir) for f in $(CONFFILES) $(GENFILES); do \ if test "x$(OVERWRITE_CONFIG)" = "xyes" -o ! -f $(DESTDIR)$(pkgconfdir)/$$f; then \ echo "$(INSTALL_DATA) $$f $(DESTDIR)$(pkgconfdir)"; \ $(INSTALL_DATA) $$f $(DESTDIR)$(pkgconfdir); \ else \ echo "not overwriting $$f"; \ fi; \ done if USE_DEBIAN $(mkinstalldirs) $(DESTDIR)/etc/default if test "x$(OVERWRITE_CONFIG)" = "xyes" -o ! -f /etc/default/netatalk; then \ echo "$(INSTALL_DATA) $(srcdir)/netatalk.conf $(DESTDIR)/etc/default/netatalk"; \ $(INSTALL_DATA) $(srcdir)/netatalk.conf $(DESTDIR)/etc/default/netatalk; \ else \ echo "not overwriting /etc/default/netatalk"; \ fi endif install-webmin: if test "x$(webminpath)" != "x"; then \ if ! test -d "x$(webminpath)"; then \ mkdir -p "$(webminpath)"; \ fi; \ cd "$(webminpath)"; \ wget http://prdownloads.sourceforge.net/webadmin/webmin-$(webminversion).tar.gz ; \ tar xzf webmin-$(webminversion).tar.gz; \ rm webmin-$(webminversion).tar.gz; \ /etc/init.d/webmin stop; \ rm -r webmin; \ mv webmin-$(webminversion) webmin; \ cd webmin; \ rm -r adsl-client apache at backup-config bacula-backup bandwidth bind8 bsdexports burner \ cfengine cluster-copy cluster-cron cluster-passwd cluster-shell cluster-software cluster-useradmin \ cluster-usermin cluster-webmin custom \ cron dfsadmin dhcpd dnsadmin dovecot exim exports \ fdisk fetchmail file filter firewall format frox fsdump grub heartbeat hpuxexports \ htaccess-htpasswd idmapd inetd inittab ipfilter ipfw ipsec jabber \ ldap-server lilo logrotate lpadmin lvm \ mailboxes mailcap majordomo man mon mscstyle3 mysql \ net nis openslp pap phpini postfix postgresql ppp-client pptp-client pptp-server \ procmail proftpd pserver qmailadmin raid rbac \ samba sarg sendmail sentry sgiexports shell \ shorewall smart-status smf software spam squid sshd \ status stunnel tcpwrappers telnet time tunnel \ updown usermin vgetty webalizer wuftpd xinetd zones; \ wget https://sourceforge.net/projects/netatalk/files/Netatalk%20Webmin%20Module/0.9-beta2/netatalk.wbm.gz/download ; \ tar xzf netatalk.wbm.gz; \ rm netatalk.wbm.gz; \ cd netatalk; \ rm config; \ echo "applevolumedefault_c=$(sysconfdir)/netatalk/AppleVolumes.default" >> config; \ echo "applevolumesystem_c=$(sysconfdir)/netatalk/AppleVolumes.system" >> config; \ echo "afpd_c=$(sysconfdir)/netatalk/afpd.conf" >> config; \ echo "atalk_c=$(sysconfdir)/netatalk/atalk.conf" >> config; \ echo "papd_c=$(sysconfdir)/netatalk/papd.conf" >> config; \ echo "afpd_d=$(sbindir)/afpd" >> config; \ echo "atalkd_d=$(sbindir)/atalkd" >> config; \ echo "papd_d=$(sbindir)/papd" >> config; \ echo "netatalk_c=@PAMDIR@/etc/pam.d" >> config; \ echo "atalk_start=$(sysconfdir)/init.d/atalk" >> config; \ echo "select_minUsers=" >> config; \ echo "select_maxUsers=" >> config; \ echo "atalk_nls=" >> config; \ cd ..; \ config_dir="$(sysconfdir)/netatalk/webmin-config" \ var_dir="$(prefix)/var" \ perl="`which perl`" \ port="$(webminport)" \ login="$(webminuser)" \ password="$(webminpass)" \ ssl=1 \ atboot=1 \ bootscript=netamin \ ./setup.sh > /dev/null; \ fi netatalk-2.2.2/config/Makefile.in0000644000175200017500000005257211703521724013572 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @HAVE_ACLS_TRUE@am__append_1 = afp_ldap.conf @USE_APPLETALK_TRUE@am__append_2 = atalkd.conf papd.conf subdir = config DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = pam SUFFIXES = .tmpl . TMPLFILES = afpd.conf.tmpl AppleVolumes.default.tmpl GENFILES = afpd.conf AppleVolumes.default CLEANFILES = $(GENFILES) EXTRA_DIST = \ AppleVolumes.default.tmpl \ AppleVolumes.system \ afp_ldap.conf \ afpd.conf.tmpl \ atalkd.conf \ netatalk.conf \ papd.conf @USE_DEBIAN_FALSE@CONFFILES = AppleVolumes.system netatalk.conf \ @USE_DEBIAN_FALSE@ $(am__append_1) $(am__append_2) @USE_DEBIAN_TRUE@CONFFILES = AppleVolumes.system $(am__append_1) \ @USE_DEBIAN_TRUE@ $(am__append_2) pkgconfdir = @PKGCONFDIR@ webminpath = @WEBMIN_PATH@ webminuser = @WEBMIN_USER@ webminversion = @WEBMIN_VERSION@ webminpass = @WEBMIN_PASS@ webminport = @WEBMIN_PORT@ all: all-recursive .SUFFIXES: .SUFFIXES: .tmpl . $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign config/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign config/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-data-local install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-local .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-local install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-local # # rule to parse template files # .tmpl: sed -e s@:UAMS_PATH:@${UAMS_PATH}@ \ -e s@:ETCDIR:@${pkgconfdir}@ \ -e s@:COMPILED_BACKENDS:@"$(compiled_backends)"@ \ -e s@:DEFAULT_CNID_SCHEME:@$(DEFAULT_CNID_SCHEME)@ \ <$< >$@ # # install configuration files # install-data-local: install-config-files install-webmin uninstall-local: for f in $(CONFFILES) $(GENFILES); do \ echo rm -f $(DESTDIR)$(pkgconfdir)/$$f; \ rm -f $(DESTDIR)$(pkgconfdir)/$$f; \ done @USE_DEBIAN_TRUE@ rm -f $(DESTDIR)/etc/default/netatalk install-config-files: $(CONFFILES) $(GENFILES) $(mkinstalldirs) $(DESTDIR)$(pkgconfdir) for f in $(CONFFILES) $(GENFILES); do \ if test "x$(OVERWRITE_CONFIG)" = "xyes" -o ! -f $(DESTDIR)$(pkgconfdir)/$$f; then \ echo "$(INSTALL_DATA) $$f $(DESTDIR)$(pkgconfdir)"; \ $(INSTALL_DATA) $$f $(DESTDIR)$(pkgconfdir); \ else \ echo "not overwriting $$f"; \ fi; \ done @USE_DEBIAN_TRUE@ $(mkinstalldirs) $(DESTDIR)/etc/default @USE_DEBIAN_TRUE@ if test "x$(OVERWRITE_CONFIG)" = "xyes" -o ! -f /etc/default/netatalk; then \ @USE_DEBIAN_TRUE@ echo "$(INSTALL_DATA) $(srcdir)/netatalk.conf $(DESTDIR)/etc/default/netatalk"; \ @USE_DEBIAN_TRUE@ $(INSTALL_DATA) $(srcdir)/netatalk.conf $(DESTDIR)/etc/default/netatalk; \ @USE_DEBIAN_TRUE@ else \ @USE_DEBIAN_TRUE@ echo "not overwriting /etc/default/netatalk"; \ @USE_DEBIAN_TRUE@ fi install-webmin: if test "x$(webminpath)" != "x"; then \ if ! test -d "x$(webminpath)"; then \ mkdir -p "$(webminpath)"; \ fi; \ cd "$(webminpath)"; \ wget http://prdownloads.sourceforge.net/webadmin/webmin-$(webminversion).tar.gz ; \ tar xzf webmin-$(webminversion).tar.gz; \ rm webmin-$(webminversion).tar.gz; \ /etc/init.d/webmin stop; \ rm -r webmin; \ mv webmin-$(webminversion) webmin; \ cd webmin; \ rm -r adsl-client apache at backup-config bacula-backup bandwidth bind8 bsdexports burner \ cfengine cluster-copy cluster-cron cluster-passwd cluster-shell cluster-software cluster-useradmin \ cluster-usermin cluster-webmin custom \ cron dfsadmin dhcpd dnsadmin dovecot exim exports \ fdisk fetchmail file filter firewall format frox fsdump grub heartbeat hpuxexports \ htaccess-htpasswd idmapd inetd inittab ipfilter ipfw ipsec jabber \ ldap-server lilo logrotate lpadmin lvm \ mailboxes mailcap majordomo man mon mscstyle3 mysql \ net nis openslp pap phpini postfix postgresql ppp-client pptp-client pptp-server \ procmail proftpd pserver qmailadmin raid rbac \ samba sarg sendmail sentry sgiexports shell \ shorewall smart-status smf software spam squid sshd \ status stunnel tcpwrappers telnet time tunnel \ updown usermin vgetty webalizer wuftpd xinetd zones; \ wget https://sourceforge.net/projects/netatalk/files/Netatalk%20Webmin%20Module/0.9-beta2/netatalk.wbm.gz/download ; \ tar xzf netatalk.wbm.gz; \ rm netatalk.wbm.gz; \ cd netatalk; \ rm config; \ echo "applevolumedefault_c=$(sysconfdir)/netatalk/AppleVolumes.default" >> config; \ echo "applevolumesystem_c=$(sysconfdir)/netatalk/AppleVolumes.system" >> config; \ echo "afpd_c=$(sysconfdir)/netatalk/afpd.conf" >> config; \ echo "atalk_c=$(sysconfdir)/netatalk/atalk.conf" >> config; \ echo "papd_c=$(sysconfdir)/netatalk/papd.conf" >> config; \ echo "afpd_d=$(sbindir)/afpd" >> config; \ echo "atalkd_d=$(sbindir)/atalkd" >> config; \ echo "papd_d=$(sbindir)/papd" >> config; \ echo "netatalk_c=@PAMDIR@/etc/pam.d" >> config; \ echo "atalk_start=$(sysconfdir)/init.d/atalk" >> config; \ echo "select_minUsers=" >> config; \ echo "select_maxUsers=" >> config; \ echo "atalk_nls=" >> config; \ cd ..; \ config_dir="$(sysconfdir)/netatalk/webmin-config" \ var_dir="$(prefix)/var" \ perl="`which perl`" \ port="$(webminport)" \ login="$(webminuser)" \ password="$(webminpass)" \ ssl=1 \ atboot=1 \ bootscript=netamin \ ./setup.sh > /dev/null; \ fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/config/afpd.conf.tmpl0000644000175200017500000004715611655731243014270 00000000000000# # CONFIGURATION FOR AFPD # # Each single line defines a virtual server that should be available. # Though, using "\" character, newline escaping is supported. # Empty lines and lines beginning with `#' are ignored. # Options in this file will override both compiled-in defaults # and command line options. # # # Format: # - [options] to specify options for the default server # "Server name" [options] to specify an additional server # # # The following options are available: # Transport Protocols: # -[no]tcp Make "AFP over TCP" [not] available # -[no]ddp Make "AFP over AppleTalk" [not] available. # If you have -proxy specified, specify -uamlist "" to # prevent ddp connections from working. # # -transall Make both available # # Transport Options: # -ipaddr Specifies the IP address that the server should # advertise and listens to. The default is advertise # the first IP address of the system, but to listen # for any incoming request. The network address may # be specified either in dotted-decimal format for # IPv4 or in hexadecimal format for IPv6. # This option also allows to use one machine to # advertise the AFP-over-TCP/IP settings of another # machine via NBP when used together with the -proxy # option. # -server_quantum # Specifies the DSI server quantum. The minimum # value is 1MB. The max value is 0xFFFFFFFF. If you # specify a value that is out of range, you'll get # the default value (currently the minimum). # -admingroup # Specifies the group of administrators who should # all be seen as the superuser when they log in. # Default is disabled. # -ddpaddr x.y Specifies the DDP address of the server. # the default is to auto-assign an address (0.0). # this is only useful if you're running on # a multihomed host. # -port Specifies the TCP port the server should respond # to (default is 548) # -fqdn specify a fully-qualified domain name (+optional # port). this gets discarded if the server can't # resolve it. this is not honored by appleshare # clients <= 3.8.3 (default: none) # -hostname Use this instead of the result from calling # hostname for dertermening which IP address to # advertise, therfore the hostname is resolved to # an IP which is the advertised. This is NOT used for # listening and it is also overwritten by -ipaddr. # -proxy Run an AppleTalk proxy server for specified # AFP/TCP server (if address/port aren't given, # then first IP address of the system/548 will # be used). # if you don't want the proxy server to act as # a ddp server as well, set -uamlist to an empty # string. # -dsireadbuf [number] # Scale factor that determines the size of the # DSI/TCP readahead buffer, default is 12. This is # multiplies with the DSI server quantum (default # ~300k) to give the size of the buffer. Increasing # this value might increase throughput in fast local # networks for volume to volume copies. Note: This # buffer is allocated per afpd child process, so # specifying large values will eat up large amount of # memory (buffer size * number of clients). # -tcprcvbuf [number] # Try to set TCP receive buffer using setsockpt(). # Often OSes impose restrictions on the applications # ability to set this value. # -tcpsndbuf [number] # Try to set TCP send buffer using setsockpt(). # Often OSes impose restrictions on the applications # ability to set this value. # -slp Register this server with the Service Location # Protocol (if SLP support was compiled in). # -nozeroconf Don't register this server with the Multicats # DNS Protocol. # -advertise_ssh Allows Mac OS X clients (10.3.3-10.4) to # automagically establish a tunneled AFP connection # through SSH. This option is not so significant # for the recent Mac OS X. See the Netatalk Manual # in detail. # # # Authentication Methods: # -uampath Use this path to look for User Authentication Modules. # (default: :UAMS_PATH:) # -uamlist Comma-separated list of UAMs. # (default: uams_dhx.so,uams_dhx2.so) # # some commonly available UAMs: # uams_guest.so: Allow guest logins # # uams_clrtxt.so: (uams_pam.so or uams_passwd.so) # Allow logins with passwords # transmitted in the clear. # # uams_randnum.so: Allow Random Number and Two-Way # Random Number exchange for # authentication. # # uams_dhx.so: (uams_dhx_pam.so or uams_dhx_passwd.so) # Allow Diffie-Hellman eXchange # (DHX) for authentication. # # uams_dhx2.so: (uams_dhx2_pam.so or uams_dhx2_passwd.so) # Allow Diffie-Hellman eXchange 2 # (DHX2) for authentication. # # Password Options: # -[no]savepassword [Don't] Allow clients to save password locally # -passwdfile Use this path to store Randnum passwords. # (Default: :ETCDIR:/afppasswd. The only other # useful value is ~/.passwd. See 'man afppasswd' # for details.) # -passwdminlen <#> minimum password length. may be ignored. # -[no]setpassword [Don't] Allow clients to change their passwords. # -loginmaxfail <#> maximum number of failed logins. this may be # ignored if the uam can't handle it. # # AppleVolumes files: # -defaultvol Specifies path to AppleVolumes.default file # (default :ETCDIR:/AppleVolumes.default, # same as -f on command line) # -systemvol Specifies path to AppleVolumes.system file # (default :ETCDIR:/AppleVolumes.system, # same as -s on command line) # -[no]uservolfirst [Don't] read the user's ~/AppleVolumes or # ~/.AppleVolumes before reading # :ETCDIR:/AppleVolumes.default # (same as -u on command line) # -[no]uservol [Don't] Read the user's volume file # -closevol Immediately unmount volumes removed from # AppleVolumes files on SIGHUP sent to the afp # master process. # # Miscellaneous: # -authprintdir Specifies the path to be used (per server) to # store the files required to do CAP-style # print authentication which papd will examine # to determine if a print job should be allowed. # These files are created at login and if they # are to be properly removed, this directory # probably needs to be umode 1777 # -guestname "user" Specifies the user name for the guest login # (default "nobody", same as -g on command line) # -loginmesg "Message" Client will display "Message" upon logging in # (no default, same as -l "Message" on commandline) # -nodebug Switch off debugging # -client_polling With this switch enabled, afpd won't advertise # that it is capable of server notifications, so that # connected clients poll the server every 10 seconds # to detect changes in opened server windows. # Note: Depending on the number of simultaneously # connected clients and the network's speed, this can # lead to a significant higher load on your network! # -sleep AFP 3.x wait number hours before disconnecting # clients in sleep mode. Default 10 hours # -tickleval Specify the tickle timeout interval (in seconds). # Note, this defaults to 30 seconds, and really # shouldn't be changed. If you want to control # the server idle timeout, use the -timeout option. # -timeout Specify the number of tickles to send before # timing out a connection. # The default is 4, therefore a connection will # timeout in 2 minutes. # -[no]icon [Don't] Use the platform-specific icon. Recent # Mac OS don't display it any longer. # -volnamelen # Max length of UTF8-MAC volume name for Mac OS X. # Note that Hangul is especially sensitive to this. # 255: limit of spec # 80: limit of generic Mac OS X (default) # 73: limit of Mac OS X 10.1, if >= 74 # Finder crashed and restart repeatedly. # Mac OS 9 and earlier is not influenced by this, # Maccharset volume names are always limitted to 27. # -[un]setuplog " []" # Specify that any message of a loglevel up to the # given loglevel should be logged to the given file. # If the filename is ommited the loglevel applies to # messages passed to syslog. # # By default (no explicit -setuplog and no buildtime # configure flag --with-logfile) afpd logs to syslog # with a default logging setup equivalent to # "-setuplog default log_info". # # If build with --with-logfile[=somefile] # (default logfile /var/log/netatalk.log) afpd # defaults to a setup that is equivalent to # "-setuplog default log_info [netatalk.log|somefile]" # # logtypes: Default, AFPDaemon, Logger, UAMSDaemon # loglevels: LOG_SEVERE, LOG_ERROR, LOG_WARN, # LOG_NOTE, LOG_INFO, LOG_DEBUG, # LOG_DEBUG6, LOG_DEBUG7, LOG_DEBUG8, # LOG_DEBUG9, LOG_MAXDEBUG # # Example: Useful default config # -setuplog "default log_info /var/log/afpd.log" # # Debugging config # -setuplog "default log_maxdebug /var/log/afpd.log" # # -signature { user: | auto } # Specify a server signature. This option is useful # while running multiple independent instances of # afpd on one machine (eg. in clustered environments, # to provide fault isolation etc.). # Default is "auto". # "auto" signature type allows afpd generating # signature and saving it to afp_signature.conf # automatically (based on random number). # "host" signature type switches back to "auto" # because it is obsoleted. # "user" signature type allows administrator to # set up a signature string manually. # Examples: three servers running on one machine: # first -signature user:USERS # second -signature user:USERS # third -signature user:ADMINS # First two servers will act as one logical AFP # service. If user logs in to first one and then # connects to second one, session will be # automatically redirected to the first one. But if # client connects to first and then to third, # will be asked for password twice and will see # resources of both servers. # Traditional method of signature generation causes # two independent afpd instances to have the same # signature and thus cause clients to be redirected # automatically to server (s)he logged in first. # -k5keytab # -k5service # -k5realm # These are required if the server supports # Kerberos 5 authentication # -ntdomain # -ntseparator # Use for eg. winbind authentication, prepends # both strings before the username from login and # then tries to authenticate with the result # through the availabel and active UAM authentication # modules. # -dircachesize entries # Maximum possible entries in the directory cache. # The cache stores directories and files. It is used # to cache the full path to directories and CNIDs # which considerably speeds up directory enumeration. # Default size is 8192, maximum size is 131072. Given # value is rounded up to nearest power of 2. Each # entry takes about 100 bytes, which is not much, but # remember that every afpd child process for every # connected user has its cache. # -fcelistener host[:port] # Enables sending FCE events to the specified host, # default port is 12250 if not specified. Specifying # mutliple listeners is done by having this option # once for each of them. # -fceevents fmod,fdel,ddel,fcre,dcre,tmsz # Speficies which FCE events are active, default is # fmod,fdel,ddel,fcre,dcre. # -fcecoalesce all|delete|create # Coalesce FCE events. # -fceholdfmod seconds # This determines the time delay in seconds which is # always waited if another file modification for the # same file is done by a client before sending an FCE # file modification event (fmod). For example saving # a file in Photoshop would generate multiple events # by itself because the application is opening, # modifying and closing a file mutliple times for # every "save". Defautl: 60 seconds. # -keepsessions Enable "Continuous AFP Service". This means the # ability to stop the master afpd process with a # SIGQUIT signal, possibly install an afpd update and # start the afpd process. Existing AFP sessions afpd # processes will remain unaffected. Technically they # will be notified of the master afpd shutdown, sleep # 15-20 seconds and then try to reconnect their IPC # channel to the master afpd process. If this # reconnect fails, the sessions are in an undefined # state. Therefor it's absolutely critical to restart # the master process in time! # -noacl2maccess Don't map filesystem ACLs to effective permissions. # # Codepage Options: # -unixcodepage Specifies the servers unix codepage, # e.g. "ISO-8859-15" or "UTF8". # This is used to convert strings to/from # the systems locale, e.g. for authenthication. # Defaults to LOCALE if your system supports it, # otherwise ASCII will be used. # # -maccodepage Specifies the legacy clients (<= Mac OS 9) # codepage, e.g. "MAC_ROMAN". # This is used to convert strings to the # systems locale, e.g. for authenthication # and SIGUSR2 messaging. This will also be # the default for volumes maccharset. # # CNID related options: # -cnidserver # Specifies the IP address and port of a # cnid_metad server, required for CNID dbd # backend. Defaults to localhost:4700. # The network address may be specified either # in dotted-decimal format for IPv4 or in # hexadecimal format for IPv6. # # Avahi (Bonjour) related options: # -mimicmodel # Specifies the icon model that appears on # clients. Defaults to off. Examples: RackMac # (same as Xserve), PowerBook, PowerMac, Macmini, # iMac, MacBook, MacBookPro, MacBookAir, MacPro, # AppleTV1,1, AirPort # # # Some examples: # # The simplest case is to not have an afpd.conf. # # 4 servers w/ names server1-3 and one w/ the hostname. servers # 1-3 get routed to different ports with server 3 being bound # specifically to address 192.168.1.3 # # - # server1 -port 12000 # server2 -port 12001 # server3 -port 12002 -ipaddr 192.168.1.3 # # a dedicated guest server, a user server, and a special # AppleTalk-only server: # # "Guest Server" -uamlist uams_guest.so \ # -loginmesg "Welcome guest! I'm a public server." # "User Server" -uamlist uams_dhx2.so -port 12000 # "special" -ddp -notcp -defaultvol -systemvol # # default: # - -tcp -noddp -uamlist uams_dhx.so,uams_dhx2.so -nosavepassword netatalk-2.2.2/config/AppleVolumes.default.tmpl0000644000175200017500000002260111655731243016455 00000000000000# This file looks empty when viewed with "vi". In fact, there is one # '~', so users with no AppleVolumes file in their home directory get # their home directory by default. # # volume format: # :DEFAULT: [all of the default options except volume name] # path [name] [casefold:x] [options:z,l,j] \ # [allow:a,@b,c,d] [deny:a,@b,c,d] [dbpath:path] [password:p] \ # [rwlist:a,@b,c,d] [rolist:a,@b,c,d] [limitsize:value in bytes] \ # [preexec:cmd] [root_preexec:cmd] [postexec:cmd] [root_postexec:cmd] \ # [allowed_hosts:IPv4 address[/IPv4 netmask bits]] \ # [denied_hosts:IPv4 address[/IPv4 netmask bits]] \ # ... more, see below ... # # name: volume name. it can't include the ':' character # # # variable substitutions: # you can use variables for both and now. here are the # rules: # 1) if you specify an unknown variable, it will not get converted. # 2) if you specify a known variable, but that variable doesn't have # a value, it will get ignored. # # the variables: # $b -> basename of path # $c -> client's ip or appletalk address # $d -> volume pathname on server # $f -> full name (whatever's in the gecos field) # $g -> group # $h -> hostname # $i -> client ip without tcp port or appletalk network # $s -> server name (can be the hostname) # $u -> username (if guest, it's whatever user guest is running as) # $v -> volume name (either ADEID_NAME or basename of path) # $z -> zone (may not exist) # $$ -> $ # # # casefold options [syntax: casefold:option]: # tolower -> lowercases names in both directions # toupper -> uppercases names in both directions # xlatelower -> client sees lowercase, server sees uppercase # xlateupper -> client sees uppercase, server sees lowercase # # allow/deny/rwlist/rolist format [syntax: allow:user1,@group]: # user1,@group,user2 -> allows/denies access from listed users/groups # rwlist/rolist control whether or not the # volume is ro for those users. # allowed_hosts -> Only listed hosts and networks are allowed, # all others are rejected. Example: # allowed_hosts:10.1.0.0/16,10.2.1.100 # denied_hosts -> Listed hosts and nets are rejected, # all others are allowed. Example: # denied_hosts: 192.168.100/24,10.1.1.1 # preexec -> command to be run when the volume is mounted, # ignore for user defined volumes # root_preexec -> command to be run as root when the volume is mounted, # ignore for user defined volumes # postexec -> command to be run when the volume is closed, # ignore for user defined volumes # root_postexec -> command to be run as root when the volume is closed, # ignore for user defined volumes # veto -> hide files and directories,where the path matches # one of the "/" delimited vetoed names. Matches are # partial, e.g. path is /abc/def/file and veto:/abc/ # will hide the file. # adouble -> specify the format of the metadata files. # default is "v2". netatalk 1.x used "v1". # "osx" cannot be treated normally any longer. # volsizelimit -> size in MiB. Useful for TimeMachine: limits the # reported volume size, thus preventing TM from using # the whole real disk space for backup. # Example: "volsizelimit:1000" would limit the # reported disk space to 1 GB. # # codepage options [syntax: options:charsetname] # volcharset -> specifies the charset to be used # as the volume codepage # e.g. "UTF8", "UTF8-MAC", "ISO-8859-15" # maccharset -> specifies the charset to be used # as the legacy client (<=Mac OS 9) codepage # e.g. "MAC_ROMAN", "MAC_CYRILLIC" # # perm -> default permission value # OR with the client requested perm # Use with options:upriv # dperm -> default permission value for directories # OR with the client requested perm # Use with options:upriv # fperm -> default permission value for files # OR with the client requested perm # Use with options:upriv # umask -> set perm mask # Use with options:upriv # dbpath:path -> store the database stuff in the following path. # cnidserver:server[:port] # -> Query this servername or IP address # (default:localhost) and port (default: 4700) # for CNIDs. Only used with CNID backend "dbd". # This option here overrides any setting from # afpd.conf:cnidserver. # password:password -> set a volume password (8 characters max) # cnidscheme:scheme -> set the cnid scheme for the volume, # default is [:DEFAULT_CNID_SCHEME:] # available schemes: [:COMPILED_BACKENDS:] # ea -> none|auto|sys|ad # Specify how Extended Attributes are stores. default # is auto. # auto: try "sys" (by setting an EA on the shared # directory itself), fallback to "ad". Requires # writable volume for performing the test. # Note: options:ro overwrites "auto" with "none." # sys: Use filesystem EAs # ad: Use files in AppleDouble directories # none: No EA support # # # miscellaneous options [syntax: options:option1,option2]: # tm -> enable TimeMachine support # prodos -> make compatible with appleII clients. # crlf -> enable crlf translation for TEXT files. # noadouble -> don't create .AppleDouble unless a resource # fork needs to be created. # ro -> mount the volume as read-only. # mswindows -> enforce filename restrictions imposed by MS # Windows. this will also invoke a default # codepage (iso8859-1) if one isn't already # specified. # nohex -> don't do :hex translations for anything # except dot files. specify usedots as well if # you want that turned off. note: this option # makes the / character illegal. # usedots -> don't do :hex translation for dot files. note: when # this option gets set, certain file names # become illegal. these are .Parent and # anything that starts with .Apple. # invisibledots -> don't do :hex translation for dot files. note: when # this option gets set, certain file names # become illegal. these are .Parent and # anything that starts with .Apple. also, dot # files created on the unix side are marked invisible. # limitsize -> limit disk size reporting to 2GB. this is # here for older macintoshes using newer # appleshare clients. yucko. # nofileid -> don't advertise createfileid, resolveid, deleteid # calls # root_preexec_close -> a non-zero return code from root_preexec close the # volume being mounted. # preexec_close -> a non-zero return code from preexec close the # volume being mounted. # nostat -> don't stat volume path when enumerating volumes list # upriv -> use unix privilege. # illegalseq -> encode illegal sequence in filename asis, # ex "\217-", which is not a valid SHIFT-JIS char, # is encoded as U\217 - # nocnidcache -> Don't store and read CNID to/from AppleDouble file. # This should not be used as it also prevents a CNID # database rebuild with `dbd`! # caseinsensitive -> The underlying FS is case insensitive (only # test with JFS in OS2 mode) # dropbox -> Allows a volume to be declared as being a "dropbox." # Note that netatalk must be compiled with dropkludge # support for this to function. Warning: This option # is deprecated and might not work as expected. # dropkludge -> same as "dropbox" # nodev -> always use 0 for device number, helps when the # device number is not constant across a reboot, # cluster, ... # # The line below sets some DEFAULT, starting with Netatalk 2.1. :DEFAULT: options:upriv,usedots # The "~" below indicates that Home directories are visible by default. # If you do not wish to have people accessing their Home directories, # please put a pound sign in front of the tilde or delete it. ~ # End of File netatalk-2.2.2/config/AppleVolumes.system0000644000175200017500000006206211655731126015407 00000000000000# ($Id) ### ### Delete a '#' character at the head of line if you need. ### If clients are Mac OS X only, it is not especially necessary. ### However, it might be useful for Mac OS 9 or earlier. ### ### Use at your own risk. No guarantees express or implied. ### ### Try to use MacPerl script 'ICDumpSuffixMap' included in /usr/doc ### to download file mapping list from your Internet Config Preference. ### ### inoue@ma.ns.musashi-tech.ac.jp. ### ### default translation -- note that CR <-> LF translation is done on all ### files of type TEXT (if crlf is set in volume's options). ### The first line turns off translation for files of unknown type, ### the third turns this translation on. ###. "????" "????" Unix Binary Unix application/octet-stream ###. "BINA" "UNIX" Unix Binary Unix application/octet-stream ###. "TEXT" "ttxt" ASCII Text SimpleText text/plain #.1st "TEXT" "ttxt" Text Readme SimpleText application/text #.669 "6669" "SNPL" 669 MOD Music PlayerPro #.8med "STrk" "SCPL" Amiga OctaMed music SoundApp #.8svx "8SVX" "SCPL" Amiga 8-bit sound SoundApp #.a "TEXT" "ttxt" Assembly Source SimpleText #.aif "AIFF" "SCPL" AIFF Sound SoundApp audio/x-aiff #.aifc "AIFC" "SCPL" AIFF Sound Compressed SoundApp audio/x-aiff #.aiff "AIFF" "SCPL" AIFF Sound SoundApp audio/x-aiff #.al "ALAW" "SCPL" ALAW Sound SoundApp #.ani "ANIi" "GKON" Animated NeoChrome GraphicConverter #.apd "TEXT" "ALD3" Aldus Printer Description Aldus PageMaker #.arc "mArc" "SITx" PC ARChive StuffIt Expander #.arj "BINA" "DArj" ARJ Archive DeArj #.arr "ARR " "GKON" Amber ARR image GraphicConverter #.art "ART " "GKON" First Publisher GraphicConverter #.asc "TEXT" "ttxt" ASCII Text SimpleText text/plain #.ascii "TEXT" "ttxt" ASCII Text SimpleText text/plain #.asf "ASF_" "Ms01" Netshow Player Netshow Server video/x-ms-asf #.asm "TEXT" "ttxt" Assembly Source SimpleText #.asx "ASX_" "Ms01" Netshow Player Netshow Server video/x-ms-asf #.au "ULAW" "TVOD" Sun Sound QuickTime Player audio/basic #.avi "VfW " "TVOD" AVI Movie QuickTime Player video/avi #.bar "BARF" "S691" Unix BAR Archive SunTar #.bas "TEXT" "ttxt" BASIC Source SimpleText #.bat "TEXT" "ttxt" MS-DOS Batch File SimpleText #.bga "BMPp" "ogle" OS/2 Bitmap PictureViewer #.bib "TEXT" "ttxt" BibTex Bibliography SimpleText #.bin "SIT!" "SITx" MacBinary StuffIt Expander application/macbinary #.binary "BINA" "hDmp" Untyped Binary Data HexEdit application/octet-stream #.bmp "BMPp" "ogle" Windows Bitmap PictureViewer #.boo "TEXT" "ttxt" BOO encoded SimpleText #.bst "TEXT" "ttxt" BibTex Style SimpleText #.bw "SGI " "GKON" SGI Image GraphicConverter #.c "TEXT" "CWIE" C Source CodeWarrior #.cgm "CGMm" "GKON" Computer Graphics Meta GraphicConverter #.class "Clss" "CWIE" Java Class File CodeWarrior #.clp "CLPp" "GKON" Windows Clipboard GraphicConverter #.cmd "TEXT" "ttxt" OS/2 Batch File SimpleText #.com "PCFA" "SWIN" MS-DOS Executable SoftWindows #.cp "TEXT" "CWIE" C++ Source CodeWarrior #.cpp "TEXT" "CWIE" C++ Source CodeWarrior #.cpt "PACT" "SITx" Compact Pro Archive StuffIt Expander #.csv "TEXT" "XCEL" Comma Separated Vars Excel #.ct "..CT" "GKON" Scitex-CT GraphicConverter #.cut "Halo" "GKON" Dr Halo Image GraphicConverter #.cvs "drw2" "DAD2" Canvas Drawing Canvas #.dbf "COMP" "FOX+" DBase Document FoxBase+ #.dcx "DCXx" "GKON" Some PCX Images GraphicConverter #.dif "TEXT" "XCEL" Data Interchange Format Excel #.diz "TEXT" "R*Ch" BBS Descriptive Text BBEdit #.dl "DL " "AnVw" DL Animation MacAnim Viewer #.dll "PCFL" "SWIN" Windows DLL SoftWindows #.doc "WDBN" "MSWD" Word Document Microsoft Word application/msword #.dot "sDBN" "MSWD" Word for Windows Template Microsoft Word #.dvi "ODVI" "xdvi" TeX DVI Document xdvi application/x-dvi #.dwt "TEXT" "DmWr" Dreamweaver Template Dreamweaver #.dxf "TEXT" "SWVL" AutoCAD 3D Data Swivel Pro #.eps "EPSF" "vgrd" Postscript LaserWriter 8 application/postscript #.epsf "EPSF" "vgrd" Postscript LaserWriter 8 application/postscript #.etx "TEXT" "ezVu" SEText Easy View text/x-setext #.evy "EVYD" "ENVY" Envoy Document Envoy #.exe "PCFA" "SWIN" MS-DOS Executable SoftWindows #.faq "TEXT" "ttxt" ASCII Text SimpleText text/x-usenet-faq #.fit "FITS" "GKON" Flexible Image Transport GraphicConverter image/x-fits #.flc "FLI " "TVOD" FLIC Animation QuickTime Player #.fli "FLI " "TVOD" FLI Animation QuickTime Player #.fm "FMPR" "FMPR" FileMaker Pro Database FileMaker Pro #.for "TEXT" "MPS " Fortran Source MPW Shell #.fts "FITS" "GKON" Flexible Image Transport GraphicConverter #.gem "GEM-" "GKON" GEM Metafile GraphicConverter #.gif "GIFf" "ogle" GIF Picture PictureViewer image/gif #.gl "GL " "AnVw" GL Animation MacAnim Viewer #.grp "GRPp" "GKON" GRP Image GraphicConverter #.gz "SIT!" "SITx" Gnu ZIP Archive StuffIt Expander application/x-gzip #.h "TEXT" "CWIE" C Include File CodeWarrior #.hcom "FSSD" "SCPL" SoundEdit Sound ex SOX SoundApp #.hp "TEXT" "CWIE" C Include File CodeWarrior #.hpgl "HPGL" "GKON" HP GL/2 GraphicConverter #.hpp "TEXT" "CWIE" C Include File CodeWarrior #.hqx "TEXT" "SITx" BinHex StuffIt Expander application/mac-binhex40 #.htm "TEXT" "MOSS" HyperText Netscape Communicator text/html #.html "TEXT" "MOSS" HyperText Netscape Communicator text/html #.i3 "TEXT" "R*ch" Modula 3 Interface BBEdit #.ic1 "IMAG" "GKON" Atari Image GraphicConverter #.ic2 "IMAG" "GKON" Atari Image GraphicConverter #.ic3 "IMAG" "GKON" Atari Image GraphicConverter #.icn "ICO " "GKON" Windows Icon GraphicConverter #.ico "ICO " "GKON" Windows Icon GraphicConverter #.ief "IEF " "GKON" IEF image GraphicConverter image/ief #.iff "ILBM" "GKON" Amiga IFF Image GraphicConverter #.ilbm "ILBM" "GKON" Amiga ILBM Image GraphicConverter #.image "dImg" "ddsk" Apple DiskCopy Image Disk Copy #.img "IMGg" "GKON" GEM bit image/XIMG GraphicConverter #.ini "TEXT" "ttxt" Windows INI File SimpleText #.java "TEXT" "CWIE" Java Source File CodeWarrior #.jfif "JPEG" "ogle" JFIF Image PictureViewer #.jpe "JPEG" "ogle" JPEG Picture PictureViewer image/jpeg #.jpeg "JPEG" "ogle" JPEG Picture PictureViewer image/jpeg #.jpg "JPEG" "ogle" JPEG Picture PictureViewer image/jpeg #.latex "TEXT" "OTEX" Latex OzTex application/x-latex #.lbm "ILBM" "GKON" Amiga IFF Image GraphicConverter #.lha "LHA " "SITx" LHArc Archive StuffIt Expander #.lzh "LHA " "SITx" LHArc Archive StuffIt Expander #.m1a "MPEG" "TVOD" MPEG-1 audiostream MoviePlayer audio/x-mpeg #.m1s "MPEG" "TVOD" MPEG-1 systemstream MoviePlayer #.m1v "M1V " "TVOD" MPEG-1 IPB videostream MoviePlayer video/mpeg #.m2 "TEXT" "R*ch" Modula 2 Source BBEdit #.m2v "MPG2" "MPG2" MPEG-2 IPB videostream MPEG2decoder #.m3 "TEXT" "R*ch" Modula 3 Source BBEdit #.mac "PICT" "ogle" PICT Picture PictureViewer image/x-pict #.mak "TEXT" "R*ch" Makefile BBEdit #.mcw "WDBN" "MSWD" Mac Word Document Microsoft Word #.me "TEXT" "ttxt" Text Readme SimpleText #.med "STrk" "SCPL" Amiga MED Sound SoundApp #.mf "TEXT" "*MF*" Metafont Metafont #.mid "Midi" "TVOD" MIDI Music MoviePlayer #.midi "Midi" "TVOD" MIDI Music MoviePlayer #.mif "TEXT" "Fram" FrameMaker MIF FrameMaker application/x-framemaker #.mime "TEXT" "SITx" MIME Message StuffIt Expander message/rfc822 #.ml "TEXT" "R*ch" ML Source BBEdit #.mod "STrk" "SCPL" MOD Music SoundApp #.mol "TEXT" "RSML" MDL Molfile RasMac #.moov "MooV" "TVOD" QuickTime Movie MoviePlayer video/quicktime #.mov "MooV" "TVOD" QuickTime Movie MoviePlayer video/quicktime #.mp2 "MPEG" "TVOD" MPEG-1 audiostream MoviePlayer audio/x-mpeg #.mp3 "MPG3" "TVOD" MPEG-3 audiostream MoviePlayer audio/x-mpeg #.mpa "MPEG" "TVOD" MPEG-1 audiostream MoviePlayer audio/x-mpeg #.mpe "MPEG" "TVOD" MPEG Movie of some sort MoviePlayer video/mpeg #.mpeg "MPEG" "TVOD" MPEG Movie of some sort MoviePlayer video/mpeg #.mpg "MPEG" "TVOD" MPEG Movie of some sort MoviePlayer video/mpeg #.msp "MSPp" "GKON" Microsoft Paint GraphicConverter #.mtm "MTM " "SNPL" MultiMOD Music PlayerPro #.mw "MW2D" "MWII" MacWrite Document MacWrite II application/macwriteii #.mwii "MW2D" "MWII" MacWrite Document MacWrite II application/macwriteii #.neo "NeoC" "GKON" Atari NeoChrome GraphicConverter #.nfo "TEXT" "ttxt" Info Text SimpleText application/text #.nst "STrk" "SCPL" MOD Music SoundApp #.obj "PCFL" "SWIN" Object (DOS/Windows) SoftWindows #.oda "ODIF" "ODA " ODA Document MacODA XTND Translator application/oda #.okt "OKTA" "SCPL" Oktalyser MOD Music SoundApp #.out "BINA" "hDmp" Output File HexEdit #.ovl "PCFL" "SWIN" Overlay (DOS/Windows) SoftWindows #.p "TEXT" "CWIE" Pascal Source CodeWarrior #.pac "STAD" "GKON" Atari STAD Image GraphicConverter #.pas "TEXT" "CWIE" Pascal Source CodeWarrior #.pbm "PPGM" "GKON" Portable Bitmap GraphicConverter image/x-portable-bitmap #.pc1 "Dega" "GKON" Atari Degas Image GraphicConverter #.pc2 "Dega" "GKON" Atari Degas Image GraphicConverter #.pc3 "Dega" "GKON" Atari Degas Image GraphicConverter #.pcs "PICS" "GKON" Animated PICTs GraphicConverter #.pct "PICT" "ogle" PICT Picture PictureViewer image/x-pict #.pcx "PCXx" "GKON" PC PaintBrush GraphicConverter #.pdb "TEXT" "RSML" Brookhaven PDB file RasMac #.pdf "PDF " "CARO" Portable Document Format Acrobat Reader application/pdf #.pdx "TEXT" "ALD5" Printer Description PageMaker #.pf "CSIT" "SITx" Private File StuffIt Expander #.pgm "PPGM" "GKON" Portable Graymap GraphicConverter image/x-portable-graymap #.pi1 "Dega" "GKON" Atari Degas Image GraphicConverter #.pi2 "Dega" "GKON" Atari Degas Image GraphicConverter #.pi3 "Dega" "GKON" Atari Degas Image GraphicConverter #.pic "PICT" "ogle" PICT Picture PictureViewer image/x-pict #.pict "PICT" "ogle" PICT Picture PictureViewer image/x-macpict #.pit "PIT " "SITx" PackIt Archive StuffIt Expander #.pkg "HBSF" "SITx" AppleLink Package StuffIt Expander #.pl "TEXT" "McPL" Perl Source MacPerl #.plt "HPGL" "GKON" HP GL/2 GraphicConverter #.pm "PMpm" "GKON" Bitmap from xv GraphicConverter #.pm3 "ALB3" "ALD3" PageMaker 3 Document PageMaker #.pm4 "ALB4" "ALD4" PageMaker 4 Document PageMaker #.pm5 "ALB5" "ALD5" PageMaker 5 Document PageMaker #.png "PNG " "ogle" Portable Network Graphic PictureViewer #.pntg "PNTG" "ogle" Macintosh Painting PictureViewer #.ppd "TEXT" "ALD5" Printer Description PageMaker #.ppm "PPGM" "GKON" Portable Pixmap GraphicConverter image/x-portable-pixmap #.prn "TEXT" "R*ch" Printer Output File BBEdit #.ps "TEXT" "vgrd" PostScript LaserWriter 8 application/postscript #.psd "8BPS" "8BIM" PhotoShop Document Photoshop #.pt4 "ALT4" "ALD4" PageMaker 4 Template PageMaker #.pt5 "ALT5" "ALD5" PageMaker 5 Template PageMaker #.pxr "PXR " "8BIM" Pixar Image Photoshop #.qdv "QDVf" "GKON" QDV image GraphicConverter #.qt "MooV" "TVOD" QuickTime Movie MoviePlayer video/quicktime #.qxd "XDOC" "XPR3" QuarkXpress Document QuarkXpress #.qxt "XTMP" "XPR3" QuarkXpress Template QuarkXpress #.raw "BINA" "GKON" Raw Image GraphicConverter #.readme "TEXT" "ttxt" Text Readme SimpleText application/text #.rgb "SGI " "GKON" SGI Image GraphicConverter image/x-rgb #.rgba "SGI " "GKON" SGI Image GraphicConverter image/x-rgb #.rib "TEXT" "RINI" Renderman 3D Data Renderman #.rif "RIFF" "GKON" RIFF Graphic GraphicConverter #.rle "RLE " "GKON" RLE image GraphicConverter #.rme "TEXT" "ttxt" Text Readme SimpleText #.rpl "FRL!" "REP!" Replica Document Replica #.rsc "rsrc" "RSED" Resource File ResEdit #.rsrc "rsrc" "RSED" Resource File ResEdit #.rtf "TEXT" "MSWD" Rich Text Format Microsoft Word application/rtf #.rtx "TEXT" "R*ch" Rich Text BBEdit text/richtext #.s3m "S3M " "SNPL" ScreamTracker 3 MOD PlayerPro #.scc "MSX " "GKON" MSX pitcure GraphicConverter #.scg "RIX3" "GKON" ColoRIX GraphicConverter #.sci "RIX3" "GKON" ColoRIX GraphicConverter #.scp "RIX3" "GKON" ColoRIX GraphicConverter #.scr "RIX3" "GKON" ColoRIX GraphicConverter #.scu "RIX3" "GKON" ColoRIX GraphicConverter #.sea "APPL" "????" Self-Extracting Archive Self Extracting Archive #.sf "IRCM" "SDHK" IRCAM Sound SoundHack #.sgi ".SGI" "ogle" SGI Image PictureViewer #.sha "TEXT" "UnSh" Unix Shell Archive UnShar application/x-shar #.shar "TEXT" "UnSh" Unix Shell Archive UnShar application/x-shar #.shp "SHPp" "GKON" Printmaster Icon Library GraphicConverter #.sit "SIT!" "SITx" StuffIt 1.5.1 Archive StuffIt Expander application/x-stuffit #.sithqx "TEXT" "SITx" BinHexed StuffIt Archive StuffIt Expander application/mac-binhex40 #.six "SIXE" "GKON" SIXEL image GraphicConverter #.slk "TEXT" "XCEL" SYLK Spreadsheet Excel #.snd "BINA" "SCPL" Sound of various types SoundApp #.spc "Spec" "GKON" Atari Spectrum 512 GraphicConverter #.sr "SUNn" "GKON" Sun Raster Image GraphicConverter #.sty "TEXT" "*TEX" TeX Style Textures #.sun "SUNn" "GKON" Sun Raster Image GraphicConverter #.sup "SCRN" "GKON" StartupScreen GraphicConverter #.svx "8SVX" "SCPL" Amiga IFF Sound SoundApp #.syk "TEXT" "XCEL" SYLK Spreadsheet Excel #.sylk "TEXT" "XCEL" SYLK Spreadsheet Excel #.tar "TARF" "SITx" Unix Tape ARchive StuffIt Expander application/x-tar #.targa "TPIC" "GKON" Truevision Image GraphicConverter #.taz "ZIVU" "SITx" Compressed Tape ARchive StuffIt Expander application/x-compress #.tex "TEXT" "OTEX" TeX Document OzTeX application/x-tex #.texi "TEXT" "OTEX" TeX Document OzTeX #.texinfo "TEXT" "OTEX" TeX Document OzTeX application/x-texinfo #.text "TEXT" "ttxt" ASCII Text SimpleText text/plain #.tga "TPIC" "GKON" Truevision Image GraphicConverter #.tgz "Gzip" "SITx" Gnu ZIPed Tape ARchive StuffIt Expander application/x-gzip #.tif "TIFF" "ogle" TIFF Picture PictureViewer image/tiff #.tiff "TIFF" "ogle" TIFF Picture PictureViewer image/tiff #.tny "TINY" "GKON" Atari TINY Bitmap GraphicConverter #.tsv "TEXT" "XCEL" Tab Separated Values Excel text/tab-separated-values #.tx8 "TEXT" "ttxt" 8-bit ASCII Text SimpleText #.txt "TEXT" "ttxt" ASCII Text SimpleText text/plain #.ul "ULAW" "TVOD" Mu-Law Sound MoviePlayer audio/basic #.url "AURL" "Arch" URL Bookmark Anarchie message/external-body #.uu "TEXT" "SITx" UUEncode StuffIt Expander #.uue "TEXT" "SITx" UUEncode StuffIt Expander #.vff "VFFf" "GKON" DESR VFF Greyscale Image GraphicConverter #.vga "BMPp" "ogle" OS/2 Bitmap PictureViewer #.voc "VOC " "SCPL" VOC Sound SoundApp #.w51 ".WP5" "WPC2" WordPerfect PC 5.1 Doc WordPerfect application/wordperfect5.1 #.wav "WAVE" "TVOD" Windows WAV Sound MoviePlayer audio/x-wav #.wk1 "XLBN" "XCEL" Lotus Spreadsheet r2.1 Excel #.wks "XLBN" "XCEL" Lotus Spreadsheet r1.x Excel #.wmf "WMF " "GKON" Windows Metafile GraphicConverter #.wp ".WP5" "WPC2" WordPerfect PC 5.1 Doc WordPerfect application/wordperfect5.1 #.wp4 ".WP4" "WPC2" WordPerfect PC 4.2 Doc WordPerfect #.wp5 ".WP5" "WPC2" WordPerfect PC 5.x Doc WordPerfect application/wordperfect5.1 #.wp6 ".WP6" "WPC2" WordPerfect PC 6.x Doc WordPerfect #.wpg "WPGf" "GKON" WordPerfect Graphic GraphicConverter #.wpm "WPD1" "WPC2" WordPerfect Mac WordPerfect #.wri "WDBN" "MSWD" MS Write/Windows Microsoft Word #.wve "BINA" "SCPL" PSION sound SoundApp #.x10 "XWDd" "GKON" X-Windows Dump GraphicConverter image/x-xwd #.x11 "XWDd" "GKON" X-Windows Dump GraphicConverter image/x-xwd #.xbm "XBM " "GKON" X-Windows Bitmap GraphicConverter image/x-xbm #.xl "XLS " "XCEL" Excel Spreadsheet Excel #.xlc "XLC " "XCEL" Excel Chart Excel #.xlm "XLM " "XCEL" Excel Macro Excel #.xls "XLS " "XCEL" Excel Spreadsheet Excel #.xlw "XLW " "XCEL" Excel Workspace Excel #.xm "XM " "SNPL" FastTracker MOD Music PlayerPro #.xpm "XPM " "GKON" X-Windows Pixmap GraphicConverter image/x-xpm #.xwd "XWDd" "GKON" X-Windows Dump GraphicConverter image/x-xwd #.Z "ZIVU" "SITx" Unix Compress Archive StuffIt Expander application/x-compress #.zip "ZIP " "SITx" PC ZIP Archive StuffIt Expander application/zip #.zoo "Zoo " "Booz" Zoo Archive MacBooz ### Last Updated Jan 2, 2002 ### Use at your own risk. Take care ! ### ### I'd like to dedicate this as follows code to Miss.Tamaki Imazu ### ### Kazuhiko Okudaira the Nursery Teacher ### kokudaira@hotmail.com #.bld "BLD " "GKON" BLD GraphicConverter #.bum ".bMp" "GKON" QuickTime Importer(QuickDraw) GraphicConverter #.cel "CEL " "GKON" KISS CEL GraphicConverter #.cur "CUR " "GKON" Windows Cursor GraphicConverter #.cwj "CWSS" "cwkj" ClarisWorks Document ClarisWorks 4.0 #.dat "TCLl" "GKON" TCL image GraphicConverter #.hr "TR80" "GKON" TSR-80 HR GraphicConverter #.iss "ISS " "GKON" ISS GraphicConverter #.jif "JIFf" "GKON" JIF99a GraphicConverter #.lwf "lwfF" "GKON" LuraWave(LWF) GraphicConverter #.mbm "MBM " "GKON" PSION 5(MBM) GraphicConverter #.ngg "NGGC" "GKON" Mobile Phone(Nokia)Format GraphicConverter #.nol "NOL " "GKON" Mobile Phone(Nokia)Format GraphicConverter #.pal "8BCT" "8BIM" Color Table GraphicConverter #.pgc "PGCF" "GKON" PGC/PGF Atari Portfolio PCG GraphicConverter #.pics "PICS" "GKON" PICS-PICT Sequence GraphicConverter #.swf "SWFL" "SWF2" Flash Macromedia Flash #.vpb "VPB " "GKON" VPB QUANTEL GraphicConverter #.wbmp "WBMP" "GKON" WBMP GraphicConverter #.x-face "TEXT" "GKON" X-Face GraphicConverter ### Nov 29, 2002 #.fla "SPA " "MFL2" Flash source Macromedia Flash netatalk-2.2.2/config/atalkd.conf0000644000175200017500000000204311655731126013625 00000000000000# # Format of lines in this file: # # interface [ -seed ] [ -router | -dontroute ] # [ -phase { 1 | 2 } ] [ -addr net.node ] # [ -net first[-last] ] [ -zone ZoneName ] ... # # -seed only works if you have multi-interfaces. Any missing arguments are # automatically configured from the network. Note: lines can't actually be # split, tho it's a good idea. # # -router is like -seed but it allows single-interface routing. -dontroute # disables routing for the specified interface. # # Some examples: # # The simplest case is no atalkd.conf. This works on most platforms # (notably not Solaris), since atalkd can discover the local interfaces # on the machine. # # Very slightly more complicated: # # le0 # or # eth0 # # for Solaris/SunOS or Linux. # # A much more complicated example: # # le0 -phase 1 # le1 -seed -phase 2 -addr 66.6 -net 66-67 -zone "No Parking" # # This turns on transition routing between the le0 and le1 # interfaces on a Sun. It also causes atalkd to fail if other # routers disagree about it's configuration of le1. # netatalk-2.2.2/config/afp_ldap.conf0000644000175200017500000000056311655731126014140 00000000000000# ldap_server = localhost # ldap_auth_method = simple # ldap_auth_dn = cn=admin,dc=domain,dc=org # ldap_auth_pw = notthisone # ldap_userbase = ou=users,dc=domain,dc=org # ldap_userscope = one # ldap_groupbase = ou=groups,dc=domain,dc=org # ldap_groupscope = one # ldap_uuid_attr = apple-generateduid # ldap_name_attr = cn # ldap_group_attr = cn netatalk-2.2.2/config/netatalk.conf0000644000175200017500000000373411655731243014200 00000000000000# Netatalk configuration ######################################################################### # Global configuration ######################################################################### #### machine's AFPserver/AppleTalk name. #ATALK_NAME=machinename #### server (unix) and legacy client (<= Mac OS 9) charsets ATALK_UNIX_CHARSET='LOCALE' ATALK_MAC_CHARSET='MAC_ROMAN' #### Don't Edit. export the charsets, read form ENV by apps export ATALK_UNIX_CHARSET export ATALK_MAC_CHARSET ######################################################################### # AFP specific configuration ######################################################################### #### Set which daemons to run. #### If you use AFP file server, run both cnid_metad and afpd. CNID_METAD_RUN=yes AFPD_RUN=yes #### maximum number of clients that can connect: #AFPD_MAX_CLIENTS=20 #### UAMs (User Authentication Modules) #### available options: uams_dhx.so, uams_dhx2.so, uams_guest.so, #### uams_clrtxt.so(legacy), uams_randnum.so(legacy) #AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so" #### Set the id of the guest user when using uams_guest.so #AFPD_GUEST=nobody #### config for cnid_metad. Default log config: #CNID_CONFIG="-l log_note" ######################################################################### # AppleTalk specific configuration (legacy) ######################################################################### #### Set which legacy daemons to run. #### If you need AppleTalk, run atalkd. #### papd, timelord and a2boot are dependent upon atalkd. #ATALKD_RUN=no #PAPD_RUN=no #TIMELORD_RUN=no #A2BOOT_RUN=no #### Control whether the daemons are started in the background. #### If it is dissatisfied that legacy atalkd starts slowly, set "yes". #### In case using systemd/systemctl, this is not so significant. #ATALK_BGROUND=no #### Set the AppleTalk Zone name. #### NOTE: if your zone has spaces in it, you're better off specifying #### it in atalkd.conf #ATALK_ZONE=@zone netatalk-2.2.2/config/papd.conf0000644000175200017500000000270711655731126013320 00000000000000# Attributes are: # # Name Type Default Description # pd str ".ppd" Pathname to ppd file. # pr str "lp" LPD printer name. # pa str "0.0" AppleTalk address (not usually needed). # op str "operator" Operator name, for LPD spooling. # au flag not-present If present, authentication required # note that if ca and sp are both set, # ca will be tried first and then sp # am str none Comma separated list of uams to use # (for every printer) whenever # authentication is on # ca str not-present If present, use cap-style authentication # directory to place print authentication files # sp flag not-present use PSSP authentication. # # Some examples: # # On many systems (notably not Solaris), no papd.conf is required, # since papd shares the same defaults as lpd. # # A simple example: # # terminator:\ # :pr=lp:op=wes:\ # :pd=/usr/share/lib/ppd/HPLJ_4M.PPD: # # An example with authenticated printing: # authprn:\ # :pr=|/usr/bin/lpr -Plp:\ # :pd=/usr/share/lib/ppd/HPLJ_4M.PPD:\ # :sp:ca=/tmp/print:\ # :am=uams_clrtxt.so: # # Note also that papd.conf can list several printers. # # The printer name in papd may be a full NBP-name of the form # name:type@zone, for example: # Printer 1:LaserWriter@Printing and Mailing:\ # :pr=|/usr/bin/lpr -Plp1: # # Warning: If you are using more than 15 printers and you do not # specify the zone in the printer name, only some of the printers may # appear in the Chooser. netatalk-2.2.2/config/pam/0000777000175200017500000000000011704770424012357 500000000000000netatalk-2.2.2/config/pam/Makefile.am0000644000175200017500000000212611655731243014331 00000000000000## Makefile for distrib/pam/ SUFFIXES = .tmpl . pamdir = @PAMDIR@/etc/pam.d EXTRA_DIST = netatalk.pam.tmpl noinst_SCRIPTS = netatalk.pam CLEANFILES = netatalk.pam .tmpl: sed -e "s,[@]PAM_DIRECTIVE[@],${PAM_DIRECTIVE},g" \ -e "s,[@]PAM_AUTH[@],${PAM_AUTH}," \ -e "s,[@]PAM_ACCOUNT[@],${PAM_ACCOUNT}," \ -e "s,[@]PAM_PASSWORD[@],${PAM_PASSWORD}," \ -e "s,[@]PAM_SESSION[@],${PAM_SESSION}," \ <$< >$@ if USE_PAM install-data-local: netatalk.pam $(mkinstalldirs) $(DESTDIR)$(pamdir) if test "x$(OVERWRITE_CONFIG)" = "xyes" -o ! -f $(DESTDIR)$(pamdir)/netatalk; then \ echo "$(INSTALL_DATA) $$f $(DESTDIR)$(pamdir)/netatalk"; \ $(INSTALL_DATA) netatalk.pam $(DESTDIR)$(pamdir)/netatalk || echo "WARNING: Can't install PAM files"; \ else \ echo "not overwriting $(DESTDIR)$(pamdir)/netatalk"; \ fi; uninstall-local: echo rm -f $(DESTDIR)$(pamdir)/netatalk; \ rm -f $(DESTDIR)$(pamdir)/netatalk; \ for f in $(CONFFILES) $(GENFILES); do \ echo rm -f $(DESTDIR)$(pkgconfdir)/$$f; \ rm -f $(DESTDIR)$(pkgconfdir)/$$f; \ done else install-data-local: uninstall-local: endif netatalk-2.2.2/config/pam/Makefile.in0000644000175200017500000003110711703521724014336 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = config/pam DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SCRIPTS = $(noinst_SCRIPTS) SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUFFIXES = .tmpl . pamdir = @PAMDIR@/etc/pam.d EXTRA_DIST = netatalk.pam.tmpl noinst_SCRIPTS = netatalk.pam CLEANFILES = netatalk.pam all: all-am .SUFFIXES: .SUFFIXES: .tmpl . $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign config/pam/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign config/pam/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-local .tmpl: sed -e "s,[@]PAM_DIRECTIVE[@],${PAM_DIRECTIVE},g" \ -e "s,[@]PAM_AUTH[@],${PAM_AUTH}," \ -e "s,[@]PAM_ACCOUNT[@],${PAM_ACCOUNT}," \ -e "s,[@]PAM_PASSWORD[@],${PAM_PASSWORD}," \ -e "s,[@]PAM_SESSION[@],${PAM_SESSION}," \ <$< >$@ @USE_PAM_TRUE@install-data-local: netatalk.pam @USE_PAM_TRUE@ $(mkinstalldirs) $(DESTDIR)$(pamdir) @USE_PAM_TRUE@ if test "x$(OVERWRITE_CONFIG)" = "xyes" -o ! -f $(DESTDIR)$(pamdir)/netatalk; then \ @USE_PAM_TRUE@ echo "$(INSTALL_DATA) $$f $(DESTDIR)$(pamdir)/netatalk"; \ @USE_PAM_TRUE@ $(INSTALL_DATA) netatalk.pam $(DESTDIR)$(pamdir)/netatalk || echo "WARNING: Can't install PAM files"; \ @USE_PAM_TRUE@ else \ @USE_PAM_TRUE@ echo "not overwriting $(DESTDIR)$(pamdir)/netatalk"; \ @USE_PAM_TRUE@ fi; @USE_PAM_TRUE@uninstall-local: @USE_PAM_TRUE@ echo rm -f $(DESTDIR)$(pamdir)/netatalk; \ @USE_PAM_TRUE@ rm -f $(DESTDIR)$(pamdir)/netatalk; \ @USE_PAM_TRUE@ for f in $(CONFFILES) $(GENFILES); do \ @USE_PAM_TRUE@ echo rm -f $(DESTDIR)$(pkgconfdir)/$$f; \ @USE_PAM_TRUE@ rm -f $(DESTDIR)$(pkgconfdir)/$$f; \ @USE_PAM_TRUE@ done @USE_PAM_FALSE@install-data-local: @USE_PAM_FALSE@uninstall-local: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/config/pam/netatalk.pam.tmpl0000644000175200017500000000024411655731126015551 00000000000000#%PAM-1.0 auth @PAM_DIRECTIVE@ @PAM_AUTH@ account @PAM_DIRECTIVE@ @PAM_ACCOUNT@ password @PAM_DIRECTIVE@ @PAM_PASSWORD@ session @PAM_DIRECTIVE@ @PAM_SESSION@ netatalk-2.2.2/include/0000777000175200017500000000000011704770432011757 500000000000000netatalk-2.2.2/include/Makefile.am0000644000175200017500000000005411655731126013730 00000000000000# Makefile.am for include/ SUBDIRS = atalk netatalk-2.2.2/include/Makefile.in0000644000175200017500000004125611703521726013747 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for include/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = include DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = atalk all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign include/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/include/atalk/0000777000175200017500000000000011704770432013053 500000000000000netatalk-2.2.2/include/atalk/directory.h0000644000175200017500000000753111655731126015154 00000000000000/* * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef ATALK_DIRECTORY_H #define ATALK_DIRECTORY_H 1 #include #include #include #include #include #include #include #include /* setgid directories */ #ifndef DIRBITS # ifdef AFS # define DIRBITS 0 # else /* AFS */ # define DIRBITS S_ISGID # endif /* AFS */ #endif /* DIRBITS */ /* reserved directory id's */ #define DIRDID_ROOT_PARENT htonl(1) /* parent directory of root */ #define DIRDID_ROOT htonl(2) /* root directory */ /* struct dir.d_flags */ #define DIRF_FSMASK (3<<0) #define DIRF_NOFS (0<<0) #define DIRF_AFS (1<<0) #define DIRF_UFS (1<<1) #define DIRF_ISFILE (1<<3) /* it's cached file, not a directory */ #define DIRF_OFFCNT (1<<4) /* offsprings count is valid */ #define DIRF_CNID (1<<5) /* renumerate id */ struct dir { bstring d_fullpath; /* complete unix path to dir (or file) */ bstring d_m_name; /* mac name */ bstring d_u_name; /* unix name */ /* be careful here! if d_m_name == d_u_name, d_u_name */ /* will just point to the same storage as d_m_name !! */ ucs2_t *d_m_name_ucs2; /* mac name as UCS2 */ qnode_t *qidx_node; /* pointer to position in queue index */ time_t d_ctime; /* inode ctime, used and modified by reenumeration */ int d_flags; /* directory flags */ cnid_t d_pdid; /* CNID of parent directory */ cnid_t d_did; /* CNID of directory */ uint32_t d_offcnt; /* offspring count */ uint16_t d_vid; /* only needed in the dircache, because we put all directories in one cache. */ uint32_t d_rights_cache; /* cached rights combinded from mode and possible ACL */ /* Stuff used in the dircache */ time_t dcache_ctime; /* inode ctime, used and modified by dircache */ ino_t dcache_ino; /* inode number, used to detect changes in the dircache */ }; struct path { int m_type; /* mac name type (long name, unicode */ char *m_name; /* mac name */ char *u_name; /* unix name */ cnid_t id; /* file id (only for getmetadata) */ struct dir *d_dir; /* */ int st_valid; /* does st_errno and st set */ int st_errno; struct stat st; }; static inline int path_isadir(struct path *o_path) { return o_path->d_dir != NULL; #if 0 return o_path->m_name == '\0' || /* we are in a it */ !o_path->st_valid || /* in cache but we can't chdir in it */ (!o_path->st_errno && S_ISDIR(o_path->st.st_mode)); /* not in cache an can't chdir */ #endif } #endif /* ATALK_DIRECTORY_H */ netatalk-2.2.2/include/atalk/Makefile.am0000644000175200017500000000076011655731244015031 00000000000000# Makefile.am for include/atalk/ atalkincludedir = $(includedir)/atalk atalkinclude_HEADERS = \ adouble.h vfs.h aep.h afp.h asp.h atp.h \ cnid.h compat.h ddp.h dsi.h ldapconfig.h list.h logger.h \ nbp.h netddp.h pap.h paths.h queue.h rtmp.h server_child.h \ server_ipc.h tdb.h uam.h unicode.h util.h uuid.h volinfo.h \ zip.h ea.h acl.h unix.h directory.h hash.h volume.h noinst_HEADERS = cnid_dbd_private.h cnid_private.h bstradd.h bstrlib.h errchk.h ftw.h globals.h fce_api.h standards.h netatalk-2.2.2/include/atalk/ldapconfig.h0000644000175200017500000000216211655731244015252 00000000000000#ifdef HAVE_LDAP #ifndef LDAPCONFIG_H #define LDAPCONFIG_H /* One function does the whole job */ extern int acl_ldap_readconfig(char *name); /* These are the prefvalues */ extern char *ldap_server; extern int ldap_auth_method; extern char *ldap_auth_dn; extern char *ldap_auth_pw; extern char *ldap_userbase; extern char *ldap_groupbase; extern char *ldap_uuid_attr; extern char *ldap_name_attr; extern char *ldap_group_attr; extern char *ldap_uid_attr; struct ldap_pref { void *pref; char *name; int strorint; /* string to just store in char * or convert to int ? */ int intfromarray; /* convert to int, but use string to int mapping array pref_array[] */ int valid; /* -1 = mandatory, 0 = omittable/valid */ }; struct pref_array { char *pref; /* name of pref from ldap_prefs[] to which this value corresponds */ char *valuestring; /* config string */ int value; /* corresponding value */ }; /* For parsing */ extern struct ldap_pref ldap_prefs[]; extern struct pref_array prefs_array[]; extern int ldap_config_valid; #endif /* LDAPCONFIG_H */ #endif /* HAVE_LDAP */ netatalk-2.2.2/include/atalk/uam.h0000644000175200017500000000733311655731126013732 00000000000000/* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. */ #ifndef UAM_H #define UAM_H 1 #include #include #include #ifdef TRU64 #include #include #endif /* TRU64 */ /* just a label for exported bits */ #ifndef UAM_MODULE_EXPORT #define UAM_MODULE_EXPORT #endif /* type of uam */ #define UAM_MODULE_SERVER 1 #define UAM_MODULE_CLIENT 2 /* in case something drastic has to change */ #define UAM_MODULE_VERSION 1 /* things for which we can have uams */ #define UAM_SERVER_LOGIN (1 << 0) #define UAM_SERVER_CHANGEPW (1 << 1) #define UAM_SERVER_PRINTAUTH (1 << 2) #define UAM_SERVER_LOGIN_EXT (1 << 3) /* options */ #define UAM_OPTION_USERNAME (1 << 0) /* get space for username */ #define UAM_OPTION_GUEST (1 << 1) /* get guest user */ #define UAM_OPTION_PASSWDOPT (1 << 2) /* get the password file */ #define UAM_OPTION_SIGNATURE (1 << 3) /* get server signature */ #define UAM_OPTION_RANDNUM (1 << 4) /* request a random number */ #define UAM_OPTION_HOSTNAME (1 << 5) /* get host name */ #define UAM_OPTION_COOKIE (1 << 6) /* cookie handle */ #define UAM_OPTION_PROTOCOL (1 << 7) /* DSI or ASP */ #define UAM_OPTION_CLIENTNAME (1 << 8) /* get client IP address */ #define UAM_OPTION_KRB5SERVICE (1 << 9) /* service name for krb5 principal */ #define UAM_OPTION_MACCHARSET (1 << 10) /* mac charset handle */ #define UAM_OPTION_UNIXCHARSET (1 << 11) /* unix charset handle */ #define UAM_OPTION_SESSIONINFO (1 << 12) /* unix charset handle */ #define UAM_OPTION_KRB5REALM (1 << 13) /* krb realm */ #define UAM_OPTION_FQDN (1 << 14) /* fully qualified name */ /* some password options. you pass these in the length parameter and * get back the corresponding option. not all of these are implemented. */ #define UAM_PASSWD_FILENAME (1 << 0) #define UAM_PASSWD_MINLENGTH (1 << 1) #define UAM_PASSWD_MAXFAIL (1 << 2) /* not implemented yet. */ #define UAM_PASSWD_EXPIRETIME (1 << 3) /* not implemented yet. */ /* max lenght of username */ #define UAM_USERNAMELEN 255 /* i'm doing things this way because os x server's dynamic linker * support is braindead. it also allows me to do a little versioning. */ struct uam_export { int uam_type, uam_version; int (*uam_setup)(const char *); void (*uam_cleanup)(void); }; #define SESSIONKEY_LEN 64 #define SESSIONTOKEN_LEN 8 struct session_info { void *sessionkey; /* random session key */ size_t sessionkey_len; void *cryptedkey; /* kerberos/gssapi crypted key */ size_t cryptedkey_len; void *sessiontoken; /* session token sent to the client on FPGetSessionToken*/ size_t sessiontoken_len; void *clientid; /* whole buffer cotaining eg idlen, id and boottime */ size_t clientid_len; }; /* register and unregister uams with these functions */ extern UAM_MODULE_EXPORT int uam_register (const int, const char *, const char *, ...); extern UAM_MODULE_EXPORT void uam_unregister (const int, const char *); /* helper functions */ extern UAM_MODULE_EXPORT struct passwd *uam_getname (void*, char *, const int); extern UAM_MODULE_EXPORT int uam_checkuser (const struct passwd *); /* afp helper functions */ extern UAM_MODULE_EXPORT int uam_afp_read (void *, char *, size_t *, int (*)(void *, void *, const int)); extern UAM_MODULE_EXPORT int uam_afpserver_option (void *, const int, void *, size_t *); #ifdef TRU64 extern void uam_afp_getcmdline (int *, char ***); extern int uam_sia_validate_user (sia_collect_func_t *, int, char **, char *, char *, char *, int, char *, char *); #endif /* TRU64 */ #endif netatalk-2.2.2/include/atalk/Makefile.in0000644000175200017500000003511411703521726015037 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for include/atalk/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = include/atalk DIST_COMMON = $(atalkinclude_HEADERS) $(noinst_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(atalkincludedir)" atalkincludeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(atalkinclude_HEADERS) $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ atalkincludedir = $(includedir)/atalk atalkinclude_HEADERS = \ adouble.h vfs.h aep.h afp.h asp.h atp.h \ cnid.h compat.h ddp.h dsi.h ldapconfig.h list.h logger.h \ nbp.h netddp.h pap.h paths.h queue.h rtmp.h server_child.h \ server_ipc.h tdb.h uam.h unicode.h util.h uuid.h volinfo.h \ zip.h ea.h acl.h unix.h directory.h hash.h volume.h noinst_HEADERS = cnid_dbd_private.h cnid_private.h bstradd.h bstrlib.h errchk.h ftw.h globals.h fce_api.h standards.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/atalk/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign include/atalk/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-atalkincludeHEADERS: $(atalkinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(atalkincludedir)" || $(MKDIR_P) "$(DESTDIR)$(atalkincludedir)" @list='$(atalkinclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(atalkincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(atalkincludedir)/$$f'"; \ $(atalkincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(atalkincludedir)/$$f"; \ done uninstall-atalkincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(atalkinclude_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(atalkincludedir)/$$f'"; \ rm -f "$(DESTDIR)$(atalkincludedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(atalkincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-atalkincludeHEADERS install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-atalkincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am \ install-atalkincludeHEADERS install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags uninstall uninstall-am \ uninstall-atalkincludeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/include/atalk/list.h0000644000175200017500000001035611655731126014122 00000000000000/* This code has been stolen from Linux kernel :) */ /* distributed under GNU GPL version 2. */ #ifndef _ATALK_LIST_H #define _ATALK_LIST_H /* * Simple doubly linked list implementation. * * Some of the internal functions ("__xxx") are useful when * manipulating whole lists rather than single entries, as * sometimes we already know the next/prev entries and we can * generate better code by using them directly rather than * using the generic single-entry routines. */ struct list_head { struct list_head *next, *prev; }; #define ATALK_LIST_HEAD_INIT(name) { &(name), &(name) } #define ATALK_LIST_HEAD(name) \ struct list_head name = ATALK_LIST_HEAD_INIT(name) #define ATALK_INIT_LIST_HEAD(ptr) do { \ (ptr)->next = (ptr); (ptr)->prev = (ptr); \ } while (0) #ifdef USE_LIST /* * Insert a new entry between two known consecutive entries. * * This is only for internal list manipulation where we know * the prev/next entries already! */ static inline void __list_add(struct list_head * new, struct list_head * prev, struct list_head * next) { next->prev = new; new->next = next; new->prev = prev; prev->next = new; } /** * list_add - add a new entry * @new: new entry to be added * @head: list head to add it after * * Insert a new entry after the specified head. * This is good for implementing stacks. */ static inline void list_add(struct list_head *new, struct list_head *head) { __list_add(new, head, head->next); } /** * list_add_tail - add a new entry * @new: new entry to be added * @head: list head to add it before * * Insert a new entry before the specified head. * This is useful for implementing queues. */ static inline void list_add_tail(struct list_head *new, struct list_head *head) { __list_add(new, head->prev, head); } /* * Delete a list entry by making the prev/next entries * point to each other. * * This is only for internal list manipulation where we know * the prev/next entries already! */ static inline void __list_del(struct list_head * prev, struct list_head * next) { next->prev = prev; prev->next = next; } /** * list_del - deletes entry from list. * @entry: the element to delete from the list. * Note: list_empty on entry does not return true after this, the entry is in an undefined state. */ static inline void list_del(struct list_head *entry) { __list_del(entry->prev, entry->next); } /** * list_del_init - deletes entry from list and reinitialize it. * @entry: the element to delete from the list. */ static inline void list_del_init(struct list_head *entry) { __list_del(entry->prev, entry->next); ATALK_INIT_LIST_HEAD(entry); } /** * list_empty - tests whether a list is empty * @head: the list to test. */ static inline int list_empty(struct list_head *head) { return head->next == head; } /** * list_splice - join two lists * @list: the new list to add. * @head: the place to add it in the first list. */ static inline void list_splice(struct list_head *list, struct list_head *head) { struct list_head *first = list->next; if (first != list) { struct list_head *last = list->prev; struct list_head *at = head->next; first->prev = head; head->next = first; last->next = at; at->prev = last; } } #endif /** * list_entry - get the struct for this entry * @ptr: the &struct list_head pointer. * @type: the type of the struct this is embedded in. * @member: the name of the list_struct within the struct. */ #define list_entry(ptr, type, member) \ ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) /** * list_for_each - iterate over a list * @pos: the &struct list_head to use as a loop counter. * @n: another &struct list_head to use as temporary storage * @head: the head for your list. */ #define list_for_each(pos, head) \ for (pos = (head)->next; pos != (head); \ pos = pos->next) /** * list_for_each_prev - iterate over a list in reverse order * @pos: the &struct list_head to use as a loop counter. * @head: the head for your list. */ #define list_for_each_prev(pos, head) \ for (pos = (head)->prev; pos != (head); \ pos = pos->prev) #endif netatalk-2.2.2/include/atalk/aep.h0000644000175200017500000000174411655731244013716 00000000000000/* * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef _ATALK_AEP_H #define _ATALK_AEP_H 1 #ifndef NO_DDP #define AEPOP_REQUEST 1 #define AEPOP_REPLY 2 #endif /* NO_DDP */ #endif netatalk-2.2.2/include/atalk/compat.h0000644000175200017500000000471111655731126014430 00000000000000/* * Copyright (c) 1996 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * * NOTE: SunOS 4 and ultrix are pretty much the only reason why there * are checks for EINTR everywhere. */ #include #include #ifdef __svr4__ /* * SunOS 5 (solaris) has SA_RESTART, but no SA_INTERRUPT. */ #ifndef SA_INTERRUPT #define SA_INTERRUPT 0 #endif #include #include #include extern int flock (int, int); extern int inet_aton (const char *, struct in_addr *); #else /* __svr4__ */ #ifdef sun /* * SunOS 4 has SA_INTERRUPT, but no SA_RESTART. */ #ifndef SA_RESTART #define SA_RESTART 0 #endif #endif /* sun */ #endif /* __svr4__ */ #ifdef linux /* * Linux has SA_RESTART, but no SA_INTERRUPT. Note that the documentation * seems to be wrong on several counts. First, SA_ONESHOT is not the default, * and second, SA_RESTART does what you'd expect (the same as svr4) and has * nothing to do with SA_ONESHOT. */ #ifndef SA_INTERRUPT #define SA_INTERRUPT 0 #endif /* SA_INTERRUPT */ #endif /* linux */ #ifdef ultrix #include #include #include /* * Here's the really confusing one... Under Ultrix, sigaction() works just * like sigvec(), except that SV_INTERRUPT is always set. Hence, there is * no SA_INTERRUPT flag. Unfortunately, there's also no SA_RESTART, so * there's no way to suppress the interrupt. Sigh. */ #ifndef SA_INTERRUPT #define SA_INTERRUPT 0 #endif #ifndef SA_RESTART #define SA_RESTART 0 #endif extern char *strdup (const char *); extern int inet_aton (const char *, struct in_addr *); #endif /* ultrix */ #ifdef BSD4_4 #ifndef SA_INTERRUPT #define SA_INTERRUPT 0 #endif #endif /* BSD4_4 */ #if defined(ultrix) || defined(_IBMR2) || defined(NEED_GETUSERSHELL) extern char *getusershell (void); #endif #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) #include #include #endif #ifndef HAVE_SNPRINTF int snprintf (char *str,size_t count,const char *fmt,...); #endif #ifndef HAVE_VSNPRINTF int vsnprintf(char *str, size_t count, const char *fmt, va_list args); #endif /* OpenBSD */ #if defined(__OpenBSD__) && !defined(ENOTSUP) #define ENOTSUP EOPNOTSUPP #endif #if !defined(HAVE_PSELECT) || defined(__OpenBSD__) extern int pselect(int, fd_set * restrict, fd_set * restrict, fd_set * restrict, const struct timespec * restrict, const sigset_t * restrict); #endif netatalk-2.2.2/include/atalk/asp.h0000644000175200017500000000610211655731244013725 00000000000000/* * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef _ATALK_ASP_H #define _ATALK_ASP_H 1 #ifndef NO_DDP #include #include #include #include #include #include #include #define ASP_HDRSIZ 4 #define ASP_CMDSIZ 578 #define ASP_MAXPACKETS 8 #define ASP_CMDMAXSIZ (ASP_CMDSIZ + ASP_HDRSIZ) #define ASP_DATASIZ (ASP_CMDSIZ*ASP_MAXPACKETS) #define ASP_DATAMAXSIZ ((ASP_CMDSIZ + ASP_HDRSIZ)*ASP_MAXPACKETS) typedef struct ASP { ATP asp_atp; struct sockaddr_at asp_sat; u_int8_t asp_wss; u_int8_t asp_sid; union { struct { char *as_status; int as_slen; } asu_status; u_int16_t asu_seq; } asp_u; #define asp_status asp_u.asu_status.as_status #define asp_slen asp_u.asu_status.as_slen #define asp_seq asp_u.asu_seq int asp_flags; char child, inited, *commands; char cmdbuf[ASP_CMDMAXSIZ]; char data[ASP_DATAMAXSIZ]; size_t cmdlen, datalen; off_t read_count, write_count; } *ASP; #define ASPFL_SLS 1 #define ASPFL_SSS 2 #define ASPFUNC_CLOSE 1 #define ASPFUNC_CMD 2 #define ASPFUNC_STAT 3 #define ASPFUNC_OPEN 4 #define ASPFUNC_TICKLE 5 #define ASPFUNC_WRITE 6 #define ASPFUNC_WRTCONT 7 #define ASPFUNC_ATTN 8 #define ASPERR_OK 0x0000 #define ASPERR_BADVERS 0xfbd6 #define ASPERR_BUFSMALL 0xfbd5 #define ASPERR_NOSESS 0xfbd4 #define ASPERR_NOSERV 0xfbd3 #define ASPERR_PARM 0xfbd2 #define ASPERR_SERVBUSY 0xfbd1 #define ASPERR_SESSCLOS 0xfbd0 #define ASPERR_SIZERR 0xfbcf #define ASPERR_TOOMANY 0xfbce #define ASPERR_NOACK 0xfbcd extern ASP asp_init (ATP); extern void asp_setstatus (ASP, char *, const int); extern ASP asp_getsession (ASP, server_child *, const int); extern int asp_close (ASP); extern int asp_shutdown (ASP); extern int asp_attention (ASP, AFPUserBytes); extern int asp_getrequest (ASP); extern int asp_cmdreply (ASP, int); extern int asp_wrtcont (ASP, char *, size_t *); #define asp_wrtreply(a,b) asp_cmdreply((a), (b)) extern void asp_kill (int); extern int asp_tickle (ASP, const u_int8_t, struct sockaddr_at *); extern void asp_stop_tickle (void); #endif /* NO_DDP */ #endif netatalk-2.2.2/include/atalk/unicode.h0000644000175200017500000001455311655731126014600 00000000000000#ifndef _ATALK_UNICODE_H #define _ATALK_UNICODE_H 1 #include #include #include #include #define ucs2_t u_int16_t #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif /* ! MIN */ #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif /* ! MIN */ #define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0) #ifndef EILSEQ #define EILSEQ 84 /* Illegal byte sequence. */ #endif /* generic iconv conversion structure */ typedef struct { size_t (*direct)(void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); size_t (*pull)(void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); size_t (*push)(void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); void *cd_direct, *cd_pull, *cd_push; char *from_name, *to_name; } *atalk_iconv_t; #define CHARSET_CLIENT 1 #define CHARSET_VOLUME 2 #define CHARSET_PRECOMPOSED 4 #define CHARSET_DECOMPOSED 8 #define CHARSET_MULTIBYTE 16 #define CHARSET_WIDECHAR 32 #define CHARSET_ICONV 64 #define IGNORE_CHAR '_' /* conversion flags */ #define CONV_IGNORE (1<<0) /* return the first convertable characters. */ #define CONV_ESCAPEHEX (1<<1) /* escape unconvertable chars with :[UCS2HEX], */ /* also escape '/'. Escape ':' if also CONV_ALLOW_COLON, */ /* else ':' raises EILSEQ */ #define CONV_ESCAPEDOTS (1<<2) /* escape leading dots with :2600 */ #define CONV_UNESCAPEHEX (1<<3) #define CONV_TOUPPER (1<<4) /* convert to UPPERcase */ #define CONV_TOLOWER (1<<5) /* convert to lowercase */ #define CONV_PRECOMPOSE (1<<6) /* precompose */ #define CONV_DECOMPOSE (1<<7) /* precompose */ #define CONV_FORCE (1<<8) /* force convertion */ #define CONV__EILSEQ (1<<9) /* ignore EILSEQ, replace with IGNORE_CHAR (try USC2) */ #define CONV_ALLOW_COLON (1<<10) /* Allow ':' in name. Needed for Extended Attributes */ /* conversion return flags */ #define CONV_REQMANGLE (1<<14) /* mangling of returned name is required */ #define CONV_REQESCAPE (1<<15) /* espace unconvertable chars with :[UCS2HEX] */ /* this defines the charset types used in samba */ typedef enum {CH_UCS2=0, CH_UTF8=1, CH_MAC=2, CH_UNIX=3, CH_UTF8_MAC=4} charset_t; #define NUM_CHARSETS 5 /* * for each charset we have a function that pulls from that charset to * a ucs2 buffer, and a function that pushes to a ucs2 buffer */ struct charset_functions { const char *name; const long kTextEncoding; size_t (*pull)(void *, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); size_t (*push)(void *, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); u_int32_t flags; const char *iname; struct charset_functions *prev, *next; }; /* from iconv.c */ extern atalk_iconv_t atalk_iconv_open (const char *, const char *); extern size_t atalk_iconv (atalk_iconv_t, const char **, size_t *, char **, size_t *); extern int atalk_iconv_close (atalk_iconv_t); extern struct charset_functions *find_charset_functions (const char *); extern int atalk_register_charset (struct charset_functions *); /* from utf16_case.c */ extern ucs2_t toupper_w (ucs2_t); extern u_int32_t toupper_sp (u_int32_t); extern ucs2_t tolower_w (ucs2_t); extern u_int32_t tolower_sp (u_int32_t); /* from util_unistr.c */ extern int strupper_w (ucs2_t *); extern int strlower_w (ucs2_t *); extern int islower_w (ucs2_t); extern int isupper_w (ucs2_t); extern size_t strlen_w (const ucs2_t *); extern size_t strnlen_w (const ucs2_t *, size_t); extern ucs2_t* strchr_w (const ucs2_t *, ucs2_t); extern ucs2_t *strcasechr_w (const ucs2_t *s, ucs2_t c); extern int strcmp_w (const ucs2_t *, const ucs2_t *); extern int strncmp_w (const ucs2_t *, const ucs2_t *, size_t); extern int strcasecmp_w (const ucs2_t *, const ucs2_t *); extern int strncasecmp_w (const ucs2_t *, const ucs2_t *, size_t); extern ucs2_t *strstr_w (const ucs2_t *s, const ucs2_t *ins); extern ucs2_t *strcasestr_w (const ucs2_t *, const ucs2_t *); extern ucs2_t *strndup_w (const ucs2_t *, size_t); extern ucs2_t *strdup_w (const ucs2_t *); extern ucs2_t *strncpy_w (ucs2_t *, const ucs2_t *, const size_t); extern ucs2_t *strncat_w (ucs2_t *, const ucs2_t *, const size_t); extern ucs2_t *strcat_w (ucs2_t *, const ucs2_t *); extern size_t precompose_w (ucs2_t *, size_t, ucs2_t *,size_t *); extern size_t decompose_w (ucs2_t *, size_t, ucs2_t *,size_t *); extern size_t utf8_charlen ( char* ); extern size_t utf8_strlen_validate ( char *); /* from charcnv.c */ extern void init_iconv (void); extern size_t convert_string (charset_t, charset_t, void const *, size_t, void *, size_t); extern size_t convert_string_allocate (charset_t, charset_t, void const *, size_t, char **); extern size_t utf8_strupper (const char *, size_t, char *, size_t); extern size_t utf8_strlower (const char *, size_t, char *, size_t); extern size_t unix_strupper (const char *, size_t, char *, size_t); extern size_t unix_strlower (const char *, size_t, char *, size_t); extern size_t charset_strupper (charset_t, const char *, size_t, char *, size_t); extern size_t charset_strlower (charset_t, const char *, size_t, char *, size_t); extern size_t charset_to_ucs2_allocate (charset_t, ucs2_t **dest, const char *src); extern size_t charset_to_utf8_allocate (charset_t, char **dest, const char *src); extern size_t ucs2_to_charset_allocate (charset_t, char **dest, const ucs2_t *src); extern size_t utf8_to_charset_allocate (charset_t, char **dest, const char *src); extern size_t ucs2_to_charset (charset_t, const ucs2_t *src, char *dest, size_t); extern size_t convert_charset (charset_t, charset_t, charset_t, const char *, size_t, char *, size_t, u_int16_t *); extern size_t charset_precompose ( charset_t, char *, size_t, char *, size_t); extern size_t charset_decompose ( charset_t, char *, size_t, char *, size_t); extern size_t utf8_precompose ( char *, size_t, char *, size_t); extern size_t utf8_decompose ( char *, size_t, char *, size_t); extern charset_t add_charset (const char* name); #endif /* _ATALK_UNICODE_H */ netatalk-2.2.2/include/atalk/vfs.h0000644000175200017500000001273111655731126013744 00000000000000/* Copyright (c) 2004 Didier Gautheron This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. vfs layer for afp */ #ifndef ATALK_VFS_H #define ATALK_VFS_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #define VFS_FUNC_ARGS_VALIDUPATH const struct vol *vol, const char *name #define VFS_FUNC_VARS_VALIDUPATH vol, name #define VFS_FUNC_ARGS_CHOWN const struct vol *vol, const char *path, uid_t uid, gid_t gid #define VFS_FUNC_VARS_CHOWN vol, path, uid, gid #define VFS_FUNC_ARGS_RENAMEDIR const struct vol *vol, int dirfd, const char *oldpath, const char *newpath #define VFS_FUNC_VARS_RENAMEDIR vol, dirfd, oldpath, newpath #define VFS_FUNC_ARGS_DELETECURDIR const struct vol *vol #define VFS_FUNC_VARS_DELETECURDIR vol #define VFS_FUNC_ARGS_SETFILEMODE const struct vol *vol, const char *name, mode_t mode, struct stat *st #define VFS_FUNC_VARS_SETFILEMODE vol, name, mode, st #define VFS_FUNC_ARGS_SETDIRMODE const struct vol *vol, const char *name, mode_t mode, struct stat *st #define VFS_FUNC_VARS_SETDIRMODE vol, name, mode, st #define VFS_FUNC_ARGS_SETDIRUNIXMODE const struct vol *vol, const char *name, mode_t mode, struct stat *st #define VFS_FUNC_VARS_SETDIRUNIXMODE vol, name, mode, st #define VFS_FUNC_ARGS_SETDIROWNER const struct vol *vol, const char *name, uid_t uid, gid_t gid #define VFS_FUNC_VARS_SETDIROWNER vol, name, uid, gid #define VFS_FUNC_ARGS_DELETEFILE const struct vol *vol, int dirfd, const char *file #define VFS_FUNC_VARS_DELETEFILE vol, dirfd, file #define VFS_FUNC_ARGS_RENAMEFILE const struct vol *vol, int dirfd, const char *src, const char *dst #define VFS_FUNC_VARS_RENAMEFILE vol, dirfd, src, dst #define VFS_FUNC_ARGS_COPYFILE const struct vol *vol, int sfd, const char *src, const char *dst #define VFS_FUNC_VARS_COPYFILE vol, sfd, src, dst #ifdef HAVE_SOLARIS_ACLS #define VFS_FUNC_ARGS_ACL const struct vol *vol, const char *path, int cmd, int count, void *aces #define VFS_FUNC_VARS_ACL vol, path, cmd, count, aces #endif #ifdef HAVE_POSIX_ACLS #define VFS_FUNC_ARGS_ACL const struct vol *vol, const char *path, acl_type_t type, int count, acl_t acl #define VFS_FUNC_VARS_ACL vol, path, type, count, acl #endif #define VFS_FUNC_ARGS_REMOVE_ACL const struct vol *vol, const char *path, int dir #define VFS_FUNC_VARS_REMOVE_ACL vol, path, dir #define VFS_FUNC_ARGS_EA_GETSIZE const struct vol * restrict vol, char * restrict rbuf, size_t * restrict rbuflen, const char * restrict uname, int oflag, const char * restrict attruname #define VFS_FUNC_VARS_EA_GETSIZE vol, rbuf, rbuflen, uname, oflag, attruname #define VFS_FUNC_ARGS_EA_GETCONTENT const struct vol * restrict vol, char * restrict rbuf, size_t * restrict rbuflen, const char * restrict uname, int oflag, const char * restrict attruname, int maxreply #define VFS_FUNC_VARS_EA_GETCONTENT vol, rbuf, rbuflen, uname, oflag, attruname, maxreply #define VFS_FUNC_ARGS_EA_LIST const struct vol * restrict vol, char * restrict attrnamebuf, size_t * restrict buflen, const char * restrict uname, int oflag #define VFS_FUNC_VARS_EA_LIST vol, attrnamebuf, buflen, uname, oflag #define VFS_FUNC_ARGS_EA_SET const struct vol * restrict vol, const char * restrict uname, const char * restrict attruname, const char * restrict ibuf, size_t attrsize, int oflag #define VFS_FUNC_VARS_EA_SET vol, uname, attruname, ibuf, attrsize, oflag #define VFS_FUNC_ARGS_EA_REMOVE const struct vol * restrict vol, const char * restrict uname, const char * restrict attruname, int oflag #define VFS_FUNC_VARS_EA_REMOVE vol, uname, attruname, oflag /* * Forward declaration. We need it because of the circular inclusion of * of vfs.h <-> volume.h. */ struct vol; struct vfs_ops { int (*vfs_validupath) (VFS_FUNC_ARGS_VALIDUPATH); int (*vfs_chown) (VFS_FUNC_ARGS_CHOWN); int (*vfs_renamedir) (VFS_FUNC_ARGS_RENAMEDIR); int (*vfs_deletecurdir) (VFS_FUNC_ARGS_DELETECURDIR); int (*vfs_setfilmode) (VFS_FUNC_ARGS_SETFILEMODE); int (*vfs_setdirmode) (VFS_FUNC_ARGS_SETDIRMODE); int (*vfs_setdirunixmode)(VFS_FUNC_ARGS_SETDIRUNIXMODE); int (*vfs_setdirowner) (VFS_FUNC_ARGS_SETDIROWNER); int (*vfs_deletefile) (VFS_FUNC_ARGS_DELETEFILE); int (*vfs_renamefile) (VFS_FUNC_ARGS_RENAMEFILE); int (*vfs_copyfile) (VFS_FUNC_ARGS_COPYFILE); #ifdef HAVE_ACLS /* ACLs */ int (*vfs_acl) (VFS_FUNC_ARGS_ACL); int (*vfs_remove_acl) (VFS_FUNC_ARGS_REMOVE_ACL); #endif /* Extended Attributes */ int (*vfs_ea_getsize) (VFS_FUNC_ARGS_EA_GETSIZE); int (*vfs_ea_getcontent) (VFS_FUNC_ARGS_EA_GETCONTENT); int (*vfs_ea_list) (VFS_FUNC_ARGS_EA_LIST); int (*vfs_ea_set) (VFS_FUNC_ARGS_EA_SET); int (*vfs_ea_remove) (VFS_FUNC_ARGS_EA_REMOVE); }; extern void initvol_vfs(struct vol * restrict vol); #endif /* ATALK_VFS_H */ netatalk-2.2.2/include/atalk/pap.h0000644000175200017500000000225111655731244013723 00000000000000/* * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef _ATALK_PAP_H #define _ATALK_PAP_H 1 #ifndef NO_DDP #define PAP_OPEN 1 #define PAP_OPENREPLY 2 #define PAP_READ 3 #define PAP_DATA 4 #define PAP_TICKLE 5 #define PAP_CLOSE 6 #define PAP_CLOSEREPLY 7 #define PAP_SENDSTATUS 8 #define PAP_STATUS 9 #define PAP_MAXDATA 512 #define PAP_MAXQUANTUM 8 #endif /* NO_DDP */ #endif netatalk-2.2.2/include/atalk/hash.h0000644000175200017500000001620311655731126014067 00000000000000/* * Hash Table Data Type * Copyright (C) 1997 Kaz Kylheku * * Free Software License: * * All rights are reserved by the author, with the following exceptions: * Permission is granted to freely reproduce and distribute this software, * possibly in exchange for a fee, provided that this copyright notice appears * intact. Permission is also granted to adapt this software to produce * derivative works, as long as the modified versions carry this copyright * notice and additional notices stating that the work has been modified. * This source code may be translated into executable form and incorporated * into proprietary software; there is no requirement for such software to * contain a copyright notice related to this source. * * $Id: hash.h,v 1.2 2009-11-19 10:37:44 franklahm Exp $ * $Name: $ */ #ifndef ATALK_HASH_H #define ATALK_HASH_H #include #include typedef unsigned long hashcount_t; #define HASHCOUNT_T_MAX ULONG_MAX typedef uint32_t hash_val_t; #define HASH_VAL_T_MAX UINT32_MAX extern int hash_val_t_bit; #ifndef HASH_VAL_T_BIT #define HASH_VAL_T_BIT ((int) hash_val_t_bit) #endif /* * Hash chain node structure. * Notes: * 1. This preprocessing directive is for debugging purposes. The effect is * that if the preprocessor symbol KAZLIB_OPAQUE_DEBUG is defined prior to the * inclusion of this header, then the structure shall be declared as having * the single member int __OPAQUE__. This way, any attempts by the * client code to violate the principles of information hiding (by accessing * the structure directly) can be diagnosed at translation time. However, * note the resulting compiled unit is not suitable for linking. * 2. This is a pointer to the next node in the chain. In the last node of a * chain, this pointer is null. * 3. The key is a pointer to some user supplied data that contains a unique * identifier for each hash node in a given table. The interpretation of * the data is up to the user. When creating or initializing a hash table, * the user must supply a pointer to a function for comparing two keys, * and a pointer to a function for hashing a key into a numeric value. * 4. The value is a user-supplied pointer to void which may refer to * any data object. It is not interpreted in any way by the hashing * module. * 5. The hashed key is stored in each node so that we don't have to rehash * each key when the table must grow or shrink. */ typedef struct hnode_t { #if defined(HASH_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG) /* 1 */ struct hnode_t *hash_next; /* 2 */ const void *hash_key; /* 3 */ void *hash_data; /* 4 */ hash_val_t hash_hkey; /* 5 */ #else int hash_dummy; #endif } hnode_t; /* * The comparison function pointer type. A comparison function takes two keys * and produces a value of -1 if the left key is less than the right key, a * value of 0 if the keys are equal, and a value of 1 if the left key is * greater than the right key. */ typedef int (*hash_comp_t)(const void *, const void *); /* * The hashing function performs some computation on a key and produces an * integral value of type hash_val_t based on that key. For best results, the * function should have a good randomness properties in *all* significant bits * over the set of keys that are being inserted into a given hash table. In * particular, the most significant bits of hash_val_t are most significant to * the hash module. Only as the hash table expands are less significant bits * examined. Thus a function that has good distribution in its upper bits but * not lower is preferrable to one that has poor distribution in the upper bits * but not the lower ones. */ typedef hash_val_t (*hash_fun_t)(const void *); /* * allocator functions */ typedef hnode_t *(*hnode_alloc_t)(void *); typedef void (*hnode_free_t)(hnode_t *, void *); /* * This is the hash table control structure. It keeps track of information * about a hash table, as well as the hash table itself. * Notes: * 1. Pointer to the hash table proper. The table is an array of pointers to * hash nodes (of type hnode_t). If the table is empty, every element of * this table is a null pointer. A non-null entry points to the first * element of a chain of nodes. * 2. This member keeps track of the size of the hash table---that is, the * number of chain pointers. * 3. The count member maintains the number of elements that are presently * in the hash table. * 4. The maximum count is the greatest number of nodes that can populate this * table. If the table contains this many nodes, no more can be inserted, * and the hash_isfull() function returns true. * 5. The high mark is a population threshold, measured as a number of nodes, * which, if exceeded, will trigger a table expansion. Only dynamic hash * tables are subject to this expansion. * 6. The low mark is a minimum population threshold, measured as a number of * nodes. If the table population drops below this value, a table shrinkage * will occur. Only dynamic tables are subject to this reduction. No table * will shrink beneath a certain absolute minimum number of nodes. * 7. This is the a pointer to the hash table's comparison function. The * function is set once at initialization or creation time. * 8. Pointer to the table's hashing function, set once at creation or * initialization time. * 9. The current hash table mask. If the size of the hash table is 2^N, * this value has its low N bits set to 1, and the others clear. It is used * to select bits from the result of the hashing function to compute an * index into the table. * 10. A flag which indicates whether the table is to be dynamically resized. It * is set to 1 in dynamically allocated tables, 0 in tables that are * statically allocated. */ typedef struct hash_t { #if defined(HASH_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG) struct hnode_t **hash_table; /* 1 */ hashcount_t hash_nchains; /* 2 */ hashcount_t hash_nodecount; /* 3 */ hashcount_t hash_maxcount; /* 4 */ hashcount_t hash_highmark; /* 5 */ hashcount_t hash_lowmark; /* 6 */ hash_comp_t hash_compare; /* 7 */ hash_fun_t hash_function; /* 8 */ hnode_alloc_t hash_allocnode; hnode_free_t hash_freenode; void *hash_context; hash_val_t hash_mask; /* 9 */ int hash_dynamic; /* 10 */ #else int hash_dummy; #endif } hash_t; /* * Hash scanner structure, used for traversals of the data structure. * Notes: * 1. Pointer to the hash table that is being traversed. * 2. Reference to the current chain in the table being traversed (the chain * that contains the next node that shall be retrieved). * 3. Pointer to the node that will be retrieved by the subsequent call to * hash_scan_next(). */ typedef struct hscan_t { #if defined(HASH_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG) hash_t *hash_table; /* 1 */ hash_val_t hash_chain; /* 2 */ hnode_t *hash_next; /* 3 */ #else int hash_dummy; #endif } hscan_t; #endif /* ATALK_HASH_H */ netatalk-2.2.2/include/atalk/tdb.h0000644000175200017500000001133611655731126013717 00000000000000#ifndef __TDB_H__ #define __TDB_H__ /* Unix SMB/CIFS implementation. Samba database functions Copyright (C) Andrew Tridgell 1999 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef __cplusplus extern "C" { #endif /* flags to tdb_store() */ #define TDB_REPLACE 1 #define TDB_INSERT 2 #define TDB_MODIFY 3 /* flags for tdb_open() */ #define TDB_DEFAULT 0 /* just a readability place holder */ #define TDB_CLEAR_IF_FIRST 1 #define TDB_INTERNAL 2 /* don't store on disk */ #define TDB_NOLOCK 4 /* don't do any locking */ #define TDB_NOMMAP 8 /* don't use mmap */ #define TDB_CONVERT 16 /* convert endian (internal use) */ #define TDB_BIGENDIAN 32 /* header is big-endian (internal use) */ #define TDB_ERRCODE(code, ret) ((tdb->ecode = (code)), ret) /* error codes */ enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK, TDB_ERR_OOM, TDB_ERR_EXISTS, TDB_ERR_NOEXIST, TDB_ERR_NOLOCK, TDB_ERR_LOCK_TIMEOUT }; #ifndef u32 #define u32 unsigned #endif typedef struct { char *dptr; size_t dsize; } TDB_DATA; typedef u32 tdb_len; typedef u32 tdb_off; /* this is stored at the front of every database */ struct tdb_header { char magic_food[32]; /* for /etc/magic */ u32 version; /* version of the code */ u32 hash_size; /* number of hash entries */ tdb_off rwlocks; tdb_off reserved[31]; }; struct tdb_lock_type { u32 count; u32 ltype; }; struct tdb_traverse_lock { struct tdb_traverse_lock *next; u32 off; u32 hash; }; /* this is the context structure that is returned from a db open */ typedef struct tdb_context { char *name; /* the name of the database */ void *map_ptr; /* where it is currently mapped */ int fd; /* open file descriptor for the database */ tdb_len map_size; /* how much space has been mapped */ int read_only; /* opened read-only */ struct tdb_lock_type *locked; /* array of chain locks */ enum TDB_ERROR ecode; /* error code for last tdb error */ struct tdb_header header; /* a cached copy of the header */ u32 flags; /* the flags passed to tdb_open */ u32 *lockedkeys; /* array of locked keys: first is #keys */ struct tdb_traverse_lock travlocks; /* current traversal locks */ struct tdb_context *next; /* all tdbs to avoid multiple opens */ dev_t device; /* uniquely identifies this tdb */ ino_t inode; /* uniquely identifies this tdb */ void (*log_fn)(struct tdb_context *tdb, int level, const char *, ...); /* logging function */ int open_flags; /* flags used in the open - needed by reopen */ } TDB_CONTEXT; typedef int (*tdb_traverse_func)(TDB_CONTEXT *, TDB_DATA, TDB_DATA, void *); typedef void (*tdb_log_func)(TDB_CONTEXT *, int , const char *, ...); TDB_CONTEXT *tdb_open(const char *name, int hash_size, int tdb_flags, int open_flags, mode_t mode); TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags, int open_flags, mode_t mode, tdb_log_func log_fn); int tdb_reopen(TDB_CONTEXT *tdb); int tdb_reopen_all(void); void tdb_logging_function(TDB_CONTEXT *tdb, tdb_log_func); enum TDB_ERROR tdb_error(TDB_CONTEXT *tdb); const char *tdb_errorstr(TDB_CONTEXT *tdb); TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA key); int tdb_delete(TDB_CONTEXT *tdb, TDB_DATA key); int tdb_store(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, int flag); int tdb_append(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA new_dbuf); int tdb_close(TDB_CONTEXT *tdb); TDB_DATA tdb_firstkey(TDB_CONTEXT *tdb); TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA key); int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *state); int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key); int tdb_lockkeys(TDB_CONTEXT *tdb, u32 number, TDB_DATA keys[]); void tdb_unlockkeys(TDB_CONTEXT *tdb); int tdb_lockall(TDB_CONTEXT *tdb); void tdb_unlockall(TDB_CONTEXT *tdb); /* Low level locking functions: use with care */ void tdb_set_lock_alarm(sig_atomic_t *palarm); int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key); int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key); /* Debug functions. Not used in production. */ void tdb_dump_all(TDB_CONTEXT *tdb); int tdb_printfreelist(TDB_CONTEXT *tdb); extern TDB_DATA tdb_null; #ifdef __cplusplus } #endif #endif /* tdb.h */ netatalk-2.2.2/include/atalk/globals.h0000644000175200017500000001237211656511777014603 00000000000000/* * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifndef AFPD_GLOBALS_H #define AFPD_GLOBALS_H 1 #include #include #ifdef ADMIN_GRP #include #include #endif /* ADMIN_GRP */ #ifdef HAVE_NETDB_H #include /* this isn't header-protected under ultrix */ #endif /* HAVE_NETDB_H */ #include #include #include #include #include /* #define DOSFILELEN 12 */ /* Type1, DOS-compat*/ #define MACFILELEN 31 /* Type2, HFS-compat */ #define UTF8FILELEN_EARLY 255 /* Type3, early Mac OS X 10.0-10.4.? */ /* #define UTF8FILELEN_NAME_MAX 765 */ /* Type3, 10.4.?- , getconf NAME_MAX */ /* #define UTF8FILELEN_SPEC 0xFFFF */ /* Type3, spec on document */ /* #define HFSPLUSFILELEN 510 */ /* HFS+ spec, 510byte = 255codepoint */ #define MAXUSERLEN 256 #define OPTION_DEBUG (1 << 0) #define OPTION_USERVOLFIRST (1 << 1) #define OPTION_NOUSERVOL (1 << 2) #define OPTION_PROXY (1 << 3) #define OPTION_CUSTOMICON (1 << 4) #define OPTION_NOSLP (1 << 5) #define OPTION_ANNOUNCESSH (1 << 6) #define OPTION_UUID (1 << 7) #define OPTION_ACL2MACCESS (1 << 8) #define OPTION_NOZEROCONF (1 << 9) #define OPTION_KEEPSESSIONS (1 << 10) /* preserve sessions across master afpd restart with SIGQUIT */ #ifdef FORCE_UIDGID /* set up a structure for this */ typedef struct uidgidset_t { uid_t uid; gid_t gid; } uidgidset; #endif /* FORCE_UIDGID */ /* a couple of these options could get stuck in unions to save * space. */ struct afp_volume_name { time_t mtime; char *name; char *full_name; int loaded; }; struct afp_options { int connections, transports, tickleval, timeout, server_notif, flags, dircachesize; int sleep; /* Maximum time allowed to sleep (in tickles) */ int disconnected; /* Maximum time in disconnected state (in tickles) */ int fce_fmodwait; /* number of seconds FCE file mod events are put on hold */ unsigned int tcp_sndbuf, tcp_rcvbuf; unsigned char passwdbits, passwdminlen, loginmaxfail; u_int32_t server_quantum; int dsireadbuf; /* scale factor for sizefof(dsi->buffer) = server_quantum * dsireadbuf */ char hostname[MAXHOSTNAMELEN + 1], *server, *ipaddr, *port, *configfile; #ifndef NO_DDP struct at_addr ddpaddr; #endif char *uampath, *fqdn; char *pidfile; char *sigconffile; char *uuidconf; struct afp_volume_name defaultvol, systemvol, uservol; int closevol; char *guest, *loginmesg, *keyfile, *passwdfile; char *uamlist; char *authprintdir; char *signatureopt; unsigned char signature[16]; char *k5service, *k5realm, *k5keytab; char *unixcodepage,*maccodepage; charset_t maccharset, unixcharset; mode_t umask; mode_t save_mask; #ifdef ADMIN_GRP gid_t admingid; #endif /* ADMIN_GRP */ int volnamelen; /* default value for winbind authentication */ char *ntdomain, *ntseparator; char *logconfig; char *mimicmodel; char *adminauthuser; }; #define AFPOBJ_TMPSIZ (MAXPATHLEN) typedef struct _AFPObj { int proto; unsigned long servernum; void *handle; /* either (DSI *) or (ASP *) */ void *config; struct afp_options options; char *Obj, *Type, *Zone; char username[MAXUSERLEN]; void (*logout)(void), (*exit)(int); int (*reply)(void *, int); int (*attention)(void *, AFPUserBytes); /* to prevent confusion, only use these in afp_* calls */ char oldtmp[AFPOBJ_TMPSIZ + 1], newtmp[AFPOBJ_TMPSIZ + 1]; void *uam_cookie; /* cookie for uams */ struct session_info sinfo; uid_t uid; /* client running user id */ int ipc_fd; /* anonymous PF_UNIX socket for IPC with afpd parent */ #ifdef FORCE_UIDGID int force_uid; uidgidset uidgid; #endif } AFPObj; /* typedef for AFP functions handlers */ typedef int (*AFPCmd)(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); /* Global variables */ extern AFPObj *AFPobj; extern int afp_version; extern int afp_errno; extern unsigned char nologin; extern struct dir *curdir; extern char getwdbuf[]; extern struct afp_options default_options; extern const char *Cnid_srv; extern const char *Cnid_port; extern int get_afp_errno (const int param); extern void afp_options_init (struct afp_options *); extern int afp_options_parse (int, char **, struct afp_options *); extern int afp_options_parseline (char *, struct afp_options *); extern void afp_options_free (struct afp_options *, const struct afp_options *); extern void setmessage (const char *); extern void readmessage (AFPObj *); /* gettok.c */ extern void initline (int, char *); extern int parseline (int, char *); /* afp_util.c */ extern const char *AfpNum2name (int ); extern const char *AfpErr2name(int err); /* directory.c */ extern struct dir rootParent; #ifndef NO_DDP extern void afp_over_asp (AFPObj *); #endif /* NO_DDP */ extern void afp_over_dsi (AFPObj *); #endif /* globals.h */ netatalk-2.2.2/include/atalk/bstrlib.h0000644000175200017500000003361011655731126014606 00000000000000/* * This source file is part of the bstring string library. This code was * written by Paul Hsieh in 2002-2008, and is covered by the BSD open source * license and the GPL. Refer to the accompanying documentation for details * on usage and license. */ /*! * @file * This file is the core module for implementing the bstring functions. */ #ifndef BSTRLIB_INCLUDE #define BSTRLIB_INCLUDE #ifdef __cplusplus extern "C" { #endif #include #include #include #include #if !defined (BSTRLIB_VSNP_OK) && !defined (BSTRLIB_NOVSNP) # if defined (__TURBOC__) && !defined (__BORLANDC__) # define BSTRLIB_NOVSNP # endif #endif #define BSTR_ERR (-1) #define BSTR_OK (0) #define BSTR_BS_BUFF_LENGTH_GET (0) typedef struct tagbstring * bstring; typedef const struct tagbstring * const_bstring; /* Copy functions */ #define cstr2bstr bfromcstr extern bstring bfromcstr (const char * str); extern bstring bfromcstralloc (int mlen, const char * str); extern bstring blk2bstr (const void * blk, int len); extern char * bstr2cstr (const_bstring s, char z); extern int bcstrfree (char * s); extern bstring bstrcpy (const_bstring b1); extern int bassign (bstring a, const_bstring b); extern int bassignmidstr (bstring a, const_bstring b, int left, int len); extern int bassigncstr (bstring a, const char * str); extern int bassignblk (bstring a, const void * s, int len); /* Destroy function */ extern int bdestroy (bstring b); /* Space allocation hinting functions */ extern int balloc (bstring s, int len); extern int ballocmin (bstring b, int len); /* Substring extraction */ extern bstring bmidstr (const_bstring b, int left, int len); /* Various standard manipulations */ extern int bconcat (bstring b0, const_bstring b1); extern int bconchar (bstring b0, char c); extern int bcatcstr (bstring b, const char * s); extern int bcatblk (bstring b, const void * s, int len); extern int binsert (bstring s1, int pos, const_bstring s2, unsigned char fill); extern int binsertch (bstring s1, int pos, int len, unsigned char fill); extern int breplace (bstring b1, int pos, int len, const_bstring b2, unsigned char fill); extern int bdelete (bstring s1, int pos, int len); extern int bsetstr (bstring b0, int pos, const_bstring b1, unsigned char fill); extern int btrunc (bstring b, int n); /* Scan/search functions */ extern int bstricmp (const_bstring b0, const_bstring b1); extern int bstrnicmp (const_bstring b0, const_bstring b1, int n); extern int biseqcaseless (const_bstring b0, const_bstring b1); extern int bisstemeqcaselessblk (const_bstring b0, const void * blk, int len); extern int biseq (const_bstring b0, const_bstring b1); extern int bisstemeqblk (const_bstring b0, const void * blk, int len); extern int biseqcstr (const_bstring b, const char * s); extern int biseqcstrcaseless (const_bstring b, const char * s); extern int bstrcmp (const_bstring b0, const_bstring b1); extern int bstrncmp (const_bstring b0, const_bstring b1, int n); extern int binstr (const_bstring s1, int pos, const_bstring s2); extern int binstrr (const_bstring s1, int pos, const_bstring s2); extern int binstrcaseless (const_bstring s1, int pos, const_bstring s2); extern int binstrrcaseless (const_bstring s1, int pos, const_bstring s2); extern int bstrchrp (const_bstring b, int c, int pos); extern int bstrrchrp (const_bstring b, int c, int pos); #define bstrchr(b,c) bstrchrp ((b), (c), 0) #define bstrrchr(b,c) bstrrchrp ((b), (c), blength(b)-1) extern int binchr (const_bstring b0, int pos, const_bstring b1); extern int binchrr (const_bstring b0, int pos, const_bstring b1); extern int bninchr (const_bstring b0, int pos, const_bstring b1); extern int bninchrr (const_bstring b0, int pos, const_bstring b1); extern int bfindreplace (bstring b, const_bstring find, const_bstring repl, int pos); extern int bfindreplacecaseless (bstring b, const_bstring find, const_bstring repl, int pos); /* List of string container functions */ struct bstrList { int qty, mlen; bstring * entry; }; extern struct bstrList * bstrListCreate (void); extern int bstrListDestroy (struct bstrList * sl); extern int bstrListAlloc (struct bstrList * sl, int msz); extern int bstrListAllocMin (struct bstrList * sl, int msz); /* String split and join functions */ extern struct bstrList * bsplit (const_bstring str, unsigned char splitChar); extern struct bstrList * bsplits (const_bstring str, const_bstring splitStr); extern struct bstrList * bsplitstr (const_bstring str, const_bstring splitStr); extern bstring bjoin (const struct bstrList * bl, const_bstring sep); extern int bsplitcb (const_bstring str, unsigned char splitChar, int pos, int (* cb) (void * parm, int ofs, int len), void * parm); extern int bsplitscb (const_bstring str, const_bstring splitStr, int pos, int (* cb) (void * parm, int ofs, int len), void * parm); extern int bsplitstrcb (const_bstring str, const_bstring splitStr, int pos, int (* cb) (void * parm, int ofs, int len), void * parm); /* Miscellaneous functions */ extern int bpattern (bstring b, int len); extern int btoupper (bstring b); extern int btolower (bstring b); extern int bltrimws (bstring b); extern int brtrimws (bstring b); extern int btrimws (bstring b); #if !defined (BSTRLIB_NOVSNP) extern bstring bformat (const char * fmt, ...); extern int bformata (bstring b, const char * fmt, ...); extern int bassignformat (bstring b, const char * fmt, ...); extern int bvcformata (bstring b, int count, const char * fmt, va_list arglist); #define bvformata(ret, b, fmt, lastarg) { \ bstring bstrtmp_b = (b); \ const char * bstrtmp_fmt = (fmt); \ int bstrtmp_r = BSTR_ERR, bstrtmp_sz = 16; \ for (;;) { \ va_list bstrtmp_arglist; \ va_start (bstrtmp_arglist, lastarg); \ bstrtmp_r = bvcformata (bstrtmp_b, bstrtmp_sz, bstrtmp_fmt, bstrtmp_arglist); \ va_end (bstrtmp_arglist); \ if (bstrtmp_r >= 0) { /* Everything went ok */ \ bstrtmp_r = BSTR_OK; \ break; \ } else if (-bstrtmp_r <= bstrtmp_sz) { /* A real error? */ \ bstrtmp_r = BSTR_ERR; \ break; \ } \ bstrtmp_sz = -bstrtmp_r; /* Doubled or target size */ \ } \ ret = bstrtmp_r; \ } #endif typedef int (*bNgetc) (void *parm); typedef size_t (* bNread) (void *buff, size_t elsize, size_t nelem, void *parm); /* Input functions */ extern bstring bgetstream (bNgetc getcPtr, void * parm, char terminator); extern bstring bread (bNread readPtr, void * parm); extern int bgetsa (bstring b, bNgetc getcPtr, void * parm, char terminator); extern int bassigngets (bstring b, bNgetc getcPtr, void * parm, char terminator); extern int breada (bstring b, bNread readPtr, void * parm); /* Stream functions */ extern struct bStream * bsopen (bNread readPtr, void * parm); extern void * bsclose (struct bStream * s); extern int bsbufflength (struct bStream * s, int sz); extern int bsreadln (bstring b, struct bStream * s, char terminator); extern int bsreadlns (bstring r, struct bStream * s, const_bstring term); extern int bsread (bstring b, struct bStream * s, int n); extern int bsreadlna (bstring b, struct bStream * s, char terminator); extern int bsreadlnsa (bstring r, struct bStream * s, const_bstring term); extern int bsreada (bstring b, struct bStream * s, int n); extern int bsunread (struct bStream * s, const_bstring b); extern int bspeek (bstring r, const struct bStream * s); extern int bssplitscb (struct bStream * s, const_bstring splitStr, int (* cb) (void * parm, int ofs, const_bstring entry), void * parm); extern int bssplitstrcb (struct bStream * s, const_bstring splitStr, int (* cb) (void * parm, int ofs, const_bstring entry), void * parm); extern int bseof (const struct bStream * s); struct tagbstring { int mlen; int slen; unsigned char * data; }; /* Accessor macros */ #define blengthe(b, e) (((b) == (void *)0 || (b)->slen < 0) ? (int)(e) : ((b)->slen)) #define blength(b) (blengthe ((b), 0)) #define bdataofse(b, o, e) (((b) == (void *)0 || (b)->data == (void*)0) ? (char *)(e) : ((char *)(b)->data) + (o)) #define bdataofs(b, o) (bdataofse ((b), (o), (void *)0)) #define bdatae(b, e) (bdataofse (b, 0, e)) #define bdata(b) (bdataofs (b, 0)) #define bchare(b, p, e) ((((unsigned)(p)) < (unsigned)blength(b)) ? ((b)->data[(p)]) : (e)) #define bchar(b, p) bchare ((b), (p), '\0') /* Static constant string initialization macro */ #define bsStaticMlen(q,m) {(m), (int) sizeof(q)-1, (unsigned char *) ("" q "")} #if defined(_MSC_VER) # define bsStatic(q) bsStaticMlen(q,-32) #endif #ifndef bsStatic # define bsStatic(q) bsStaticMlen(q,-__LINE__) #endif /* Static constant block parameter pair */ #define bsStaticBlkParms(q) ((void *)("" q "")), ((int) sizeof(q)-1) /* Reference building macros */ #define cstr2tbstr btfromcstr #define btfromcstr(t,s) { \ (t).data = (unsigned char *) (s); \ (t).slen = ((t).data) ? ((int) (strlen) ((char *)(t).data)) : 0; \ (t).mlen = -1; \ } #define blk2tbstr(t,s,l) { \ (t).data = (unsigned char *) (s); \ (t).slen = l; \ (t).mlen = -1; \ } #define btfromblk(t,s,l) blk2tbstr(t,s,l) #define bmid2tbstr(t,b,p,l) { \ const_bstring bstrtmp_s = (b); \ if (bstrtmp_s && bstrtmp_s->data && bstrtmp_s->slen >= 0) { \ int bstrtmp_left = (p); \ int bstrtmp_len = (l); \ if (bstrtmp_left < 0) { \ bstrtmp_len += bstrtmp_left; \ bstrtmp_left = 0; \ } \ if (bstrtmp_len > bstrtmp_s->slen - bstrtmp_left) \ bstrtmp_len = bstrtmp_s->slen - bstrtmp_left; \ if (bstrtmp_len <= 0) { \ (t).data = (unsigned char *)""; \ (t).slen = 0; \ } else { \ (t).data = bstrtmp_s->data + bstrtmp_left; \ (t).slen = bstrtmp_len; \ } \ } else { \ (t).data = (unsigned char *)""; \ (t).slen = 0; \ } \ (t).mlen = -__LINE__; \ } #define btfromblkltrimws(t,s,l) { \ int bstrtmp_idx = 0, bstrtmp_len = (l); \ unsigned char * bstrtmp_s = (s); \ if (bstrtmp_s && bstrtmp_len >= 0) { \ for (; bstrtmp_idx < bstrtmp_len; bstrtmp_idx++) { \ if (!isspace (bstrtmp_s[bstrtmp_idx])) break; \ } \ } \ (t).data = bstrtmp_s + bstrtmp_idx; \ (t).slen = bstrtmp_len - bstrtmp_idx; \ (t).mlen = -__LINE__; \ } #define btfromblkrtrimws(t,s,l) { \ int bstrtmp_len = (l) - 1; \ unsigned char * bstrtmp_s = (s); \ if (bstrtmp_s && bstrtmp_len >= 0) { \ for (; bstrtmp_len >= 0; bstrtmp_len--) { \ if (!isspace (bstrtmp_s[bstrtmp_len])) break; \ } \ } \ (t).data = bstrtmp_s; \ (t).slen = bstrtmp_len + 1; \ (t).mlen = -__LINE__; \ } #define btfromblktrimws(t,s,l) { \ int bstrtmp_idx = 0, bstrtmp_len = (l) - 1; \ unsigned char * bstrtmp_s = (s); \ if (bstrtmp_s && bstrtmp_len >= 0) { \ for (; bstrtmp_idx <= bstrtmp_len; bstrtmp_idx++) { \ if (!isspace (bstrtmp_s[bstrtmp_idx])) break; \ } \ for (; bstrtmp_len >= bstrtmp_idx; bstrtmp_len--) { \ if (!isspace (bstrtmp_s[bstrtmp_len])) break; \ } \ } \ (t).data = bstrtmp_s + bstrtmp_idx; \ (t).slen = bstrtmp_len + 1 - bstrtmp_idx; \ (t).mlen = -__LINE__; \ } /* Write protection macros */ #define bwriteprotect(t) { if ((t).mlen >= 0) (t).mlen = -1; } #define bwriteallow(t) { if ((t).mlen == -1) (t).mlen = (t).slen + ((t).slen == 0); } #define biswriteprotected(t) ((t).mlen <= 0) #ifdef __cplusplus } #endif #endif netatalk-2.2.2/include/atalk/nbp.h0000644000175200017500000000510411655731244013722 00000000000000/* * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef _ATALK_NBP_H #define _ATALK_NBP_H 1 #ifndef NO_DDP #define NBP_UNRGSTR_4ARGS 1 #define ATP_OPEN_2ARGS 1 #include #include #include #include struct nbphdr { #if BYTE_ORDER == BIG_ENDIAN unsigned nh_op : 4, nh_cnt : 4, #else /* BYTE_ORDER != BIG_ENDIAN */ unsigned nh_cnt : 4, nh_op : 4, #endif /* BYTE_ORDER */ nh_id : 8; }; #define SZ_NBPHDR 2 struct nbptuple { u_int16_t nt_net; u_int8_t nt_node; u_int8_t nt_port; u_int8_t nt_enum; }; #define SZ_NBPTUPLE 5 #define NBPSTRLEN 32 /* * Name Binding Protocol Network Visible Entity */ struct nbpnve { struct sockaddr_at nn_sat; u_char nn_objlen; char nn_obj[ NBPSTRLEN ]; u_char nn_typelen; char nn_type[ NBPSTRLEN ]; u_char nn_zonelen; char nn_zone[ NBPSTRLEN ]; }; /* * Note that NBPOP_ERROR is not standard. As Apple adds more NBPOPs, * we need to check for collisions with our extra values. */ #define NBPOP_BRRQ 0x1 #define NBPOP_LKUP 0x2 #define NBPOP_LKUPREPLY 0x3 #define NBPOP_FWD 0x4 #define NBPOP_RGSTR 0x7 #define NBPOP_UNRGSTR 0x8 #define NBPOP_CONFIRM 0x9 #define NBPOP_OK 0xa /* NBPOP_STATUS_REPLY */ #define NBPOP_CLOSE_NOTE 0xb #define NBPOP_ERROR 0xf #define NBPMATCH_NOGLOB (1<<1) #define NBPMATCH_NOZONE (1<<2) extern int nbp_name (const char *, char **, char **, char **); extern int nbp_lookup (const char *, const char *, const char *, struct nbpnve *, const int, const struct at_addr *); extern int nbp_rgstr (struct sockaddr_at *, const char *, const char *, const char *); extern int nbp_unrgstr (const char *, const char *, const char *, const struct at_addr *); #endif /* NO_DDP */ #endif netatalk-2.2.2/include/atalk/queue.h0000644000175200017500000000235411655731126014272 00000000000000/* Copyright (c) 2010 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef ATALK_QUEUE_H #define ATALK_QUEUE_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ typedef struct qnode { struct qnode *prev; struct qnode *next; void *data; } qnode_t; typedef qnode_t q_t; extern q_t *queue_init(void); extern void queue_destroy(q_t *q, void (*callback)(void *)); #define queue_free(q) queue_destroy((q), free) extern qnode_t *enqueue(q_t *q, void *data); extern qnode_t *prequeue(q_t *q, void *data); extern void *dequeue(q_t *q); #endif /* ATALK_QUEUE_H */ netatalk-2.2.2/include/atalk/server_child.h0000644000175200017500000000415011655731126015613 00000000000000/* * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. */ #ifndef _ATALK_SERVER_CHILD_H #define _ATALK_SERVER_CHILD_H 1 #include #include #include /* useful stuff for child processes. most of this is hidden in * server_child.c to ease changes in implementation */ #define CHILD_NFORKS 2 #define CHILD_ASPFORK 0 #define CHILD_PAPFORK 0 #define CHILD_DSIFORK 1 typedef struct server_child { void *fork; int count, nsessions, nforks; } server_child; typedef struct server_child_data { pid_t pid; /* afpd worker process pid (from the worker afpd process )*/ uid_t uid; /* user id of connected client (from the worker afpd process) */ int valid; /* 1 if we have a clientid */ int killed; /* 1 if we already tried to kill the client */ int disasociated; /* 1 if this is not a child, but a child from a previous afpd master */ uint32_t time; /* client boot time (from the mac client) */ uint32_t idlen; /* clientid len (from the Mac client) */ char *clientid; /* clientid (from the Mac client) */ int ipc_fds[2]; /* socketpair for IPC bw */ struct server_child_data **prevp, *next; } afp_child_t; extern int parent_or_child; /* server_child.c */ extern server_child *server_child_alloc (const int, const int); extern afp_child_t *server_child_add (server_child *, int, pid_t, uint ipc_fds[2]); extern int server_child_remove (server_child *, const int, const pid_t); extern void server_child_free (server_child *); extern void server_child_kill (server_child *, const int, const int); extern void server_child_kill_one_by_id (server_child *children, const int forkid, const pid_t pid, const uid_t, const u_int32_t len, char *id, u_int32_t boottime); extern int server_child_transfer_session(server_child *children, int forkid, pid_t, uid_t, int, uint16_t); extern void server_child_setup (server_child *, const int, void (*)(const pid_t)); extern void server_child_handler (server_child *); extern void server_reset_signal (void); #endif netatalk-2.2.2/include/atalk/paths.h0000644000175200017500000000457011655731244014270 00000000000000#ifndef ATALK_PATHS_H #define ATALK_PATHS_H 1 /* we need a way of concatenating strings */ #ifdef __STDC__ #ifdef HAVE_BROKEN_CPP #define BROKEN_ECHO(a) a #define ATALKPATHCAT(a,b) BROKEN_ECHO(a)##BROKEN_ECHO(b) #else #define ATALKPATHCAT(a,b) a b #endif #else #define ATALKPATHCAT(a,b) a/**/b #endif /* lock file path. this should be re-organized a bit. */ #if ! defined (_PATH_LOCKDIR) # if defined (FHS_COMPATIBILITY) || defined (__NetBSD__) || defined (__OpenBSD__) # define _PATH_LOCKDIR "/var/run/" # elif defined (BSD4_4) # ifdef MACOSX_SERVER # define _PATH_LOCKDIR "/var/run/" # else # define _PATH_LOCKDIR "/var/spool/lock/" # endif # elif defined (linux) # define _PATH_LOCKDIR "/var/lock/" # else # define _PATH_LOCKDIR "/var/spool/locks/" # endif #endif /* * papd paths */ #define _PATH_PAPDPRINTCAP "/etc/printcap" #ifdef ultrix #define _PATH_PAPDSPOOLDIR "/usr/spool/lpd" #else /* !ultrix */ #define _PATH_PAPDSPOOLDIR "/var/spool/lpd" #endif /* ultrix */ #ifdef BSD4_4 #define _PATH_DEVPRINTER "/var/run/printer" #else /* !BSD4_4 */ #define _PATH_DEVPRINTER "/dev/printer" #endif /* BSD4_4 */ /* * atalkd paths */ #define _PATH_ATALKDEBUG "/tmp/atalkd.debug" #define _PATH_ATALKDTMP "atalkd.tmp" #if defined (FHS_COMPATIBILITY) || defined (__NetBSD__) || defined (__OpenBSD__) # define _PATH_ATALKDLOCK ATALKPATHCAT(_PATH_LOCKDIR,"atalkd.pid") #else # define _PATH_ATALKDLOCK ATALKPATHCAT(_PATH_LOCKDIR,"atalkd") #endif /* * psorder paths */ #define _PATH_TMPPAGEORDER "/tmp/psorderXXXXXX" #if defined (FHS_COMPATIBILITY) || defined (__NetBSD__) || defined (__OpenBSD__) # define _PATH_PAPDLOCK ATALKPATHCAT(_PATH_LOCKDIR,"papd.pid") #else # define _PATH_PAPDLOCK ATALKPATHCAT(_PATH_LOCKDIR,"papd") #endif /* * afpd paths */ #define _PATH_AFPTKT "/tmp/AFPtktXXXXXX" #define _PATH_AFP_IPC ATALKPATHCAT(_PATH_LOCKDIR,"afpd_ipc") #if defined (FHS_COMPATIBILITY) || defined (__NetBSD__) || defined (__OpenBSD__) # define _PATH_AFPDLOCK ATALKPATHCAT(_PATH_LOCKDIR,"afpd.pid") #else # define _PATH_AFPDLOCK ATALKPATHCAT(_PATH_LOCKDIR,"afpd") #endif /* * cnid_metad paths */ #if defined (FHS_COMPATIBILITY) || defined (__NetBSD__) || defined (__OpenBSD__) # define _PATH_CNID_METAD_LOCK ATALKPATHCAT(_PATH_LOCKDIR,"cnid_metad.pid") #else # define _PATH_CNID_METAD_LOCK ATALKPATHCAT(_PATH_LOCKDIR,"cnid_metad") #endif #endif /* atalk/paths.h */ netatalk-2.2.2/include/atalk/afp.h0000644000175200017500000002030411655731126013707 00000000000000/* * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef _ATALK_AFP_H #define _ATALK_AFP_H 1 #include #include typedef u_int16_t AFPUserBytes; /* protocols */ #define AFPPROTO_ASP 1 #define AFPPROTO_DSI 2 /* actual transports. the DSI ones (tcp right now) need to be * kept in sync w/ . * convention: AFPTRANS_* = (1 << DSI_*) */ #define AFPTRANS_NONE 0 #define AFPTRANS_DDP (1 << 0) #define AFPTRANS_TCP (1 << 1) #define AFPTRANS_ALL (AFPTRANS_DDP | AFPTRANS_TCP) /* server flags */ #define AFPSRVRINFO_COPY (1<<0) /* supports copyfile */ #define AFPSRVRINFO_PASSWD (1<<1) /* supports change password */ #define AFPSRVRINFO_NOSAVEPASSWD (1<<2) /* don't allow save password */ #define AFPSRVRINFO_SRVMSGS (1<<3) /* supports server messages */ #define AFPSRVRINFO_SRVSIGNATURE (1<<4) /* supports server signature */ #define AFPSRVRINFO_TCPIP (1<<5) /* supports tcpip */ #define AFPSRVRINFO_SRVNOTIFY (1<<6) /* supports server notifications */ #define AFPSRVRINFO_SRVRECONNECT (1<<7) /* supports server reconnect */ #define AFPSRVRINFO_SRVRDIR (1<<8) /* supports directories service */ #define AFPSRVRINFO_SRVUTF8 (1<<9) /* supports UTF8 names AFP 3.1 */ #define AFPSRVRINFO_UUID (1<<10) /* supports UUIDs */ #define AFPSRVRINFO_EXTSLEEP (1<<11) /* supports extended sleep */ #define AFPSRVRINFO_FASTBOZO (1<<15) /* fast copying */ #define AFP_OK 0 #define AFPERR_DID1 -4000 /* not an afp error DID is 1*/ #define AFPERR_ACCESS -5000 /* permission denied */ #define AFPERR_AUTHCONT -5001 /* logincont */ #define AFPERR_BADUAM -5002 /* uam doesn't exist */ #define AFPERR_BADVERS -5003 /* bad afp version number */ #define AFPERR_BITMAP -5004 /* invalid bitmap */ #define AFPERR_CANTMOVE -5005 /* can't move file */ #define AFPERR_DENYCONF -5006 /* file synchronization locks conflict */ #define AFPERR_DIRNEMPT -5007 /* directory not empty */ #define AFPERR_DFULL -5008 /* disk full */ #define AFPERR_EOF -5009 /* end of file -- catsearch and afp_read */ #define AFPERR_BUSY -5010 /* FileBusy */ #define AFPERR_FLATVOL -5011 /* volume doesn't support directories */ #define AFPERR_NOITEM -5012 /* ItemNotFound */ #define AFPERR_LOCK -5013 /* LockErr */ #define AFPERR_MISC -5014 /* misc. err */ #define AFPERR_NLOCK -5015 /* no more locks */ #define AFPERR_NOSRVR -5016 /* no response by server at that address */ #define AFPERR_EXIST -5017 /* object already exists */ #define AFPERR_NOOBJ -5018 /* object not found */ #define AFPERR_PARAM -5019 /* parameter error */ #define AFPERR_NORANGE -5020 /* no range lock */ #define AFPERR_RANGEOVR -5021 /* range overlap */ #define AFPERR_SESSCLOS -5022 /* session closed */ #define AFPERR_NOTAUTH -5023 /* user not authenticated */ #define AFPERR_NOOP -5024 /* command not supported */ #define AFPERR_BADTYPE -5025 /* object is the wrong type */ #define AFPERR_NFILE -5026 /* too many files open */ #define AFPERR_SHUTDOWN -5027 /* server is going down */ #define AFPERR_NORENAME -5028 /* can't rename */ #define AFPERR_NODIR -5029 /* couldn't find directory */ #define AFPERR_ITYPE -5030 /* wrong icon type */ #define AFPERR_VLOCK -5031 /* volume locked */ #define AFPERR_OLOCK -5032 /* object locked */ #define AFPERR_CTNSHRD -5033 /* share point contains a share point */ #define AFPERR_NOID -5034 /* file thread not found */ #define AFPERR_EXISTID -5035 /* file already has an id */ #define AFPERR_DIFFVOL -5036 /* different volume */ #define AFPERR_CATCHNG -5037 /* catalog has changed */ #define AFPERR_SAMEOBJ -5038 /* source file == destination file */ #define AFPERR_BADID -5039 /* non-existent file id */ #define AFPERR_PWDSAME -5040 /* same password/can't change password */ #define AFPERR_PWDSHORT -5041 /* password too short */ #define AFPERR_PWDEXPR -5042 /* password expired */ #define AFPERR_INSHRD -5043 /* folder being shared is inside a shared folder. may be returned by afpMoveAndRename. */ #define AFPERR_INTRASH -5044 /* shared folder in trash. */ #define AFPERR_PWDCHNG -5045 /* password needs to be changed */ #define AFPERR_PWDPOLCY -5046 /* password fails policy check */ #define AFPERR_USRLOGIN -5047 /* user already logged on */ /* AFP Attention Codes -- 4 bits */ #define AFPATTN_SHUTDOWN (1 << 15) /* shutdown/disconnect */ #define AFPATTN_CRASH (1 << 14) /* server crashed */ #define AFPATTN_MESG (1 << 13) /* server has message */ #define AFPATTN_NORECONNECT (1 << 12) /* don't reconnect */ /* server notification */ #define AFPATTN_NOTIFY (AFPATTN_MESG | AFPATTN_NORECONNECT) /* extended bitmap -- 12 bits. volchanged is only useful w/ a server * notification, and time is only useful for shutdown. */ #define AFPATTN_VOLCHANGED (1 << 0) /* volume has changed */ #define AFPATTN_TIME(x) ((x) & 0xfff) /* time in minutes */ typedef enum { AFPMESG_LOGIN = 0, AFPMESG_SERVER = 1 } afpmessage_t; /* extended sleep flag */ #define AFPZZZ_EXT_SLEEP 1 #define AFPZZZ_EXT_WAKEUP 2 /* AFP functions */ #define AFP_BYTELOCK 1 #define AFP_CLOSEVOL 2 #define AFP_CLOSEDIR 3 #define AFP_CLOSEFORK 4 #define AFP_COPYFILE 5 #define AFP_CREATEDIR 6 #define AFP_CREATEFILE 7 #define AFP_DELETE 8 #define AFP_ENUMERATE 9 #define AFP_FLUSH 10 #define AFP_FLUSHFORK 11 #define AFP_GETFORKPARAM 14 #define AFP_GETSRVINFO 15 #define AFP_GETSRVPARAM 16 #define AFP_GETVOLPARAM 17 #define AFP_LOGIN 18 #define AFP_LOGINCONT 19 #define AFP_LOGOUT 20 #define AFP_MAPID 21 #define AFP_MAPNAME 22 #define AFP_MOVE 23 #define AFP_OPENVOL 24 #define AFP_OPENDIR 25 #define AFP_OPENFORK 26 #define AFP_READ 27 #define AFP_RENAME 28 #define AFP_SETDIRPARAM 29 #define AFP_SETFILEPARAM 30 #define AFP_SETFORKPARAM 31 #define AFP_SETVOLPARAM 32 #define AFP_WRITE 33 #define AFP_GETFLDRPARAM 34 #define AFP_SETFLDRPARAM 35 #define AFP_CHANGEPW 36 #define AFP_GETUSERINFO 37 #define AFP_GETSRVRMSG 38 #define AFP_CREATEID 39 #define AFP_DELETEID 40 #define AFP_RESOLVEID 41 #define AFP_EXCHANGEFILE 42 #define AFP_CATSEARCH 43 #define AFP_OPENDT 48 #define AFP_CLOSEDT 49 #define AFP_GETICON 51 #define AFP_GTICNINFO 52 #define AFP_ADDAPPL 53 #define AFP_RMVAPPL 54 #define AFP_GETAPPL 55 #define AFP_ADDCMT 56 #define AFP_RMVCMT 57 #define AFP_GETCMT 58 #define AFP_ADDICON 192 /* version 3.0 */ #define AFP_BYTELOCK_EXT 59 #define AFP_CATSEARCH_EXT 67 #define AFP_ENUMERATE_EXT 66 #define AFP_READ_EXT 60 #define AFP_WRITE_EXT 61 #define AFP_LOGIN_EXT 63 #define AFP_GETSESSTOKEN 64 #define AFP_DISCTOLDSESS 65 /* version 3.1 */ #define AFP_ENUMERATE_EXT2 68 #define AFP_SPOTLIGHT_PRIVATE 76 #define AFP_SYNCDIR 78 #define AFP_SYNCFORK 79 #define AFP_ZZZ 122 /* version 3.2 */ #define AFP_GETEXTATTR 69 #define AFP_SETEXTATTR 70 #define AFP_REMOVEATTR 71 #define AFP_LISTEXTATTR 72 #define AFP_GETACL 73 #define AFP_SETACL 74 #define AFP_ACCESS 75 /* more defines */ #define REPLAYCACHE_SIZE 128 #endif netatalk-2.2.2/include/atalk/ddp.h0000644000175200017500000000212511655731244013712 00000000000000/* * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef _ATALK_DDP_H #define _ATALK_DDP_H 1 #ifndef NO_DDP #define DDPTYPE_RTMPRD 1 #define DDPTYPE_NBP 2 #define DDPTYPE_ATP 3 #define DDPTYPE_AEP 4 #define DDPTYPE_RTMPR 5 #define DDPTYPE_ZIP 6 #define DDPTYPE_ADSP 7 #endif /* NO_DDP */ #endif netatalk-2.2.2/include/atalk/logger.h0000644000175200017500000001642211655731244014427 00000000000000#ifndef _ATALK_LOGGER_H #define _ATALK_LOGGER_H 1 /* * logger LOG Macro Usage * ====================== * * LOG(, , ""[, args]); * * * logger API Setup * ================ * * Standard interface: * ------------------- * * setuplog(char *confstring) * confstring = " []" * * Calling without configures basic logging to syslog. Specifying * configures extended logging to . * * You can later disable logging by calling * * unsetuplog(char *confstring) * confstring = " []" * * Calling without disables syslog logging, calling with * disables file logging. * * : * you can setup a default with "Default". Any other logtype used in LOG will then * use the default if not setup itself. This is probabyl the only thing you may * want to use. * * Example: * setuplog("default log_debug /var/log/debug.log"); * See also libatalk/util/test/logger_test.c * * "Legacy" interface: * ------------------- * * Some netatalk daemons (31.3.2009.: e.g. atalkd, papd) may not be converted to * use the new API and might still call * * syslog_setup(int loglevel, enum logtypes logtype, int display_options, int facility); * * directly. These daemons are therefore limited to syslog logging. Also their * loglevel can't be changed at runtime. * * * Note: * dont get confused by log_init(). It only gets called if your app * forgets to setup logging before calling LOG. */ #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif /* logger is used by pam modules */ #ifndef UAM_MODULE_EXPORT #define UAM_MODULE_EXPORT #endif enum loglevels { log_none, log_severe, log_error, log_warning, log_note, log_info, log_debug, log_debug6, log_debug7, log_debug8, log_debug9, log_maxdebug }; /* this is the enum specifying all availiable logtypes */ enum logtypes { logtype_default, logtype_logger, logtype_cnid, logtype_afpd, logtype_dsi, logtype_atalkd, logtype_papd, logtype_uams, logtype_end_of_list_marker /* don't put any logtypes after this */ }; /* Display Option flags. */ /* redefine these so they can don't interfeer with syslog */ /* these can be used in standard logging too */ #define logoption_nsrcinfo 0x04 /* don't log source info */ /* the following do not work anymore, they're only provided in order to not * break existing source code */ #define logoption_pid 0x01 /* log the pid with each message */ #define logoption_cons 0x02 /* log on the console if error logging */ #define logoption_ndelay 0x08 /* don't delay open */ #define logoption_perror 0x20 /* log to stderr as well */ #define logoption_nfile 0x40 /* ignore the file that called the log */ #define logoption_nline 0x80 /* ignore the line that called the log*/ /* facility codes */ /* redefine these so they can don't interfeer with syslog */ #define logfacility_user (1<<3) /* random user-level messages */ #define logfacility_mail (2<<3) /* mail system */ #define logfacility_daemon (3<<3) /* system daemons */ #define logfacility_auth (4<<3) /* security/authorization messages */ #define logfacility_syslog (5<<3) /* messages generated by syslogd */ #define logfacility_lpr (6<<3) /* line printer subsystem */ #define logfacility_authpriv (10<<3) /* security/auth messages (private) */ #define logfacility_ftp (11<<3) /* ftp daemon */ /* ========================================================================= Structure definitions ========================================================================= */ /* Main log config */ typedef struct { bool inited; /* file log config initialized ? */ bool syslog_opened; /* syslog opened ? */ bool console; /* if logging to console from a cli util */ char processname[16]; int syslog_facility; int syslog_display_options; } log_config_t; /* This stores the config and options for one filelog type (e.g. logger, afpd etc.) */ typedef struct { bool set; /* set individually ? yes: changing default * doesnt change it. no: it changes it.*/ bool syslog; /* This type logs to syslog */ int fd; /* logfiles fd */ enum loglevels level; /* Log Level to put in this file */ int display_options; } logtype_conf_t; /* ========================================================================= Global variables ========================================================================= */ /* Make config accessible for LOG macro */ extern log_config_t log_config; extern UAM_MODULE_EXPORT logtype_conf_t type_configs[logtype_end_of_list_marker]; /* ========================================================================= Global function decarations ========================================================================= */ /* */ void log_init(void); /* Setup the level and type of log that will be logged for file loggging */ void log_setup(const char *filename, enum loglevels loglevel, enum logtypes logtype); /* Setup the level and type of log that will be logged to syslog. */ void syslog_setup(int loglevel, enum logtypes logtype, int display_options, int facility); /* This gets called e.g. from afpd.conf parsing code with a string like: */ /* "default log_maxdebug /var/log/afpd.log" */ void setuplog(const char *logstr); /* This gets called e.g. from afpd.conf parsing code with a string like: */ /* "default dummyname" */ void unsetuplog(const char *logstr); /* finish up and close the logs */ void log_close(void); /* This function sets up the ProcessName */ void set_processname(const char *processname); /* LOG macro func no.1: log the message to file */ UAM_MODULE_EXPORT void make_log_entry(enum loglevels loglevel, enum logtypes logtype, const char *file, int line, char *message, ...); /* * How to write a LOG macro: * http://c-faq.com/cpp/debugmacs.html * * We choose the verbose form in favor of the obfuscated ones, its easier * to parse for human beings and facilitates expanding the macro for * inline checks for debug levels. * * How to properly enclose multistatement macros: * http://en.wikipedia.org/wiki/C_macro#Multiple_statements */ #define LOG_MAX log_info #ifdef NO_DEBUG #define LOG(log_level, type, ...) \ do { \ if (log_level <= LOG_MAX) \ if (log_level <= type_configs[type].level) \ make_log_entry((log_level), (type), __FILE__, __LINE__, __VA_ARGS__); \ } while(0) #else /* ! NO_DEBUG */ #define LOG(log_level, type, ...) \ do { \ if (log_level <= type_configs[type].level) \ make_log_entry((log_level), (type), __FILE__, __LINE__, __VA_ARGS__); \ } while(0) #endif /* NO_DEBUG */ #endif /* _ATALK_LOGGER_H */ netatalk-2.2.2/include/atalk/unix.h0000644000175200017500000000311711655731244014130 00000000000000/* $Id: unix.h,v 1.3 2010-03-12 15:16:49 franklahm Exp $ Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef ATALK_UNIX_H #define ATALK_UNIX_H #ifdef HAVE_CONFIG_H #include #endif #include #include /* vfs/unix.c */ extern int netatalk_unlink(const char *name); extern int netatalk_unlinkat(int dirfd, const char *name); extern int statat(int dirfd, const char *path, struct stat *st); extern int lstatat(int dirfd, const char *path, struct stat *st); extern DIR *opendirat(int dirfd, const char *path); /* rmdir ENOENT not an error */ extern int netatalk_rmdir(int dirfd, const char *name); extern int netatalk_rmdir_all_errors(int dirfd, const char *name); extern int setfilmode(const char *, mode_t, struct stat *, mode_t); extern int dir_rx_set(mode_t mode); extern int stickydirmode(const char *name, const mode_t mode, const int dropbox, const mode_t v_umask); extern int unix_rename(int sfd, const char *oldpath, int dfd, const char *newpath); extern int copy_file(int sfd, const char *src, const char *dst, mode_t mode); #endif /* ATALK_UNIX_H */ netatalk-2.2.2/include/atalk/server_ipc.h0000644000175200017500000000073311655731126015306 00000000000000#ifndef ATALK_SERVER_IPC_H #define ATALK_SERVER_IPC_H #include #include #define IPC_DISCOLDSESSION 0 #define IPC_GETSESSION 1 extern int ipc_server_uds(const char *name); extern int ipc_client_uds(const char *name); extern int reconnect_ipc(AFPObj *); extern int ipc_server_read(server_child *children, int fd); extern int ipc_child_write(int fd, uint16_t command, int len, void *token); #endif /* IPC_GETSESSION_LOGIN */ netatalk-2.2.2/include/atalk/errchk.h0000644000175200017500000001652211655751751014434 00000000000000/* Copyright (c) 2010 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef ERRCHECK_H #define ERRCHECK_H #define EC_INIT int ret = 0 #define EC_STATUS(a) ret = (a) #define EC_FAIL do { ret = -1; goto cleanup; } while (0) #define EC_CLEANUP cleanup #define EC_EXIT return ret /* * Check out doc/DEVELOPER for more infos. * * We have these macros: * EC_ZERO, EC_ZERO_LOG, EC_ZERO_LOGSTR, EC_ZERO_LOG_ERR, EC_ZERO_CUSTOM * EC_NEG1, EC_NEG1_LOG, EC_NEG1_LOGSTR, EC_NEG1_LOG_ERR, EC_NEG1_CUSTOM * EC_NULL, EC_NULL_LOG, EC_NULL_LOGSTR, EC_NULL_LOG_ERR, EC_NULL_CUSTOM * * A boileplate function template is: int func(void) { EC_INIT; ...your code here... EC_STATUS(0); EC_CLEANUP: EC_EXIT; } */ /* check for return val 0 which is ok, every other is an error, prints errno */ #define EC_ZERO_LOG(a) \ do { \ if ((a) != 0) { \ LOG(log_error, logtype_default, "%s failed: %s", #a, strerror(errno)); \ ret = -1; \ goto cleanup; \ } \ } while (0) #define EC_ZERO_LOGSTR(a, b, ...) \ do { \ if ((a) != 0) { \ LOG(log_error, logtype_default, b, __VA_ARGS__); \ ret = -1; \ goto cleanup; \ } \ } while (0) #define EC_ZERO_LOG_ERR(a, b) \ do { \ if ((a) != 0) { \ LOG(log_error, logtype_default, "%s failed: %s", #a, strerror(errno)); \ ret = (b); \ goto cleanup; \ } \ } while (0) #define EC_ZERO(a) \ do { \ if ((a) != 0) { \ ret = -1; \ goto cleanup; \ } \ } while (0) #define EC_ZERO_ERR(a,b ) \ do { \ if ((a) != 0) { \ ret = b; \ goto cleanup; \ } \ } while (0) /* check for return val 0 which is ok, every other is an error, prints errno */ #define EC_NEG1_LOG(a) \ do { \ if ((a) == -1) { \ LOG(log_error, logtype_default, "%s failed: %s", #a, strerror(errno)); \ ret = -1; \ goto cleanup; \ } \ } while (0) #define EC_NEG1_LOGSTR(a, b, ...) \ do { \ if ((a) == -1) { \ LOG(log_error, logtype_default, b, __VA_ARGS__); \ ret = -1; \ goto cleanup; \ } \ } while (0) #define EC_NEG1_LOG_ERR(a, b) \ do { \ if ((a) == -1) { \ LOG(log_error, logtype_default, "%s failed: %s", #a, strerror(errno)); \ ret = b; \ goto cleanup; \ } \ } while (0) #define EC_NEG1(a) \ do { \ if ((a) == -1) { \ ret = -1; \ goto cleanup; \ } \ } while (0) /* check for return val != NULL, prints errno */ #define EC_NULL_LOG(a) \ do { \ if ((a) == NULL) { \ LOG(log_error, logtype_default, "%s failed: %s", #a, strerror(errno)); \ ret = -1; \ goto cleanup; \ } \ } while (0) #define EC_NULL_LOGSTR(a, b, ...) \ do { \ if ((a) == NULL) { \ LOG(log_error, logtype_default, b , __VA_ARGS__); \ ret = -1; \ goto cleanup; \ } \ } while (0) #define EC_NULL_LOG_ERR(a, b) \ do { \ if ((a) == NULL) { \ LOG(log_error, logtype_default, "%s failed: %s", #a, strerror(errno)); \ ret = b; \ goto cleanup; \ } \ } while (0) #define EC_NULL(a) \ do { \ if ((a) == NULL) { \ ret = -1; \ goto cleanup; \ } \ } while (0) #endif /* ERRCHECK_H */ netatalk-2.2.2/include/atalk/uuid.h0000644000175200017500000000344611655731245014121 00000000000000/* Copyright (c) 2008,2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef AFP_UUID_H #define AFP_UUID_H #define UUID_BINSIZE 16 #define UUID_STRINGSIZE 36 typedef unsigned char *uuidp_t; typedef unsigned char atalk_uuid_t[UUID_BINSIZE]; typedef enum {UUID_USER = 1, UUID_GROUP = 2, UUID_ENOENT = 4} /* used as bit flag */ uuidtype_t; #define UUIDTYPESTR_MASK 3 extern char *uuidtype[]; /* afp_options.c needs these. defined in libatalk/ldap.c */ extern char *ldap_host; extern int ldap_auth_method; extern char *ldap_auth_dn; extern char *ldap_auth_pw; extern char *ldap_userbase; extern char *ldap_groupbase; extern char *ldap_uuid_attr; extern char *ldap_name_attr; extern char *ldap_group_attr; extern char *ldap_uid_attr; /******************************************************** * Interface ********************************************************/ extern int getuuidfromname( const char *name, uuidtype_t type, uuidp_t uuid); extern int getnamefromuuid( const uuidp_t uuidp, char **name, uuidtype_t *type); extern void localuuid_from_id(unsigned char *buf, uuidtype_t type, unsigned int id); extern const char *uuid_bin2string(unsigned char *uuid); extern void uuid_string2bin( const char *uuidstring, uuidp_t uuid); extern void uuidcache_dump(void); #endif /* AFP_UUID_H */ netatalk-2.2.2/include/atalk/cnid.h0000644000175200017500000001275011655731126014064 00000000000000/* * Copyright (c) 2003 the Netatalk Team * Copyright (c) 2003 Rafal Lewczuk * Copyright (c) 2010 Frank Lahm * * This program is free software; you can redistribute and/or modify * it under the terms of the GNU General Public License as published * by the Free Software Foundation version 2 of the License or later * version if explicitly stated by any of above copyright holders. * */ /* * This file contains all generic CNID related stuff * declarations. Included: * - CNID factory, which retrieves (eventually instantiates) * CNID objects on demand * - selection of CNID backends (default, detected by volume) * - full set of CNID operations needed by server core. */ #ifndef _ATALK_CNID__H #define _ATALK_CNID__H 1 #include #include /* CNID object flags */ #define CNID_FLAG_PERSISTENT 0x01 /* This backend implements DID persistence */ #define CNID_FLAG_MANGLING 0x02 /* This backend has name mangling feature. */ #define CNID_FLAG_SETUID 0x04 /* Set db owner to parent folder owner. */ #define CNID_FLAG_BLOCK 0x08 /* block signals in update. */ #define CNID_FLAG_NODEV 0x10 /* don't use device number only inode */ #define CNID_FLAG_LAZY_INIT 0x20 /* */ #define CNID_FLAG_MEMORY 0x40 /* this is a memory only db */ #define CNID_FLAG_INODE 0x80 /* in cnid_add the inode is authoritative */ #define CNID_INVALID 0 /* first valid ID */ #define CNID_START 17 #define CNID_ERR_PARAM 0x80000001 #define CNID_ERR_PATH 0x80000002 #define CNID_ERR_DB 0x80000003 #define CNID_ERR_CLOSE 0x80000004 /* the db was not open */ #define CNID_ERR_MAX 0x80000005 /* * This is instance of CNID database object. */ struct _cnid_db { u_int32_t flags; /* Flags describing some CNID backend aspects. */ char *volpath; /* Volume path this particular CNID db refers to. */ void *_private; /* back-end speficic data */ cnid_t (*cnid_add) (struct _cnid_db *cdb, const struct stat *st, const cnid_t did, char *name, const size_t, cnid_t hint); int (*cnid_delete) (struct _cnid_db *cdb, cnid_t id); cnid_t (*cnid_get) (struct _cnid_db *cdb, const cnid_t did, char *name, const size_t); cnid_t (*cnid_lookup) (struct _cnid_db *cdb, const struct stat *st, const cnid_t did, char *name, const size_t); cnid_t (*cnid_nextid) (struct _cnid_db *cdb); char * (*cnid_resolve) (struct _cnid_db *cdb, cnid_t *id, void *buffer, size_t len); int (*cnid_update) (struct _cnid_db *cdb, const cnid_t id, const struct stat *st, const cnid_t did, char *name, const size_t len); void (*cnid_close) (struct _cnid_db *cdb); int (*cnid_getstamp) (struct _cnid_db *cdb, void *buffer, const size_t len); cnid_t (*cnid_rebuild_add) (struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t, cnid_t); int (*cnid_find) (struct _cnid_db *cdb, char *name, size_t namelen, void *buffer, size_t buflen); }; typedef struct _cnid_db cnid_db; /* * Consolidation of args passedn from main cnid_open to modules cnid_XXX_open, so * that it's easier to add aditional args as required. */ struct cnid_open_args { const char *dir; mode_t mask; uint32_t flags; const char *cnidserver; /* for dbd */ const char *cnidport; /* for dbd */ }; /* * CNID module - represents particular CNID implementation */ struct _cnid_module { char *name; struct list_head db_list; /* CNID modules are also stored on a bidirectional list. */ struct _cnid_db *(*cnid_open)(struct cnid_open_args *args); u_int32_t flags; /* Flags describing some CNID backend aspects. */ }; typedef struct _cnid_module cnid_module; /* Inititalize the CNID backends */ void cnid_init(); /* Registers new CNID backend module */ void cnid_register(struct _cnid_module *module); /* This function opens a CNID database for selected volume. */ struct _cnid_db *cnid_open(const char *volpath, mode_t mask, char *type, int flags, const char *cnidsrv, const char *cnidport); cnid_t cnid_add (struct _cnid_db *cdb, const struct stat *st, const cnid_t did, const char *name, const size_t len, cnid_t hint); int cnid_delete (struct _cnid_db *cdb, cnid_t id); cnid_t cnid_get (struct _cnid_db *cdb, const cnid_t did, char *name,const size_t len); int cnid_getstamp (struct _cnid_db *cdb, void *buffer, const size_t len); cnid_t cnid_lookup (struct _cnid_db *cdb, const struct stat *st, const cnid_t did, char *name, const size_t len); char *cnid_resolve (struct _cnid_db *cdb, cnid_t *id, void *buffer, size_t len); int cnid_update (struct _cnid_db *cdb, const cnid_t id, const struct stat *st, const cnid_t did, char *name, const size_t len); cnid_t cnid_rebuild_add(struct _cnid_db *cdb, const struct stat *st, const cnid_t did, char *name, const size_t len, cnid_t hint); int cnid_find (struct _cnid_db *cdb, const char *name, size_t namelen, void *buffer, size_t buflen); void cnid_close (struct _cnid_db *db); #endif netatalk-2.2.2/include/atalk/volume.h0000644000175200017500000002056311664654413014462 00000000000000/* * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifndef ATALK_VOLUME_H #define ATALK_VOLUME_H 1 #include #include #include // #include #include #include #include #include #define AFPVOL_U8MNAMELEN 255 /* AFP3 sepc */ #define AFPVOL_MACNAMELEN 27 /* AFP2 spec */ typedef uint64_t VolSpace; struct vol { struct vol *v_next; u_int16_t v_vid; int v_flags; char *v_path; struct dir *v_root; time_t v_mtime; charset_t v_volcharset; charset_t v_maccharset; u_int16_t v_mtou_flags; /* flags for convert_charset in mtoupath */ u_int16_t v_utom_flags; long v_kTextEncoding; /* mac charset encoding in network order * FIXME: should be a u_int32_t ? */ size_t max_filename; char *v_veto; int v_adouble; /* adouble format: v1, v2, sfm ... */ int v_ad_options; /* adouble option NODEV, NOCACHE, etc.. */ char *(*ad_path)(const char *, int); struct _cnid_db *v_cdb; char v_stamp[ADEDLEN_PRIVSYN]; VolSpace v_limitsize; /* Size limit, if any, in MiB */ mode_t v_umask; mode_t v_perm; /* default permission value OR with requested perm*/ mode_t v_dperm; /* default directories permission value OR with requested perm*/ mode_t v_fperm; /* default files permission value OR with requested perm*/ ucs2_t *v_u8mname; /* converted to utf8-mac in ucs2 */ ucs2_t *v_macname; /* mangled to legacy longname in ucs2 */ ucs2_t *v_name; /* either v_u8mname or v_macname */ /* get/set volparams */ time_t v_ctime; /* volume creation date, not unix ctime */ dev_t v_dev; /* Unix volume device, Set but not used */ /* adouble VFS indirection */ struct vfs_ops *vfs; /* pointer to vfs_master_funcs for chaining */ const struct vfs_ops *vfs_modules[4]; int v_vfs_ea; /* The AFPVOL_EA_xx flag */ /* misc */ char *v_gvs; void *v_nfsclient; int v_nfs; VolSpace v_tm_used; /* used bytes on a TM volume */ time_t v_tm_cachetime; /* time at which v_tm_used was calculated last */ VolSpace v_appended; /* amount of data appended to files */ /* only when opening/closing volumes or in error */ int v_casefold; char *v_localname; /* as defined in AppleVolumes.default */ char *v_volcodepage; char *v_maccodepage; char *v_password; char *v_cnidscheme; char *v_dbpath; char *v_cnidserver; char *v_cnidport; int v_hide; /* new volume wait until old volume is closed */ int v_new; /* volume deleted but there's a new one with the same name */ int v_deleted; /* volume open but deleted in new config file */ char *v_root_preexec; char *v_preexec; char *v_root_postexec; char *v_postexec; int v_root_preexec_close; int v_preexec_close; char *v_uuid; /* For TimeMachine zeroconf record */ #ifdef FORCE_UIDGID char *v_forceuid; char *v_forcegid; #endif #ifdef __svr4__ int v_qfd; #endif /*__svr4__*/ }; #define AFPVOL_OPEN (1<<0) /* flags for AFS and quota 0xxx0 */ #define AFPVOL_GVSMASK (7<<2) #define AFPVOL_NONE (0<<2) #define AFPVOL_AFSGVS (1<<2) #define AFPVOL_USTATFS (2<<2) #define AFPVOL_UQUOTA (4<<2) /* Flags that alter volume behaviour. Keep in sync with libatalk/util/volinfo.c */ #define AFPVOL_A2VOL (1 << 5) /* prodos volume */ #define AFPVOL_CRLF (1 << 6) /* cr/lf translation */ #define AFPVOL_NOADOUBLE (1 << 7) /* don't create .AppleDouble by default */ #define AFPVOL_RO (1 << 8) /* read-only volume */ #define AFPVOL_MSWINDOWS (1 << 9) /* deal with ms-windows yuckiness. this is going away. */ #define AFPVOL_NOHEX (1 << 10) /* don't do :hex translation */ #define AFPVOL_USEDOTS (1 << 11) /* use real dots */ #define AFPVOL_LIMITSIZE (1 << 12) /* limit size for older macs */ #define AFPVOL_MAPASCII (1 << 13) /* map the ascii range as well */ #define AFPVOL_DROPBOX (1 << 14) /* dropkludge dropbox support */ #define AFPVOL_NOFILEID (1 << 15) /* don't advertise createid resolveid and deleteid calls */ #define AFPVOL_NOSTAT (1 << 16) /* advertise the volume even if we can't stat() it * maybe because it will be mounted later in preexec */ #define AFPVOL_UNIX_PRIV (1 << 17) /* support unix privileges */ #define AFPVOL_NODEV (1 << 18) /* always use 0 for device number in cnid calls * help if device number is notconsistent across reboot * NOTE symlink to a different device will return an ACCESS error */ #define AFPVOL_CASEINSEN (1 << 19) /* volume is case insensitive */ #define AFPVOL_EILSEQ (1 << 20) /* encode illegal sequence 'asis' UCS2, ex "\217-", which is not a valid SHIFT-JIS char, is encoded as U\217 -*/ #define AFPVOL_CACHE (1 << 21) /* Use adouble v2 CNID caching. Default: yes */ #define AFPVOL_INV_DOTS (1 << 22) /* dots files are invisible */ #define AFPVOL_TM (1 << 23) /* Supports TimeMachine */ #define AFPVOL_ACLS (1 << 24) /* Volume supports ACLS */ #define AFPVOL_SEARCHDB (1 << 25) /* Use fast CNID db search instead of filesystem */ #define AFPVOL_NONETIDS (1 << 26) /* signal the client it shall do privelege mapping */ /* Extended Attributes vfs indirection */ #define AFPVOL_EA_NONE 0 /* No EAs */ #define AFPVOL_EA_AUTO 1 /* try sys, fallback to ad (default) */ #define AFPVOL_EA_SYS 2 /* Store them in native EAs */ #define AFPVOL_EA_AD 3 /* Store them in adouble files */ /* FPGetSrvrParms options */ #define AFPSRVR_CONFIGINFO (1 << 0) #define AFPSRVR_PASSWD (1 << 7) /* handle casefolding */ #define AFPVOL_MTOUUPPER (1 << 0) #define AFPVOL_MTOULOWER (1 << 1) #define AFPVOL_UTOMUPPER (1 << 2) #define AFPVOL_UTOMLOWER (1 << 3) #define AFPVOL_UMLOWER (AFPVOL_MTOULOWER | AFPVOL_UTOMLOWER) #define AFPVOL_UMUPPER (AFPVOL_MTOUUPPER | AFPVOL_UTOMUPPER) #define AFPVOL_UUPPERMLOWER (AFPVOL_MTOUUPPER | AFPVOL_UTOMLOWER) #define AFPVOL_ULOWERMUPPER (AFPVOL_MTOULOWER | AFPVOL_UTOMUPPER) #define MSWINDOWS_BADCHARS ":\t\\/<>*?|\"" int wincheck(const struct vol *vol, const char *path); #define AFPVOLSIG_FLAT 0x0001 /* flat fs */ #define AFPVOLSIG_FIX 0x0002 /* fixed ids */ #define AFPVOLSIG_VAR 0x0003 /* variable ids */ #define AFPVOLSIG_DEFAULT AFPVOLSIG_FIX /* volume attributes */ #define VOLPBIT_ATTR_RO (1 << 0) #define VOLPBIT_ATTR_PASSWD (1 << 1) #define VOLPBIT_ATTR_FILEID (1 << 2) #define VOLPBIT_ATTR_CATSEARCH (1 << 3) #define VOLPBIT_ATTR_BLANKACCESS (1 << 4) #define VOLPBIT_ATTR_UNIXPRIV (1 << 5) #define VOLPBIT_ATTR_UTF8 (1 << 6) #define VOLPBIT_ATTR_NONETIDS (1 << 7) #define VOLPBIT_ATTR_EXT_ATTRS (1 << 10) #define VOLPBIT_ATTR_ACLS (1 << 11) #define VOLPBIT_ATTR_TM (1 << 13) #define VOLPBIT_ATTR 0 #define VOLPBIT_SIG 1 #define VOLPBIT_CDATE 2 #define VOLPBIT_MDATE 3 #define VOLPBIT_BDATE 4 #define VOLPBIT_VID 5 #define VOLPBIT_BFREE 6 #define VOLPBIT_BTOTAL 7 #define VOLPBIT_NAME 8 /* handle > 4GB volumes */ #define VOLPBIT_XBFREE 9 #define VOLPBIT_XBTOTAL 10 #define VOLPBIT_BSIZE 11 /* block size */ #define utf8_encoding() (afp_version >= 30) #define vol_noadouble(vol) (((vol)->v_flags & AFPVOL_NOADOUBLE) ? 1 : 0) #define vol_nodev(vol) (((vol)->v_flags & AFPVOL_NODEV) ? 1 : 0) #define vol_unix_priv(vol) (afp_version >= 30 && ((vol)->v_flags & AFPVOL_UNIX_PRIV)) #define vol_inv_dots(vol) (((vol)->v_flags & AFPVOL_INV_DOTS) ? 1 : 0) #endif netatalk-2.2.2/include/atalk/dsi.h0000644000175200017500000001625011664176240013725 00000000000000/* * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. */ #ifndef _ATALK_DSI_H #define _ATALK_DSI_H #include #include #include #include #include #include #include #include #include #include /* What a DSI packet looks like: 0 32 |-------------------------------| |flags |command| requestID | |-------------------------------| |error code/enclosed data offset| |-------------------------------| |total data length | |-------------------------------| |reserved field | |-------------------------------| CONVENTION: anything with a dsi_ prefix is kept in network byte order. */ /* these need to be kept in sync w/ AFPTRANS_* in . * convention: AFPTRANS_* = (1 << DSI_*) */ typedef enum { DSI_MIN = 1, DSI_TCPIP = 1, DSI_MAX = 1 } dsi_proto; #define DSI_BLOCKSIZ 16 struct dsi_block { u_int8_t dsi_flags; /* packet type: request or reply */ u_int8_t dsi_command; /* command */ u_int16_t dsi_requestID; /* request ID */ u_int32_t dsi_code; /* error code or data offset */ u_int32_t dsi_len; /* total data length */ u_int32_t dsi_reserved; /* reserved field */ }; #define DSI_CMDSIZ 8192 #define DSI_DATASIZ 8192 /* child and parent processes might interpret a couple of these * differently. */ typedef struct DSI { AFPObj *AFPobj; dsi_proto protocol; struct dsi_block header; struct sockaddr_storage server, client; struct itimerval timer; int tickle; /* tickle count */ int in_write; /* in the middle of writing multiple packets, signal handlers can't write to the socket */ int msg_request; /* pending message to the client */ int down_request; /* pending SIGUSR1 down in 5 mn */ u_int32_t attn_quantum, datasize, server_quantum; u_int16_t serverID, clientID; char *status; u_int8_t commands[DSI_CMDSIZ], data[DSI_DATASIZ]; size_t statuslen; size_t datalen, cmdlen; off_t read_count, write_count; uint32_t flags; /* DSI flags like DSI_SLEEPING, DSI_DISCONNECTED */ const char *program; int socket, serversock; /* protocol specific open/close, send/receive * send/receive fill in the header and use dsi->commands. * write/read just write/read data */ pid_t (*proto_open)(struct DSI *); void (*proto_close)(struct DSI *); /* url registered with slpd */ #ifdef USE_SRVLOC char srvloc_url[512]; #endif #ifdef USE_ZEROCONF char *bonjourname; /* server name as UTF8 maxlen MAXINSTANCENAMELEN */ int zeroconf_registered; #endif /* DSI readahead buffer used for buffered reads in dsi_peek */ size_t dsireadbuf; /* size of the DSI readahead buffer used in dsi_peek() */ char *buffer; char *start; char *eof; char *end; } DSI; /* DSI flags */ #define DSIFL_REQUEST 0x00 #define DSIFL_REPLY 0x01 #define DSIFL_MAX 0x01 /* DSI session options */ #define DSIOPT_SERVQUANT 0x00 /* server request quantum */ #define DSIOPT_ATTNQUANT 0x01 /* attention quantum */ #define DSIOPT_REPLCSIZE 0x02 /* AFP replaycache size supported by the server (that's us) */ /* DSI Commands */ #define DSIFUNC_CLOSE 1 /* DSICloseSession */ #define DSIFUNC_CMD 2 /* DSICommand */ #define DSIFUNC_STAT 3 /* DSIGetStatus */ #define DSIFUNC_OPEN 4 /* DSIOpenSession */ #define DSIFUNC_TICKLE 5 /* DSITickle */ #define DSIFUNC_WRITE 6 /* DSIWrite */ #define DSIFUNC_ATTN 8 /* DSIAttention */ #define DSIFUNC_MAX 8 /* largest command */ /* DSI Error codes: most of these aren't used. */ #define DSIERR_OK 0x0000 #define DSIERR_BADVERS 0xfbd6 #define DSIERR_BUFSMALL 0xfbd5 #define DSIERR_NOSESS 0xfbd4 #define DSIERR_NOSERV 0xfbd3 #define DSIERR_PARM 0xfbd2 #define DSIERR_SERVBUSY 0xfbd1 #define DSIERR_SESSCLOS 0xfbd0 #define DSIERR_SIZERR 0xfbcf #define DSIERR_TOOMANY 0xfbce #define DSIERR_NOACK 0xfbcd /* server and client quanta */ #define DSI_DEFQUANT 2 /* default attention quantum size */ #define DSI_SERVQUANT_MAX 0xffffffff /* server quantum */ #define DSI_SERVQUANT_MIN 32000 /* minimum server quantum */ #define DSI_SERVQUANT_DEF 0x0004A2E0L /* default server quantum */ /* default port number */ #define DSI_AFPOVERTCP_PORT 548 /* DSI session State flags */ #define DSI_DATA (1 << 0) /* we have received a DSI command */ #define DSI_RUNNING (1 << 1) /* we have received a AFP command */ #define DSI_SLEEPING (1 << 2) /* we're sleeping after FPZzz */ #define DSI_EXTSLEEP (1 << 3) /* we're sleeping after FPZzz */ #define DSI_DISCONNECTED (1 << 4) /* we're in diconnected state after a socket error */ #define DSI_DIE (1 << 5) /* SIGUSR1, going down in 5 minutes */ #define DSI_NOREPLY (1 << 6) /* in dsi_write we generate our own replies */ #define DSI_RECONSOCKET (1 << 7) /* we have a new socket from primary reconnect */ #define DSI_RECONINPROG (1 << 8) /* used in the new session in reconnect */ #define DSI_AFP_LOGGED_OUT (1 << 9) /* client called afp_logout, quit on next EOF from socket */ #if 0 #define DSI_GOT_ECONNRESET (1 << 10) /* got ECONNRESET from client => exit */ #endif /* basic initialization: dsi_init.c */ extern DSI *dsi_init (const dsi_proto /*protocol*/, const char * /*program*/, const char * /*host*/, const char * /*address*/, const char * /*port*/, const int /*proxy*/, const u_int32_t /* server quantum */); extern void dsi_setstatus (DSI *, char *, const size_t); /* in dsi_getsess.c */ extern afp_child_t *dsi_getsession (DSI *, server_child *, const int); extern void dsi_kill (int); /* DSI Commands: individual files */ extern void dsi_opensession (DSI *); extern int dsi_attention (DSI *, AFPUserBytes); extern int dsi_cmdreply (DSI *, const int); extern int dsi_tickle (DSI *); extern void dsi_getstatus (DSI *); extern void dsi_close (DSI *); #define DSI_NOWAIT 1 /* low-level stream commands -- in dsi_stream.c */ extern ssize_t dsi_stream_write (DSI *, void *, const size_t, const int mode); extern size_t dsi_stream_read (DSI *, void *, const size_t); extern int dsi_stream_send (DSI *, void *, size_t); extern int dsi_stream_receive (DSI *); extern int dsi_disconnect(DSI *dsi); #ifdef WITH_SENDFILE extern ssize_t dsi_stream_read_file(DSI *, int, off_t off, const size_t len); #endif /* client writes -- dsi_write.c */ extern size_t dsi_writeinit (DSI *, void *, const size_t); extern size_t dsi_write (DSI *, void *, const size_t); extern void dsi_writeflush (DSI *); #define dsi_wrtreply(a,b) dsi_cmdreply(a,b) /* client reads -- dsi_read.c */ extern ssize_t dsi_readinit (DSI *, void *, const size_t, const size_t, const int); extern ssize_t dsi_read (DSI *, void *, const size_t); extern void dsi_readdone (DSI *); /* some useful macros */ #define dsi_serverID(x) ((x)->serverID++) #define dsi_send(x) do { \ (x)->header.dsi_len = htonl((x)->cmdlen); \ dsi_stream_send((x), (x)->commands, (x)->cmdlen); \ } while (0) #endif /* atalk/dsi.h */ netatalk-2.2.2/include/atalk/acl.h0000644000175200017500000000302211655731244013677 00000000000000/* Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef ATALK_ACL_H #define ATALK_ACL_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef HAVE_ACLS #ifdef HAVE_SOLARIS_ACLS #include #define chmod_acl nfsv4_chmod extern int get_nfsv4_acl(const char *name, ace_t **retAces); extern int strip_trivial_aces(ace_t **saces, int sacecount); extern int strip_nontrivial_aces(ace_t **saces, int sacecount); extern ace_t *concat_aces(ace_t *aces1, int ace1count, ace_t *aces2, int ace2count); extern int nfsv4_chmod(char *name, mode_t mode); #endif /* HAVE_SOLARIS_ACLS */ #ifdef HAVE_POSIX_ACLS #include #include #include #define chmod_acl posix_chmod #define fchmod_acl posix_fchmod extern int posix_chmod(const char *name, mode_t mode); extern int posix_fchmod(int fd, mode_t mode); #endif /* HAVE_POSIX_ACLS */ extern int remove_acl_vfs(const char *name); #else /* HAVE_ACLS=no */ #define chmod_acl chmod #endif /* HAVE_ACLS */ #endif /* ATALK_ACL_H */ netatalk-2.2.2/include/atalk/cnid_private.h0000644000175200017500000000416311655731126015615 00000000000000/* * Common defines for cnid */ #ifndef _ATALK_CNID_PRIVATE_H #define _ATALK_CNID_PRIVATE_H 1 #define CNID_DB_MAGIC 0x434E4944U /* CNID */ #define CNID_DATA_MAGIC 0x434E4945U /* CNIE */ #define CNID_OFS 0 #define CNID_LEN 4 #define CNID_DEV_OFS CNID_LEN #define CNID_DEV_LEN 8 #define CNID_INO_OFS (CNID_DEV_OFS + CNID_DEV_LEN) #define CNID_INO_LEN 8 #define CNID_DEVINO_OFS CNID_LEN #define CNID_DEVINO_LEN (CNID_DEV_LEN + CNID_INO_LEN) #define CNID_TYPE_OFS (CNID_DEVINO_OFS + CNID_DEVINO_LEN) #define CNID_TYPE_LEN 4 #define CNID_DID_OFS (CNID_TYPE_OFS + CNID_TYPE_LEN) #define CNID_DID_LEN CNID_LEN #define CNID_NAME_OFS (CNID_DID_OFS + CNID_DID_LEN) #define CNID_HEADER_LEN (CNID_NAME_OFS) #define CNIDFLAG_ROOTINFO_RO (1 << 0) #define CNIDFLAG_DB_RO (1 << 1) /* special key/data pair we use to store current cnid and database stamp in cnid2.db */ #define ROOTINFO_KEY "\0\0\0\0" #define ROOTINFO_KEYLEN 4 /* Rootinfo data, fields as they are used by normal entries for CNIDs (for reference): 4 bytes: CNID 8 bytes: dev 8 bytes: inode 4 bytes: is a file/directory (type) 4 bytes: DID x bytes: name Contents in Rootinfo entry: 4 bytes: 0 8 bytes: db stamp: struct stat.st_ctime of database file 8 bytes: unused 4 bytes: last used CNID 4 bytes: version as htonl(uint32_t) 9 bytes: name "RootInfo" */ #define ROOTINFO_DATA "\0\0\0\0" \ "\0\0\0\0\0\0\0\0" \ "\0\0\0\0\0\0\0\0" \ "\0\0\0\0" \ "\0\0\0\0" \ "RootInfo" #define ROOTINFO_DATALEN (3*4 + 2*8 + 9) /* * CNID version history: * 0: up to Netatalk 2.1.x * 1: starting with 2.2, additional name index, used in cnid_find */ #define CNID_VERSION_0 0 #define CNID_VERSION_1 1 #define CNID_VERSION_UNINTIALIZED_DB UINT32_MAX /* Current CNID version */ #define CNID_VERSION CNID_VERSION_1 #endif netatalk-2.2.2/include/atalk/zip.h0000644000175200017500000000300711655731245013746 00000000000000/* * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef _ATALK_ZIP_H #define _ATALK_ZIP_H 1 #ifndef NO_DDP #include struct ziphdr { u_int8_t zh_op; u_int8_t zh_cnt; #define zh_count zh_cnt #define zh_zero zh_cnt #define zh_flags zh_cnt }; struct zipreplent { u_int16_t zre_net; u_int8_t zre_zonelen; }; #define ZIPOP_QUERY 1 #define ZIPOP_REPLY 2 #define ZIPOP_TAKEDOWN 3 /* XXX */ #define ZIPOP_BRINGUP 4 /* XXX */ #define ZIPOP_GNI 5 #define ZIPOP_GNIREPLY 6 #define ZIPOP_NOTIFY 7 #define ZIPOP_EREPLY 8 #define ZIPOP_GETMYZONE 7 #define ZIPOP_GETZONELIST 8 #define ZIPOP_GETLOCALZONES 9 #define ZIPGNI_INVALID 0x80 #define ZIPGNI_ONEZONE 0x20 #endif /* NO_DDP */ #endif netatalk-2.2.2/include/atalk/ftw.h0000644000175200017500000000675511655731126013757 00000000000000/* Copyright (C) 1992,1996-1999,2003,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* * X/Open Portability Guide 4.2: ftw.h */ #ifndef _ATALK_FTW_H #define _ATALK_FTW_H 1 #include #include /* Values for the FLAG argument to the user function passed to `ftw' and 'nftw'. */ enum { FTW_F, /* Regular file. */ #define FTW_F FTW_F FTW_D, /* Directory. */ #define FTW_D FTW_D FTW_DNR, /* Unreadable directory. */ #define FTW_DNR FTW_DNR FTW_NS, /* Unstatable file. */ #define FTW_NS FTW_NS FTW_SL, /* Symbolic link. */ # define FTW_SL FTW_SL /* These flags are only passed from the `nftw' function. */ FTW_DP, /* Directory, all subdirs have been visited. */ # define FTW_DP FTW_DP FTW_SLN /* Symbolic link naming non-existing file. */ # define FTW_SLN FTW_SLN }; /* Flags for fourth argument of `nftw'. */ enum { FTW_PHYS = 1, /* Perform physical walk, ignore symlinks. */ # define FTW_PHYS FTW_PHYS FTW_MOUNT = 2, /* Report only files on same file system as the argument. */ # define FTW_MOUNT FTW_MOUNT FTW_CHDIR = 4, /* Change to current directory while processing it. */ # define FTW_CHDIR FTW_CHDIR FTW_DEPTH = 8, /* Report files in directory before directory itself.*/ # define FTW_DEPTH FTW_DEPTH FTW_ACTIONRETVAL = 16 /* Assume callback to return FTW_* values instead of zero to continue and non-zero to terminate. */ # define FTW_ACTIONRETVAL FTW_ACTIONRETVAL }; /* Return values from callback functions. */ enum { FTW_CONTINUE = 0, /* Continue with next sibling or for FTW_D with the first child. */ # define FTW_CONTINUE FTW_CONTINUE FTW_STOP = 1, /* Return from `ftw' or `nftw' with FTW_STOP as return value. */ # define FTW_STOP FTW_STOP FTW_SKIP_SUBTREE = 2, /* Only meaningful for FTW_D: Don't walk through the subtree, instead just continue with its next sibling. */ # define FTW_SKIP_SUBTREE FTW_SKIP_SUBTREE FTW_SKIP_SIBLINGS = 3,/* Continue with FTW_DP callback for current directory (if FTW_DEPTH) and then its siblings. */ # define FTW_SKIP_SIBLINGS FTW_SKIP_SIBLINGS }; /* Structure used for fourth argument to callback function for `nftw'. */ struct FTW { int base; int level; }; /* Convenient types for callback functions. */ typedef int (*nftw_func_t) (const char *filename, const struct stat *status, int flag, struct FTW *info); #define NFTW_FUNC_T nftw_func_t typedef void (*dir_notification_func_t) (void); extern int nftw(const char *dir, nftw_func_t func, dir_notification_func_t up, int descriptors, int flag); #endif /* ATALK_FTW_H */ netatalk-2.2.2/include/atalk/netddp.h0000644000175200017500000000223111655731244014417 00000000000000/* * $Id: netddp.h,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. * * this provides a generic interface to the ddp layer. with this, we * should be able to interact with any appletalk stack that allows * direct access to the ddp layer. right now, only os x server's ddp * layer and the generic socket based interfaces are understood. */ #ifndef _ATALK_NETDDP_H #define _ATALK_NETDDP_H 1 #ifndef NO_DDP #include #include #include #include extern int netddp_open (struct sockaddr_at *, struct sockaddr_at *); #if !defined(NO_DDP) && defined(MACOSX_SERVER) extern int netddp_sendto (int, void *, size_t, unsigned int, const struct sockaddr *, unsigned int); extern int netddp_recvfrom (int, void *, int, unsigned int, struct sockaddr *, unsigned int *); #define netddp_close(a) ddp_close(a) #else #include #include #define netddp_close(a) close(a) #define netddp_sendto sendto #define netddp_recvfrom recvfrom #endif #endif /* NO_DDP */ #endif /* netddp.h */ netatalk-2.2.2/include/atalk/volinfo.h0000644000175200017500000000253111655731126014617 00000000000000#ifndef _ATALK_VOLINFO_H #define _ATALK_VOLINFO_H 1 #include #include /* volinfo for shell utilities */ #define VOLINFODIR ".AppleDesktop" #define VOLINFOFILE ".volinfo" typedef struct { const u_int32_t option; const char *name; } vol_opt_name_t; struct volinfo { int retaincount; int malloced; char *v_name; char *v_path; int v_flags; int v_casefold; char *v_cnidscheme; char *v_dbpath; char *v_volcodepage; charset_t v_volcharset; char *v_maccodepage; charset_t v_maccharset; int v_adouble; /* default adouble format */ int v_ad_options; int v_vfs_ea; char *(*ad_path)(const char *, int); char *v_dbd_host; char *v_dbd_port; }; struct volinfo *allocvolinfo(char *path); extern int loadvolinfo(char *path, struct volinfo *vol); extern void retainvolinfo(struct volinfo *vol); extern int closevolinfo(struct volinfo *vol); extern int savevolinfo(const struct vol *vol, const char *Cnid_srv, const char *Cnid_port); extern int vol_load_charsets(struct volinfo *vol); #endif netatalk-2.2.2/include/atalk/standards.h0000644000175200017500000000154411655731244015132 00000000000000/* Copyright (c) 2011, Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef ATALK_STANDARDS_H #define ATALK_STANDARDS_H 1 #if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) # ifndef _XOPEN_SOURCE # define _XOPEN_SOURCE 600 # endif # ifndef __EXTENSIONS__ # define __EXTENSIONS__ # endif # ifndef _GNU_SOURCE # define _GNU_SOURCE # endif #endif #endif /* ATALK_STANDARDS_H */ netatalk-2.2.2/include/atalk/rtmp.h0000644000175200017500000000232111655731244014123 00000000000000/* * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef _ATALK_RTMP_H #define _ATALK_RTMP_H 1 #ifndef NO_DDP #include #define RTMPROP_REQUEST 1 struct rtmpent { u_int16_t re_net; u_int8_t re_hops; }; #define RTMPHOPS_MAX 15 #define RTMPHOPS_POISON 31 struct rtmprdhdr { u_int16_t rrdh_snet; u_int8_t rrdh_idlen; u_int8_t rrdh_id; }; #endif /* NO_DDP */ #endif netatalk-2.2.2/include/atalk/cnid_dbd_private.h0000644000175200017500000000351511655731126016426 00000000000000/* * Interface to the cnid_dbd daemon that stores/retrieves CNIDs from a database. */ #ifndef _ATALK_CNID_DBD_PRIVATE_H #define _ATALK_CNID_DBD_PRIVATE_H 1 #include #include #include #include #define CNID_DBD_OP_OPEN 0x01 #define CNID_DBD_OP_CLOSE 0x02 #define CNID_DBD_OP_ADD 0x03 #define CNID_DBD_OP_GET 0x04 #define CNID_DBD_OP_RESOLVE 0x05 #define CNID_DBD_OP_LOOKUP 0x06 #define CNID_DBD_OP_UPDATE 0x07 #define CNID_DBD_OP_DELETE 0x08 #define CNID_DBD_OP_MANGLE_ADD 0x09 #define CNID_DBD_OP_MANGLE_GET 0x0a #define CNID_DBD_OP_GETSTAMP 0x0b #define CNID_DBD_OP_REBUILD_ADD 0x0c #define CNID_DBD_OP_SEARCH 0x0d #define CNID_DBD_RES_OK 0x00 #define CNID_DBD_RES_NOTFOUND 0x01 #define CNID_DBD_RES_ERR_DB 0x02 #define CNID_DBD_RES_ERR_MAX 0x03 #define CNID_DBD_RES_ERR_DUPLCNID 0x04 #define CNID_DBD_RES_SRCH_CNT 0x05 #define CNID_DBD_RES_SRCH_DONE 0x06 #define DBD_MAX_SRCH_RSLTS 100 struct cnid_dbd_rqst { int op; cnid_t cnid; dev_t dev; ino_t ino; uint32_t type; cnid_t did; char *name; size_t namelen; }; struct cnid_dbd_rply { int result; cnid_t cnid; cnid_t did; char *name; size_t namelen; }; typedef struct CNID_private { u_int32_t magic; char db_dir[MAXPATHLEN + 1]; /* Database directory without /.AppleDB appended */ char *cnidserver; char *cnidport; int fd; /* File descriptor to cnid_dbd */ char stamp[ADEDLEN_PRIVSYN]; /* db timestamp */ char *client_stamp; size_t stamp_size; int notfirst; /* already open before */ int changed; /* stamp differ */ } CNID_private; #endif /* include/atalk/cnid_dbd.h */ netatalk-2.2.2/include/atalk/ea.h0000644000175200017500000001364411655731126013537 00000000000000/* $Id: ea.h,v 1.11 2010-03-12 15:16:49 franklahm Exp $ Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef ATALK_EA_H #define ATALK_EA_H #ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_SOLARIS_ACLS #include #endif #include /* * This seems to be the current limit fo HFS+, we arbitrarily force that * which also safes us from buffer overflows */ #define MAX_EA_SIZE 3802 /* * At time of writing the 10.5.6 client adds 8 bytes to the * length of the EA that we send him */ #define MAX_REPLY_EXTRA_BYTES 8 /* * Library user must provide a static buffer of size ATTRNAMEBUFSIZ. * It's used when listing EAs as intermediate buffer. For afpd it's * defined in extattrs.c. */ #define ATTRNAMEBUFSIZ 4096 enum { kXAttrNoFollow = 0x1, kXAttrCreate = 0x2, kXAttrReplace = 0x4 }; #if !defined(HAVE_SETXATTR) #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ #endif /**************************************************************************************** * Stuff for our implementation of storing EAs in files in .AppleDouble dirs ****************************************************************************************/ #define EA_INITED 0xea494e54 /* ea"INT", for interfacing ea_open w. ea_close */ #define EA_MAGIC 0x61644541 /* "adEA" */ #define EA_VERSION1 0x01 #define EA_VERSION EA_VERSION1 typedef enum { /* ea_open flags */ EA_CREATE = (1<<1), /* create if not existing on ea_open */ EA_RDONLY = (1<<2), /* open read only */ EA_RDWR = (1<<3), /* open read/write */ /* ea_open internal flags */ EA_DIR = (1<<4) /* ea header file is for a dir, ea_open adds it as appropiate */ } eaflags_t; #define EA_MAGIC_OFF 0 #define EA_MAGIC_LEN 4 #define EA_VERSION_OFF (EA_MAGIC_OFF + EA_MAGIC_LEN) #define EA_VERSION_LEN 2 #define EA_COUNT_OFF (EA_VERSION_OFF + EA_VERSION_LEN) #define EA_COUNT_LEN 2 #define EA_HEADER_SIZE (EA_MAGIC_LEN + EA_VERSION_LEN + EA_COUNT_LEN) /* * structs describing the layout of the Extended Attributes bookkeeping file. * This isn't really an AppleDouble structure, it's just a binary blob that * lives in our .AppleDouble directory too. */ struct ea_entry { size_t ea_namelen; /* len of ea_name without terminating 0 ie. strlen(ea_name)*/ size_t ea_size; /* size of EA*/ char *ea_name; /* name of the EA */ }; /* We read the on-disk data into *ea_data and parse it into this*/ struct ea { uint32_t ea_inited; /* needed for interfacing ea_open w. ea_close */ const struct vol *vol; /* vol handle, ea_close needs it */ int dirfd; /* for *at (cf openat) semantics, -1 means ignore */ char *filename; /* name of file, needed by ea_close too */ unsigned int ea_count; /* number of EAs in ea_entries array */ struct ea_entry (*ea_entries)[]; /* malloced and realloced as needed by ea_count*/ int ea_fd; /* open fd for ea_data */ eaflags_t ea_flags; /* flags */ size_t ea_size; /* size of header file = size of ea_data buffer */ char *ea_data; /* pointer to buffer into that we actually * * read the disc file into */ }; /* On-disk format, just for reference ! */ #if 0 struct ea_entry_ondisk { uint32_t ea_size; char ea_name[]; /* zero terminated string */ }; struct ea_ondisk { u_int32_t ea_magic; u_int16_t ea_version; u_int16_t ea_count; struct ea_entry_ondisk ea_entries[ea_count]; }; #endif /* 0 */ /* VFS inderected funcs ... : */ /* Default adouble EAs */ extern int get_easize(VFS_FUNC_ARGS_EA_GETSIZE); extern int get_eacontent(VFS_FUNC_ARGS_EA_GETCONTENT); extern int list_eas(VFS_FUNC_ARGS_EA_LIST); extern int set_ea(VFS_FUNC_ARGS_EA_SET); extern int remove_ea(VFS_FUNC_ARGS_EA_REMOVE); /* ... EA VFS funcs that deal with file/dir cp/mv/rm */ extern int ea_deletefile(VFS_FUNC_ARGS_DELETEFILE); extern int ea_renamefile(VFS_FUNC_ARGS_RENAMEFILE); extern int ea_copyfile(VFS_FUNC_ARGS_COPYFILE); extern int ea_chown(VFS_FUNC_ARGS_CHOWN); extern int ea_chmod_file(VFS_FUNC_ARGS_SETFILEMODE); extern int ea_chmod_dir(VFS_FUNC_ARGS_SETDIRUNIXMODE); /* native EAs */ extern int sys_get_easize(VFS_FUNC_ARGS_EA_GETSIZE); extern int sys_get_eacontent(VFS_FUNC_ARGS_EA_GETCONTENT); extern int sys_list_eas(VFS_FUNC_ARGS_EA_LIST); extern int sys_set_ea(VFS_FUNC_ARGS_EA_SET); extern int sys_remove_ea(VFS_FUNC_ARGS_EA_REMOVE); /* native EA VFSfile/dir cp/mv/rm */ extern int sys_ea_copyfile(VFS_FUNC_ARGS_COPYFILE); /* dbd needs access to these */ extern int ea_open(const struct vol * restrict vol, const char * restrict uname, eaflags_t eaflags, struct ea * restrict ea); extern int ea_openat(const struct vol * restrict vol, int dirfd, const char * restrict uname, eaflags_t eaflags, struct ea * restrict ea); extern int ea_close(struct ea * restrict ea); extern char *ea_path(const struct ea * restrict ea, const char * restrict eaname, int macname); #endif /* ATALK_EA_H */ netatalk-2.2.2/include/atalk/adouble.h0000644000175200017500000004636611667700415014574 00000000000000/* * $Id: adouble.h,v 1.55 2010-03-30 12:55:26 franklahm Exp $ * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ /*! * @file * @brief Part of Netatalk's AppleDouble implementatation */ #ifndef _ATALK_ADOUBLE_H #define _ATALK_ADOUBLE_H #ifdef HAVE_CONFIG_H #include #endif #include #include #include #ifdef HAVE_UNISTD_H #undef __USE_MISC #define __USE_MISC #include #endif #include #ifdef HAVE_FCNTL_H #include #endif #include #ifdef HAVE_SYS_TIME_H #include #endif #include /* version info */ #define AD_VERSION1 0x00010000 #define SFM_VERSION AD_VERSION1 #define AD_VERSION2 0x00020000 #define AD_VERSION2_OSX 0x00020001 /* #define AD_VERSION1_ADS 0x00010002 */ #define AD_VERSION1_SFM 0x00010003 #define AD_VERSION AD_VERSION2 /* * AppleDouble entry IDs. */ #define ADEID_DFORK 1 #define ADEID_RFORK 2 #define ADEID_NAME 3 /* Note: starting with Netatalk 2.1 we do NOT alway set the name */ #define ADEID_COMMENT 4 #define ADEID_ICONBW 5 #define ADEID_ICONCOL 6 #define ADEID_FILEI 7 /* v1, replaced by: */ #define ADEID_FILEDATESI 8 /* this */ #define ADEID_FINDERI 9 #define ADEID_MACFILEI 10 /* we don't use this */ #define ADEID_PRODOSFILEI 11 /* we store prodos info here */ #define ADEID_MSDOSFILEI 12 /* we don't use this */ #define ADEID_SHORTNAME 13 #define ADEID_AFPFILEI 14 /* where the rest of the FILEI info goes */ #define ADEID_DID 15 #if AD_VERSION == AD_VERSION1 #define ADEID_MAX 16 #else /* netatalk private note fileid reused DID */ #define ADEID_PRIVDEV 16 #define ADEID_PRIVINO 17 #define ADEID_PRIVSYN 18 /* in synch with database */ #define ADEID_PRIVID 19 #define ADEID_SFMRESERVE1 20 #define ADEID_SFMRESERVE2 21 #define AD_DEV 0x80444556 #define AD_INO 0x80494E4F #define AD_SYN 0x8053594E #define AD_ID 0x8053567E #define ADEID_MAX 22 #endif /* magic */ #define AD_APPLESINGLE_MAGIC 0x00051600 #define AD_APPLEDOUBLE_MAGIC 0x00051607 #define AD_MAGIC AD_APPLEDOUBLE_MAGIC #define SFM_MAGIC 0x00504641 /* sizes of relevant entry bits */ #define ADEDLEN_MAGIC 4 #define ADEDLEN_VERSION 4 #define ADEDLEN_FILLER 16 #define ADEDLEN_NENTRIES 2 /* 26 */ #define AD_HEADER_LEN (ADEDLEN_MAGIC + ADEDLEN_VERSION + \ ADEDLEN_FILLER + ADEDLEN_NENTRIES) #define AD_ENTRY_LEN 12 /* size of a single entry header */ /* v1 field widths */ #define ADEDLEN_NAME 255 #define ADEDLEN_COMMENT 200 #define ADEDLEN_FILEI 16 #define ADEDLEN_FINDERI 32 /* v2 field widths */ #define ADEDLEN_FILEDATESI 16 #define ADEDLEN_SHORTNAME 12 /* length up to 8.3 */ #define ADEDLEN_AFPFILEI 4 #define ADEDLEN_MACFILEI 4 #define ADEDLEN_PRODOSFILEI 8 #define ADEDLEN_MSDOSFILEI 2 #define ADEDLEN_DID 4 #define ADEDLEN_PRIVDEV 8 #define ADEDLEN_PRIVINO 8 #define ADEDLEN_PRIVSYN 8 #define ADEDLEN_PRIVID 4 #define ADEID_NUM_V1 5 #define ADEID_NUM_V2 13 // #define ADEID_NUM_SFM 5 /* sizeof SFM meta data */ #define AD_SFM_LEN 60 /* 589 */ #define AD_DATASZ1 (AD_HEADER_LEN + ADEDLEN_NAME + ADEDLEN_COMMENT + ADEDLEN_FILEI + ADEDLEN_FINDERI + \ (ADEID_NUM_V1 * AD_ENTRY_LEN)) #if AD_DATASZ1 != 589 #error bad size for AD_DATASZ1 #endif #define AD_NEWSZ2 (ADEDLEN_DID + ADEDLEN_AFPFILEI + ADEDLEN_SHORTNAME + ADEDLEN_PRODOSFILEI \ + ADEDLEN_PRIVDEV + ADEDLEN_PRIVINO + ADEDLEN_PRIVSYN + ADEDLEN_PRIVID) /* 725 */ #define AD_DATASZ2 (AD_DATASZ1 + AD_NEWSZ2 + ((ADEID_NUM_V2 - ADEID_NUM_V1) * AD_ENTRY_LEN)) #if AD_DATASZ2 != 741 #error bad size for AD_DATASZ2 #endif #define AD_DATASZ_MAX 1024 #if AD_VERSION == AD_VERSION1 #define AD_DATASZ AD_DATASZ1 /* hold enough for the entries */ #elif AD_VERSION == AD_VERSION2 #define AD_DATASZ AD_DATASZ2 #endif /* * some legacy defines from netatalk-990130 * (to keep from breaking certain packages) * */ #define ADEDOFF_RFORK 589 #define ADEDOFF_NAME 86 #define ADEDOFF_COMMENT 341 #define ADEDOFF_FINDERI 557 #ifndef ADEDOFF_FILEI #define ADEDOFF_FILEI 541 #endif typedef u_int32_t cnid_t; /* * The header of the AppleDouble Header File looks like this: * * NAME SIZE * ==== ==== * Magic 4 * Version 4 * Home File System 16 (this becomes filler in ad v2) * Number of Entries 2 * Entry Descriptors for each entry: * Entry ID 4 * Offset 4 * Length 4 */ struct ad_entry { off_t ade_off; ssize_t ade_len; }; typedef struct adf_lock_t { struct flock lock; int user; int *refcount; /* handle read locks with multiple users */ } adf_lock_t; struct ad_fd { int adf_fd; /* -1: invalid, -2: symlink */ #ifndef HAVE_PREAD off_t adf_off; #endif char *adf_syml; int adf_flags; int adf_excl; adf_lock_t *adf_lock; int adf_refcount, adf_lockcount, adf_lockmax; }; /* some header protection */ #define AD_INITED 0xad494e54 /* ad"INT" */ struct adouble_fops; struct adouble { u_int32_t ad_magic; u_int32_t ad_version; char ad_filler[ 16 ]; struct ad_entry ad_eid[ ADEID_MAX ]; struct ad_fd ad_data_fork, ad_resource_fork, ad_metadata_fork; struct ad_fd *ad_md; /* either ad_resource or ad_metadata */ int ad_flags; /* This really stores version info too (AD_VERSION*) */ int ad_adflags; /* ad_open flags adflags like ADFLAGS_DIR */ unsigned int ad_inited; int ad_options; int ad_fileordir; int ad_refcount; /* used in afpd/ofork.c */ off_t ad_rlen; /* ressource fork len with AFP 3.0 the header parameter size is too small. */ char *ad_m_name; /* mac name for open fork */ int ad_m_namelen; struct adouble_fops *ad_ops; u_int16_t ad_open_forks; /* open forks (by others) */ #ifdef USE_MMAPPED_HEADERS char *ad_data; #else char ad_data[AD_DATASZ_MAX]; #endif }; struct adouble_fops { char *(*ad_path)(const char *, int); int (*ad_mkrf)(char *); int (*ad_rebuild_header)(struct adouble *); int (*ad_check_header)(struct adouble *, struct stat *); int (*ad_header_read)(struct adouble *, struct stat *); int (*ad_header_upgrade)(struct adouble *, char *); }; #define ADFLAGS_DF (1<<0) #define ADFLAGS_HF (1<<1) #define ADFLAGS_DIR (1<<2) /* #define ADFLAGS_NOADOUBLE (1<<3) */ #define ADFLAGS_V1COMPAT (1<<4) #define ADFLAGS_NOHF (1<<5) /* not an error if no ressource fork */ #define ADFLAGS_RDONLY (1<<6) /* don't try readwrite */ #define ADFLAGS_OPENFORKS (1<<7) /* check for open fork in ad_metadata function */ #define ADFLAGS_RF (1<<8) #define ADFLAGS_MD ADFLAGS_HF /* (1<<9) */ #define ADFLAGS_CREATE (1<<9) /* adouble v2 cnid cache */ #define ADVOL_NODEV (1 << 0) #define ADVOL_CACHE (1 << 1) #define ADVOL_UNIXPRIV (1 << 2) /* adouble unix priv */ #define ADVOL_INVDOTS (1 << 3) /* dot files (.DS_Store) are invisible) */ #define ADVOL_NOADOUBLE (1 << 4) /* lock flags */ #define ADLOCK_CLR (0) #define ADLOCK_RD (1<<0) #define ADLOCK_WR (1<<1) #define ADLOCK_MASK (ADLOCK_RD | ADLOCK_WR) #define ADLOCK_UPGRADE (1<<2) #define ADLOCK_FILELOCK (1<<3) /* we use this so that we can use the same mechanism for both byte * locks and file synchronization locks. i do this by co-opting either * first bits on 32-bit machines or shifting above the last bit on * 64-bit machines. this only matters for the data fork. */ #if defined(TRY_64BITOFF_T) && (~0UL > 0xFFFFFFFFU) /* synchronization locks */ #define AD_FILELOCK_BASE (0x80000000) #else #if _FILE_OFFSET_BITS == 64 #define AD_FILELOCK_BASE (0x7FFFFFFFFFFFFFFFULL - 9) #else #define AD_FILELOCK_BASE (0x7FFFFFFF -9) #endif #endif /* FIXME: * AD_FILELOCK_BASE case */ #if _FILE_OFFSET_BITS == 64 #define BYTELOCK_MAX (0x7FFFFFFFFFFFFFFFULL) #else /* Tru64 is an always-64-bit OS; version 4.0 does not set _FILE_OFFSET_BITS */ #if defined(TRU64) #define BYTELOCK_MAX (0x7FFFFFFFFFFFFFFFULL) #else #define BYTELOCK_MAX (0x7FFFFFFFU) #endif #endif #define AD_FILELOCK_OPEN_WR (AD_FILELOCK_BASE + 0) #define AD_FILELOCK_OPEN_RD (AD_FILELOCK_BASE + 1) #define AD_FILELOCK_DENY_WR (AD_FILELOCK_BASE + 2) #define AD_FILELOCK_DENY_RD (AD_FILELOCK_BASE + 3) #define AD_FILELOCK_OPEN_NONE (AD_FILELOCK_BASE + 4) /* time stuff. we overload the bits a little. */ #define AD_DATE_CREATE 0 #define AD_DATE_MODIFY 4 #define AD_DATE_BACKUP 8 #define AD_DATE_ACCESS 12 #define AD_DATE_MASK (AD_DATE_CREATE | AD_DATE_MODIFY | \ AD_DATE_BACKUP | AD_DATE_ACCESS) #define AD_DATE_UNIX (1 << 10) #define AD_DATE_START htonl(0x80000000) #define AD_DATE_DELTA 946684800 #define AD_DATE_FROM_UNIX(x) htonl((x) - AD_DATE_DELTA) #define AD_DATE_TO_UNIX(x) (ntohl(x) + AD_DATE_DELTA) /* various finder offset and info bits */ #define FINDERINFO_FRTYPEOFF 0 #define FINDERINFO_FRCREATOFF 4 #define FINDERINFO_FRFLAGOFF 8 /* FinderInfo Flags, char in `ad ls`, valid for files|dirs */ #define FINDERINFO_ISONDESK (1) /* "d", fd */ #define FINDERINFO_COLOR (0x0e) #define FINDERINFO_HIDEEXT (1<<4) /* "e", fd */ #define FINDERINFO_ISHARED (1<<6) /* "m", f */ #define FINDERINFO_HASNOINITS (1<<7) /* "n", f */ #define FINDERINFO_HASBEENINITED (1<<8) /* "i", fd */ #define FINDERINFO_HASCUSTOMICON (1<<10) /* "c", fd */ #define FINDERINFO_ISSTATIONNERY (1<<11) /* "t", f */ #define FINDERINFO_NAMELOCKED (1<<12) /* "s", fd */ #define FINDERINFO_HASBUNDLE (1<<13) /* "b", fd */ #define FINDERINFO_INVISIBLE (1<<14) /* "v", fd */ #define FINDERINFO_ISALIAS (1<<15) /* "a", fd */ #define FINDERINFO_FRVIEWOFF 14 #define FINDERINFO_CUSTOMICON 0x4 #define FINDERINFO_CLOSEDVIEW 0x100 /* The "shared" and "invisible" attributes are opaque and stored and retrieved from the FinderFlags. This fixes Bug #2802236: */ /* AFP attributes, char in `ad ls`, valid for files|dirs */ #define ATTRBIT_INVISIBLE (1<<0) /* opaque from FinderInfo */ #define ATTRBIT_MULTIUSER (1<<1) /* file: opaque, dir: see below */ #define ATTRBIT_SYSTEM (1<<2) /* "y", fd */ #define ATTRBIT_DOPEN (1<<3) /* data fork already open. Not stored, computed on the fly */ #define ATTRBIT_ROPEN (1<<4) /* resource fork already open. Not stored, computed on the fly */ #define ATTRBIT_NOWRITE (1<<5) /* "w", f, write inhibit(v2)/read-only(v1) bit */ #define ATTRBIT_BACKUP (1<<6) /* "p", fd */ #define ATTRBIT_NORENAME (1<<7) /* "r", fd */ #define ATTRBIT_NODELETE (1<<8) /* "l", fd */ #define ATTRBIT_NOCOPY (1<<10) /* "o", f */ #define ATTRBIT_SETCLR (1<<15) /* set/clear bit (d) */ /* AFP attributes for dirs. These should probably be computed on the fly. * We don't do that, nor does e.g. OS S X 10.5 Server */ #define ATTRBIT_EXPFLDR (1<<1) /* Folder is a sharepoint */ #define ATTRBIT_MOUNTED (1<<3) /* Directory is mounted by a user */ #define ATTRBIT_SHARED (1<<4) /* Shared area, called IsExpFolder in spec */ /* private AFPFileInfo bits */ #define AD_AFPFILEI_OWNER (1 << 0) /* any owner */ #define AD_AFPFILEI_GROUP (1 << 1) /* ignore group */ #define AD_AFPFILEI_BLANKACCESS (1 << 2) /* blank access permissions */ #define ad_data_fileno(ad) ((ad)->ad_data_fork.adf_fd) #define ad_reso_fileno(ad) ((ad)->ad_resource_fork.adf_fd) #define ad_meta_fileno(ad) ((ad)->ad_md->adf_fd) #define ad_getversion(ad) ((ad)->ad_version) #define ad_getentrylen(ad,eid) ((ad)->ad_eid[(eid)].ade_len) #define ad_setentrylen(ad,eid,len) ((ad)->ad_eid[(eid)].ade_len = (len)) #define ad_getentryoff(ad,eid) ((ad)->ad_eid[(eid)].ade_off) #define ad_entry(ad,eid) ((caddr_t)(ad)->ad_data + (ad)->ad_eid[(eid)].ade_off) #define ad_get_HF_flags(ad) ((ad)->ad_resource_fork.adf_flags) #define ad_get_MD_flags(ad) ((ad)->ad_md->adf_flags) /* ad_flush.c */ extern int ad_rebuild_adouble_header (struct adouble *); extern int ad_rebuild_sfm_header (struct adouble *); extern int ad_copy_header (struct adouble *, struct adouble *); extern int ad_flush (struct adouble *); extern int ad_close (struct adouble *, int); /* ad_lock.c */ extern int ad_fcntl_lock (struct adouble *, const u_int32_t /*eid*/, const int /*type*/, const off_t /*offset*/, const off_t /*len*/, const int /*user*/); extern void ad_fcntl_unlock (struct adouble *, const int /*user*/); extern int ad_fcntl_tmplock (struct adouble *, const u_int32_t /*eid*/, const int /*type*/, const off_t /*offset*/, const off_t /*len*/, const int /*user*/); extern int ad_testlock (struct adouble * /*adp*/, int /*eid*/, off_t /*off*/); extern u_int16_t ad_openforks (struct adouble * /*adp*/, u_int16_t); extern int ad_excl_lock (struct adouble * /*adp*/, const u_int32_t /*eid*/); #define ad_lock ad_fcntl_lock #define ad_tmplock ad_fcntl_tmplock #define ad_unlock ad_fcntl_unlock /* ad_open.c */ extern int ad_setfuid (const uid_t ); extern uid_t ad_getfuid (void ); extern char *ad_dir (const char *); extern char *ad_path (const char *, int); extern char *ad_path_osx (const char *, int); extern char *ad_path_ads (const char *, int); extern char *ad_path_sfm (const char *, int); extern int ad_mode (const char *, int); extern int ad_mkdir (const char *, int); extern void ad_init (struct adouble *, int, int ); extern int ad_open (const char *, int, int, int, struct adouble *); extern int ad_openat (int dirfd, const char *, int, int, int, struct adouble *); extern int ad_refresh (struct adouble *); extern int ad_stat (const char *, struct stat *); extern int ad_metadata (const char *, int, struct adouble *); extern int ad_metadataat (int, const char *, int, struct adouble *); #define ad_open_metadata(name, flags, mode, adp)\ ad_open(name, ADFLAGS_MD|(flags), O_RDWR |(mode), 0666, (adp)) #define ad_close_metadata(adp) ad_close( (adp), ADFLAGS_MD) /* build a resource fork mode from the data fork mode: * remove X mode and extend header to RW if R or W (W if R for locking), */ static inline mode_t ad_hf_mode (mode_t mode) { mode &= ~(S_IXUSR | S_IXGRP | S_IXOTH); /* fnctl lock need write access */ if ((mode & S_IRUSR)) mode |= S_IWUSR; if ((mode & S_IRGRP)) mode |= S_IWGRP; if ((mode & S_IROTH)) mode |= S_IWOTH; /* if write mode set add read mode */ if ((mode & S_IWUSR)) mode |= S_IRUSR; if ((mode & S_IWGRP)) mode |= S_IRGRP; if ((mode & S_IWOTH)) mode |= S_IROTH; return mode; } /* ad_ea.c */ ssize_t sys_getxattr (const char *path, const char *name, void *value, size_t size); ssize_t sys_lgetxattr (const char *path, const char *name, void *value, size_t size); ssize_t sys_fgetxattr (int filedes, const char *name, void *value, size_t size); ssize_t sys_listxattr (const char *path, char *list, size_t size); ssize_t sys_llistxattr (const char *path, char *list, size_t size); ssize_t sys_flistxattr (int filedes, char *list, size_t size); int sys_removexattr (const char *path, const char *name); int sys_lremovexattr (const char *path, const char *name); int sys_fremovexattr (int filedes, const char *name); int sys_setxattr (const char *path, const char *name, const void *value, size_t size, int flags); int sys_lsetxattr (const char *path, const char *name, const void *value, size_t size, int flags); int sys_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags); int sys_copyxattr (const char *src, const char *dst); /* ad_read.c/ad_write.c */ extern int sys_ftruncate(int fd, off_t length); extern ssize_t ad_read (struct adouble *, const u_int32_t, const off_t, char *, const size_t); extern ssize_t ad_pread (struct ad_fd *, void *, size_t, off_t); extern ssize_t ad_write (struct adouble *, const u_int32_t, off_t, const int, const char *, const size_t); extern ssize_t adf_pread (struct ad_fd *, void *, size_t, off_t); extern ssize_t adf_pwrite (struct ad_fd *, const void *, size_t, off_t); extern int ad_dtruncate (struct adouble *, const off_t); extern int ad_rtruncate (struct adouble *, const off_t); /* ad_size.c */ extern off_t ad_size (const struct adouble *, const u_int32_t ); /* ad_mmap.c */ extern void *ad_mmapread (struct adouble *, const u_int32_t, const off_t, const size_t); extern void *ad_mmapwrite (struct adouble *, const u_int32_t, const off_t, const int, const size_t); #define ad_munmap(buf, len) (munmap((buf), (len))) /* ad_date.c */ extern int ad_setdate (struct adouble *, unsigned int, u_int32_t); extern int ad_getdate (const struct adouble *, unsigned int, u_int32_t *); /* ad_attr.c */ extern int ad_setattr (const struct adouble *, const u_int16_t); extern int ad_getattr (const struct adouble *, u_int16_t *); /* Note: starting with Netatalk 2.1 we do NOT alway set the name */ extern int ad_setname (struct adouble *, const char *); #if AD_VERSION == AD_VERSION2 extern int ad_setid (struct adouble *, const dev_t dev,const ino_t ino, const u_int32_t, const u_int32_t, const void *); extern u_int32_t ad_getid (struct adouble *, const dev_t, const ino_t, const cnid_t, const void *); extern u_int32_t ad_forcegetid (struct adouble *adp); #else #define ad_setid(a, b, c) #endif #ifdef WITH_SENDFILE extern int ad_readfile_init(const struct adouble *ad, const int eid, off_t *off, const int end); #endif #if 0 #ifdef HAVE_SENDFILE_WRITE extern ssize_t ad_writefile (struct adouble *, const int, const int, off_t, const int, const size_t); #endif /* HAVE_SENDFILE_WRITE */ #endif /* 0 */ #endif /* _ATALK_ADOUBLE_H */ netatalk-2.2.2/include/atalk/util.h0000644000175200017500000001532111657220543014117 00000000000000/*! * @file * Netatalk utility functions * * Utility functions for these areas: \n * * sockets \n * * locking \n * * misc UNIX function wrappers, eg for getcwd */ #ifndef _ATALK_UTIL_H #define _ATALK_UTIL_H 1 #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #include /* exit error codes */ #define EXITERR_CLNT 1 /* client related error */ #define EXITERR_CONF 2 /* error in config files/cmd line parameters */ #define EXITERR_SYS 3 /* local system error */ /* Print a SBT and exit */ #define AFP_PANIC(why) \ do { \ netatalk_panic(why); \ abort(); \ } while(0); /* LOG assert errors */ #ifndef NDEBUG #define AFP_ASSERT(b) \ do { \ if (!(b)) { \ AFP_PANIC(#b); \ } \ } while(0); #else #define AFP_ASSERT(b) #endif /* NDEBUG */ #define STRCMP(a,b,c) (strcmp(a,c) b 0) #ifndef MAX #define MAX(a,b) ((a) > (b) ? a : b) #endif #ifndef MIN #define MIN(a,b) ((a) < (b) ? a : b) #endif #if BYTE_ORDER == BIG_ENDIAN #define hton64(x) (x) #define ntoh64(x) (x) #else /* BYTE_ORDER == BIG_ENDIAN */ #define hton64(x) ((uint64_t) (htonl(((x) >> 32) & 0xffffffffLL)) | \ (uint64_t) ((htonl(x) & 0xffffffffLL) << 32)) #define ntoh64(x) (hton64(x)) #endif /* BYTE_ORDER == BIG_ENDIAN */ #ifdef WITH_SENDFILE extern ssize_t sys_sendfile (int __out_fd, int __in_fd, off_t *__offset,size_t __count); #endif extern const int _diacasemap[], _dialowermap[]; extern char **getifacelist(void); extern void freeifacelist(char **); #define diatolower(x) _dialowermap[(unsigned char) (x)] #define diatoupper(x) _diacasemap[(unsigned char) (x)] #ifndef NO_DDP extern int atalk_aton (char *, struct at_addr *); #endif extern void bprint (char *, int); extern int strdiacasecmp (const char *, const char *); extern int strndiacasecmp (const char *, const char *, size_t); extern pid_t server_lock (char * /*program*/, char * /*file*/, int /*debug*/); extern int check_lockfile (const char *program, const char *pidfile); extern int create_lockfile(const char *program, const char *pidfile); extern void fault_setup (void (*fn)(void *)); extern void netatalk_panic(const char *why); #define server_unlock(x) (unlink(x)) /* strlcpy and strlcat are used by pam modules */ #ifndef UAM_MODULE_EXPORT #define UAM_MODULE_EXPORT #endif #ifndef HAVE_STRLCPY UAM_MODULE_EXPORT size_t strlcpy (char *, const char *, size_t); #endif #ifndef HAVE_STRLCAT UAM_MODULE_EXPORT size_t strlcat (char *, const char *, size_t); #endif #ifndef HAVE_DLFCN_H extern void *mod_open (const char *); extern void *mod_symbol (void *, const char *); extern void mod_close (void *); #define mod_error() "" #else /* ! HAVE_DLFCN_H */ #include #ifndef RTLD_NOW #define RTLD_NOW 1 #endif /* ! RTLD_NOW */ /* NetBSD doesn't like RTLD_NOW for dlopen (it fails). Use RTLD_LAZY. * OpenBSD currently does not use the second arg for dlopen(). For * future compatibility we define DL_LAZY */ #ifdef __NetBSD__ #define mod_open(a) dlopen(a, RTLD_LAZY) #elif defined(__OpenBSD__) #define mod_open(a) dlopen(a, DL_LAZY) #else /* ! __NetBSD__ && ! __OpenBSD__ */ #define mod_open(a) dlopen(a, RTLD_NOW) #endif /* __NetBSD__ */ #ifndef DLSYM_PREPEND_UNDERSCORE #define mod_symbol(a, b) dlsym(a, b) #else /* ! DLSYM_PREPEND_UNDERSCORE */ extern void *mod_symbol (void *, const char *); #endif /* ! DLSYM_PREPEND_UNDERSCORE */ #define mod_error() dlerror() #define mod_close(a) dlclose(a) #endif /* ! HAVE_DLFCN_H */ /****************************************************************** * locking.c ******************************************************************/ extern int lock_reg(int fd, int cmd, int type, off_t offest, int whence, off_t len); #define read_lock(fd, offset, whence, len) \ lock_reg((fd), F_SETLK, F_RDLCK, (offset), (whence), (len)) #define write_lock(fd, offset, whence, len) \ lock_reg((fd), F_SETLK, F_WRLCK, (offset), (whence), (len)) #define unlock(fd, offset, whence, len) \ lock_reg((fd), F_SETLK, F_UNLCK, (offset), (whence), (len)) /****************************************************************** * socket.c ******************************************************************/ extern int setnonblock(int fd, int cmd); extern ssize_t readt(int socket, void *data, const size_t length, int setnonblocking, int timeout); extern ssize_t writet(int socket, void *data, const size_t length, int setnonblocking, int timeout); extern const char *getip_string(const struct sockaddr *sa); extern unsigned int getip_port(const struct sockaddr *sa); extern void apply_ip_mask(struct sockaddr *ai, int maskbits); extern int compare_ip(const struct sockaddr *sa1, const struct sockaddr *sa2); /* Structures and functions dealing with dynamic pollfd arrays */ enum fdtype {IPC_FD, LISTEN_FD, DISASOCIATED_IPC_FD}; struct polldata { enum fdtype fdtype; /* IPC fd or listening socket fd */ void *data; /* pointer to AFPconfig for listening socket and * * pointer to afp_child_t for IPC fd */ }; extern void fdset_add_fd(int maxconns, struct pollfd **fdsetp, struct polldata **polldatap, int *fdset_usedp, int *fdset_sizep, int fd, enum fdtype fdtype, void *data); extern void fdset_del_fd(struct pollfd **fdsetp, struct polldata **polldatap, int *fdset_usedp, int *fdset_sizep, int fd); extern int send_fd(int socket, int fd); extern int recv_fd(int fd, int nonblocking); /****************************************************************** * unix.c *****************************************************************/ extern const char *getcwdpath(void); extern const char *fullpathname(const char *); extern char *stripped_slashes_basename(char *p); extern int lchdir(const char *dir); extern void randombytes(void *buf, int n); extern int daemonize(int nochdir, int noclose); /****************************************************************** * cnid.c *****************************************************************/ extern bstring rel_path_in_vol(const char *path, const char *volpath); #endif /* _ATALK_UTIL_H */ netatalk-2.2.2/include/atalk/fce_api.h0000755000175200017500000000306511655731244014540 00000000000000/* * File: fce_api.h * Author: mw * * Created on 1. Oktober 2010, 21:35 * * API calls for file change event api */ #ifndef _FCE_API_H #define _FCE_API_H #include /* fce_packet.mode */ #define FCE_FILE_MODIFY 1 #define FCE_FILE_DELETE 2 #define FCE_DIR_DELETE 3 #define FCE_FILE_CREATE 4 #define FCE_DIR_CREATE 5 #define FCE_TM_SIZE 6 #define FCE_CONN_START 42 #define FCE_CONN_BROKEN 99 /* fce_packet.fce_magic */ #define FCE_PACKET_MAGIC "at_fcapi" /* This packet goes over the network, so we want to * be shure about datastructs and type sizes between platforms. * Format is network byte order. */ #define FCE_PACKET_HEADER_SIZE 8+1+1+4+2 struct fce_packet { char magic[8]; unsigned char version; unsigned char mode; uint32_t event_id; uint16_t datalen; char data[MAXPATHLEN]; }; struct path; struct ofork; void fce_pending_events(AFPObj *obj); int fce_register_delete_file( struct path *path ); int fce_register_delete_dir( char *name ); int fce_register_new_dir( struct path *path ); int fce_register_new_file( struct path *path ); int fce_register_file_modification( struct ofork *ofork ); int fce_register_tm_size(const char *vol, size_t used); int fce_add_udp_socket(const char *target ); // IP or IP:Port int fce_set_coalesce( char *coalesce_opt ); // all|delete|create int fce_set_events(const char *events); /* fmod,fdel,ddel,fcre,dcre,tmsz (default is all except tmsz) */ #define FCE_DEFAULT_PORT 12250 #define FCE_DEFAULT_PORT_STRING "12250" #endif /* _FCE_API_H */ netatalk-2.2.2/include/atalk/bstradd.h0000644000175200017500000000264411655731126014573 00000000000000/* Copyright (c) 2010 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ /*! * @file * Additional functions for bstrlib. */ #ifndef ATALK_BSTRADD_H #define ATALK_BSTRADD_H #ifdef HAVE_CONFIG_H #include #endif #include #define cfrombstr(b) ((char *)((b)->data)) /* strip slashes from end of a bstring */ #define BSTRING_STRIP_SLASH(a) \ do { \ while (bchar((a), blength(a) - 1) == '/') \ bdelete((a), blength(a) - 1, 1); \ } while (0); typedef struct tagbstring static_bstring; extern bstring brefcstr(const char *str); extern int bunrefcstr(bstring b); extern struct bstrList *bstrListCreateMin(int min); extern int bstrListPush(struct bstrList *sl, bstring bs); extern bstring bstrListPop(struct bstrList *sl); extern bstring bjoinInv(const struct bstrList * bl, const_bstring sep); #endif /* ATALK_BSTRADD_H */ netatalk-2.2.2/include/atalk/atp.h0000644000175200017500000001353211655731244013733 00000000000000/* * $Id: atp.h,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef _ATALK_ATP_H #define _ATALK_ATP_H 1 #ifndef NO_DDP #include #include #include #include #include /* ATP packet format |----------------| | link header | | ... | |----------------| | DDP header | | ... | | type = 3 | |----------------| | control info | --> bits 7,6: function code |----------------| 5: XO bit | bitmap/seq no. | 4: EOM bit |----------------| 3: STS bit | TID (MSB) | 2,1,0: release timer code (ignored under phase I) |----------------| | TID (LSB) | |----------------| | user bytes (4) | |----------------| | data (0-578) | | ... | |----------------| */ struct atphdr { u_int8_t atphd_ctrlinfo; /* control information */ u_int8_t atphd_bitmap; /* bitmap or sequence number */ u_int16_t atphd_tid; /* transaction id. */ }; /* ATP protocol parameters */ #define ATP_MAXDATA (578+4) /* maximum ATP data size */ #define ATP_BUFSIZ 587 /* maximum packet size */ #define ATP_HDRSIZE 5 /* includes DDP type field */ #define ATP_TRELMASK 0x07 /* mask all but TREL */ #define ATP_RELTIME 30 /* base release timer (in secs) */ #define ATP_TREL30 0x0 /* release time codes */ #define ATP_TREL1M 0x1 /* these are passed in flags of */ #define ATP_TREL2M 0x2 /* atp_sreq call, and set in the */ #define ATP_TREL4M 0x3 /* packet control info. */ #define ATP_TREL8M 0x4 #define ATP_TRIES_INFINITE -1 /* for atp_sreq, etc */ struct atpxobuf { u_int16_t atpxo_tid; struct timeval atpxo_tv; int atpxo_reltime; struct atpbuf *atpxo_packet[8]; }; struct atpbuf { struct atpbuf *atpbuf_next; /* next buffer in chain */ size_t atpbuf_dlen; /* data length <= ATP_BUFSIZ */ struct sockaddr_at atpbuf_addr; /* net address sent/recvd */ union { char atpbuf_data[ ATP_BUFSIZ ]; /* the data */ struct atpxobuf atpbuf_xo; /* for XO requests */ } atpbuf_info; }; struct atp_handle { int atph_socket; /* ddp socket */ struct sockaddr_at atph_saddr; /* address */ u_int16_t atph_tid; /* last tid used */ u_int16_t atph_rtid; /* last received (rreq) */ u_int8_t atph_rxo; /* XO flag from last rreq */ int atph_rreltime; /* release time (secs) */ struct atpbuf *atph_sent; /* packets we send (XO) */ struct atpbuf *atph_queue; /* queue of pending packets */ int atph_reqtries; /* retry count for request */ int atph_reqto; /* retry timeout for request */ int atph_rrespcount; /* expected # of responses */ u_int8_t atph_rbitmap; /* bitmap for request */ struct atpbuf *atph_reqpkt; /* last request packet */ struct timeval atph_reqtv; /* when we last sent request */ struct atpbuf *atph_resppkt[8]; /* response to request */ }; typedef struct atp_handle *ATP; #define atp_sockaddr( h ) (&(h)->atph_saddr) #define atp_fileno(x) ((x)->atph_socket) struct sreq_st { char *atpd_data; /* request data */ int atpd_dlen; int atpd_tries; /* max. retry count */ int atpd_to; /* retry interval */ }; struct rres_st { struct iovec *atpd_iov; /* for response */ int atpd_iovcnt; }; struct rreq_st { char *atpd_data; /* request data */ int atpd_dlen; }; struct sres_st { struct iovec *atpd_iov; /* for response */ int atpd_iovcnt; }; struct atp_block { struct sockaddr_at *atp_saddr; /* from/to address */ union { struct sreq_st sreqdata; #define atp_sreqdata atp_data.sreqdata.atpd_data #define atp_sreqdlen atp_data.sreqdata.atpd_dlen #define atp_sreqtries atp_data.sreqdata.atpd_tries #define atp_sreqto atp_data.sreqdata.atpd_to struct rres_st rresdata; #define atp_rresiov atp_data.rresdata.atpd_iov #define atp_rresiovcnt atp_data.rresdata.atpd_iovcnt struct rreq_st rreqdata; #define atp_rreqdata atp_data.rreqdata.atpd_data #define atp_rreqdlen atp_data.rreqdata.atpd_dlen struct sres_st sresdata; #define atp_sresiov atp_data.sresdata.atpd_iov #define atp_sresiovcnt atp_data.sresdata.atpd_iovcnt } atp_data; u_int8_t atp_bitmap; /* response buffer bitmap */ }; /* flags for ATP options (and control byte) */ #define ATP_STS (1<<3) /* Send Transaction Status */ #define ATP_EOM (1<<4) /* End Of Message */ #define ATP_XO (1<<5) /* eXactly Once mode */ /* function codes */ #define ATP_FUNCMASK (3<<6) /* mask all but function */ #define ATP_TREQ (1<<6) /* Trans. REQuest */ #define ATP_TRESP (2<<6) /* Trans. RESPonse */ #define ATP_TREL (3<<6) /* Trans. RELease */ extern ATP atp_open (u_int8_t, const struct at_addr *); extern int atp_close (ATP); extern int atp_sreq (ATP, struct atp_block *, int, u_int8_t); extern int atp_rresp (ATP, struct atp_block *); extern int atp_rsel (ATP, struct sockaddr_at *, int); extern int atp_rreq (ATP, struct atp_block *); extern int atp_sresp (ATP, struct atp_block *); #endif /* NO_DDP */ #endif netatalk-2.2.2/Makefile.in0000644000175200017500000005445011703521732012321 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for top level of netatalk package VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = . DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure $(top_srcdir)/sys/solaris/Makefile.in \ AUTHORS COPYING NEWS compile config.guess config.sub depcomp \ install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = sys/solaris/Makefile SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = libatalk bin config etc man contrib distrib include sys doc macros test EXTRA_DIST = CONTRIBUTORS COPYRIGHT COPYING NEWS VERSION services.atalk ACLOCAL_AMFLAGS = -I macros AUTOMAKE_OPTIONS = foreign all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 sys/solaris/Makefile: $(top_builddir)/config.status $(top_srcdir)/sys/solaris/Makefile.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \ distclean distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/install-sh0000755000175200017500000003246411661232404012257 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2006-12-25.00 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: netatalk-2.2.2/configure.ac0000644000175200017500000012275611670074205012550 00000000000000dnl configure.in for netatalk AC_INIT(etc/afpd/main.c) NETATALK_VERSION=`cat $srcdir/VERSION` AC_SUBST(NETATALK_VERSION) AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION}) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE([enable]) dnl Checks for programs. AC_PROG_AWK AC_PROG_CC AC_PROG_CC_C99 AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_LIBTOOL_DLOPEN AC_PROG_LIBTOOL AC_PROG_PERL AC_PROG_GREP AC_PROG_PS AM_PROG_CC_C_O dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h time.h sys/param.h sys/fcntl.h sys/file.h sys/ioctl.h sys/time.h sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h mntent.h syslog.h unistd.h termios.h sys/termios.h netdb.h sgtty.h ufs/quota.h mount.h statfs.h sys/types.h dlfcn.h errno.h sys/errno.h sys/uio.h langinfo.h locale.h sys/filio.h) AC_CHECK_HEADER(sys/cdefs.h,, AC_MSG_RESULT([enabling generic cdefs.h from tree]) CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS" ) AC_CHECK_HEADERS([sys/mount.h], , , [#ifdef HAVE_SYS_PARAM_H #include #endif ]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_UID_T AC_C_INLINE AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_STRUCT_ST_RDEV AC_HEADER_TIME AC_STRUCT_TM dnl -------------------------------------------------------------------------- dnl check if dlsym needs to add an underscore, uses libtool macros dnl -------------------------------------------------------------------------- AC_LTDL_DLLIB AC_CHECK_FUNCS(dlopen dlsym dlclose) AC_LTDL_DLSYM_USCORE if test x"$libltdl_cv_need_uscore" = xyes; then AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro]) fi dnl Checks for library functions. AC_TYPE_GETGROUPS AC_PROG_GCC_TRADITIONAL AC_FUNC_MEMCMP AC_HEADER_MAJOR AC_FUNC_MMAP AC_TYPE_SIGNAL AC_FUNC_UTIME_NULL AC_FUNC_WAIT3 AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strcasestr strstr strtoul strchr memcpy) AC_CHECK_FUNCS(backtrace_symbols setlocale nl_langinfo strlcpy strlcat setlinebuf dirfd pselect access pread pwrite) AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64) ac_neta_haveatfuncs=yes AC_CHECK_FUNCS(openat renameat fstatat unlinkat, , ac_neta_haveatfuncs=no) if test x"$ac_neta_haveatfuncs" = x"yes" ; then AC_DEFINE([_ATFILE_SOURCE], 1, AT file source) AC_DEFINE([HAVE_ATFUNCS], 1, whether at funcs are available) fi AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include ]) AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)]) AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)]) dnl search for necessary libs for libpthread stuff AC_SEARCH_LIBS(pthread_sigmask, pthread,, [AC_MSG_ERROR([cannot find pthread_sigmask in libc or libpthread])]) if test x"$ac_cv_search_pthread_sigmask" != x"none required" ; then PTHREAD_LIBS=$ac_cv_search_pthread_sigmask fi AC_SUBST(PTHREAD_LIBS) AC_CACHE_SAVE dnl Checks for (v)snprintf NETATALK_SNPRINTF_CHECK dnl -------------------------------------------------------------------------- dnl 64bit platform check dnl -------------------------------------------------------------------------- AC_MSG_CHECKING([whether to check for 64bit libraries]) # Test if the compiler is in 64bit mode echo 'int i;' > conftest.$ac_ext atalk_cv_cc_64bit_output=no if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *"ELF 64"*) atalk_cv_cc_64bit_output=yes ;; esac fi rm -rf conftest* case $host_cpu:$atalk_cv_cc_64bit_output in powerpc64:yes | s390x:yes | sparc*:yes | x86_64:yes | i386:yes) case $target_os in solaris2*) AC_MSG_RESULT([yes]) atalk_libname="lib/64" ;; *bsd* | dragonfly*) AC_MSG_RESULT([no]) atalk_libname="lib" ;; *) AC_MSG_RESULT([yes]) atalk_libname="lib64" ;; esac ;; *:*) AC_MSG_RESULT([no]) atalk_libname="lib" ;; esac dnl -------------------------------------------------------------------------- dnl specific configuration comes in here: dnl -------------------------------------------------------------------------- netatalk_cv_admin_group=yes AC_MSG_CHECKING([for administrative group support]) AC_ARG_ENABLE(admin-group, [ --disable-admin-group disable admin group],[ if test x"$enableval" = x"no"; then AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled]) netatalk_cv_admin_group=no AC_MSG_RESULT([no]) else AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled]) AC_MSG_RESULT([yes]) fi],[ AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled]) AC_MSG_RESULT([yes]) ] ) NETATALK_AFS_CHECK NETATALK_CONFIG_DIRS netatalk_cv_with_cracklib=no AC_ARG_WITH(cracklib, [ --with-cracklib=DICT enable/set location of cracklib dictionary],[ if test "x$withval" != "xno" ; then cracklib="$withval" AC_CHECK_LIB(crack, main, [ AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used]) LIBS="$LIBS -lcrack" if test "$cracklib" = "yes"; then cracklib="/usr/$atalk_libname/cracklib_dict" fi AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib", [path to cracklib dictionary]) AC_MSG_RESULT([setting cracklib dictionary to $cracklib]) netatalk_cv_with_cracklib=yes ],[ AC_MSG_ERROR([cracklib not found!]) ] ) fi ] ) AC_MSG_CHECKING([for cracklib support]) AC_MSG_RESULT([$netatalk_cv_with_cracklib]) netatalk_cv_ddp_enabled=no AC_MSG_CHECKING([whether to enable DDP]) AC_ARG_ENABLE(ddp, [ --enable-ddp enable DDP (AppleTalk)],[ if test "$enableval" = "yes"; then AC_MSG_RESULT([yes]) netatalk_cv_ddp_enabled=yes else AC_MSG_RESULT([yes]) AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled]) fi ],[ AC_MSG_RESULT([no]) AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled]) ] ) AC_MSG_CHECKING([whether to enable debug code]) AC_ARG_ENABLE(debug1, [ --enable-debug1 enable debug code],[ if test "$enableval" != "no"; then if test "$enableval" = "yes"; then AC_DEFINE(DEBUG1, 1, [Define if debugging information should be included]) else AC_DEFINE_UNQUOTED(DEBUG1, $enableval, [Define if debugging information should be included]) fi AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ],[ AC_MSG_RESULT([no]) ] ) AC_MSG_CHECKING([whether to enable verbose debug code]) AC_ARG_ENABLE(debug, [ --enable-debug enable verbose debug code],[ if test "$enableval" != "no"; then if test "$enableval" = "yes"; then AC_DEFINE(DEBUG, 1, [Define if verbose debugging information should be included]) else AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if verbose debugging information should be included]) fi AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) AC_DEFINE(NDEBUG, 1, [Disable assertions]) fi ],[ AC_MSG_RESULT([no]) AC_DEFINE(NDEBUG, 1, [Disable assertions]) ] ) AC_MSG_CHECKING([whether to enable debugging with debuggers]) AC_ARG_ENABLE(debugging, [ --enable-debugging disable SIGALRM timers and DSI tickles (eg for debugging with gdb/dbx/...)],[ if test "$enableval" != "no"; then if test "$enableval" = "yes"; then AC_DEFINE(DEBUGGING, 1, [Define if you want to disable SIGALRM timers and DSI tickles]) else AC_DEFINE_UNQUOTED(DEBUGGING, $enableval, [Define if you want to disable SIGALRM timers and DSI tickles]) fi AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ],[ AC_MSG_RESULT([no]) ] ) AC_SYS_LARGEFILE([], AC_MSG_ERROR([AFP 3.x support requires Large File Support.])) AC_CHECK_ICONV dnl ----------- A NOTE ABOUT DROPKLUDGE dnl The trouble with this fix is that if you know what the file is called, it dnl can be read from the Unix side. That's okay for most academic institutions dnl since the students don't have telnet access to the Mac servers. There is dnl currently no one working on further development/fixes of DROPKLUDGE. dnl ----------- netatalk_cv_dropkludge=no AC_MSG_CHECKING([whether to enable experimental dropbox support]) AC_ARG_ENABLE(dropkludge, [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ],[ if test "$enableval" = "yes"; then AC_DEFINE(DROPKLUDGE, 1, [Define if you want to use the experimental dropkludge support]) AC_MSG_RESULT([yes]) netatalk_cv_dropkludge=yes else AC_MSG_RESULT([no]) fi ],[ AC_MSG_RESULT([no]) ] ) netatalk_cv_force_uidgid=no AC_MSG_CHECKING([whether to enable forcing of uid/gid per volume]) AC_ARG_ENABLE(force-uidgid, [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ],[ if test "$enableval" = "yes"; then AC_DEFINE(FORCE_UIDGID, 1, [Define if you want forcing of uid/gid per volume]) AC_MSG_RESULT([enabling forcing of uid/gid per volume]) AC_MSG_RESULT([yes]) netatalk_cv_force_uidgid=yes else AC_MSG_RESULT([no]) fi ],[ AC_MSG_RESULT([no]) ] ) dnl Check for CNID database backends bdb_required=no AC_NETATALK_CNID([bdb_required=yes],[bdb_required=no]) dnl Check for quota support AC_CHECK_QUOTA dnl Check for optional server location protocol support (used by MacOS X) NETATALK_SRVLOC dnl Check for optional Zeroconf support NETATALK_ZEROCONF dnl Check for PAM libs netatalk_cv_use_pam=no AC_PATH_PAM([ use_pam_so=yes compile_pam=yes netatalk_cv_use_pam=yes AC_DEFINE(USE_PAM, 1, [Define to enable PAM support]) ]) netatalk_cv_use_shadowpw=no AC_ARG_WITH(shadow, [ --with-shadow enable shadow password support [[auto]]], [netatalk_cv_use_shadowpw="$withval"], [netatalk_cv_use_shadowpw=auto] ) if test "x$netatalk_cv_use_shadowpw" != "xno"; then AC_CHECK_HEADER([shadow.h]) if test x"$ac_cv_header_shadow_h" = x"yes"; then netatalk_cv_use_shadowpw=yes AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used]) else if test "x$shadowpw" = "xyes"; then AC_MSG_ERROR([shadow support not available]) else netatalk_cv_use_shadowpw=no fi fi fi AC_MSG_CHECKING([whether shadow support should be enabled]) if test "x$netatalk_cv_use_shadowpw" = "xyes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi netatalk_cv_use_shellcheck=yes AC_MSG_CHECKING([whether checking for a valid shell should be enabled]) AC_ARG_ENABLE(shell-check, [ --disable-shell-check disable checking for a valid shell],[ if test "$enableval" = "no"; then AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled]) AC_MSG_RESULT([no]) netatalk_cv_use_shellcheck=no else AC_MSG_RESULT([yes]) fi ],[ AC_MSG_RESULT([yes]) ] ) NETATALK_TCP_WRAPPERS AC_MSG_CHECKING([whether system (fcntl) locking should be disabled]) AC_ARG_ENABLE(locking, [ --disable-locking disable system locking],[ if test "$enableval" = "no"; then AC_DEFINE(DISABLE_LOCKING, 1, [Define if system (fcntl) locking should be disabled]) AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ],[ AC_MSG_RESULT([no]) ] ) AC_ARG_ENABLE(redhat, [ --enable-redhat obsoleted ],[ echo "ERROR: --enable-redhat is obsoleted. Use --enable-redhat-sysv or --enable-redhat-systemd." exit 1 ] ) AC_ARG_ENABLE(redhat-sysv, [ --enable-redhat-sysv use redhat-style sysv (upstart) configuration ],[ if test "$enableval" = "yes"; then sysv_style=redhat-sysv fi AC_MSG_RESULT([enabling redhat-style sysv support]) ] ) AC_ARG_ENABLE(redhat-systemd, [ --enable-redhat-systemd use redhat-style systemd (>=Fedora15) configuration ],[ if test "$enableval" = "yes"; then sysv_style=redhat-systemd fi AC_MSG_RESULT([enabling redhat-style systemd support]) ] ) AC_ARG_ENABLE(suse, [ --enable-suse obsoleted ],[ echo "ERROR: --enable-suse is obsoleted. Use --enable-suse-sysv or --enable-suse-systemd." exit 1 ] ) AC_ARG_ENABLE(suse-sysv, [ --enable-suse-sysv use suse-style sysv configuration ],[ if test "$enableval" = "yes"; then sysv_style=suse-sysv fi AC_MSG_RESULT([enabling suse-style sysv support]) ] ) AC_ARG_ENABLE(suse-systemd, [ --enable-suse-systemd use suse-style systemd (>=openSUSE12.1) configuration ],[ if test "$enableval" = "yes"; then sysv_style=suse-systemd fi AC_MSG_RESULT([enabling suse-style systemd support]) ] ) AC_ARG_ENABLE(gentoo, [ --enable-gentoo use gentoo-style sysv configuration ],[ if test "$enableval" = "yes"; then sysv_style=gentoo fi AC_MSG_RESULT([enabling gentoo-style sysv support]) ] ) AC_ARG_ENABLE(netbsd, [ --enable-netbsd use NetBSD-style rc.d configuration ], if test "x$enableval" = "xyes"; then sysv_style=netbsd fi AC_MSG_RESULT([enabling NetBSD-style rc.d support]) ) AC_ARG_ENABLE(debian, [ --enable-debian use debian-style sysv configuration ],[ if test "$enableval" = "yes"; then sysv_style=debian fi AC_MSG_RESULT([enabling debian-style sysv support]) ] ) AC_ARG_ENABLE(systemd, [ --enable-systemd use general systemd configuration],[ if test "$enableval" = "yes"; then sysv_style=systemd fi AC_MSG_RESULT([enabling general systemd support]) ] ) dnl ----- timelord compilation (disabled by default) AC_MSG_CHECKING([whether timelord should be compiled]) compile_timelord=no AC_ARG_ENABLE(timelord, [ --enable-timelord enable compilation of timelord server], [compile_timelord="$enableval"], [compile_timelord="no"] ) AC_MSG_RESULT([$compile_timelord]) dnl ----- a2boot compilation (disabled by default) AC_MSG_CHECKING([whether a2boot should be compiled]) compile_a2boot=no AC_ARG_ENABLE(a2boot, [ --enable-a2boot enable compilation of Apple2 boot server], [compile_a2boot="$enableval"], [compile_a2boot="no"] ) AC_MSG_RESULT([$compile_a2boot]) AC_ARG_WITH(uams-path, [ --with-uams-path=PATH path to UAMs [[PKGCONF/uams]]],[ uams_path="$withval" ],[ uams_path="${PKGCONFDIR}/uams" ] ) NETATALK_AC_CUPS dnl check if we can use attribute unused (gcc only) from ethereal AC_MSG_CHECKING(to see if we can add '__attribute__((unused))' to CFLAGS) if test x$GCC != x ; then CFLAGS="-D_U_=\"__attribute__((unused))\" $CFLAGS" AC_MSG_RESULT(yes) else CFLAGS="-D_U_=\"\" $CFLAGS" AC_MSG_RESULT(no) fi dnl -------------------------------------------------------------------------- dnl FHS stuff has to be done last because it overrides other defaults dnl -------------------------------------------------------------------------- AC_MSG_CHECKING([whether to use Filesystem Hierarchy Standard (FHS) compatibility]) AC_ARG_ENABLE(fhs, [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],[ if test "$enableval" = "yes"; then uams_path="${libdir}/netatalk" sysconfdir="/etc" PKGCONFDIR=${sysconfdir}/netatalk SERVERTEXT="${PKGCONFDIR}/msg" use_pam_so=yes mandir="/usr/share/man" AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS]) AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ],[ AC_MSG_RESULT([no]) ] ) dnl -------------------------------------------------------------------------- dnl post-FHS substitutions, etc dnl -------------------------------------------------------------------------- dnl ***** UAMS_PATH dnl AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}", dnl [path to UAMs [default=PKGCONF/uams]]) UAMS_PATH="${uams_path}" AC_SUBST(UAMS_PATH) dnl -------------------------------------------------------------------------- dnl drop in includes for top level directory structures here... dnl -------------------------------------------------------------------------- dnl Note: $(top_srcdir)/include should be added before all other includes dnl so that includes from that directory a preferred to includes from dnl /usr/include or similar places. LIBS="$LIBS -L\$(top_srcdir)/libatalk" CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys" AC_DEFINE(OPEN_NOFOLLOW_ERRNO, ELOOP, errno returned by open with O_NOFOLLOW) dnl -------------------------------------------------------------------------- dnl specific configuration comes in here: dnl -------------------------------------------------------------------------- dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu dnl --------------------- determine operating system from "target" case "$host_os" in *aix*) this_os=aix ;; *kfreebsd*-gnu) this_os=kfreebsd-gnu ;; *freebsd*) this_os=freebsd ;; *hpux11*) this_os=hpux11 ;; *irix*) this_os=irix ;; *linux*) this_os=linux ;; *osx*) this_os=macosx ;; *darwin*) this_os=macosx ;; *netbsd*) this_os=netbsd ;; *openbsd*) this_os=openbsd ;; *osf*) this_os=tru64 ;; *solaris*) this_os=solaris ;; esac case "$host_cpu" in i386|i486|i586|i686|k7) this_cpu=x86 ;; alpha) this_cpu=alpha ;; mips) this_cpu=mips ;; powerpc|ppc) this_cpu=ppc ;; esac dnl --------------------- GNU source case "$this_os" in linux) AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions]) ;; kfreebsd-gnu) AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions]) ;; esac dnl --------------------- operating system specific flags (port from sys/*) dnl ----- AIX specific ----- if test x"$this_os" = "xaix"; then AC_MSG_RESULT([ * AIX specific configuration]) AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available]) dnl This is probably a lie; AIX 4.3 supports a 64-bit long dnl compilation environment. It's enough to get things defined dnl right in endian.h provided that long long is supported, though. AC_DEFINE(HAVE_32BIT_LONGS, 1, [Define if the data type long has 32 bit]) fi dnl ----- FreeBSD specific ----- if test x"$this_os" = "xfreebsd"; then AC_MSG_RESULT([ * FreeBSD specific configuration]) AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro]) AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD]) AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW) fi dnl ----- GNU/kFreeBSD specific ----- if test x"$this_os" = "xkfreebsd-gnu"; then AC_MSG_RESULT([ * GNU/kFreeBSD specific configuration]) AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro]) AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD]) AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW) fi dnl ----- HP-UX 11 specific ----- if test x"$this_os" = "xhpux11"; then AC_MSG_RESULT([ * HP-UX 11 specific configuration]) AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro]) AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available]) fi dnl ----- IRIX specific ----- if test x"$this_os" = "xirix"; then AC_MSG_RESULT([ * IRIX specific configuration]) AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available]) fi dnl ----- Linux specific ----- if test x"$this_os" = "xlinux"; then AC_MSG_RESULT([ * Linux specific configuration]) dnl ----- kernel 2.6 changed struct at_addr to atalk_addr AC_MSG_CHECKING([for struct atalk_addr]) dnl AC_COMPILE_IFELSE([ AC_TRY_COMPILE([ #include #include #include struct atalk_addr foo; ], [ ], [ ac_have_atalk_addr=yes AC_MSG_RESULT([yes]) ], [ AC_MSG_RESULT([no]) ]) if test "x$ac_have_atalk_addr" = "xyes"; then AC_DEFINE(HAVE_ATALK_ADDR, 1, [set if struct at_addr is called atalk_addr]) fi dnl ----- check if we need the quotactl wrapper # AC_CHECK_HEADERS(sys/quota.h linux/quota.h) # AC_CHECK_FUNC(quotactl,, # AC_DEFINE(NEED_QUOTACTL_WRAPPER, 1, [Define if the quotactl wrapper is needed]) # AC_MSG_RESULT([enabling quotactl wrapper]) # ) # For quotas on Linux XFS filesystems # For linux > 2.5.56 AC_CHECK_HEADERS(linux/dqblk_xfs.h,, [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h) AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)] ) dnl ----- as far as I can tell, dbtob always does the wrong thing dnl ----- on every single version of linux I've ever played with. dnl ----- see etc/afpd/quota.c AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken]) dnl ----- Linux/alpha specific ----- if test x"$this_cpu" = "xalpha"; then AC_MSG_RESULT([enabling gcc memcpy bug workaround]) AC_DEFINE(HAVE_GCC_MEMCPY_BUG, 1, [Define if memcpy is buggy]) fi need_dash_r=no fi dnl ----- Mac OSX specific ----- if test x"$this_os" = "xmacosx"; then AC_MSG_RESULT([ * Mac OSX specific configuration]) AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro]) AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments]) dnl AC_DEFINE(NO_DLFCN_H) AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled]) AC_DEFINE(NO_QUOTA_SUPPORT, 1, [Define if Quota support should be disabled]) AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server]) fi dnl ----- NetBSD specific ----- if test x"$this_os" = "xnetbsd"; then AC_MSG_RESULT([ * NetBSD specific configuration]) AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro]) AC_DEFINE(NETBSD, 1, [Define if OS is NetBSD]) AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EFTYPE, errno returned by open with O_NOFOLLOW) CFLAGS="-I\$(top_srcdir)/sys/netbsd $CFLAGS" need_dash_r=yes dnl ----- NetBSD does not have crypt.h, uses unistd.h ----- AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled]) fi dnl ----- OpenBSD specific ----- if test x"$this_os" = "xopenbsd"; then AC_MSG_RESULT([ * OpenBSD specific configuration]) AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro]) dnl ----- OpenBSD does not have crypt.h, uses unistd.h ----- AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled]) AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled]) fi dnl ----- Solaris specific ----- if test x"$this_os" = "xsolaris"; then AC_MSG_RESULT([ * Solaris specific configuration]) AC_DEFINE(__svr4__, 1, [Solaris compatibility macro]) AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro]) AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available]) AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro]) AC_DEFINE(_XOPEN_SOURCE, 600, [Solaris compilation environment]) AC_DEFINE(__EXTENSIONS__, 1, [Solaris compilation environment]) CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS" need_dash_r=yes sysv_style=solaris solaris_module=no AC_MSG_CHECKING([if we can build Solaris kernel module]) if test -x /usr/ccs/bin/ld && test x"$netatalk_cv_ddp_enabled" = x"yes" ; then solaris_module=yes fi AC_MSG_RESULT([$solaris_module]) COMPILE_64BIT_KMODULE=no KCFLAGS="" KLDFLAGS="" COMPILE_KERNEL_GCC=no if test "$solaris_module" = "yes"; then dnl Solaris kernel module stuff AC_MSG_CHECKING([if we have to build a 64bit kernel module]) # check for isainfo, if not found it has to be a 32 bit kernel (<=2.6) if test -x /usr/bin/isainfo; then # check for 64 bit platform if isainfo -kv | grep '^64-bit'; then COMPILE_64BIT_KMODULE=yes fi fi AC_MSG_RESULT([$COMPILE_64BIT_KMODULE]) if test "${GCC}" = yes; then COMPILE_KERNEL_GCC=yes if test "$COMPILE_64BIT_KMODULE" = yes; then AC_MSG_CHECKING([if we can build a 64bit kernel module]) case `$CC --version 2>/dev/null` in [[12]].* | 3.0.*) COMPILE_64BIT_KMODULE=no COMPILE_KERNEL_GCC=no solaris_module=no;; *) # use for 64 bit KCFLAGS="-m64" #KLDFLAGS="-melf64_sparc" KLDFLAGS="-64";; esac AC_MSG_RESULT([$COMPILE_64BIT_KMODULE]) else KCFLAGS="" KLDFLAGS="" fi KCFLAGS="$KCFLAGS -D_KERNEL -Wall -Wstrict-prototypes" else if test "$COMPILE_64BIT_KMODULE" = yes; then # use Sun CC (for a 64-bit kernel, uncomment " -xarch=v9 -xregs=no%appl ") KCFLAGS="-xarch=v9 -xregs=no%appl" KLDFLAGS="-64" else KCFLAGS="" KLDFLAGS="" fi KCFLAGS="-D_KERNEL $KCFLAGS -mno-app-regs -munaligned-doubles -fpcc-struct-return" fi AC_CACHE_CHECK([for timeout_id_t],netatalk_cv_HAVE_TIMEOUT_ID_T,[ AC_TRY_LINK([\ #include #include ], [\ timeout_id_t dummy; ], netatalk_cv_HAVE_TIMEOUT_ID_T=yes,netatalk_cv_HAVE_TIMEOUT_ID_T=no,netatalk_cv_HAVE_TIMEOUT_ID_T=cross)]) AC_DEFINE(HAVE_TIMEOUT_ID_T, test x"$netatalk_cv_HAVE_TIMEOUT_ID" = x"yes", [define for timeout_id_t]) fi AC_SUBST(COMPILE_KERNEL_GCC) AC_SUBST(COMPILE_64BIT_KMODULE) AC_SUBST(KCFLAGS) AC_SUBST(KLDFLAGS) fi dnl ----- Tru64 specific ----- if test x"$this_os" = "xtru64"; then AC_MSG_RESULT([ * Tru64 specific configuration]) AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled]) AC_DEFINE(HAVE_64BIT_LONGS, 1, [Define if the data type long has 64 bit]) dnl AC_DEFINE(USE_MOUNT_H) AC_DEFINE(USE_OLD_RQUOTA, 1, [Define to use old rquota]) dnl AC_DEFINE(USE_UFS_QUOTA_H) AC_DEFINE(TRU64, 1, [Define on Tru64 platforms]) AC_DEFINE(_OSF_SOURCE, 1, [Define if the *passwd UAMs should be used]) AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Define for Berkeley DB 4]) AC_CHECK_LIB(security,set_auth_parameters) CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS" need_dash_r=no sysv_style=tru64 fi dnl ------ Check for sendfile() -------- netatalk_cv_search_sendfile=yes AC_ARG_ENABLE(sendfile, [ --disable-sendfile disable sendfile syscall], [if test x"$enableval" = x"no"; then netatalk_cv_search_sendfile=no fi] ) if test x"$netatalk_cv_search_sendfile" = x"yes"; then case "$host_os" in *linux*) AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available]) AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes]) ;; *solaris*) AC_DEFINE(SENDFILE_FLAVOR_SOLARIS, 1, [Solaris sendfile()]) AC_SEARCH_LIBS(sendfile, sendfile) AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes]) ;; *freebsd*) AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics]) AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes]) ;; *) ;; esac if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used]) fi fi dnl -- check for libgcrypt, if found enables DHX UAM AM_PATH_LIBGCRYPT([1:1.2.3],[neta_cv_compile_dhx2=yes neta_cv_have_libgcrypt=yes AC_MSG_NOTICE([Enabling DHX2 UAM]) AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define if the DHX2 modules should be built with libgcrypt]) AC_DEFINE(UAM_DHX2, 1, [Define if the DHX2 UAM modules should be compiled]) ]) dnl -- look for openssl, if found enables DHX UAM and Randnum UAM AC_PATH_SSL dnl Check for Berkeley DB library if test "x$bdb_required" = "xyes"; then AC_PATH_BDB(, [ AC_MSG_RESULT([]) AC_MSG_RESULT([Make sure you have the required Berkeley DB libraries AND headers installed.]) AC_MSG_RESULT([You can download the latest version from http://www.sleepycat.com.]) AC_MSG_RESULT([If you have installed BDB in a non standard location use the]) AC_MSG_RESULT([--with-bdb=/path/to/bdb configure option and make sure]) AC_MSG_RESULT([your linker is configured to check for libraries there.]) AC_MSG_ERROR([Berkeley DB library required but not found!]) ]) fi dnl -- check for crypt AC_CRYPT dnl --------------------- check for building PGP UAM module AC_MSG_CHECKING([whether the PGP UAM should be build]) AC_ARG_ENABLE(pgp-uam, [ --enable-pgp-uam enable build of PGP UAM module],[ if test "$enableval" = "yes"; then if test "x$neta_cv_have_openssl" = "xyes"; then AC_DEFINE(UAM_PGP, 1, [Define if the PGP UAM module should be compiled]) compile_pgp=yes AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi ],[ AC_MSG_RESULT([no]) ] ) dnl --------------------- check for building Kerberos v4 UAM module AC_MSG_CHECKING([whether the Kerberos IV UAM should be build]) AC_ARG_ENABLE(krb4-uam, [ --enable-krb4-uam enable build of Kerberos v4 UAM module],[ if test "$enableval" = "yes"; then AC_DEFINE(UAM_KRB4, 1, [Define if the Kerberos 4 UAM module should be compiled]) compile_kerberos=yes AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ],[ AC_MSG_RESULT([no]) ] ) dnl --------------------- check for building Kerberos V UAM module netatalk_cv_build_krb5_uam=no AC_ARG_ENABLE(krbV-uam, [ --enable-krbV-uam enable build of Kerberos V UAM module], [ if test x"$enableval" = x"yes"; then NETATALK_GSSAPI_CHECK([ netatalk_cv_build_krb5_uam=yes ],[ AC_MSG_ERROR([need GSSAPI to build Kerberos V UAM]) ]) fi ] ) AC_MSG_CHECKING([whether Kerberos V UAM should be build]) if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi AM_CONDITIONAL(USE_GSSAPI, test x"$netatalk_cv_build_krb5_uam" = x"yes") dnl --------------------- overwrite the config files . . . or not. AC_MSG_CHECKING([whether configuration files should be overwritten]) AC_ARG_ENABLE(overwrite, [ --enable-overwrite overwrite configuration files during installation], [OVERWRITE_CONFIG="${enable_overwrite}"], [OVERWRITE_CONFIG="no"] ) AC_MSG_RESULT([$OVERWRITE_CONFIG]) dnl --------------------- check for LDAP support, for client-side ACL visibility AC_MSG_CHECKING(for LDAP (necessary for client-side ACL visibility)) AC_ARG_WITH(ldap, [AS_HELP_STRING([--with-ldap], [LDAP support (default=auto)])], [ case "$withval" in yes|no) with_ldap="$withval" ;; *) with_ldap=auto ;; esac ]) AC_MSG_RESULT($with_ldap) if test x"$with_ldap" != x"no" ; then AC_CHECK_HEADER([ldap.h], with_ldap=yes, [ if test x"$with_ldap" = x"yes" ; then AC_MSG_ERROR([Missing LDAP headers]) fi with_ldap=no ]) AC_CHECK_LIB(ldap, ldap_init, with_ldap=yes, [ if test x"$with_ldap" = x"yes" ; then AC_MSG_ERROR([Missing LDAP library]) fi with_ldap=no ]) fi if test x"$with_ldap" = x"yes"; then AC_DEFINE(HAVE_LDAP,1,[Whether LDAP is available]) fi dnl --------------------- check for ACL support AC_MSG_CHECKING(whether to support ACLs) AC_ARG_WITH(acls, [AS_HELP_STRING([--with-acls], [Include ACL support (default=auto)])], [ case "$withval" in yes|no) with_acl_support="$withval" ;; *) with_acl_support=auto ;; esac ], [with_acl_support=auto]) AC_MSG_RESULT($with_acl_support) if test x"$with_acl_support" = x"no"; then AC_MSG_RESULT(Disabling ACL support) AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in]) else with_acl_support=yes fi if test x"$with_acl_support" = x"yes" ; then AC_MSG_NOTICE(checking whether ACL support is available:) case "$host_os" in *sysv5*) AC_MSG_NOTICE(Using UnixWare ACLs) AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available]) ;; *solaris*) AC_MSG_NOTICE(Using solaris ACLs) AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available]) ACL_LIBS="$ACL_LIBS -lsec" ;; *hpux*) AC_MSG_NOTICE(Using HPUX ACLs) AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available]) ;; *irix*) AC_MSG_NOTICE(Using IRIX ACLs) AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available]) ;; *aix*) AC_MSG_NOTICE(Using AIX ACLs) AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available]) ;; *osf*) AC_MSG_NOTICE(Using Tru64 ACLs) AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available]) ACL_LIBS="$ACL_LIBS -lpacl" ;; *darwin*) AC_MSG_NOTICE(ACLs on Darwin currently not supported) AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available]) ;; *) AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"]) case "$host_os" in *linux*) AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"]) ;; esac AC_CACHE_CHECK([for POSIX ACL support],netatalk_cv_HAVE_POSIX_ACLS,[ acl_LIBS=$LIBS LIBS="$LIBS $ACL_LIBS" AC_TRY_LINK([ #include #include ],[ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry(acl, entry_id, entry_p); ], [netatalk_cv_HAVE_POSIX_ACLS=yes], [netatalk_cv_HAVE_POSIX_ACLS=no with_acl_support=no]) LIBS=$acl_LIBS ]) if test x"$netatalk_cv_HAVE_POSIX_ACLS" = x"yes"; then AC_MSG_NOTICE(Using POSIX ACLs) AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available]) AC_CACHE_CHECK([for acl_get_perm_np],netatalk_cv_HAVE_ACL_GET_PERM_NP,[ acl_LIBS=$LIBS LIBS="$LIBS $ACL_LIBS" AC_TRY_LINK([ #include #include ],[ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np(permset_d, perm); ], [netatalk_cv_HAVE_ACL_GET_PERM_NP=yes], [netatalk_cv_HAVE_ACL_GET_PERM_NP=no]) LIBS=$acl_LIBS ]) if test x"$netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available]) fi AC_CACHE_CHECK([for acl_from_mode], netatalk_cv_HAVE_ACL_FROM_MODE,[ acl_LIBS=$LIBS LIBS="$LIBS $ACL_LIBS" AC_CHECK_FUNCS(acl_from_mode, [netatalk_cv_HAVE_ACL_FROM_MODE=yes], [netatalk_cv_HAVE_ACL_FROM_MODE=no]) LIBS=$acl_LIBS ]) if test x"netatalk_cv_HAVE_ACL_FROM_MODE" = x"yes"; then AC_DEFINE(HAVE_ACL_FROM_MODE,1,[Whether acl_from_mode() is available]) fi else AC_MSG_NOTICE(ACL support is not avaliable) AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available]) fi ;; esac fi if test x"$with_acl_support" = x"yes" ; then AC_CHECK_HEADERS([acl/libacl.h]) AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available]) AC_SUBST(ACL_LIBS) fi dnl --------------------- check for Extended Attributes support neta_cv_eas="ad" neta_cv_eas_sys_found=no neta_cv_eas_sys_not_found=no AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h) case "$this_os" in *osf*) AC_SEARCH_LIBS(getproplist, [proplist]) AC_CHECK_FUNCS([getproplist fgetproplist setproplist fsetproplist], [neta_cv_eas_sys_found=yes], [neta_cv_eas_sys_not_found=yes]) AC_CHECK_FUNCS([delproplist fdelproplist add_proplist_entry get_proplist_entry],, [neta_cv_eas_sys_not_found=yes]) AC_CHECK_FUNCS([sizeof_proplist_entry],, [neta_cv_eas_sys_not_found=yes]) ;; *solaris*) AC_CHECK_FUNCS([attropen], [neta_cv_eas_sys_found=yes], [neta_cv_eas_sys_not_found=yes]) ;; 'freebsd') AC_CHECK_FUNCS([extattr_delete_fd extattr_delete_file extattr_delete_link], [neta_cv_eas_sys_found=yes], [neta_cv_eas_sys_not_found=yes]) AC_CHECK_FUNCS([extattr_get_fd extattr_get_file extattr_get_link],, [neta_cv_eas_sys_not_found=yes]) AC_CHECK_FUNCS([extattr_list_fd extattr_list_file extattr_list_link],, [neta_cv_eas_sys_not_found=yes]) AC_CHECK_FUNCS([extattr_set_fd extattr_set_file extattr_set_link],, [neta_cv_eas_sys_not_found=yes]) ;; *freebsd4* | *dragonfly* ) AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work]) ;; *) AC_SEARCH_LIBS(getxattr, [attr]) if test "x$neta_cv_eas_sys_found" != "xyes" ; then AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr listxattr llistxattr], [neta_cv_eas_sys_found=yes], [neta_cv_eas_sys_not_found=yes]) AC_CHECK_FUNCS([flistxattr removexattr lremovexattr fremovexattr],, [neta_cv_eas_sys_not_found=yes]) AC_CHECK_FUNCS([setxattr lsetxattr fsetxattr],, [neta_cv_eas_sys_not_found=yes]) fi if test "x$neta_cv_eas_sys_found" != "xyes" ; then AC_CHECK_FUNCS([getea fgetea lgetea listea flistea llistea], [neta_cv_eas_sys_found=yes], [neta_cv_eas_sys_not_found=yes]) AC_CHECK_FUNCS([removeea fremoveea lremoveea setea fsetea lsetea],, [neta_cv_eas_sys_not_found=yes]) fi if test "x$neta_cv_eas_sys_found" != "xyes" ; then AC_CHECK_FUNCS([attr_get attr_list attr_set attr_remove],, [neta_cv_eas_sys_not_found=yes]) AC_CHECK_FUNCS([attr_getf attr_listf attr_setf attr_removef],, [neta_cv_eas_sys_not_found=yes]) fi ;; esac # Do xattr functions take additional options like on Darwin? if test x"$ac_cv_func_getxattr" = x"yes" ; then AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [ old_LIBS=$LIBS LIBS="$LIBS $ACL_LIBS" AC_TRY_COMPILE([ #include #if HAVE_ATTR_XATTR_H #include #elif HAVE_SYS_XATTR_H #include #endif ],[ getxattr(0, 0, 0, 0, 0, 0); ], [smb_attr_cv_xattr_add_opt=yes], [smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS]) ]) if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then AC_DEFINE(XATTR_ADD_OPT, 1, [xattr functions have additional options]) fi fi if test "x$neta_cv_eas_sys_found" = "xyes" ; then if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then neta_cv_eas="$neta_cv_eas | sys" fi fi AC_DEFINE_UNQUOTED(EA_MODULES,["$neta_cv_eas"],[Available Extended Attributes modules]) dnl --------------------- Check if realpath() takes NULL AC_CACHE_CHECK([if the realpath function allows a NULL argument], neta_cv_REALPATH_TAKES_NULL, [ AC_TRY_RUN([ #include #include #include void exit_on_core(int ignored) { exit(1); } main() { char *newpath; signal(SIGSEGV, exit_on_core); newpath = realpath("/tmp", NULL); exit((newpath != NULL) ? 0 : 1); }], neta_cv_REALPATH_TAKES_NULL=yes, neta_cv_REALPATH_TAKES_NULL=no, neta_cv_REALPATH_TAKES_NULL=cross ) ] ) if test x"$neta_cv_REALPATH_TAKES_NULL" = x"yes"; then AC_DEFINE(REALPATH_TAKES_NULL,1,[Whether the realpath function allows NULL]) fi dnl --------------------- Netatalk Webmin NETATALK_WEBMIN dnl --------------------- last minute substitutions AC_SUBST(LIBS) AC_SUBST(CFLAGS) AC_SUBST(OVERWRITE_CONFIG) AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes) AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes) AM_CONDITIONAL(COMPILE_A2BOOT, test x$compile_a2boot = xyes) AM_CONDITIONAL(HAVE_LIBGCRYPT, test x$neta_cv_have_libgcrypt = xyes) AM_CONDITIONAL(HAVE_OPENSSL, test x$neta_cv_have_openssl = xyes) AM_CONDITIONAL(HAVE_ACLS, test x"$with_acl_support" = x"yes") AM_CONDITIONAL(HAVE_LDAP, test x"$with_ldap" = x"yes") AM_CONDITIONAL(USE_DHX, test x$neta_cv_compile_dhx = xyes) AM_CONDITIONAL(USE_DHX2, test x$neta_cv_compile_dhx2 = xyes) AM_CONDITIONAL(USE_RANDNUM, test x$neta_cv_have_openssl = xyes) AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes) AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes) AM_CONDITIONAL(USE_PAM, test x$netatalk_cv_install_pam = xyes) AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes) AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes) AM_CONDITIONAL(DEFAULT_HOOK, test x$neta_cv_have_libgcrypt != xyes && test x$neta_cv_have_openssl != xyes) AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd) AM_CONDITIONAL(USE_REDHAT_SYSV, test x$sysv_style = xredhat-sysv) AM_CONDITIONAL(USE_SUSE_SYSV, test x$sysv_style = xsuse-sysv) AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes) AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64) AM_CONDITIONAL(USE_SOLARIS, test x$sysv_style = xsolaris) AM_CONDITIONAL(USE_GENTOO, test x$sysv_style = xgentoo) AM_CONDITIONAL(USE_DEBIAN, test x$sysv_style = xdebian) AM_CONDITIONAL(USE_SYSTEMD, test x$sysv_style = xsystemd || test x$sysv_style = xredhat-systemd || test x$sysv_style = xsuse-systemd) AM_CONDITIONAL(USE_UNDEF, test x$sysv_style = x) AM_CONDITIONAL(USE_BDB, test x$bdb_required = xyes) AM_CONDITIONAL(USE_APPLETALK, test x$netatalk_cv_ddp_enabled = xyes) AM_CONDITIONAL(HAVE_ATFUNCS, test x"$ac_neta_haveatfuncs" = x"yes") dnl --------------------- generate files AC_OUTPUT([Makefile bin/Makefile bin/ad/Makefile bin/adv1tov2/Makefile bin/aecho/Makefile bin/afppasswd/Makefile bin/cnid/Makefile bin/cnid/cnid2_create bin/getzones/Makefile bin/megatron/Makefile bin/misc/Makefile bin/nbp/Makefile bin/pap/Makefile bin/psorder/Makefile bin/uniconv/Makefile config/Makefile config/pam/Makefile contrib/Makefile contrib/macusers/Makefile contrib/macusers/macusers contrib/misc/Makefile contrib/printing/Makefile contrib/shell_utils/Makefile contrib/shell_utils/apple_dump contrib/shell_utils/asip-status.pl contrib/timelord/Makefile contrib/a2boot/Makefile distrib/Makefile distrib/config/Makefile distrib/config/netatalk-config distrib/initscripts/Makefile distrib/m4/Makefile distrib/systemd/Makefile doc/Makefile etc/Makefile etc/afpd/Makefile etc/atalkd/Makefile etc/cnid_dbd/Makefile etc/uams/Makefile etc/uams/uams_krb4/Makefile etc/papd/Makefile etc/psf/Makefile include/Makefile include/atalk/Makefile libatalk/Makefile libatalk/acl/Makefile libatalk/adouble/Makefile libatalk/asp/Makefile libatalk/atp/Makefile libatalk/bstring/Makefile libatalk/cnid/Makefile libatalk/cnid/cdb/Makefile libatalk/cnid/last/Makefile libatalk/cnid/dbd/Makefile libatalk/cnid/tdb/Makefile libatalk/compat/Makefile libatalk/dsi/Makefile libatalk/nbp/Makefile libatalk/netddp/Makefile libatalk/util/Makefile libatalk/tdb/Makefile libatalk/unicode/Makefile libatalk/unicode/charsets/Makefile libatalk/vfs/Makefile macros/Makefile man/Makefile man/man1/Makefile man/man3/Makefile man/man4/Makefile man/man5/Makefile man/man8/Makefile sys/Makefile sys/generic/Makefile sys/generic/sys/Makefile sys/netatalk/Makefile sys/netbsd/Makefile sys/netbsd/netatalk/Makefile sys/solaris/Makefile sys/sunos/Makefile sys/ultrix/Makefile test/Makefile test/afpd/Makefile ], [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*] ) AC_NETATALK_LIBS_SUMMARY AC_NETATALK_CONFIG_SUMMARY netatalk-2.2.2/ltmain.sh0000644000175200017500000060646710752724413012113 00000000000000# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION="1.5.26 Debian 1.5.26-1ubuntu1" TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)" # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= duplicate_deps=no preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 ##################################### # Shell function definitions: # This seems to be the best place for them # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $mkdir "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || { $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 exit $EXIT_FAILURE } fi $echo "X$my_tmpdir" | $Xsed } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ $SED -n -e '1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) extracted_serial=`expr $extracted_serial + 1` my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then exit $exit_status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" disable_libs=no # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) echo "\ $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag preserve_args="$preserve_args --tag" ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi case $disable_libs in no) ;; shared) build_libtool_libs=no build_old_libs=yes ;; static) build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ;; esac # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.[fF][09]?) xform=[fF][09]. ;; *.for) xform=for ;; *.java) xform=java ;; *.obj) xform=obj ;; *.sx) xform=sx ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qlibobj="\"$qlibobj\"" ;; esac test "X$libobj" != "X$qlibobj" \ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qsrcfile="\"$qsrcfile\"" ;; esac $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework|darwin_framework_skip) test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework|-arch|-isysroot) case " $CC " in *" ${arg} ${1} "* | *" ${arg} ${1} "*) prev=darwin_framework_skip ;; *) compiler_flags="$compiler_flags $arg" prev=darwin_framework ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" notinst_path="$notinst_path $dir" fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC # -F/path gives path to uninstalled frameworks, gcc on darwin # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" compiler_flags="$compiler_flags $arg" continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then exit $exit_status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` if eval $echo \"$deplib\" 2>/dev/null \ | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $absdir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes ; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP ": [^:]* bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$deplibdir/$depdepl" ; then depdepl="$deplibdir/$depdepl" elif test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" else # Can't find it, oh well... depdepl= fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) case " $deplibs" in *\ -l* | *\ -L*) $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;; esac if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then major=`expr $current - $age` else major=`expr $current - $age + 1` fi case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name=`expr $a_deplib : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then case $archive_cmds in *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;; *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;; esac else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$output_la-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then $show "${rm}r $gentop" $run ${rm}r "$gentop" fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) case " $deplibs" in *\ -l* | *\ -L*) $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;; esac if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac else $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/${outputname}.def" ; then compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` else compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` fi ;; * ) compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` ;; esac ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $exit_status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) output_name=`basename $output` output_path=`dirname $output` cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) /* -DDEBUG is fairly common in CFLAGS. */ #undef DEBUG #if defined DEBUGWRAPPER # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) #else # define DEBUG(format, ...) #endif const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); const char * base_name (const char *name); char * find_executable(const char *wrapper); int check_executable(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup (base_name (argv[0])); DEBUG("(main) argv[0] : %s\n",argv[0]); DEBUG("(main) program_name : %s\n",program_name); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = find_executable(argv[0]); if (newargz[1] == NULL) lt_fatal("Couldn't find %s", argv[0]); DEBUG("(main) found exe at : %s\n",newargz[1]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" return 127; } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char)name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable(const char * path) { struct stat st; DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && ( /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ #if defined (S_IXOTH) ((st.st_mode & S_IXOTH) == S_IXOTH) || #endif #if defined (S_IXGRP) ((st.st_mode & S_IXGRP) == S_IXGRP) || #endif ((st.st_mode & S_IXUSR) == S_IXUSR)) ) return 1; else return 0; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise */ char * find_executable (const char* wrapper) { int has_slash = 0; const char* p; const char* p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char* concat_name; DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char* path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char* q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR(*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); return NULL; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \$*\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$gentop"; then exit $exit_status fi fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` else relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: netatalk-2.2.2/VERSION0000644000175200017500000000000511703523027011306 000000000000002.2.2netatalk-2.2.2/bin/0000777000175200017500000000000011704770424011105 500000000000000netatalk-2.2.2/bin/Makefile.am0000644000175200017500000000026711655731126013063 00000000000000# Makefile.am for bin/ SUBDIRS = adv1tov2 afppasswd cnid megatron uniconv misc if USE_APPLETALK SUBDIRS += aecho getzones nbp pap psorder endif if HAVE_ATFUNCS SUBDIRS += ad endif netatalk-2.2.2/bin/pap/0000777000175200017500000000000011704770424011665 500000000000000netatalk-2.2.2/bin/pap/Makefile.am0000644000175200017500000000041711655731126013640 00000000000000# Makefile.am for bin/pap/ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys bin_PROGRAMS = pap papstatus pap_SOURCES = pap.c pap_LDADD = $(top_builddir)/libatalk/libatalk.la papstatus_SOURCES = papstatus.c papstatus_LDADD = $(top_builddir)/libatalk/libatalk.la netatalk-2.2.2/bin/pap/Makefile.in0000644000175200017500000004205011703521723013642 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for bin/pap/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = pap$(EXEEXT) papstatus$(EXEEXT) subdir = bin/pap DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_pap_OBJECTS = pap.$(OBJEXT) pap_OBJECTS = $(am_pap_OBJECTS) pap_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la am_papstatus_OBJECTS = papstatus.$(OBJEXT) papstatus_OBJECTS = $(am_papstatus_OBJECTS) papstatus_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(pap_SOURCES) $(papstatus_SOURCES) DIST_SOURCES = $(pap_SOURCES) $(papstatus_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys pap_SOURCES = pap.c pap_LDADD = $(top_builddir)/libatalk/libatalk.la papstatus_SOURCES = papstatus.c papstatus_LDADD = $(top_builddir)/libatalk/libatalk.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bin/pap/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign bin/pap/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done pap$(EXEEXT): $(pap_OBJECTS) $(pap_DEPENDENCIES) @rm -f pap$(EXEEXT) $(LINK) $(pap_OBJECTS) $(pap_LDADD) $(LIBS) papstatus$(EXEEXT): $(papstatus_OBJECTS) $(papstatus_DEPENDENCIES) @rm -f papstatus$(EXEEXT) $(LINK) $(papstatus_OBJECTS) $(papstatus_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/papstatus.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/bin/pap/pap.c0000644000175200017500000005024411655731126012533 00000000000000/* * $Id: pap.c,v 1.14 2009-10-16 01:10:59 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #include #include #include #define FUCKED #define _PATH_PAPRC ".paprc" /* Forward Declarations */ static void updatestatus(char *s, int len); static int send_file(int fd, ATP atp, int lastfile); static void usage(char *path) { char *p; if (( p = strrchr( path, '/' )) == NULL ) { p = path; } else { p++; } fprintf( stderr, "Usage:\t%s [ -A address ] [ -c ] [ -d ] [ -e ] [ -E ] [ -p printer ]\n" " [ -s statusfile ] [ -w ] [ -W ] [ FILES ]\n" " -A address - printer Appletalk address\n" " -c - take cuts (lie about wait time)\n" " -d - enable debug\n" " -e - send stdout to stderr\n" " -E - don't wait for EOF from printer\n" " -p printer - printer name\n" " -s statusfile - put current printer status in statusfile\n" " -w - wait for printer status = 'waiting'\n" " -W - wait for printer status = 'idle'\n" " FILES - send FILES to printer\n" , p ); exit( 2 ); } static char * paprc(void) { static char s[ 32 + 1 + 32 + 1 + 32 ]; char *name = NULL; FILE *f; if (( f = fopen( _PATH_PAPRC, "r" )) == NULL ) { if ( errno == ENOENT ) { return( NULL ); } else { perror( _PATH_PAPRC ); exit( 2 ); } } while ( fgets( s, sizeof( s ), f ) != NULL ) { s[ strlen( s ) - 1 ] = '\0'; /* remove trailing newline */ if ( *s == '#' ) { continue; } name = s; break; } fclose( f ); return( name ); } static char *printer = NULL; static char *status = NULL; static int noeof = 0; static int waitforprinter = 0; static unsigned char connid, quantum, oquantum = PAP_MAXQUANTUM; static struct sockaddr_at sat; static char cbuf[ 8 ]; static struct nbpnve nn; static ATP satp; static char fbuf[ PAP_MAXQUANTUM ][ 4 + PAP_MAXDATA ]; static struct iovec rfiov[ PAP_MAXQUANTUM ] = { { fbuf[ 0 ] + 4, 0 }, { fbuf[ 1 ] + 4, 0 }, { fbuf[ 2 ] + 4, 0 }, { fbuf[ 3 ] + 4, 0 }, { fbuf[ 4 ] + 4, 0 }, { fbuf[ 5 ] + 4, 0 }, { fbuf[ 6 ] + 4, 0 }, { fbuf[ 7 ] + 4, 0 }, }; static struct iovec sniov[ PAP_MAXQUANTUM ] = { { fbuf[ 0 ], 0 }, { fbuf[ 1 ], 0 }, { fbuf[ 2 ], 0 }, { fbuf[ 3 ], 0 }, { fbuf[ 4 ], 0 }, { fbuf[ 5 ], 0 }, { fbuf[ 6 ], 0 }, { fbuf[ 7 ], 0 }, }; static char nbuf[ PAP_MAXQUANTUM ][ 4 + PAP_MAXDATA ]; static struct iovec rniov[ PAP_MAXQUANTUM ] = { { nbuf[ 0 ], 0 }, { nbuf[ 1 ], 0 }, { nbuf[ 2 ], 0 }, { nbuf[ 3 ], 0 }, { nbuf[ 4 ], 0 }, { nbuf[ 5 ], 0 }, { nbuf[ 6 ], 0 }, { nbuf[ 7 ], 0 }, }; static struct iovec sfiov[ PAP_MAXQUANTUM ] = { { nbuf[ 0 ] + 4, 0 }, { nbuf[ 1 ] + 4, 0 }, { nbuf[ 2 ] + 4, 0 }, { nbuf[ 3 ] + 4, 0 }, { nbuf[ 4 ] + 4, 0 }, { nbuf[ 5 ] + 4, 0 }, { nbuf[ 6 ] + 4, 0 }, { nbuf[ 7 ] + 4, 0 }, }; static int debug; int main( int ac, char **av) { ATP atp; struct atp_block atpb; int c, err = 0, fd, cuts = 0; char *obj = NULL, *type = "LaserWriter", *zone = "*"; struct timeval stv, tv; char rbuf[ ATP_MAXDATA ]; struct iovec iov; unsigned short waiting, result; int connattempts = 10; int waitforidle = 0; struct at_addr addr; extern char *optarg; extern int optind; memset(&addr, 0, sizeof(addr)); while (( c = getopt( ac, av, "dWwcep:s:EA:" )) != EOF ) { switch ( c ) { #ifdef FUCKED case 'w' : waitforprinter = 1; break; case 'W' : waitforidle = 1; break; #endif /* FUCKED */ /* enable debugging */ case 'd' : debug++; break; case 'c' : cuts++; break; case 'e' : /* send stdout to stderr */ dup2( 2, 1 ); break; case 'p' : printer = optarg; break; case 's' : status = optarg; break; case 'E' : noeof = 1; break; case 'A': if (!atalk_aton(optarg, &addr)) { fprintf(stderr, "Bad address.\n"); exit(1); } break; default : err++; } } if ( err ) { usage( *av ); } if ( printer == NULL && (( printer = paprc()) == NULL )) { fprintf( stderr, "No printer specified and ./.paprc not found.\n" ); exit( 2 ); } /* * Open connection. */ if ( nbp_name( printer, &obj, &type, &zone ) < 0 ) { fprintf( stderr, "%s: Bad name\n", printer ); exit( 2 ); } if ( obj == NULL ) { fprintf( stderr, "%s: Bad name\n", printer ); exit( 2 ); } if ( nbp_lookup( obj, type, zone, &nn, 1, &addr ) <= 0 ) { if ( errno != 0 ) { perror( "nbp_lookup" ); exit( 2 ); } fprintf( stderr, "%s:%s@%s: NBP Lookup failed\n", obj, type, zone ); exit( 1 ); } if ( isatty( 1 )) { printf( "Trying %u.%d:%d ...\n", ntohs( nn.nn_sat.sat_addr.s_net ), nn.nn_sat.sat_addr.s_node, nn.nn_sat.sat_port ); } if (( atp = atp_open( ATADDR_ANYPORT, &addr )) == NULL ) { perror( "atp_open" ); exit( 2 ); } if (( satp = atp_open( ATADDR_ANYPORT, &addr )) == NULL ) { perror( "atp_open" ); exit( 2 ); } while ( waitforidle ) { char st_buf[ 1024 ]; /* XXX too big */ cbuf[ 0 ] = 0; cbuf[ 1 ] = PAP_SENDSTATUS; cbuf[ 2 ] = cbuf[ 3 ] = 0; atpb.atp_saddr = &nn.nn_sat; atpb.atp_sreqdata = cbuf; atpb.atp_sreqdlen = 4; /* bytes in SendStatus request */ atpb.atp_sreqto = 2; /* retry timer */ atpb.atp_sreqtries = 5; /* retry count */ if ( atp_sreq( satp, &atpb, 1, 0 ) < 0 ) { perror( "atp_sreq" ); exit( 1 ); } if(debug){ printf( "SENDSTATUS >\n" ), fflush( stdout );} atpb.atp_saddr = &nn.nn_sat; rniov[ 0 ].iov_len = PAP_MAXDATA + 4; atpb.atp_rresiov = rniov; atpb.atp_rresiovcnt = 1; if ( atp_rresp( satp, &atpb ) < 0 ) { perror( "atp_rresp" ); continue; } #ifndef NONZEROSTATUS /* * The stinking LaserWriter IINTX puts crap in this * field. */ if ( ((char *)rniov[ 0 ].iov_base)[ 0 ] != 0 ) { fprintf( stderr, "Bad status response!\n" ); exit( 1 ); } #endif /* NONZEROSTATUS */ if ( ((char *)rniov[ 0 ].iov_base)[ 1 ] != PAP_STATUS || atpb.atp_rresiovcnt != 1 ) { fprintf( stderr, "Bad status response!\n" ); exit( 1 ); } if(debug){ printf( "< STATUS\n" ), fflush( stdout );} memcpy( st_buf, (char *) rniov[ 0 ].iov_base + 9, ((char *)rniov[ 0 ].iov_base)[ 8 ] ); st_buf[ (int) ((char *)rniov[ 0 ].iov_base)[ 8 ]] = '\0'; if ( strstr( st_buf, "idle" ) != NULL ) { waitforidle = 0; } else { updatestatus( (char *) rniov[ 0 ].iov_base + 9, ((char *)rniov[ 0 ].iov_base)[ 8 ] ); sleep( 5 ); } } cbuf[ 0 ] = connid = getpid() & 0xff; cbuf[ 1 ] = PAP_OPEN; cbuf[ 2 ] = cbuf[ 3 ] = 0; cbuf[ 4 ] = atp_sockaddr( atp )->sat_port; cbuf[ 5 ] = oquantum; /* flow quantum */ if ( gettimeofday( &stv, NULL ) < 0 ) { perror( "gettimeofday" ); exit( 2 ); } for (;;) { if ( cuts ) { waiting = 0xffff; } else { if ( gettimeofday( &tv, NULL ) < 0 ) { perror( "gettimeofday" ); exit( 2 ); } waiting = htons( tv.tv_sec - stv.tv_sec ); } memcpy(cbuf + 6, &waiting, sizeof( waiting )); atpb.atp_saddr = &nn.nn_sat; atpb.atp_sreqdata = cbuf; atpb.atp_sreqdlen = 8; /* bytes in OpenConn request */ atpb.atp_sreqto = 2; /* retry timer */ atpb.atp_sreqtries = 5; /* retry count */ if ( atp_sreq( atp, &atpb, 1, ATP_XO ) < 0 ) { perror( "atp_sreq" ); exit( 1 ); } if(debug){ printf( "OPEN >\n" ), fflush( stdout );} iov.iov_base = rbuf; iov.iov_len = sizeof( rbuf ); atpb.atp_rresiov = &iov; atpb.atp_rresiovcnt = 1; if ( atp_rresp( atp, &atpb ) < 0 ) { perror( "atp_rresp" ); if ( connattempts-- <= 0 ) { fprintf( stderr, "Can't connect!\n" ); exit( 1 ); } continue; } /* sanity */ if ( iov.iov_len < 8 || (unsigned char)rbuf[ 0 ] != connid || rbuf[ 1 ] != PAP_OPENREPLY ) { fprintf( stderr, "Bad response!\n" ); continue; /* This is weird, since TIDs must match... */ } if(debug){ printf( "< OPENREPLY\n" ), fflush( stdout );} if ( isatty( 1 )) { printf( "%.*s\n", (int)iov.iov_len - 9, (char *) iov.iov_base + 9 ); } updatestatus( (char *) iov.iov_base + 9, iov.iov_len - 9 ); memcpy( &result, rbuf + 6, sizeof( result )); if ( result != 0 ) { sleep( 2 ); } else { memcpy( &sat, &nn.nn_sat, sizeof( struct sockaddr_at )); sat.sat_port = rbuf[ 4 ]; quantum = rbuf[ 5 ]; break; } } if ( isatty( 1 )) { printf( "Connected to %.*s:%.*s@%.*s.\n", nn.nn_objlen, nn.nn_obj, nn.nn_typelen, nn.nn_type, nn.nn_zonelen, nn.nn_zone ); } if ( optind == ac ) { send_file( 0, atp, 1 ); } else { for (; optind < ac; optind++ ) { if ( strcmp( av[ optind ], "-" ) == 0 ) { fd = 0; } else if (( fd = open( av[ optind ], O_RDONLY )) < 0 ) { perror( av[ optind ] ); continue; } send_file( fd, atp, ( optind == ac - 1 ) ? 1 : 0 ); if ( fd != 0 ) { close( fd ); } } } /* * Close connection. */ cbuf[ 0 ] = connid; cbuf[ 1 ] = PAP_CLOSE; cbuf[ 2 ] = cbuf[ 3 ] = 0; atpb.atp_saddr = &sat; atpb.atp_sreqdata = cbuf; atpb.atp_sreqdlen = 4; /* bytes in CloseConn request */ atpb.atp_sreqto = 2; /* retry timer */ atpb.atp_sreqtries = 5; /* retry count */ if ( atp_sreq( atp, &atpb, 1, ATP_XO ) < 0 ) { perror( "atp_sreq" ); exit( 1 ); } if(debug){ printf( "CLOSE >\n" ), fflush( stdout );} iov.iov_base = rbuf; iov.iov_len = sizeof( rbuf ); atpb.atp_rresiov = &iov; atpb.atp_rresiovcnt = 1; if ( atp_rresp( atp, &atpb ) < 0 ) { perror( "atp_rresp" ); exit( 1 ); } /* sanity */ if ( iov.iov_len != 4 || rbuf[ 1 ] != PAP_CLOSEREPLY ) { fprintf( stderr, "Bad response!\n" ); exit( 1 ); } #ifndef ZEROCONNID /* * The AGFA Viper Rip doesn't have the connection id in the close request. */ if ((unsigned char)rbuf[ 0 ] != connid ) { fprintf( stderr, "Bad connid in close!\n" ); exit( 1 ); } #endif /* ZEROCONNID */ if(debug){ printf( "< CLOSEREPLY\n" ), fflush( stdout );} if ( isatty( 1 )) { printf( "Connection closed.\n" ); } exit( 0 ); } static int data = 0; static unsigned char port; static u_int16_t seq = 0; static int send_file( int fd, ATP atp, int lastfile) { struct timeval stv, tv; struct sockaddr_at ssat; struct atp_block atpb; fd_set fds; int fiovcnt = 0, eof = 0, senteof = 0, to = 0; int cc, i; unsigned short netseq; if ( gettimeofday( &stv, NULL ) < 0 ) { perror( "gettimeofday" ); exit( 2 ); } /* * Ask for more data. */ cbuf[ 0 ] = connid; cbuf[ 1 ] = PAP_READ; if ( ++seq == 0 ) seq = 1; netseq = htons( seq ); memcpy( cbuf + 2, &netseq, sizeof( netseq )); atpb.atp_saddr = &sat; atpb.atp_sreqdata = cbuf; atpb.atp_sreqdlen = 4; /* bytes in SendData request */ atpb.atp_sreqto = 15; /* retry timer */ atpb.atp_sreqtries = -1; /* retry count */ if ( atp_sreq( atp, &atpb, oquantum, ATP_XO ) < 0 ) { perror( "atp_sreq" ); exit( 1 ); } if(debug){ printf( "READ %d >\n", seq ), fflush( stdout );} for (;;) { if ( gettimeofday( &tv, NULL ) < 0 ) { perror( "gettimeofday" ); exit( 2 ); } if (( tv.tv_sec - stv.tv_sec ) >= 60 ) { stv = tv; /* * Send a tickle. */ cbuf[ 0 ] = connid; cbuf[ 1 ] = PAP_TICKLE; cbuf[ 2 ] = cbuf[ 3 ] = 0; atpb.atp_saddr = &sat; atpb.atp_sreqdata = cbuf; atpb.atp_sreqdlen = 4; /* bytes in Tickle request */ atpb.atp_sreqto = 0; /* retry timer */ atpb.atp_sreqtries = 1; /* retry count */ if ( atp_sreq( satp, &atpb, 0, 0 ) < 0 ) { perror( "atp_sreq" ); exit( 1 ); } if(debug){ printf( "TICKLE >\n" ), fflush( stdout );} } tv.tv_sec = stv.tv_sec + 60 - tv.tv_sec; tv.tv_usec = 0; FD_ZERO( &fds ); if ( !waitforprinter && !eof && fiovcnt == 0 ) { FD_SET( fd, &fds ); } FD_SET( atp_fileno( atp ), &fds ); if (( cc = select( FD_SETSIZE, &fds, NULL, NULL, &tv )) < 0 ) { perror( "select" ); exit( 2 ); } /* * A timeout has occured. Keep track of it. */ if ( cc == 0 ) { if ( to++ > 2 ) { fprintf( stderr, "Connection timed out.\n" ); exit( 1 ); } continue; } /* * Read data. */ if ( !fiovcnt && FD_ISSET( fd, &fds )) { for ( i = 0; i < quantum; i++ ) { rfiov[ i ].iov_len = PAP_MAXDATA; } if (( cc = readv( fd, rfiov, quantum )) < 0 ) { perror( "readv" ); exit( 2 ); } if ( cc == 0 ) { eof = 1; } fiovcnt = cc / PAP_MAXDATA + ( cc % PAP_MAXDATA > 0 ); for ( i = 0; cc > 0; i++ ) { rfiov[ i ].iov_len = ( cc > PAP_MAXDATA ) ? PAP_MAXDATA : cc; cc -= ( cc > PAP_MAXDATA ) ? PAP_MAXDATA : cc; } } if ( FD_ISSET( atp_fileno( atp ), &fds )) { ssat = sat; ssat.sat_port = ATADDR_ANYPORT; switch( atp_rsel( atp, &ssat, ATP_TRESP | ATP_TREQ )) { case ATP_TREQ : atpb.atp_saddr = &ssat; atpb.atp_rreqdata = cbuf; atpb.atp_rreqdlen = sizeof( cbuf ); if ( atp_rreq( atp, &atpb ) < 0 ) { perror( "atp_rreq" ); exit( 1 ); } if ( (unsigned char)cbuf[ 0 ] != connid ) { break; } /* reset timeout counter for all valid requests */ to = 0; switch ( cbuf[ 1 ] ) { case PAP_READ : memcpy( cbuf + 2, &netseq, sizeof( netseq )); if(debug){ printf( "< READ %d\n", ntohs( netseq )), fflush( stdout );} #ifdef notdef if ( netseq != 0 ) { if ( rseq != ntohs( netseq )) { if(debug){ printf( "| DUP %d\n", rseq ), fflush( stdout );} break; } if ( rseq++ == 0xffff ) rseq = 1; } #endif /* notdef */ data = 1; port = ssat.sat_port; break; case PAP_CLOSE : if(debug){ printf( "< CLOSE\n" ), fflush( stdout );} /* * Respond to the close request, and fail. */ sniov[ 0 ].iov_len = 4; ((char *)sniov[ 0 ].iov_base)[ 0 ] = connid; ((char *)sniov[ 0 ].iov_base)[ 1 ] = PAP_CLOSEREPLY; ((char *)sniov[ 0 ].iov_base)[ 2 ] = ((char *)sniov[ 0 ].iov_base)[ 3 ] = 0; atpb.atp_sresiov = sniov; atpb.atp_sresiovcnt = 1; if ( atp_sresp( atp, &atpb ) < 0 ) { perror( "atp_sresp" ); exit( 1 ); } if(debug){ printf( "CLOSEREPLY >\n" ), fflush( stdout );} fprintf( stderr, "Connection closed by foreign host.\n" ); exit( 1 ); case PAP_TICKLE : if(debug){ printf( "< TICKLE\n" ), fflush( stdout );} break; default : fprintf( stderr, "Bad PAP request!\n" ); exit( 1 ); } break; case ATP_TRESP : /* reset timeout counter for all valid requests */ to = 0; atpb.atp_saddr = &ssat; for ( i = 0; i < oquantum; i++ ) { rniov[ i ].iov_len = PAP_MAXDATA + 4; } atpb.atp_rresiov = rniov; atpb.atp_rresiovcnt = oquantum; if ( atp_rresp( atp, &atpb ) < 0 ) { perror( "atp_rresp" ); exit( 1 ); } #ifndef ZEROCONNID /* * The HP LJIIISI w/ BridgePort LocalTalk card sends * zero instead of the connid. */ if ( ((unsigned char *)rniov[ 0 ].iov_base)[ 0 ] != connid ) { fprintf( stderr, "Bad data response!\n" ); exit( 1 ); } #endif /* ZEROCONNID */ if ( ((char *)rniov[ 0 ].iov_base)[ 1 ] != PAP_DATA ) { fprintf( stderr, "Bad data response!\n" ); exit( 1 ); } for ( cc = 0, i = 0; i < atpb.atp_rresiovcnt; i++ ) { sfiov[ i ].iov_len = rniov[ i ].iov_len - 4; cc += sfiov[ i ].iov_len; } if ( cc && writev( 1, sfiov, atpb.atp_rresiovcnt ) < cc ) { perror( "writev" ); exit( 2 ); } /* eof */ if ( ((char *)rniov[ 0 ].iov_base)[ 2 ] ) { if(debug){ printf( "< DATA (eof)\n" ), fflush( stdout );} return( 0 ); } if(debug){ printf( "< DATA\n" ), fflush( stdout );} /* * Ask for more data. */ cbuf[ 0 ] = connid; cbuf[ 1 ] = PAP_READ; if ( ++seq == 0 ) seq = 1; netseq = htons( seq ); memcpy( cbuf + 2, &netseq, sizeof( netseq )); atpb.atp_saddr = &sat; atpb.atp_sreqdata = cbuf; atpb.atp_sreqdlen = 4; /* bytes in SendData request */ atpb.atp_sreqto = 15; /* retry timer */ atpb.atp_sreqtries = -1; /* retry count */ if ( atp_sreq( atp, &atpb, oquantum, ATP_XO ) < 0 ) { perror( "atp_sreq" ); exit( 1 ); } if(debug){ printf( "READ %d >\n", seq ), fflush( stdout );} break; case 0: if(debug){ printf( "| RETRANS\n" ), fflush( stdout );} break; default: perror( "atp_rsel" ); exit( 1 ); } } /* * Send whatever is pending. */ if ( !waitforprinter && !senteof && data && ( fiovcnt || eof )) { ssat.sat_port = port; atpb.atp_saddr = &ssat; if ( fiovcnt ) { for ( i = 0; i < fiovcnt; i++ ) { sniov[ i ].iov_len = rfiov[ i ].iov_len + 4; ((char *)sniov[ i ].iov_base)[ 0 ] = connid; ((char *)sniov[ i ].iov_base)[ 1 ] = PAP_DATA; senteof = ((char *)sniov[ i ].iov_base)[ 2 ] = eof; ((char *)sniov[ i ].iov_base)[ 3 ] = 0; } } else { sniov[ 0 ].iov_len = 4; ((char *)sniov[ 0 ].iov_base)[ 0 ] = connid; ((char *)sniov[ 0 ].iov_base)[ 1 ] = PAP_DATA; senteof = ((char *)sniov[ 0 ].iov_base)[ 2 ] = eof; ((char *)sniov[ 0 ].iov_base)[ 3 ] = 0; } atpb.atp_sresiov = sniov; atpb.atp_sresiovcnt = fiovcnt ? fiovcnt : 1; if ( atp_sresp( atp, &atpb ) < 0 ) { perror( "atp_sresp" ); exit( 1 ); } data = fiovcnt = 0; if(debug){ printf( "DATA %s\n", eof ? "(eof) >" : ">" ), fflush( stdout );} /* * The Apple LaserWriter IIf, the HP LWIIISi, and IV, don't * seem to send us an EOF on large jobs. To work around * this heinous protocol violation, we won't wait for their * EOF before closing. */ if ( eof && noeof && lastfile ) { return( 0 ); } } else { /* * If we can't send data right now, go ahead and get the * status. This is cool, because we get here reliably * if there is a problem. */ cbuf[ 0 ] = 0; cbuf[ 1 ] = PAP_SENDSTATUS; cbuf[ 2 ] = cbuf[ 3 ] = 0; atpb.atp_saddr = &nn.nn_sat; atpb.atp_sreqdata = cbuf; atpb.atp_sreqdlen = 4; /* bytes in SendStatus request */ atpb.atp_sreqto = 2; /* retry timer */ atpb.atp_sreqtries = 5; /* retry count */ if ( atp_sreq( satp, &atpb, 1, 0 ) < 0 ) { perror( "atp_sreq" ); exit( 1 ); } if(debug){ printf( "SENDSTATUS >\n" ), fflush( stdout );} atpb.atp_saddr = &nn.nn_sat; rniov[ 0 ].iov_len = PAP_MAXDATA + 4; atpb.atp_rresiov = rniov; atpb.atp_rresiovcnt = 1; if ( atp_rresp( satp, &atpb ) < 0 ) { perror( "atp_rresp" ); continue; } #ifndef NONZEROSTATUS /* * The stinking LaserWriter IINTX puts crap in this * field. */ if ( ((char *)rniov[ 0 ].iov_base)[ 0 ] != 0 ) { fprintf( stderr, "Bad status response!\n" ); exit( 1 ); } #endif /* NONZEROSTATUS */ if ( ((char *)rniov[ 0 ].iov_base)[ 1 ] != PAP_STATUS || atpb.atp_rresiovcnt != 1 ) { fprintf( stderr, "Bad status response!\n" ); exit( 1 ); } if(debug){ printf( "< STATUS\n" ), fflush( stdout );} #ifdef FUCKED if ( waitforprinter ) { char st_buf[ 1024 ]; /* XXX too big */ memcpy( st_buf, (char *) rniov[ 0 ].iov_base + 9, ((char *)rniov[ 0 ].iov_base)[ 8 ] ); st_buf[ (int) ((char *)rniov[ 0 ].iov_base)[ 8 ]] = '\0'; if ( strstr( st_buf, "waiting" ) != NULL ) { waitforprinter = 0; } } #endif /* FUCKED */ updatestatus( (char *) rniov[ 0 ].iov_base + 9, ((char *)rniov[ 0 ].iov_base)[ 8 ] ); } } } static void updatestatus(char *s, int len) { int fd = -1; struct iovec iov[ 3 ]; if ( status ) { if (( fd = open( status, O_WRONLY|O_TRUNC )) < 0 ) { perror( status ); status = NULL; } } if ( fd < 0 ) { fd = 2; } iov[ 0 ].iov_base = "%%[ "; iov[ 0 ].iov_len = 4; iov[ 1 ].iov_base = s; iov[ 1 ].iov_len = len; iov[ 2 ].iov_base = " ]%%\n"; iov[ 2 ].iov_len = 5; writev( fd, iov, 3 ); if ( status ) { close( fd ); } } netatalk-2.2.2/bin/pap/papstatus.c0000644000175200017500000001102611655731126013772 00000000000000/* * $Id: papstatus.c,v 1.7 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define _PATH_PAPRC ".paprc" /* Forward Declaration */ static void getstatus(ATP atp, struct sockaddr_at *sat); static void usage(char *path) { char *p; if (( p = strrchr( path, '/' )) == NULL ) { p = path; } else { p++; } fprintf( stderr, "Usage:\t%s [ -A address ] [ -p printername ]\n", p ); exit( 1 ); } static char * paprc(void) { static char s[ 32 + 1 + 32 + 1 + 32 ]; char *name = NULL; FILE *f; if (( f = fopen( _PATH_PAPRC, "r" )) == NULL ) { return( NULL ); } while ( fgets( s, sizeof( s ), f ) != NULL ) { s[ strlen( s ) - 1 ] = '\0'; /* remove trailing newline */ if ( *s == '#' ) { continue; } name = s; break; } fclose( f ); return( name ); } static char *printer = NULL; static char cbuf[ 8 ]; static struct nbpnve nn; int main( int ac, char **av) { ATP atp; int wait, c, err = 0; char *obj = NULL, *type = "LaserWriter", *zone = "*"; struct at_addr addr; extern char *optarg; extern int optind; memset(&addr, 0, sizeof(addr)); while (( c = getopt( ac, av, "p:s:A:" )) != EOF ) { switch ( c ) { case 'A': if (!atalk_aton(optarg, &addr)) { fprintf(stderr, "Bad address.\n"); exit(1); } break; case 'p' : printer = optarg; break; default : fprintf( stderr, "Unknown option: '%c'\n", c ); err++; } } if ( err ) { usage( *av ); } if ( printer == NULL && (( printer = paprc()) == NULL )) { usage( *av ); } /* * Open connection. */ if ( nbp_name( printer, &obj, &type, &zone ) < 0 ) { fprintf( stderr, "%s: Bad name\n", printer ); exit( 1 ); } if ( obj == NULL ) { fprintf( stderr, "%s: Bad name\n", printer ); exit( 1 ); } if ( nbp_lookup( obj, type, zone, &nn, 1, &addr ) <= 0 ) { if ( errno != 0 ) { perror( "nbp_lookup" ); } else { fprintf( stderr, "%s:%s@%s: NBP Lookup failed\n", obj, type, zone ); } exit( 1 ); } if (( atp = atp_open( ATADDR_ANYPORT, &addr )) == NULL ) { perror( "atp_open" ); exit( 1 ); } if ( optind == ac ) { getstatus( atp, &nn.nn_sat ); exit( 0 ); } if ( optind - ac > 1 ) { usage( *av ); } wait = atoi( av[ optind ] ); for (;;) { getstatus( atp, &nn.nn_sat ); sleep( wait ); } return 0; } static void getstatus(ATP atp, struct sockaddr_at *sat) { struct iovec iov; struct atp_block atpb; char rbuf[ ATP_MAXDATA ]; cbuf[ 0 ] = 0; cbuf[ 1 ] = PAP_SENDSTATUS; cbuf[ 2 ] = cbuf[ 3 ] = 0; atpb.atp_saddr = sat; atpb.atp_sreqdata = cbuf; atpb.atp_sreqdlen = 4; /* bytes in SendStatus request */ atpb.atp_sreqto = 2; /* retry timer */ atpb.atp_sreqtries = 5; /* retry count */ if ( atp_sreq( atp, &atpb, 1, ATP_XO ) < 0 ) { perror( "atp_sreq" ); exit( 1 ); } iov.iov_base = rbuf; iov.iov_len = sizeof( rbuf ); atpb.atp_rresiov = &iov; atpb.atp_rresiovcnt = 1; if ( atp_rresp( atp, &atpb ) < 0 ) { perror( "atp_rresp" ); exit( 1 ); } /* sanity */ if ( iov.iov_len < 8 || rbuf[ 1 ] != PAP_STATUS ) { fprintf( stderr, "Bad response!\n" ); return; /* This is weird, since TIDs must match... */ } printf( "%.*s\n", (int)iov.iov_len - 9, (char *) iov.iov_base + 9 ); } netatalk-2.2.2/bin/Makefile.in0000644000175200017500000004163011703521722013064 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for bin/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @USE_APPLETALK_TRUE@am__append_1 = aecho getzones nbp pap psorder @HAVE_ATFUNCS_TRUE@am__append_2 = ad subdir = bin DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = adv1tov2 afppasswd cnid megatron uniconv misc aecho \ getzones nbp pap psorder ad DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = adv1tov2 afppasswd cnid megatron uniconv misc \ $(am__append_1) $(am__append_2) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bin/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign bin/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/bin/nbp/0000777000175200017500000000000011704770424011664 500000000000000netatalk-2.2.2/bin/nbp/Makefile.am0000644000175200017500000000060111655731126013632 00000000000000# Makefile.am for bin/nbp/ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys bin_PROGRAMS = nbplkup nbprgstr nbpunrgstr nbplkup_SOURCES = nbplkup.c nbplkup_LDADD = $(top_builddir)/libatalk/libatalk.la nbprgstr_SOURCES = nbprgstr.c nbprgstr_LDADD = $(top_builddir)/libatalk/libatalk.la nbpunrgstr_SOURCES = nbpunrgstr.c nbpunrgstr_LDADD = $(top_builddir)/libatalk/libatalk.la netatalk-2.2.2/bin/nbp/Makefile.in0000644000175200017500000004317511703521723013652 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for bin/nbp/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = nbplkup$(EXEEXT) nbprgstr$(EXEEXT) nbpunrgstr$(EXEEXT) subdir = bin/nbp DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_nbplkup_OBJECTS = nbplkup.$(OBJEXT) nbplkup_OBJECTS = $(am_nbplkup_OBJECTS) nbplkup_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la am_nbprgstr_OBJECTS = nbprgstr.$(OBJEXT) nbprgstr_OBJECTS = $(am_nbprgstr_OBJECTS) nbprgstr_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la am_nbpunrgstr_OBJECTS = nbpunrgstr.$(OBJEXT) nbpunrgstr_OBJECTS = $(am_nbpunrgstr_OBJECTS) nbpunrgstr_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(nbplkup_SOURCES) $(nbprgstr_SOURCES) $(nbpunrgstr_SOURCES) DIST_SOURCES = $(nbplkup_SOURCES) $(nbprgstr_SOURCES) \ $(nbpunrgstr_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys nbplkup_SOURCES = nbplkup.c nbplkup_LDADD = $(top_builddir)/libatalk/libatalk.la nbprgstr_SOURCES = nbprgstr.c nbprgstr_LDADD = $(top_builddir)/libatalk/libatalk.la nbpunrgstr_SOURCES = nbpunrgstr.c nbpunrgstr_LDADD = $(top_builddir)/libatalk/libatalk.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bin/nbp/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign bin/nbp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done nbplkup$(EXEEXT): $(nbplkup_OBJECTS) $(nbplkup_DEPENDENCIES) @rm -f nbplkup$(EXEEXT) $(LINK) $(nbplkup_OBJECTS) $(nbplkup_LDADD) $(LIBS) nbprgstr$(EXEEXT): $(nbprgstr_OBJECTS) $(nbprgstr_DEPENDENCIES) @rm -f nbprgstr$(EXEEXT) $(LINK) $(nbprgstr_OBJECTS) $(nbprgstr_LDADD) $(LIBS) nbpunrgstr$(EXEEXT): $(nbpunrgstr_OBJECTS) $(nbpunrgstr_DEPENDENCIES) @rm -f nbpunrgstr$(EXEEXT) $(LINK) $(nbpunrgstr_OBJECTS) $(nbpunrgstr_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbplkup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbprgstr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbpunrgstr.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/bin/nbp/nbplkup.c0000644000175200017500000001051511655731126013422 00000000000000/* * $Id: nbplkup.c,v 1.9 2009-10-29 11:35:57 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #ifdef HAVE_STDLIB_H #include #endif #include static char *Obj = "="; static char *Type = "="; static char *Zone = "*"; static void Usage(char *av0) { char *p; if (( p = strrchr( av0, '/' )) == NULL ) { p = av0; } else { p++; } printf( "Usage:\t%s [ -A address ] [ -r responses] [-m Mac charset] [ obj:type@zone ]\n", p ); exit( 1 ); } int main(int ac, char **av) { struct nbpnve *nn; char *name; int i, c, nresp = 1000; struct at_addr addr; char *obj = NULL; size_t obj_len; charset_t chMac = CH_MAC; char * convname; extern char *optarg; extern int optind; memset(&addr, 0, sizeof(addr)); while (( c = getopt( ac, av, "r:A:m:" )) != EOF ) { switch ( c ) { case 'A': if (!atalk_aton(optarg, &addr)) { fprintf(stderr, "Bad address.\n"); exit(1); } break; case 'r' : nresp = atoi( optarg ); break; case 'm': if ((charset_t)-1 == (chMac = add_charset(optarg)) ) { fprintf(stderr, "Invalid Mac charset.\n"); exit(1); } break; default : Usage( av[ 0 ] ); exit( 1 ); } } if (( nn = (struct nbpnve *)malloc( nresp * sizeof( struct nbpnve ))) == NULL ) { perror( "malloc" ); exit( 1 ); } if ( ac - optind > 1 ) { Usage( av[ 0 ] ); exit( 1 ); } /* * Get default values from the environment. We need to copy out * the results, here, since nbp_name returns it's parameters * in static space, and we'll clobber them when we call it again * later. */ if (( name = getenv( "NBPLKUP" )) != NULL ) { if ( nbp_name( name, &Obj, &Type, &Zone )) { fprintf( stderr, "Environment variable syntax error: NBPLKUP = %s\n", name ); exit( 1 ); } if (( name = (char *)malloc( strlen( Obj ) + 1 )) == NULL ) { perror( "malloc" ); exit( 1 ); } strcpy( name, Obj ); Obj = name; if (( name = (char *)malloc( strlen( Type ) + 1 )) == NULL ) { perror( "malloc" ); exit( 1 ); } strcpy( name, Type ); Type = name; if (( name = (char *)malloc( strlen( Zone ) + 1 )) == NULL ) { perror( "malloc" ); exit( 1 ); } strcpy( name, Zone ); Zone = name; } if ( ac - optind == 1 ) { if ((size_t)(-1) == convert_string_allocate( CH_UNIX, chMac, av[ optind ], -1, &convname)) convname = av[ optind ]; if ( nbp_name( convname, &Obj, &Type, &Zone )) { Usage( av[ 0 ] ); exit( 1 ); } } if (( c = nbp_lookup( Obj, Type, Zone, nn, nresp, &addr)) < 0 ) { perror( "nbp_lookup" ); exit( -1 ); } for ( i = 0; i < c; i++ ) { if ((size_t)(-1) == (obj_len = convert_string_allocate( chMac, CH_UNIX, nn[ i ].nn_obj, nn[ i ].nn_objlen, &obj)) ) { obj_len = nn[ i ].nn_objlen; if (( obj = strdup(nn[ i ].nn_obj)) == NULL ) { perror( "strdup" ); exit( 1 ); } } printf( "%31.*s:%-34.*s %u.%u:%u\n", (int)obj_len, obj, nn[ i ].nn_typelen, nn[ i ].nn_type, ntohs( nn[ i ].nn_sat.sat_addr.s_net ), nn[ i ].nn_sat.sat_addr.s_node, nn[ i ].nn_sat.sat_port ); free(obj); } free(nn); return 0; } netatalk-2.2.2/bin/nbp/nbprgstr.c0000644000175200017500000000452711655731126013616 00000000000000/* * $Id: nbprgstr.c,v 1.9 2009-10-29 11:35:58 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include static void Usage(char *av0) { char *p; if (( p = strrchr( av0, '/' )) == NULL ) { p = av0; } else { p++; } fprintf( stderr, "Usage: %s [ -A address ] [-m Mac charset] [ -p port] obj:type@zone\n", p ); exit( 1 ); } int main(int ac, char **av) { struct sockaddr_at addr; struct at_addr ataddr; char *Obj = NULL, *Type = NULL, *Zone = NULL; char *convname = NULL; int s, c, port = 0; charset_t chMac = CH_MAC; extern char *optarg; extern int optind; memset(&ataddr, 0, sizeof(ataddr)); while (( c = getopt( ac, av, "p:A:m:" )) != EOF ) { switch ( c ) { case 'A': if (!atalk_aton(optarg, &ataddr)) { fprintf(stderr, "Bad address.\n"); exit(1); } break; case 'm': if ((charset_t)-1 == (chMac = add_charset(optarg)) ) { fprintf(stderr, "Invalid Mac charset.\n"); exit(1); } break; case 'p' : port = atoi( optarg ); break; default : Usage( av[ 0 ] ); } } if ( ac - optind != 1 ) { Usage( av[ 0 ] ); } /* Convert the name */ if ((size_t)(-1) == convert_string_allocate(CH_UNIX, chMac, av[optind], -1, &convname)) convname = av[optind]; /* * Get the name. If Type or Obj aren't specified, error. */ if ( nbp_name( convname, &Obj, &Type, &Zone ) || !Obj || !Type ) { Usage( av[ 0 ] ); } memset(&addr, 0, sizeof(addr)); memcpy(&addr.sat_addr, &ataddr, sizeof(addr.sat_addr)); if ((s = netddp_open(&addr, NULL)) < 0) return( -1 ); if ( port ) { addr.sat_port = port; } if ( nbp_rgstr( &addr, Obj, Type, Zone ) < 0 ) { perror( "nbp_rgstr" ); fprintf( stderr, "Can't register %s:%s@%s\n", Obj, Type, Zone ? Zone : "*" ); exit( 1 ); } netddp_close(s); return 0; } netatalk-2.2.2/bin/nbp/nbpunrgstr.c0000644000175200017500000000533611655731126014160 00000000000000/* * $Id: nbpunrgstr.c,v 1.10 2009-10-29 11:35:58 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #include #include static void Usage(char *av0) { char *p; if (( p = strrchr( av0, '/' )) == NULL ) { p = av0; } else { p++; } fprintf( stderr, "Usage: %s [ -A address ] [ -m Mac charset] obj:type@zone\n", p ); exit( 1 ); } int main(int ac, char **av) { char *Obj = NULL, *Type = NULL, *Zone = NULL; char *convname = NULL; struct at_addr addr; int c; charset_t chMac = CH_MAC; extern char *optarg; extern int optind; memset(&addr, 0, sizeof(addr)); while ((c = getopt(ac, av, "A:m:")) != EOF) { switch (c) { case 'A': if (!atalk_aton(optarg, &addr)) { fprintf(stderr, "Bad address.\n"); exit(1); } break; case 'm': if ((charset_t)-1 == (chMac = add_charset(optarg)) ) { fprintf(stderr, "Invalid Mac charset.\n"); exit(1); } break; default: Usage(av[0]); break; } } if (ac - optind != 1) { Usage( av[ 0 ] ); } /* Convert the name */ if ((size_t)(-1) == convert_string_allocate(CH_UNIX, chMac, av[optind], -1, &convname)) convname = av[optind]; /* * Get the name. If Type or Obj aren't specified, error. */ if ( nbp_name( convname, &Obj, &Type, &Zone ) || !Obj || !Type ) { Usage( av[ 0 ] ); } if ( nbp_unrgstr( Obj, Type, Zone, &addr ) < 0 ) { fprintf( stderr, "Can't unregister %s:%s@%s\n", Obj, Type, Zone ? Zone : "*" ); exit( 1 ); } return 0; } netatalk-2.2.2/bin/afppasswd/0000777000175200017500000000000011704770423013074 500000000000000netatalk-2.2.2/bin/afppasswd/Makefile.am0000644000175200017500000000063111655731126015046 00000000000000# Makefile.am for bin/afppasswd/ pkgconfdir = @PKGCONFDIR@ if HAVE_OPENSSL bin_PROGRAMS = afppasswd else bin_PROGRAMS = endif afppasswd_SOURCES = afppasswd.c afppasswd_LDADD = $(top_builddir)/libatalk/libatalk.la @SSL_LIBS@ AM_CFLAGS = @SSL_CFLAGS@ -I$(top_srcdir)/sys \ -D_PATH_AFPDPWFILE=\"$(pkgconfdir)/afppasswd\" install-exec-hook: if HAVE_OPENSSL chmod u+s $(DESTDIR)$(bindir)/afppasswd endif netatalk-2.2.2/bin/afppasswd/Makefile.in0000644000175200017500000004166711703521723015067 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for bin/afppasswd/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @HAVE_OPENSSL_TRUE@bin_PROGRAMS = afppasswd$(EXEEXT) subdir = bin/afppasswd DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_afppasswd_OBJECTS = afppasswd.$(OBJEXT) afppasswd_OBJECTS = $(am_afppasswd_OBJECTS) afppasswd_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(afppasswd_SOURCES) DIST_SOURCES = $(afppasswd_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgconfdir = @PKGCONFDIR@ afppasswd_SOURCES = afppasswd.c afppasswd_LDADD = $(top_builddir)/libatalk/libatalk.la @SSL_LIBS@ AM_CFLAGS = @SSL_CFLAGS@ -I$(top_srcdir)/sys \ -D_PATH_AFPDPWFILE=\"$(pkgconfdir)/afppasswd\" all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bin/afppasswd/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign bin/afppasswd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done afppasswd$(EXEEXT): $(afppasswd_OBJECTS) $(afppasswd_DEPENDENCIES) @rm -f afppasswd$(EXEEXT) $(LINK) $(afppasswd_OBJECTS) $(afppasswd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afppasswd.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS install-exec-hook: @HAVE_OPENSSL_TRUE@ chmod u+s $(DESTDIR)$(bindir)/afppasswd # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/bin/afppasswd/afppasswd.c0000644000175200017500000002276311655731243015160 00000000000000/* * Copyright 1999 (c) Adrian Sun (asun@u.washington.edu) * All Rights Reserved. See COPYRIGHT. * * format of the password file: * name:****************:****************:******** * password last login date failed usage count * * ***'s are illegal. they're just place holders for hex values. hex * values that represent actual numbers are in network byte order. * * last login date is currently a 4-byte number representing seconds * since 1970 (UTC). there's enough space to extend it to 8 bytes. * * the last two fields aren't currently used by the randnum uams. * * root syntax: afppasswd [-c] [-a] [-p path] [-f] [username] * user syntax: afppasswd */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #include #include #ifdef USE_CRACKLIB #include #endif /* USE_CRACKLIB */ #define OPT_ISROOT (1 << 0) #define OPT_CREATE (1 << 1) #define OPT_FORCE (1 << 2) #define OPT_ADDUSER (1 << 3) #define OPT_NOCRACK (1 << 4) #define PASSWD_ILLEGAL '*' #define FORMAT ":****************:****************:********\n" #define FORMAT_LEN 44 #define OPTIONS "cafnu:p:" #define UID_START 100 #define HEXPASSWDLEN 16 #define PASSWDLEN 8 static char buf[MAXPATHLEN + 1]; /* if newpwd is null, convert buf from hex to binary. if newpwd isn't * null, convert newpwd to hex and save it in buf. */ #define unhex(x) (isdigit(x) ? (x) - '0' : toupper(x) + 10 - 'A') static void convert_passwd(char *buf, char *newpwd, const int keyfd) { u_int8_t key[HEXPASSWDLEN]; Key_schedule schedule; unsigned int i, j; if (!newpwd) { /* convert to binary */ for (i = j = 0; i < sizeof(key); i += 2, j++) buf[j] = (unhex(buf[i]) << 4) | unhex(buf[i + 1]); if (j <= DES_KEY_SZ) memset(buf + j, 0, sizeof(key) - j); } if (keyfd > -1) { lseek(keyfd, 0, SEEK_SET); read(keyfd, key, sizeof(key)); /* convert to binary */ for (i = j = 0; i < sizeof(key); i += 2, j++) key[j] = (unhex(key[i]) << 4) | unhex(key[i + 1]); if (j <= DES_KEY_SZ) memset(key + j, 0, sizeof(key) - j); key_sched((C_Block *) key, schedule); memset(key, 0, sizeof(key)); if (newpwd) { ecb_encrypt((C_Block *) newpwd, (C_Block *) newpwd, schedule, DES_ENCRYPT); } else { /* decrypt the password */ ecb_encrypt((C_Block *) buf, (C_Block *) buf, schedule, DES_DECRYPT); } memset(&schedule, 0, sizeof(schedule)); } if (newpwd) { const unsigned char hextable[] = "0123456789ABCDEF"; /* convert to hex */ for (i = j = 0; i < DES_KEY_SZ; i++, j += 2) { buf[j] = hextable[(newpwd[i] & 0xF0) >> 4]; buf[j + 1] = hextable[newpwd[i] & 0x0F]; } } } /* this matches the code in uam_randnum.c */ static int update_passwd(const char *path, const char *name, int flags) { char password[PASSWDLEN + 1], *p, *passwd; FILE *fp; off_t pos; int keyfd = -1, err = 0; if ((fp = fopen(path, "r+")) == NULL) { fprintf(stderr, "afppasswd: can't open %s\n", path); return -1; } /* open the key file if it exists */ strcpy(buf, path); if (strlen(path) < sizeof(buf) - 5) { strcat(buf, ".key"); keyfd = open(buf, O_RDONLY); } pos = ftell(fp); memset(buf, 0, sizeof(buf)); while (fgets(buf, sizeof(buf), fp)) { if ((p = strchr(buf, ':'))) { /* check for a match */ if (strlen(name) == (p - buf) && strncmp(buf, name, p - buf) == 0) { p++; if (!(flags & OPT_ISROOT) && (*p == PASSWD_ILLEGAL)) { fprintf(stderr, "Your password is disabled. Please see your administrator.\n"); break; } goto found_entry; } } pos = ftell(fp); memset(buf, 0, sizeof(buf)); } if (flags & OPT_ADDUSER) { strcpy(buf, name); strcat(buf, FORMAT); p = strchr(buf, ':') + 1; fwrite(buf, strlen(buf), 1, fp); } else { fprintf(stderr, "afppasswd: can't find %s in %s\n", name, path); err = -1; goto update_done; } found_entry: /* need to verify against old password */ if ((flags & OPT_ISROOT) == 0) { passwd = getpass("Enter OLD AFP password: "); convert_passwd(p, NULL, keyfd); if (strncmp(passwd, p, PASSWDLEN)) { fprintf(stderr, "afppasswd: invalid password.\n"); err = -1; goto update_done; } } /* new password */ passwd = getpass("Enter NEW AFP password: "); memcpy(password, passwd, sizeof(password)); password[PASSWDLEN] = '\0'; #ifdef USE_CRACKLIB if (!(flags & OPT_NOCRACK)) { if (passwd = FascistCheck(password, _PATH_CRACKLIB)) { fprintf(stderr, "Error: %s\n", passwd); err = -1; goto update_done; } } #endif /* USE_CRACKLIB */ passwd = getpass("Enter NEW AFP password again: "); if (strcmp(passwd, password) == 0) { struct flock lock; int fd = fileno(fp); convert_passwd(p, password, keyfd); lock.l_type = F_WRLCK; lock.l_start = pos; lock.l_len = 1; lock.l_whence = SEEK_SET; fseek(fp, pos, SEEK_SET); fcntl(fd, F_SETLKW, &lock); fwrite(buf, p - buf + HEXPASSWDLEN, 1, fp); lock.l_type = F_UNLCK; fcntl(fd, F_SETLK, &lock); printf("afppasswd: updated password.\n"); } else { fprintf(stderr, "afppasswd: passwords don't match!\n"); err = -1; } update_done: if (keyfd > -1) close(keyfd); fclose(fp); return err; } /* creates a file with all the password entries */ static int create_file(const char *path, uid_t minuid) { struct passwd *pwd; int fd, len, err = 0; if ((fd = open(path, O_CREAT | O_TRUNC | O_RDWR, 0600)) < 0) { fprintf(stderr, "afppasswd: can't create %s\n", path); return -1; } setpwent(); while ((pwd = getpwent())) { if (pwd->pw_uid < minuid) continue; /* a little paranoia */ if (strlen(pwd->pw_name) + FORMAT_LEN > sizeof(buf) - 1) continue; strcpy(buf, pwd->pw_name); strcat(buf, FORMAT); len = strlen(buf); if (write(fd, buf, len) != len) { fprintf(stderr, "afppasswd: problem writing to %s: %s\n", path, strerror(errno)); err = -1; break; } } endpwent(); close(fd); return err; } int main(int argc, char **argv) { struct stat st; int flags; uid_t uid_min = UID_START, uid; char *path = _PATH_AFPDPWFILE; int i, err = 0; extern char *optarg; extern int optind; flags = ((uid = getuid()) == 0) ? OPT_ISROOT : 0; if (((flags & OPT_ISROOT) == 0) && (argc > 1)) { fprintf(stderr, "afppasswd (Netatalk %s)\n", VERSION); fprintf(stderr, "Usage: afppasswd [-acfn] [-u minuid] [-p path] [username]\n"); fprintf(stderr, " -a add a new user\n"); fprintf(stderr, " -c create and initialize password file or specific user\n"); fprintf(stderr, " -f force an action\n"); #ifdef USE_CRACKLIB fprintf(stderr, " -n disable cracklib checking of passwords\n"); #endif /* USE_CRACKLIB */ fprintf(stderr, " -u uid minimum uid to use, defaults to 100\n"); fprintf(stderr, " -p path path to afppasswd file\n"); return -1; } while ((i = getopt(argc, argv, OPTIONS)) != EOF) { switch (i) { case 'c': /* create and initialize password file or specific user */ flags |= OPT_CREATE; break; case 'a': /* add a new user */ flags |= OPT_ADDUSER; break; case 'f': /* force an action */ flags |= OPT_FORCE; break; case 'u': /* minimum uid to use. default is 100 */ uid_min = atoi(optarg); break; #ifdef USE_CRACKLIB case 'n': /* disable CRACKLIB check */ flags |= OPT_NOCRACK; break; #endif /* USE_CRACKLIB */ case 'p': /* path to afppasswd file */ path = optarg; break; default: err++; break; } } if (err || (optind + ((flags & OPT_CREATE) ? 0 : (flags & OPT_ISROOT)) != argc)) { #ifdef USE_CRACKLIB fprintf(stderr, "Usage: afppasswd [-acfn] [-u minuid] [-p path] [username]\n"); #else /* USE_CRACKLIB */ fprintf(stderr, "Usage: afppasswd [-acf] [-u minuid] [-p path] [username]\n"); #endif /* USE_CRACKLIB */ fprintf(stderr, " -a add a new user\n"); fprintf(stderr, " -c create and initialize password file or specific user\n"); fprintf(stderr, " -f force an action\n"); #ifdef USE_CRACKLIB fprintf(stderr, " -n disable cracklib checking of passwords\n"); #endif /* USE_CRACKLIB */ fprintf(stderr, " -u uid minimum uid to use, defaults to 100\n"); fprintf(stderr, " -p path path to afppasswd file\n"); return -1; } i = stat(path, &st); if (flags & OPT_CREATE) { if ((flags & OPT_ISROOT) == 0) { fprintf(stderr, "afppasswd: only root can create the password file.\n"); return -1; } if (!i && ((flags & OPT_FORCE) == 0)) { fprintf(stderr, "afppasswd: password file already exists.\n"); return -1; } return create_file(path, uid_min); } else { struct passwd *pwd = NULL; if (i < 0) { fprintf(stderr, "afppasswd: %s doesn't exist.\n", path); return -1; } /* if we're root, we need to specify the username */ pwd = (flags & OPT_ISROOT) ? getpwnam(argv[optind]) : getpwuid(uid); if (pwd) return update_passwd(path, pwd->pw_name, flags); fprintf(stderr, "afppasswd: can't get password entry.\n"); return -1; } } netatalk-2.2.2/bin/ad/0000777000175200017500000000000011704770424011471 500000000000000netatalk-2.2.2/bin/ad/ad.c0000644000175200017500000000363611655731243012146 00000000000000/* Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ad.h" static void usage_main(void) { printf("Usage: ad ls|cp|rm|mv|find [file|dir, ...]\n"); printf(" ad -v|--version\n"); } static void show_version(void) { printf("ad (Netatalk %s)\n", VERSION); } int main(int argc, char **argv) { setuplog("default log_note /dev/tty"); if (argc < 2) { usage_main(); return 1; } if (STRCMP(argv[1], ==, "ls")) return ad_ls(argc - 1, argv + 1); else if (STRCMP(argv[1], ==, "cp")) return ad_cp(argc - 1, argv + 1); else if (STRCMP(argv[1], ==, "rm")) return ad_rm(argc - 1, argv + 1); else if (STRCMP(argv[1], ==, "mv")) return ad_mv(argc, argv); else if (STRCMP(argv[1], ==, "find")) return ad_find(argc, argv); else if (STRCMP(argv[1], ==, "-v")) { show_version(); return 1; } else if (STRCMP(argv[1], ==, "--version")) { show_version(); return 1; } else { usage_main(); return 1; } return 0; } netatalk-2.2.2/bin/ad/Makefile.am0000644000175200017500000000051111655731126013437 00000000000000# Makefile.am for bin/ad/ noinst_HEADERS = ad.h if USE_BDB bin_PROGRAMS = ad ad_SOURCES = \ ad.c \ ad_find.c \ ad_util.c \ ad_ls.c \ ad_cp.c \ ad_mv.c \ ad_rm.c ad_CFLAGS = -D_PATH_AD=\"$(bindir)/ad\" ad_LDADD = \ $(top_builddir)/libatalk/cnid/libcnid.la \ $(top_builddir)/libatalk/libatalk.la \ @ACL_LIBS@ endif netatalk-2.2.2/bin/ad/Makefile.in0000644000175200017500000007020211703521723013446 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for bin/ad/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @USE_BDB_TRUE@bin_PROGRAMS = ad$(EXEEXT) subdir = bin/ad DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am__ad_SOURCES_DIST = ad.c ad_find.c ad_util.c ad_ls.c ad_cp.c ad_mv.c \ ad_rm.c @USE_BDB_TRUE@am_ad_OBJECTS = ad-ad.$(OBJEXT) ad-ad_find.$(OBJEXT) \ @USE_BDB_TRUE@ ad-ad_util.$(OBJEXT) ad-ad_ls.$(OBJEXT) \ @USE_BDB_TRUE@ ad-ad_cp.$(OBJEXT) ad-ad_mv.$(OBJEXT) \ @USE_BDB_TRUE@ ad-ad_rm.$(OBJEXT) ad_OBJECTS = $(am_ad_OBJECTS) @USE_BDB_TRUE@ad_DEPENDENCIES = \ @USE_BDB_TRUE@ $(top_builddir)/libatalk/cnid/libcnid.la \ @USE_BDB_TRUE@ $(top_builddir)/libatalk/libatalk.la ad_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(ad_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(ad_SOURCES) DIST_SOURCES = $(am__ad_SOURCES_DIST) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = ad.h @USE_BDB_TRUE@ad_SOURCES = \ @USE_BDB_TRUE@ ad.c \ @USE_BDB_TRUE@ ad_find.c \ @USE_BDB_TRUE@ ad_util.c \ @USE_BDB_TRUE@ ad_ls.c \ @USE_BDB_TRUE@ ad_cp.c \ @USE_BDB_TRUE@ ad_mv.c \ @USE_BDB_TRUE@ ad_rm.c @USE_BDB_TRUE@ad_CFLAGS = -D_PATH_AD=\"$(bindir)/ad\" @USE_BDB_TRUE@ad_LDADD = \ @USE_BDB_TRUE@ $(top_builddir)/libatalk/cnid/libcnid.la \ @USE_BDB_TRUE@ $(top_builddir)/libatalk/libatalk.la \ @USE_BDB_TRUE@ @ACL_LIBS@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bin/ad/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign bin/ad/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done ad$(EXEEXT): $(ad_OBJECTS) $(ad_DEPENDENCIES) @rm -f ad$(EXEEXT) $(ad_LINK) $(ad_OBJECTS) $(ad_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad-ad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad-ad_cp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad-ad_find.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad-ad_ls.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad-ad_mv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad-ad_rm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad-ad_util.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< ad-ad.o: ad.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -MT ad-ad.o -MD -MP -MF $(DEPDIR)/ad-ad.Tpo -c -o ad-ad.o `test -f 'ad.c' || echo '$(srcdir)/'`ad.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ad-ad.Tpo $(DEPDIR)/ad-ad.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ad.c' object='ad-ad.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -c -o ad-ad.o `test -f 'ad.c' || echo '$(srcdir)/'`ad.c ad-ad.obj: ad.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -MT ad-ad.obj -MD -MP -MF $(DEPDIR)/ad-ad.Tpo -c -o ad-ad.obj `if test -f 'ad.c'; then $(CYGPATH_W) 'ad.c'; else $(CYGPATH_W) '$(srcdir)/ad.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ad-ad.Tpo $(DEPDIR)/ad-ad.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ad.c' object='ad-ad.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -c -o ad-ad.obj `if test -f 'ad.c'; then $(CYGPATH_W) 'ad.c'; else $(CYGPATH_W) '$(srcdir)/ad.c'; fi` ad-ad_find.o: ad_find.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -MT ad-ad_find.o -MD -MP -MF $(DEPDIR)/ad-ad_find.Tpo -c -o ad-ad_find.o `test -f 'ad_find.c' || echo '$(srcdir)/'`ad_find.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ad-ad_find.Tpo $(DEPDIR)/ad-ad_find.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ad_find.c' object='ad-ad_find.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -c -o ad-ad_find.o `test -f 'ad_find.c' || echo '$(srcdir)/'`ad_find.c ad-ad_find.obj: ad_find.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -MT ad-ad_find.obj -MD -MP -MF $(DEPDIR)/ad-ad_find.Tpo -c -o ad-ad_find.obj `if test -f 'ad_find.c'; then $(CYGPATH_W) 'ad_find.c'; else $(CYGPATH_W) '$(srcdir)/ad_find.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ad-ad_find.Tpo $(DEPDIR)/ad-ad_find.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ad_find.c' object='ad-ad_find.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -c -o ad-ad_find.obj `if test -f 'ad_find.c'; then $(CYGPATH_W) 'ad_find.c'; else $(CYGPATH_W) '$(srcdir)/ad_find.c'; fi` ad-ad_util.o: ad_util.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -MT ad-ad_util.o -MD -MP -MF $(DEPDIR)/ad-ad_util.Tpo -c -o ad-ad_util.o `test -f 'ad_util.c' || echo '$(srcdir)/'`ad_util.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ad-ad_util.Tpo $(DEPDIR)/ad-ad_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ad_util.c' object='ad-ad_util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -c -o ad-ad_util.o `test -f 'ad_util.c' || echo '$(srcdir)/'`ad_util.c ad-ad_util.obj: ad_util.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -MT ad-ad_util.obj -MD -MP -MF $(DEPDIR)/ad-ad_util.Tpo -c -o ad-ad_util.obj `if test -f 'ad_util.c'; then $(CYGPATH_W) 'ad_util.c'; else $(CYGPATH_W) '$(srcdir)/ad_util.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ad-ad_util.Tpo $(DEPDIR)/ad-ad_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ad_util.c' object='ad-ad_util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -c -o ad-ad_util.obj `if test -f 'ad_util.c'; then $(CYGPATH_W) 'ad_util.c'; else $(CYGPATH_W) '$(srcdir)/ad_util.c'; fi` ad-ad_ls.o: ad_ls.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -MT ad-ad_ls.o -MD -MP -MF $(DEPDIR)/ad-ad_ls.Tpo -c -o ad-ad_ls.o `test -f 'ad_ls.c' || echo '$(srcdir)/'`ad_ls.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ad-ad_ls.Tpo $(DEPDIR)/ad-ad_ls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ad_ls.c' object='ad-ad_ls.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -c -o ad-ad_ls.o `test -f 'ad_ls.c' || echo '$(srcdir)/'`ad_ls.c ad-ad_ls.obj: ad_ls.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -MT ad-ad_ls.obj -MD -MP -MF $(DEPDIR)/ad-ad_ls.Tpo -c -o ad-ad_ls.obj `if test -f 'ad_ls.c'; then $(CYGPATH_W) 'ad_ls.c'; else $(CYGPATH_W) '$(srcdir)/ad_ls.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ad-ad_ls.Tpo $(DEPDIR)/ad-ad_ls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ad_ls.c' object='ad-ad_ls.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -c -o ad-ad_ls.obj `if test -f 'ad_ls.c'; then $(CYGPATH_W) 'ad_ls.c'; else $(CYGPATH_W) '$(srcdir)/ad_ls.c'; fi` ad-ad_cp.o: ad_cp.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -MT ad-ad_cp.o -MD -MP -MF $(DEPDIR)/ad-ad_cp.Tpo -c -o ad-ad_cp.o `test -f 'ad_cp.c' || echo '$(srcdir)/'`ad_cp.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ad-ad_cp.Tpo $(DEPDIR)/ad-ad_cp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ad_cp.c' object='ad-ad_cp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -c -o ad-ad_cp.o `test -f 'ad_cp.c' || echo '$(srcdir)/'`ad_cp.c ad-ad_cp.obj: ad_cp.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -MT ad-ad_cp.obj -MD -MP -MF $(DEPDIR)/ad-ad_cp.Tpo -c -o ad-ad_cp.obj `if test -f 'ad_cp.c'; then $(CYGPATH_W) 'ad_cp.c'; else $(CYGPATH_W) '$(srcdir)/ad_cp.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ad-ad_cp.Tpo $(DEPDIR)/ad-ad_cp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ad_cp.c' object='ad-ad_cp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -c -o ad-ad_cp.obj `if test -f 'ad_cp.c'; then $(CYGPATH_W) 'ad_cp.c'; else $(CYGPATH_W) '$(srcdir)/ad_cp.c'; fi` ad-ad_mv.o: ad_mv.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -MT ad-ad_mv.o -MD -MP -MF $(DEPDIR)/ad-ad_mv.Tpo -c -o ad-ad_mv.o `test -f 'ad_mv.c' || echo '$(srcdir)/'`ad_mv.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ad-ad_mv.Tpo $(DEPDIR)/ad-ad_mv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ad_mv.c' object='ad-ad_mv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -c -o ad-ad_mv.o `test -f 'ad_mv.c' || echo '$(srcdir)/'`ad_mv.c ad-ad_mv.obj: ad_mv.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -MT ad-ad_mv.obj -MD -MP -MF $(DEPDIR)/ad-ad_mv.Tpo -c -o ad-ad_mv.obj `if test -f 'ad_mv.c'; then $(CYGPATH_W) 'ad_mv.c'; else $(CYGPATH_W) '$(srcdir)/ad_mv.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ad-ad_mv.Tpo $(DEPDIR)/ad-ad_mv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ad_mv.c' object='ad-ad_mv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -c -o ad-ad_mv.obj `if test -f 'ad_mv.c'; then $(CYGPATH_W) 'ad_mv.c'; else $(CYGPATH_W) '$(srcdir)/ad_mv.c'; fi` ad-ad_rm.o: ad_rm.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -MT ad-ad_rm.o -MD -MP -MF $(DEPDIR)/ad-ad_rm.Tpo -c -o ad-ad_rm.o `test -f 'ad_rm.c' || echo '$(srcdir)/'`ad_rm.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ad-ad_rm.Tpo $(DEPDIR)/ad-ad_rm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ad_rm.c' object='ad-ad_rm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -c -o ad-ad_rm.o `test -f 'ad_rm.c' || echo '$(srcdir)/'`ad_rm.c ad-ad_rm.obj: ad_rm.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -MT ad-ad_rm.obj -MD -MP -MF $(DEPDIR)/ad-ad_rm.Tpo -c -o ad-ad_rm.obj `if test -f 'ad_rm.c'; then $(CYGPATH_W) 'ad_rm.c'; else $(CYGPATH_W) '$(srcdir)/ad_rm.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ad-ad_rm.Tpo $(DEPDIR)/ad-ad_rm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ad_rm.c' object='ad-ad_rm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ad_CFLAGS) $(CFLAGS) -c -o ad-ad_rm.obj `if test -f 'ad_rm.c'; then $(CYGPATH_W) 'ad_rm.c'; else $(CYGPATH_W) '$(srcdir)/ad_rm.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/bin/ad/ad_ls.c0000644000175200017500000003673511655731126012652 00000000000000/* Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ad.h" #define ADv2_DIRNAME ".AppleDouble" #define DIR_DOT_OR_DOTDOT(a) \ ((strcmp(a, ".") == 0) || (strcmp(a, "..") == 0)) static volatile sig_atomic_t alarmed; /* ls options */ static int ls_a; static int ls_l; static int ls_R; static int ls_d; static int ls_u; /* Used for pretty printing */ static int first = 1; static int recursion; static char *netatalk_dirs[] = { ADv2_DIRNAME, ".AppleDB", ".AppleDesktop", NULL }; static char *labels[] = { "---", "gry", "gre", "vio", "blu", "yel", "red", "ora" }; /* SIGNAL handling: catch SIGINT and SIGTERM which cause clean exit. Ignore anything else. */ static void sig_handler(int signo) { alarmed = 1; return; } static void set_signal(void) { struct sigaction sv; sv.sa_handler = sig_handler; sv.sa_flags = SA_RESTART; sigemptyset(&sv.sa_mask); if (sigaction(SIGTERM, &sv, NULL) < 0) ERROR("error in sigaction(SIGTERM): %s", strerror(errno)); if (sigaction(SIGINT, &sv, NULL) < 0) ERROR("error in sigaction(SIGINT): %s", strerror(errno)); memset(&sv, 0, sizeof(struct sigaction)); sv.sa_handler = SIG_IGN; sigemptyset(&sv.sa_mask); if (sigaction(SIGABRT, &sv, NULL) < 0) ERROR("error in sigaction(SIGABRT): %s", strerror(errno)); if (sigaction(SIGHUP, &sv, NULL) < 0) ERROR("error in sigaction(SIGHUP): %s", strerror(errno)); if (sigaction(SIGQUIT, &sv, NULL) < 0) ERROR("error in sigaction(SIGQUIT): %s", strerror(errno)); } /* Check for netatalk special folders e.g. ".AppleDB" or ".AppleDesktop" Returns pointer to name or NULL. */ static const char *check_netatalk_dirs(const char *name) { int c; for (c=0; netatalk_dirs[c]; c++) { if ((strcmp(name, netatalk_dirs[c])) == 0) return netatalk_dirs[c]; } return NULL; } static void usage_ls(void) { printf( "Usage: ad ls [-dRl[u]] [file|dir, ...]\n\n" " -l Long Output [-u: unix info]:\n" " \n\n" " FinderFlags (valid for (f)ile and/or (d)irectory):\n" " d = On Desktop (f/d)\n" " e = Hidden extension (f/d)\n" " m = Shared (can run multiple times) (f)\n" " n = No INIT resources (f)\n" " i = Inited (f/d)\n" " c = Custom icon (f/d)\n" " t = Stationery (f)\n" " s = Name locked (f/d)\n" " b = Bundle (f/d)\n" " v = Invisible (f/d)\n" " a = Alias file (f/d)\n\n" " AFPAttributes:\n" " y = System (f/d)\n" " w = No write (f)\n" " p = Needs backup (f/d)\n" " r = No rename (f/d)\n" " l = No delete (f/d)\n" " o = No copy (f)\n\n" " Note: any letter appearing in uppercase means the flag is set\n" " but it's a directory for which the flag is not allowed.\n" ); } static void print_numlinks(const struct stat *statp) { printf("%5ld", (long)statp->st_nlink); } static void print_owner(const struct stat *statp) { struct passwd *pwd = getpwuid(statp->st_uid); if (pwd == NULL) printf(" %-8ld", (long)statp->st_uid); else printf(" %-8s", pwd->pw_name); } static void print_group(const struct stat *statp) { struct group *grp = getgrgid(statp->st_gid); if (grp == NULL) printf(" %-8ld", (long)statp->st_gid); else printf(" %-8s", grp->gr_name); } static void print_size(const struct stat *statp) { switch (statp->st_mode & S_IFMT) { case S_IFCHR: case S_IFBLK: printf("%4u,%4u", (unsigned)(statp->st_rdev >> 8), (unsigned)(statp->st_rdev & 0xFF)); break; default: printf("%9lu", (unsigned long)statp->st_size); } } static void print_date(const struct stat *statp) { time_t now; double diff; char buf[100], *fmt; if (time(&now) == -1) { printf(" ????????????"); return; } diff = difftime(now, statp->st_mtime); if (diff < 0 || diff > 60 * 60 * 24 * 182.5) fmt = "%b %e %Y"; else fmt = "%b %e %H:%M"; strftime(buf, sizeof(buf), fmt, localtime(&statp->st_mtime)); printf(" %s", buf); } static void print_flags(char *path, afpvol_t *vol, const struct stat *st) { int adflags = 0; struct adouble ad; char *FinderInfo; uint16_t FinderFlags; uint16_t AFPattributes; char type[5] = "----"; char creator[5] = "----"; int i; uint32_t cnid; if (S_ISDIR(st->st_mode)) adflags = ADFLAGS_DIR; if (vol->volinfo.v_path == NULL) return; ad_init(&ad, vol->volinfo.v_adouble, vol->volinfo.v_ad_options); if ( ad_metadata(path, adflags, &ad) < 0 ) return; FinderInfo = ad_entry(&ad, ADEID_FINDERI); memcpy(&FinderFlags, FinderInfo + 8, 2); FinderFlags = ntohs(FinderFlags); memcpy(type, FinderInfo, 4); memcpy(creator, FinderInfo + 4, 4); ad_getattr(&ad, &AFPattributes); AFPattributes = ntohs(AFPattributes); /* Finder flags. Lowercase means valid, uppercase means invalid because object is a dir and flag is only valid for files. */ putchar(' '); if (FinderFlags & FINDERINFO_ISONDESK) putchar('d'); else putchar('-'); if (FinderFlags & FINDERINFO_HIDEEXT) putchar('e'); else putchar('-'); if (FinderFlags & FINDERINFO_ISHARED) { if (adflags & ADFLAGS_DIR) putchar('M'); else putchar('m'); } else putchar('-'); if (FinderFlags & FINDERINFO_HASNOINITS) { if (adflags & ADFLAGS_DIR) putchar('N'); else putchar('n'); } else putchar('-'); if (FinderFlags & FINDERINFO_HASBEENINITED) putchar('i'); else putchar('-'); if (FinderFlags & FINDERINFO_HASCUSTOMICON) putchar('c'); else putchar('-'); if (FinderFlags & FINDERINFO_ISSTATIONNERY) { if (adflags & ADFLAGS_DIR) putchar('T'); else putchar('t'); } else putchar('-'); if (FinderFlags & FINDERINFO_NAMELOCKED) putchar('s'); else putchar('-'); if (FinderFlags & FINDERINFO_HASBUNDLE) putchar('b'); else putchar('-'); if (FinderFlags & FINDERINFO_INVISIBLE) putchar('v'); else putchar('-'); if (FinderFlags & FINDERINFO_ISALIAS) putchar('a'); else putchar('-'); putchar(' '); /* AFP attributes */ if (AFPattributes & ATTRBIT_SYSTEM) putchar('y'); else putchar('-'); if (AFPattributes & ATTRBIT_NOWRITE) { if (adflags & ADFLAGS_DIR) putchar('W'); else putchar('w'); } else putchar('-'); if (AFPattributes & ATTRBIT_BACKUP) putchar('p'); else putchar('-'); if (AFPattributes & ATTRBIT_NORENAME) putchar('r'); else putchar('-'); if (AFPattributes & ATTRBIT_NODELETE) putchar('l'); else putchar('-'); if (AFPattributes & ATTRBIT_NOCOPY) { if (adflags & ADFLAGS_DIR) putchar('O'); else putchar('o'); } else putchar('-'); /* Color */ printf(" %s ", labels[(FinderFlags & FINDERINFO_COLOR) >> 1]); /* Type & Creator */ for(i=0; i<4; i++) { if (isalnum(type[i])) putchar(type[i]); else putchar('-'); } putchar(' '); for(i=0; i<4; i++) { if (isalnum(creator[i])) putchar(creator[i]); else putchar('-'); } putchar(' '); /* CNID */ cnid = ad_forcegetid(&ad); if (cnid) printf(" %10u ", ntohl(cnid)); else printf(" !ADVOL_CACHE "); ad_close_metadata(&ad); } #define TYPE(b) ((st->st_mode & (S_IFMT)) == (b)) #define MODE(b) ((st->st_mode & (b)) == (b)) static void print_mode(const struct stat *st) { if (TYPE(S_IFBLK)) putchar('b'); else if (TYPE(S_IFCHR)) putchar('c'); else if (TYPE(S_IFDIR)) putchar('d'); else if (TYPE(S_IFIFO)) putchar('p'); else if (TYPE(S_IFREG)) putchar('-'); else if (TYPE(S_IFLNK)) putchar('l'); else if (TYPE(S_IFSOCK)) putchar('s'); else putchar('?'); putchar(MODE(S_IRUSR) ? 'r' : '-'); putchar(MODE(S_IWUSR) ? 'w' : '-'); if (MODE(S_ISUID)) { if (MODE(S_IXUSR)) putchar('s'); else putchar('S'); } else if (MODE(S_IXUSR)) putchar('x'); else putchar('-'); putchar(MODE(S_IRGRP) ? 'r' : '-'); putchar(MODE(S_IWGRP) ? 'w' : '-'); if (MODE(S_ISGID)) { if (MODE(S_IXGRP)) putchar('s'); else putchar('S'); } else if (MODE(S_IXGRP)) putchar('x'); else putchar('-'); putchar(MODE(S_IROTH) ? 'r' : '-'); putchar(MODE(S_IWOTH) ? 'w' : '-'); if (MODE(S_IFDIR) && MODE(S_ISVTX)) { if (MODE(S_IXOTH)) putchar('t'); else putchar('T'); } else if (MODE(S_IXOTH)) putchar('x'); else putchar('-'); } #undef TYPE #undef MODE static int ad_print(char *path, const struct stat *st, afpvol_t *vol) { if ( ! ls_l) { printf("%s ", path); if (ls_d) printf("\n"); return 0; } /* Long output */ if (ls_u) { print_mode(st); print_numlinks(st); print_owner(st); print_group(st); print_size(st); print_date(st); } print_flags(path, vol, st); printf(" %s\n", path); return 0; } static int ad_ls_r(char *path, afpvol_t *vol) { int ret = 0, cwd, dirprinted = 0, dirempty; const char *name; char *tmp; static char cwdpath[MAXPATHLEN+1]; DIR *dp; struct dirent *ep; static struct stat st; /* Save some stack space */ if ( first) cwdpath[0] = 0; else strcat(cwdpath, "/"); strcat(cwdpath, path); first = 0; if (lstat(path, &st) < 0) { perror("Can't stat"); return -1; } /* If its a file or a dir with -d option call ad_print and return */ if (S_ISREG(st.st_mode) || ls_d) return ad_print(path, &st, vol); /* Its a dir: chdir to it remembering where we started */ if ((cwd = open(".", O_RDONLY)) == -1) { perror("Cant open ."); return -1; } if (chdir(path) != 0) { perror("Cant chdir"); close(cwd); return -1; } if ((dp = opendir (".")) == NULL) { perror("Couldn't opendir ."); return -1; } /* First run: print everything */ dirempty = 1; while ((ep = readdir (dp))) { if (alarmed) { ret = -1; goto exit; } /* Check if its "." or ".." */ if (DIR_DOT_OR_DOTDOT(ep->d_name)) continue; /* Check for netatalk special folders e.g. ".AppleDB" or ".AppleDesktop" */ if ((name = check_netatalk_dirs(ep->d_name)) != NULL) continue; if ((ep->d_name[0] == '.') && ! ls_a) continue; dirempty = 0; if (recursion && ! dirprinted) { printf("\n%s:\n", cwdpath); dirprinted = 1; } if (lstat(ep->d_name, &st) < 0) { perror("Can't stat"); return -1; } ret = ad_print(ep->d_name, &st, vol); if (ret != 0) goto exit; } if (! ls_l && ! dirempty) printf("\n"); /* Second run: recurse to dirs */ if (ls_R) { rewinddir(dp); while ((ep = readdir (dp))) { if (alarmed) { ret = -1; goto exit; } /* Check if its "." or ".." */ if (DIR_DOT_OR_DOTDOT(ep->d_name)) continue; /* Check for netatalk special folders e.g. ".AppleDB" or ".AppleDesktop" */ if ((name = check_netatalk_dirs(ep->d_name)) != NULL) continue; if ((ret = lstat(ep->d_name, &st)) < 0) { perror("Can't stat"); goto exit; } /* Recursion */ if (S_ISDIR(st.st_mode)) { recursion = 1; ret = ad_ls_r(ep->d_name, vol); } if (ret != 0) goto exit; } } exit: closedir(dp); fchdir(cwd); close(cwd); tmp = strrchr(cwdpath, '/'); if (tmp) *tmp = 0; return ret; } int ad_ls(int argc, char **argv) { int c, firstarg; afpvol_t vol; struct stat st; while ((c = getopt(argc, argv, ":adlRu")) != -1) { switch(c) { case 'a': ls_a = 1; break; case 'd': ls_d = 1; break; case 'l': ls_l = 1; break; case 'R': ls_R = 1; break; case 'u': ls_u = 1; break; case ':': case '?': usage_ls(); return -1; break; } } set_signal(); cnid_init(); if ((argc - optind) == 0) { openvol(".", &vol); ad_ls_r(".", &vol); closevol(&vol); } else { int havefile = 0; firstarg = optind; /* First run: only print files from argv paths */ while(optind < argc) { if (stat(argv[optind], &st) != 0) goto next; if (S_ISDIR(st.st_mode)) goto next; havefile = 1; first = 1; recursion = 0; openvol(argv[optind], &vol); ad_ls_r(argv[optind], &vol); closevol(&vol); next: optind++; } if (havefile && (! ls_l)) printf("\n"); /* Second run: print dirs */ optind = firstarg; while(optind < argc) { if (stat(argv[optind], &st) != 0) goto next2; if ( ! S_ISDIR(st.st_mode)) goto next2; if ((optind > firstarg) || havefile) printf("\n%s:\n", argv[optind]); first = 1; recursion = 0; openvol(argv[optind], &vol); ad_ls_r(argv[optind], &vol); closevol(&vol); next2: optind++; } } return 0; } netatalk-2.2.2/bin/ad/ad_rm.c0000644000175200017500000002055711655731126012645 00000000000000/* * Copyright (c) 2010, Frank Lahm * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ad.h" #define STRIP_TRAILING_SLASH(p) { \ while ((p).p_end > (p).p_path + 1 && (p).p_end[-1] == '/') \ *--(p).p_end = 0; \ } static afpvol_t volume; static cnid_t did, pdid; static int Rflag; static volatile sig_atomic_t alarmed; static int badrm, rval; static char *netatalk_dirs[] = { ".AppleDB", ".AppleDesktop", NULL }; /* Forward declarations */ static int rm(const char *fpath, const struct stat *sb, int tflag, struct FTW *ftwbuf); /* Check for netatalk special folders e.g. ".AppleDB" or ".AppleDesktop" Returns pointer to name or NULL. */ static const char *check_netatalk_dirs(const char *name) { int c; for (c=0; netatalk_dirs[c]; c++) { if ((strcmp(name, netatalk_dirs[c])) == 0) return netatalk_dirs[c]; } return NULL; } static void upfunc(void) { did = pdid; } /* SIGNAL handling: catch SIGINT and SIGTERM which cause clean exit. Ignore anything else. */ static void sig_handler(int signo) { alarmed = 1; return; } static void set_signal(void) { struct sigaction sv; sv.sa_handler = sig_handler; sv.sa_flags = SA_RESTART; sigemptyset(&sv.sa_mask); if (sigaction(SIGTERM, &sv, NULL) < 0) ERROR("error in sigaction(SIGTERM): %s", strerror(errno)); if (sigaction(SIGINT, &sv, NULL) < 0) ERROR("error in sigaction(SIGINT): %s", strerror(errno)); memset(&sv, 0, sizeof(struct sigaction)); sv.sa_handler = SIG_IGN; sigemptyset(&sv.sa_mask); if (sigaction(SIGABRT, &sv, NULL) < 0) ERROR("error in sigaction(SIGABRT): %s", strerror(errno)); if (sigaction(SIGHUP, &sv, NULL) < 0) ERROR("error in sigaction(SIGHUP): %s", strerror(errno)); if (sigaction(SIGQUIT, &sv, NULL) < 0) ERROR("error in sigaction(SIGQUIT): %s", strerror(errno)); } static void usage_rm(void) { printf( "Usage: ad rm [-vR] [ ...]\n\n" "The rm utility attempts to remove the non-directory type files specified\n" "on the command line.\n" "If the files and directories reside on an AFP volume, the corresponding\n" "CNIDs are deleted from the volumes database.\n\n" "The options are as follows:\n\n" " -R Attempt to remove the file hierarchy rooted in each file argument.\n" " -v Be verbose when deleting files, showing them as they are removed.\n" ); exit(EXIT_FAILURE); } int ad_rm(int argc, char *argv[]) { int ch; pdid = htonl(1); did = htonl(2); while ((ch = getopt(argc, argv, "vR")) != -1) switch (ch) { case 'R': Rflag = 1; break; case 'v': vflag = 1; break; default: usage_rm(); break; } argc -= optind; argv += optind; if (argc < 1) usage_rm(); set_signal(); cnid_init(); /* Set end of argument list */ argv[argc] = NULL; for (int i = 0; argv[i] != NULL; i++) { /* Load .volinfo file for source */ openvol(argv[i], &volume); if (nftw(argv[i], rm, upfunc, 20, FTW_DEPTH | FTW_PHYS) == -1) { if (alarmed) { SLOG("...break"); } else { SLOG("Error: %s", argv[i]); } closevol(&volume); } } return rval; } static int rm(const char *path, const struct stat *statp, int tflag, struct FTW *ftw) { cnid_t cnid; if (alarmed) return -1; const char *dir = strrchr(path, '/'); if (dir == NULL) dir = path; else dir++; if (check_netatalk_dirs(dir) != NULL) return FTW_SKIP_SUBTREE; switch (statp->st_mode & S_IFMT) { case S_IFLNK: if (volume.volinfo.v_path) { if ((volume.volinfo.v_adouble == AD_VERSION2) && (strstr(path, ".AppleDouble") != NULL)) { /* symlink inside adouble dir */ if (unlink(path) != 0) badrm = rval = 1; break; } /* Get CNID of Parent and add new childir to CNID database */ pdid = did; if ((cnid = cnid_for_path(&volume, path, &did)) == CNID_INVALID) { SLOG("Error resolving CNID for %s", path); return -1; } if (cnid_delete(volume.volume.v_cdb, cnid) != 0) { SLOG("Error removing CNID %u for %s", ntohl(cnid), path); return -1; } } if (unlink(path) != 0) { badrm = rval = 1; break; } break; case S_IFDIR: if (!Rflag) { SLOG("%s is a directory", path); return FTW_SKIP_SUBTREE; } if (volume.volinfo.v_path) { if ((volume.volinfo.v_adouble == AD_VERSION2) && (strstr(path, ".AppleDouble") != NULL)) { /* should be adouble dir itself */ if (rmdir(path) != 0) { SLOG("Error removing dir \"%s\": %s", path, strerror(errno)); badrm = rval = 1; return -1; } break; } /* Get CNID of Parent and add new childir to CNID database */ if ((did = cnid_for_path(&volume, path, &pdid)) == CNID_INVALID) { SLOG("Error resolving CNID for %s", path); return -1; } if (cnid_delete(volume.volume.v_cdb, did) != 0) { SLOG("Error removing CNID %u for %s", ntohl(did), path); return -1; } } if (rmdir(path) != 0) { SLOG("Error removing dir \"%s\": %s", path, strerror(errno)); badrm = rval = 1; return -1; } break; case S_IFBLK: case S_IFCHR: SLOG("%s is a device file.", path); badrm = rval = 1; break; case S_IFSOCK: SLOG("%s is a socket.", path); badrm = rval = 1; break; case S_IFIFO: SLOG("%s is a FIFO.", path); badrm = rval = 1; break; default: if (volume.volinfo.v_path) { if ((volume.volinfo.v_adouble == AD_VERSION2) && (strstr(path, ".AppleDouble") != NULL)) { /* file in adouble dir */ if (unlink(path) != 0) badrm = rval = 1; break; } /* Get CNID of Parent and add new childir to CNID database */ pdid = did; if ((cnid = cnid_for_path(&volume, path, &did)) == CNID_INVALID) { SLOG("Error resolving CNID for %s", path); return -1; } if (cnid_delete(volume.volume.v_cdb, cnid) != 0) { SLOG("Error removing CNID %u for %s", ntohl(cnid), path); return -1; } /* Ignore errors, because with -R adouble stuff is always alread gone */ volume.volume.vfs->vfs_deletefile(&volume.volume, -1, path); } if (unlink(path) != 0) { badrm = rval = 1; break; } break; } if (vflag && !badrm) (void)printf("%s\n", path); return 0; } netatalk-2.2.2/bin/ad/ad_util.c0000644000175200017500000002626711655731126013210 00000000000000/* * Copyright (c) 2009 Frank Lahm * Copyright (c) 1991, 1993, 1994 * 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. * 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_SOLARIS_ACLS #include #endif /* HAVE_SOLARIS_ACLS */ #ifdef HAVE_POSIX_ACLS #include #include #endif /* HAVE_POSIX_ACLS */ #include #include #include #include #include #include #include #include #include "ad.h" int log_verbose; /* Logging flag */ void _log(enum logtype lt, char *fmt, ...) { int len; static char logbuffer[1024]; va_list args; if ( (lt == STD) || (log_verbose == 1)) { va_start(args, fmt); len = vsnprintf(logbuffer, 1023, fmt, args); va_end(args); logbuffer[1023] = 0; printf("%s\n", logbuffer); } } /*! * Load volinfo and initialize struct vol * * Only opens "dbd" volumes ! * * @param path (r) path to evaluate * @param vol (rw) structure to initialize * * @returns 0 on success, exits on error */ int openvol(const char *path, afpvol_t *vol) { int flags = 0; memset(vol, 0, sizeof(afpvol_t)); /* try to find a .AppleDesktop/.volinfo */ if (loadvolinfo((char *)path, &vol->volinfo) != 0) return -1; if (STRCMP(vol->volinfo.v_cnidscheme, != , "dbd")) ERROR("\"%s\" isn't a \"dbd\" CNID volume!", vol->volinfo.v_path); if (vol_load_charsets(&vol->volinfo) == -1) ERROR("Error loading charsets!"); /* Sanity checks to ensure we can touch this volume */ if (vol->volinfo.v_adouble != AD_VERSION2) ERROR("Unsupported adouble versions: %u", vol->volinfo.v_adouble); if (vol->volinfo.v_vfs_ea != AFPVOL_EA_SYS) ERROR("Unsupported Extended Attributes option: %u", vol->volinfo.v_vfs_ea); /* initialize sufficient struct vol for VFS initialisation */ vol->volume.v_adouble = AD_VERSION2; vol->volume.v_vfs_ea = AFPVOL_EA_SYS; initvol_vfs(&vol->volume); if ((vol->volinfo.v_flags & AFPVOL_NODEV)) flags |= CNID_FLAG_NODEV; if ((vol->volume.v_cdb = cnid_open(vol->volinfo.v_path, 0000, "dbd", flags, vol->volinfo.v_dbd_host, vol->volinfo.v_dbd_port)) == NULL) ERROR("Cant initialize CNID database connection for %s", vol->volinfo.v_path); cnid_getstamp(vol->volume.v_cdb, vol->db_stamp, sizeof(vol->db_stamp)); return 0; } void closevol(afpvol_t *vol) { if (vol->volume.v_cdb) cnid_close(vol->volume.v_cdb); memset(vol, 0, sizeof(afpvol_t)); } /* Taken form afpd/desktop.c */ char *utompath(const struct volinfo *volinfo, const char *upath) { static char mpath[ MAXPATHLEN + 2]; /* for convert_charset dest_len parameter +2 */ char *m; const char *u; uint16_t flags = CONV_IGNORE | CONV_UNESCAPEHEX; size_t outlen; if (!upath) return NULL; m = mpath; u = upath; outlen = strlen(upath); if ((volinfo->v_casefold & AFPVOL_UTOMUPPER)) flags |= CONV_TOUPPER; else if ((volinfo->v_casefold & AFPVOL_UTOMLOWER)) flags |= CONV_TOLOWER; if ((volinfo->v_flags & AFPVOL_EILSEQ)) { flags |= CONV__EILSEQ; } /* convert charsets */ if ((size_t)-1 == ( outlen = convert_charset(volinfo->v_volcharset, CH_UTF8_MAC, volinfo->v_maccharset, u, outlen, mpath, MAXPATHLEN, &flags)) ) { SLOG("Conversion from %s to %s for %s failed.", volinfo->v_volcodepage, volinfo->v_maccodepage, u); return NULL; } return(m); } /*! * Convert dot encoding of basename _in place_ * * path arg can be "[/][dir/ | ...]filename". It will be converted in place * possible encoding ".file" as ":2efile" which means the result will be * longer then the original which means provide a big enough buffer. * * @param svol (r) source volume * @param dvol (r) destinatio volume * @param path (rw) path to convert _in place_ * @param buflen (r) size of path buffer (max strlen == buflen -1) * * @returns 0 on sucess, -1 on error */ int convert_dots_encoding(const afpvol_t *svol, const afpvol_t *dvol, char *path, size_t buflen) { static charset_t from = (charset_t) -1; static char buf[MAXPATHLEN+2]; char *bname = stripped_slashes_basename(path); int pos = bname - path; uint16_t flags = 0; if ( ! svol->volinfo.v_path) { /* no source volume: escape special chars (eg ':') */ from = dvol->volinfo.v_volcharset; /* src = dst charset */ flags |= CONV_ESCAPEHEX; } else { from = svol->volinfo.v_volcharset; } if ( (svol->volinfo.v_path) && ! (svol->volinfo.v_flags & AFPVOL_USEDOTS) && (dvol->volinfo.v_flags & AFPVOL_USEDOTS)) { /* source is without dots, destination is with */ flags |= CONV_UNESCAPEHEX; } else if (! (dvol->volinfo.v_flags & AFPVOL_USEDOTS)) { flags |= CONV_ESCAPEDOTS; } int len = convert_charset(from, dvol->volinfo.v_volcharset, dvol->volinfo.v_maccharset, bname, strlen(bname), buf, MAXPATHLEN, &flags); if (len == -1) return -1; if (strlcpy(bname, buf, MAXPATHLEN - pos) > MAXPATHLEN - pos) return -1; return 0; } /*! * ResolvesCNID of a given paths * * path might be: * (a) relative: * "dir/subdir" with cwd: "/afp_volume/topdir" * (b) absolute: * "/afp_volume/dir/subdir" * * path MUST be pointing inside vol, this is usually the case as vol has been build from * path using loadvolinfo and friends. * * @param vol (r) pointer to afpvol_t * @param path (r) path, see above * @param did (rw) parent CNID of returned CNID * * @returns CNID of path */ cnid_t cnid_for_path(const afpvol_t *vol, const char *path, cnid_t *did) { EC_INIT; cnid_t cnid; bstring rpath = NULL; bstring statpath = NULL; struct bstrList *l = NULL; struct stat st; cnid = htonl(2); EC_NULL(rpath = rel_path_in_vol(path, vol->volinfo.v_path)); EC_NULL(statpath = bfromcstr(vol->volinfo.v_path)); EC_ZERO(bcatcstr(statpath, "/")); l = bsplit(rpath, '/'); for (int i = 0; i < l->qty ; i++) { *did = cnid; EC_ZERO(bconcat(statpath, l->entry[i])); EC_ZERO_LOGSTR(lstat(cfrombstr(statpath), &st), "lstat(rpath: %s, elem: %s): %s: %s", cfrombstr(rpath), cfrombstr(l->entry[i]), cfrombstr(statpath), strerror(errno)); if ((cnid = cnid_add(vol->volume.v_cdb, &st, *did, cfrombstr(l->entry[i]), blength(l->entry[i]), 0)) == CNID_INVALID) { EC_FAIL; } EC_ZERO(bcatcstr(statpath, "/")); } EC_CLEANUP: bdestroy(rpath); bstrListDestroy(l); bdestroy(statpath); if (ret != 0) return CNID_INVALID; return cnid; } /*! * Resolves CNID of a given paths parent directory * * path might be: * (a) relative: * "dir/subdir" with cwd: "/afp_volume/topdir" * (b) absolute: * "/afp_volume/dir/subdir" * * path MUST be pointing inside vol, this is usually the case as vol has been build from * path using loadvolinfo and friends. * * @param vol (r) pointer to afpvol_t * @param path (r) path, see above * @param did (rw) parent CNID of returned CNID * * @returns CNID of path */ cnid_t cnid_for_paths_parent(const afpvol_t *vol, const char *path, cnid_t *did) { EC_INIT; cnid_t cnid; bstring rpath = NULL; bstring statpath = NULL; struct bstrList *l = NULL; struct stat st; *did = htonl(1); cnid = htonl(2); EC_NULL(rpath = rel_path_in_vol(path, vol->volinfo.v_path)); EC_NULL(statpath = bfromcstr(vol->volinfo.v_path)); l = bsplit(rpath, '/'); if (l->qty == 1) /* only one path element, means parent dir cnid is volume root = 2 */ goto EC_CLEANUP; for (int i = 0; i < (l->qty - 1); i++) { *did = cnid; EC_ZERO(bconcat(statpath, l->entry[i])); EC_ZERO_LOGSTR(lstat(cfrombstr(statpath), &st), "lstat(rpath: %s, elem: %s): %s: %s", cfrombstr(rpath), cfrombstr(l->entry[i]), cfrombstr(statpath), strerror(errno)); if ((cnid = cnid_add(vol->volume.v_cdb, &st, *did, cfrombstr(l->entry[i]), blength(l->entry[i]), 0)) == CNID_INVALID) { EC_FAIL; } EC_ZERO(bcatcstr(statpath, "/")); } EC_CLEANUP: bdestroy(rpath); bstrListDestroy(l); bdestroy(statpath); if (ret != 0) return CNID_INVALID; return cnid; } netatalk-2.2.2/bin/ad/ad_cp.c0000644000175200017500000010244311655731126012624 00000000000000/* * Copyright (c) 2010, Frank Lahm * Copyright (c) 1988, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * David Hitz of Auspex Systems Inc. * * 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. * 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. */ /* * Cp copies source files to target files. * * The global PATH_T structure "to" always contains the path to the * current target file. Since fts(3) does not change directories, * this path can be either absolute or dot-relative. * * The basic algorithm is to initialize "to" and use fts(3) to traverse * the file hierarchy rooted in the argument list. A trivial case is the * case of 'cp file1 file2'. The more interesting case is the case of * 'cp file1 file2 ... fileN dir' where the hierarchy is traversed and the * path (relative to the root of the traversal) is appended to dir (stored * in "to") to form the final target path. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ad.h" #define STRIP_TRAILING_SLASH(p) { \ while ((p).p_end > (p).p_path + 1 && (p).p_end[-1] == '/') \ *--(p).p_end = 0; \ } static char emptystring[] = ""; PATH_T to = { to.p_path, emptystring, "" }; enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; int fflag, iflag, nflag, pflag, vflag; mode_t mask; cnid_t ppdid, pdid, did; /* current dir CNID and parent did*/ static afpvol_t svolume, dvolume; static enum op type; static int Rflag; static volatile sig_atomic_t alarmed; static int badcp, rval; static int ftw_options = FTW_MOUNT | FTW_PHYS | FTW_ACTIONRETVAL; static char *netatalk_dirs[] = { ".AppleDouble", ".AppleDB", ".AppleDesktop", NULL }; /* Forward declarations */ static int copy(const char *fpath, const struct stat *sb, int tflag, struct FTW *ftwbuf); static int ftw_copy_file(const struct FTW *, const char *, const struct stat *, int); static int ftw_copy_link(const struct FTW *, const char *, const struct stat *, int); static int setfile(const struct stat *, int); static int preserve_dir_acls(const struct stat *, char *, char *); static int preserve_fd_acls(int, int); /* Check for netatalk special folders e.g. ".AppleDB" or ".AppleDesktop" Returns pointer to name or NULL. */ static const char *check_netatalk_dirs(const char *name) { int c; for (c=0; netatalk_dirs[c]; c++) { if ((strcmp(name, netatalk_dirs[c])) == 0) return netatalk_dirs[c]; } return NULL; } static void upfunc(void) { did = pdid; pdid = ppdid; } /* SIGNAL handling: catch SIGINT and SIGTERM which cause clean exit. Ignore anything else. */ static void sig_handler(int signo) { alarmed = 1; return; } static void set_signal(void) { struct sigaction sv; sv.sa_handler = sig_handler; sv.sa_flags = SA_RESTART; sigemptyset(&sv.sa_mask); if (sigaction(SIGTERM, &sv, NULL) < 0) ERROR("error in sigaction(SIGTERM): %s", strerror(errno)); if (sigaction(SIGINT, &sv, NULL) < 0) ERROR("error in sigaction(SIGINT): %s", strerror(errno)); memset(&sv, 0, sizeof(struct sigaction)); sv.sa_handler = SIG_IGN; sigemptyset(&sv.sa_mask); if (sigaction(SIGABRT, &sv, NULL) < 0) ERROR("error in sigaction(SIGABRT): %s", strerror(errno)); if (sigaction(SIGHUP, &sv, NULL) < 0) ERROR("error in sigaction(SIGHUP): %s", strerror(errno)); if (sigaction(SIGQUIT, &sv, NULL) < 0) ERROR("error in sigaction(SIGQUIT): %s", strerror(errno)); } static void usage_cp(void) { printf( "Usage: ad cp [-R] [-aipvf] \n" " ad cp [-R] [-aipvfx] \n\n" "In the first synopsis form, the cp utility copies the contents of the source_file to the\n" "target_file. In the second synopsis form, the contents of each named source_file is copied to the\n" "destination target_directory. The names of the files themselves are not changed. If cp detects an\n" "attempt to copy a file to itself, the copy will fail.\n\n" "Netatalk AFP volumes are detected by means of their \".AppleDesktop\" directory\n" "which is located in their volume root. When a copy targetting an AFP volume\n" "is detected, its CNID database daemon is connected and all copies will also\n" "go through the CNID database.\n" "AppleDouble files are also copied and created as needed when the target is\n" "an AFP volume.\n\n" "The following options are available:\n\n" " -a Archive mode. Same as -Rp.\n\n" " -f For each existing destination pathname, remove it and create a new\n" " file, without prompting for confirmation regardless of its permis-\n" " sions. (The -f option overrides any previous -i or -n options.)\n\n" " -i Cause cp to write a prompt to the standard error output before\n" " copying a file that would overwrite an existing file. If the\n" " response from the standard input begins with the character 'y' or\n" " 'Y', the file copy is attempted. (The -i option overrides any pre-\n" " vious -f or -n options.)\n\n" " -n Do not overwrite an existing file. (The -n option overrides any\n" " previous -f or -i options.)\n\n" " -p Cause cp to preserve the following attributes of each source file\n" " in the copy: modification time, access time, file flags, file mode,\n" " user ID, and group ID, as allowed by permissions.\n" " If the user ID and group ID cannot be preserved, no error message\n" " is displayed and the exit value is not altered.\n\n" " -R If source_file designates a directory, cp copies the directory and\n" " the entire subtree connected at that point.If the source_file\n" " ends in a /, the contents of the directory are copied rather than\n" " the directory itself.\n\n" " -v Cause cp to be verbose, showing files as they are copied.\n\n" " -x File system mount points are not traversed.\n\n" ); exit(EXIT_FAILURE); } int ad_cp(int argc, char *argv[]) { struct stat to_stat, tmp_stat; int r, ch, have_trailing_slash; char *target; #if 0 afpvol_t srcvol; afpvol_t dstvol; #endif ppdid = pdid = htonl(1); did = htonl(2); while ((ch = getopt(argc, argv, "afinpRvx")) != -1) switch (ch) { case 'a': pflag = 1; Rflag = 1; break; case 'f': fflag = 1; iflag = nflag = 0; break; case 'i': iflag = 1; fflag = nflag = 0; break; case 'n': nflag = 1; fflag = iflag = 0; break; case 'p': pflag = 1; break; case 'R': Rflag = 1; break; case 'v': vflag = 1; break; case 'x': ftw_options |= FTW_MOUNT; break; default: usage_cp(); break; } argc -= optind; argv += optind; if (argc < 2) usage_cp(); set_signal(); cnid_init(); /* Save the target base in "to". */ target = argv[--argc]; if ((strlcpy(to.p_path, target, PATH_MAX)) >= PATH_MAX) ERROR("%s: name too long", target); to.p_end = to.p_path + strlen(to.p_path); if (to.p_path == to.p_end) { *to.p_end++ = '.'; *to.p_end = 0; } have_trailing_slash = (to.p_end[-1] == '/'); if (have_trailing_slash) STRIP_TRAILING_SLASH(to); to.target_end = to.p_end; /* Set end of argument list */ argv[argc] = NULL; /* * Cp has two distinct cases: * * cp [-R] source target * cp [-R] source1 ... sourceN directory * * In both cases, source can be either a file or a directory. * * In (1), the target becomes a copy of the source. That is, if the * source is a file, the target will be a file, and likewise for * directories. * * In (2), the real target is not directory, but "directory/source". */ r = stat(to.p_path, &to_stat); if (r == -1 && errno != ENOENT) ERROR("%s", to.p_path); if (r == -1 || !S_ISDIR(to_stat.st_mode)) { /* * Case (1). Target is not a directory. */ if (argc > 1) ERROR("%s is not a directory", to.p_path); /* * Need to detect the case: *cp -R dir foo * Where dir is a directory and foo does not exist, where * we want pathname concatenations turned on but not for * the initial mkdir(). */ if (r == -1) { lstat(*argv, &tmp_stat); if (S_ISDIR(tmp_stat.st_mode) && Rflag) type = DIR_TO_DNE; else type = FILE_TO_FILE; } else type = FILE_TO_FILE; if (have_trailing_slash && type == FILE_TO_FILE) { if (r == -1) ERROR("directory %s does not exist", to.p_path); else ERROR("%s is not a directory", to.p_path); } } else /* * Case (2). Target is a directory. */ type = FILE_TO_DIR; /* * Keep an inverted copy of the umask, for use in correcting * permissions on created directories when not using -p. */ mask = ~umask(0777); umask(~mask); #if 0 /* Inhereting perms in ad_mkdir etc requires this */ ad_setfuid(0); #endif /* Load .volinfo file for destination*/ openvol(to.p_path, &dvolume); for (int i = 0; argv[i] != NULL; i++) { /* Load .volinfo file for source */ openvol(argv[i], &svolume); if (nftw(argv[i], copy, upfunc, 20, ftw_options) == -1) { if (alarmed) { SLOG("...break"); } else { SLOG("Error: %s: %s", argv[i], strerror(errno)); } closevol(&svolume); closevol(&dvolume); } } return rval; } static int copy(const char *path, const struct stat *statp, int tflag, struct FTW *ftw) { static int base = 0; struct stat to_stat; int dne; size_t nlen; const char *p; char *target_mid; if (alarmed) return -1; /* This currently doesn't work with "." */ if (strcmp(path, ".") == 0) { ERROR("\".\" not supported"); } const char *dir = strrchr(path, '/'); if (dir == NULL) dir = path; else dir++; if (check_netatalk_dirs(dir) != NULL) return FTW_SKIP_SUBTREE; /* * If we are in case (2) above, we need to append the * source name to the target name. */ if (type != FILE_TO_FILE) { /* * Need to remember the roots of traversals to create * correct pathnames. If there's a directory being * copied to a non-existent directory, e.g. * cp -R a/dir noexist * the resulting path name should be noexist/foo, not * noexist/dir/foo (where foo is a file in dir), which * is the case where the target exists. * * Also, check for "..". This is for correct path * concatenation for paths ending in "..", e.g. * cp -R .. /tmp * Paths ending in ".." are changed to ".". This is * tricky, but seems the easiest way to fix the problem. * * XXX * Since the first level MUST be FTS_ROOTLEVEL, base * is always initialized. */ if (ftw->level == 0) { if (type != DIR_TO_DNE) { base = ftw->base; if (strcmp(&path[base], "..") == 0) base += 1; } else base = strlen(path); } p = &path[base]; nlen = strlen(path) - base; target_mid = to.target_end; if (*p != '/' && target_mid[-1] != '/') *target_mid++ = '/'; *target_mid = 0; if (target_mid - to.p_path + nlen >= PATH_MAX) { SLOG("%s%s: name too long (not copied)", to.p_path, p); badcp = rval = 1; return 0; } (void)strncat(target_mid, p, nlen); to.p_end = target_mid + nlen; *to.p_end = 0; STRIP_TRAILING_SLASH(to); } /* Not an error but need to remember it happened */ if (stat(to.p_path, &to_stat) == -1) dne = 1; else { if (to_stat.st_dev == statp->st_dev && to_stat.st_ino == statp->st_ino) { SLOG("%s and %s are identical (not copied).", to.p_path, path); badcp = rval = 1; if (S_ISDIR(statp->st_mode)) /* without using glibc extension FTW_ACTIONRETVAL cant handle this */ return FTW_SKIP_SUBTREE; return 0; } if (!S_ISDIR(statp->st_mode) && S_ISDIR(to_stat.st_mode)) { SLOG("cannot overwrite directory %s with " "non-directory %s", to.p_path, path); badcp = rval = 1; return 0; } dne = 0; } /* Convert basename to appropiate volume encoding */ if (dvolume.volinfo.v_path) { if ((convert_dots_encoding(&svolume, &dvolume, to.p_path, MAXPATHLEN)) == -1) { SLOG("Error converting name for %s", to.p_path); badcp = rval = 1; return -1; } } switch (statp->st_mode & S_IFMT) { case S_IFLNK: if (ftw_copy_link(ftw, path, statp, !dne)) badcp = rval = 1; break; case S_IFDIR: if (!Rflag) { SLOG("%s is a directory", path); badcp = rval = 1; return -1; } /* * If the directory doesn't exist, create the new * one with the from file mode plus owner RWX bits, * modified by the umask. Trade-off between being * able to write the directory (if from directory is * 555) and not causing a permissions race. If the * umask blocks owner writes, we fail.. */ if (dne) { if (mkdir(to.p_path, statp->st_mode | S_IRWXU) < 0) ERROR("mkdir: %s: %s", to.p_path, strerror(errno)); } else if (!S_ISDIR(to_stat.st_mode)) { errno = ENOTDIR; ERROR("%s", to.p_path); } /* Create ad dir and copy ".Parent" */ if (dvolume.volinfo.v_path && dvolume.volinfo.v_adouble == AD_VERSION2) { /* Create ".AppleDouble" dir */ mode_t omask = umask(0); bstring addir = bfromcstr(to.p_path); bcatcstr(addir, "/.AppleDouble"); mkdir(cfrombstr(addir), 02777); bdestroy(addir); if (svolume.volinfo.v_path && svolume.volinfo.v_adouble == AD_VERSION2) { /* copy ".Parent" file */ if (dvolume.volume.vfs->vfs_copyfile(&dvolume.volume, -1, path, to.p_path)) { SLOG("Error copying adouble for %s -> %s", path, to.p_path); badcp = rval = 1; break; } } /* Get CNID of Parent and add new childir to CNID database */ ppdid = pdid; if ((did = cnid_for_path(&dvolume, to.p_path, &pdid)) == CNID_INVALID) { SLOG("Error resolving CNID for %s", to.p_path); badcp = rval = 1; return -1; } struct adouble ad; struct stat st; if (lstat(to.p_path, &st) != 0) { badcp = rval = 1; break; } ad_init(&ad, dvolume.volinfo.v_adouble, dvolume.volinfo.v_ad_options); if (ad_open_metadata(to.p_path, ADFLAGS_DIR, O_RDWR | O_CREAT, &ad) != 0) { ERROR("Error opening adouble for: %s", to.p_path); } ad_setid( &ad, st.st_dev, st.st_ino, did, pdid, dvolume.db_stamp); ad_setname(&ad, utompath(&dvolume.volinfo, basename(to.p_path))); ad_setdate(&ad, AD_DATE_CREATE | AD_DATE_UNIX, st.st_mtime); ad_setdate(&ad, AD_DATE_MODIFY | AD_DATE_UNIX, st.st_mtime); ad_setdate(&ad, AD_DATE_ACCESS | AD_DATE_UNIX, st.st_mtime); ad_setdate(&ad, AD_DATE_BACKUP, AD_DATE_START); ad_flush(&ad); ad_close_metadata(&ad); umask(omask); } if (pflag) { if (setfile(statp, -1)) rval = 1; #if 0 if (preserve_dir_acls(statp, curr->fts_accpath, to.p_path) != 0) rval = 1; #endif } break; case S_IFBLK: case S_IFCHR: SLOG("%s is a device file (not copied).", path); break; case S_IFSOCK: SLOG("%s is a socket (not copied).", path); break; case S_IFIFO: SLOG("%s is a FIFO (not copied).", path); break; default: if (ftw_copy_file(ftw, path, statp, dne)) badcp = rval = 1; if (dvolume.volinfo.v_path && dvolume.volinfo.v_adouble == AD_VERSION2) { mode_t omask = umask(0); if (svolume.volinfo.v_path && svolume.volinfo.v_adouble == AD_VERSION2) { /* copy ad-file */ if (dvolume.volume.vfs->vfs_copyfile(&dvolume.volume, -1, path, to.p_path)) { SLOG("Error copying adouble for %s -> %s", path, to.p_path); badcp = rval = 1; break; } } /* Get CNID of Parent and add new childir to CNID database */ pdid = did; cnid_t cnid; if ((cnid = cnid_for_path(&dvolume, to.p_path, &did)) == CNID_INVALID) { SLOG("Error resolving CNID for %s", to.p_path); badcp = rval = 1; return -1; } struct adouble ad; struct stat st; if (lstat(to.p_path, &st) != 0) { badcp = rval = 1; break; } ad_init(&ad, dvolume.volinfo.v_adouble, dvolume.volinfo.v_ad_options); if (ad_open_metadata(to.p_path, 0, O_RDWR | O_CREAT, &ad) != 0) { ERROR("Error opening adouble for: %s", to.p_path); } ad_setid( &ad, st.st_dev, st.st_ino, cnid, did, dvolume.db_stamp); ad_setname(&ad, utompath(&dvolume.volinfo, basename(to.p_path))); ad_setdate(&ad, AD_DATE_CREATE | AD_DATE_UNIX, st.st_mtime); ad_setdate(&ad, AD_DATE_MODIFY | AD_DATE_UNIX, st.st_mtime); ad_setdate(&ad, AD_DATE_ACCESS | AD_DATE_UNIX, st.st_mtime); ad_setdate(&ad, AD_DATE_BACKUP, AD_DATE_START); ad_flush(&ad); ad_close_metadata(&ad); umask(omask); } break; } if (vflag && !badcp) (void)printf("%s -> %s\n", path, to.p_path); return 0; } /* Memory strategy threshold, in pages: if physmem is larger then this, use a large buffer */ #define PHYSPAGES_THRESHOLD (32*1024) /* Maximum buffer size in bytes - do not allow it to grow larger than this */ #define BUFSIZE_MAX (2*1024*1024) /* Small (default) buffer size in bytes. It's inefficient for this to be smaller than MAXPHYS */ #define MAXPHYS (64 * 1024) #define BUFSIZE_SMALL (MAXPHYS) static int ftw_copy_file(const struct FTW *entp, const char *spath, const struct stat *sp, int dne) { static char *buf = NULL; static size_t bufsize; ssize_t wcount; size_t wresid; off_t wtotal; int ch, checkch, from_fd = 0, rcount, rval, to_fd = 0; char *bufp; char *p; if ((from_fd = open(spath, O_RDONLY, 0)) == -1) { SLOG("%s: %s", spath, strerror(errno)); return (1); } /* * If the file exists and we're interactive, verify with the user. * If the file DNE, set the mode to be the from file, minus setuid * bits, modified by the umask; arguably wrong, but it makes copying * executables work right and it's been that way forever. (The * other choice is 666 or'ed with the execute bits on the from file * modified by the umask.) */ if (!dne) { #define YESNO "(y/n [n]) " if (nflag) { if (vflag) printf("%s not overwritten\n", to.p_path); (void)close(from_fd); return (0); } else if (iflag) { (void)fprintf(stderr, "overwrite %s? %s", to.p_path, YESNO); checkch = ch = getchar(); while (ch != '\n' && ch != EOF) ch = getchar(); if (checkch != 'y' && checkch != 'Y') { (void)close(from_fd); (void)fprintf(stderr, "not overwritten\n"); return (1); } } if (fflag) { /* remove existing destination file name, * create a new file */ (void)unlink(to.p_path); (void)dvolume.volume.vfs->vfs_deletefile(&dvolume.volume, -1, to.p_path); to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT, sp->st_mode & ~(S_ISUID | S_ISGID)); } else { /* overwrite existing destination file name */ to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0); } } else { to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT, sp->st_mode & ~(S_ISUID | S_ISGID)); } if (to_fd == -1) { SLOG("%s: %s", to.p_path, strerror(errno)); (void)close(from_fd); return (1); } rval = 0; /* * Mmap and write if less than 8M (the limit is so we don't totally * trash memory on big files. This is really a minor hack, but it * wins some CPU back. * Some filesystems, such as smbnetfs, don't support mmap, * so this is a best-effort attempt. */ if (S_ISREG(sp->st_mode) && sp->st_size > 0 && sp->st_size <= 8 * 1024 * 1024 && (p = mmap(NULL, (size_t)sp->st_size, PROT_READ, MAP_SHARED, from_fd, (off_t)0)) != MAP_FAILED) { wtotal = 0; for (bufp = p, wresid = sp->st_size; ; bufp += wcount, wresid -= (size_t)wcount) { wcount = write(to_fd, bufp, wresid); if (wcount <= 0) break; wtotal += wcount; if (wcount >= (ssize_t)wresid) break; } if (wcount != (ssize_t)wresid) { SLOG("%s: %s", to.p_path, strerror(errno)); rval = 1; } /* Some systems don't unmap on close(2). */ if (munmap(p, sp->st_size) < 0) { SLOG("%s: %s", spath, strerror(errno)); rval = 1; } } else { if (buf == NULL) { /* * Note that buf and bufsize are static. If * malloc() fails, it will fail at the start * and not copy only some files. */ if (sysconf(_SC_PHYS_PAGES) > PHYSPAGES_THRESHOLD) bufsize = MIN(BUFSIZE_MAX, MAXPHYS * 8); else bufsize = BUFSIZE_SMALL; buf = malloc(bufsize); if (buf == NULL) ERROR("Not enough memory"); } wtotal = 0; while ((rcount = read(from_fd, buf, bufsize)) > 0) { for (bufp = buf, wresid = rcount; ; bufp += wcount, wresid -= wcount) { wcount = write(to_fd, bufp, wresid); if (wcount <= 0) break; wtotal += wcount; if (wcount >= (ssize_t)wresid) break; } if (wcount != (ssize_t)wresid) { SLOG("%s: %s", to.p_path, strerror(errno)); rval = 1; break; } } if (rcount < 0) { SLOG("%s: %s", spath, strerror(errno)); rval = 1; } } /* * Don't remove the target even after an error. The target might * not be a regular file, or its attributes might be important, * or its contents might be irreplaceable. It would only be safe * to remove it if we created it and its length is 0. */ if (pflag && setfile(sp, to_fd)) rval = 1; if (pflag && preserve_fd_acls(from_fd, to_fd) != 0) rval = 1; if (close(to_fd)) { SLOG("%s: %s", to.p_path, strerror(errno)); rval = 1; } (void)close(from_fd); return (rval); } static int ftw_copy_link(const struct FTW *p, const char *spath, const struct stat *sstp, int exists) { int len; char llink[PATH_MAX]; if ((len = readlink(spath, llink, sizeof(llink) - 1)) == -1) { SLOG("readlink: %s: %s", spath, strerror(errno)); return (1); } llink[len] = '\0'; if (exists && unlink(to.p_path)) { SLOG("unlink: %s: %s", to.p_path, strerror(errno)); return (1); } if (symlink(llink, to.p_path)) { SLOG("symlink: %s: %s", llink, strerror(errno)); return (1); } return (pflag ? setfile(sstp, -1) : 0); } static int setfile(const struct stat *fs, int fd) { static struct timeval tv[2]; struct stat ts; int rval, gotstat, islink, fdval; mode_t mode; rval = 0; fdval = fd != -1; islink = !fdval && S_ISLNK(fs->st_mode); mode = fs->st_mode & (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO); #if defined(__FreeBSD__) TIMESPEC_TO_TIMEVAL(&tv[0], &fs->st_atimespec); TIMESPEC_TO_TIMEVAL(&tv[1], &fs->st_mtimespec); #else TIMESPEC_TO_TIMEVAL(&tv[0], &fs->st_atim); TIMESPEC_TO_TIMEVAL(&tv[1], &fs->st_mtim); #endif if (utimes(to.p_path, tv)) { SLOG("utimes: %s", to.p_path); rval = 1; } if (fdval ? fstat(fd, &ts) : (islink ? lstat(to.p_path, &ts) : stat(to.p_path, &ts))) gotstat = 0; else { gotstat = 1; ts.st_mode &= S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO; } /* * Changing the ownership probably won't succeed, unless we're root * or POSIX_CHOWN_RESTRICTED is not set. Set uid/gid before setting * the mode; current BSD behavior is to remove all setuid bits on * chown. If chown fails, lose setuid/setgid bits. */ if (!gotstat || fs->st_uid != ts.st_uid || fs->st_gid != ts.st_gid) if (fdval ? fchown(fd, fs->st_uid, fs->st_gid) : (islink ? lchown(to.p_path, fs->st_uid, fs->st_gid) : chown(to.p_path, fs->st_uid, fs->st_gid))) { if (errno != EPERM) { SLOG("chown: %s: %s", to.p_path, strerror(errno)); rval = 1; } mode &= ~(S_ISUID | S_ISGID); } if (!gotstat || mode != ts.st_mode) if (fdval ? fchmod(fd, mode) : chmod(to.p_path, mode)) { SLOG("chmod: %s: %s", to.p_path, strerror(errno)); rval = 1; } #ifdef HAVE_ST_FLAGS if (!gotstat || fs->st_flags != ts.st_flags) if (fdval ? fchflags(fd, fs->st_flags) : (islink ? lchflags(to.p_path, fs->st_flags) : chflags(to.p_path, fs->st_flags))) { SLOG("chflags: %s: %s", to.p_path, strerror(errno)); rval = 1; } #endif return (rval); } static int preserve_fd_acls(int source_fd, int dest_fd) { #if 0 acl_t acl; acl_type_t acl_type; int acl_supported = 0, ret, trivial; ret = fpathconf(source_fd, _PC_ACL_NFS4); if (ret > 0 ) { acl_supported = 1; acl_type = ACL_TYPE_NFS4; } else if (ret < 0 && errno != EINVAL) { warn("fpathconf(..., _PC_ACL_NFS4) failed for %s", to.p_path); return (1); } if (acl_supported == 0) { ret = fpathconf(source_fd, _PC_ACL_EXTENDED); if (ret > 0 ) { acl_supported = 1; acl_type = ACL_TYPE_ACCESS; } else if (ret < 0 && errno != EINVAL) { warn("fpathconf(..., _PC_ACL_EXTENDED) failed for %s", to.p_path); return (1); } } if (acl_supported == 0) return (0); acl = acl_get_fd_np(source_fd, acl_type); if (acl == NULL) { warn("failed to get acl entries while setting %s", to.p_path); return (1); } if (acl_is_trivial_np(acl, &trivial)) { warn("acl_is_trivial() failed for %s", to.p_path); acl_free(acl); return (1); } if (trivial) { acl_free(acl); return (0); } if (acl_set_fd_np(dest_fd, acl, acl_type) < 0) { warn("failed to set acl entries for %s", to.p_path); acl_free(acl); return (1); } acl_free(acl); #endif return (0); } static int preserve_dir_acls(const struct stat *fs, char *source_dir, char *dest_dir) { #if 0 acl_t (*aclgetf)(const char *, acl_type_t); int (*aclsetf)(const char *, acl_type_t, acl_t); struct acl *aclp; acl_t acl; acl_type_t acl_type; int acl_supported = 0, ret, trivial; ret = pathconf(source_dir, _PC_ACL_NFS4); if (ret > 0) { acl_supported = 1; acl_type = ACL_TYPE_NFS4; } else if (ret < 0 && errno != EINVAL) { warn("fpathconf(..., _PC_ACL_NFS4) failed for %s", source_dir); return (1); } if (acl_supported == 0) { ret = pathconf(source_dir, _PC_ACL_EXTENDED); if (ret > 0) { acl_supported = 1; acl_type = ACL_TYPE_ACCESS; } else if (ret < 0 && errno != EINVAL) { warn("fpathconf(..., _PC_ACL_EXTENDED) failed for %s", source_dir); return (1); } } if (acl_supported == 0) return (0); /* * If the file is a link we will not follow it */ if (S_ISLNK(fs->st_mode)) { aclgetf = acl_get_link_np; aclsetf = acl_set_link_np; } else { aclgetf = acl_get_file; aclsetf = acl_set_file; } if (acl_type == ACL_TYPE_ACCESS) { /* * Even if there is no ACL_TYPE_DEFAULT entry here, a zero * size ACL will be returned. So it is not safe to simply * check the pointer to see if the default ACL is present. */ acl = aclgetf(source_dir, ACL_TYPE_DEFAULT); if (acl == NULL) { warn("failed to get default acl entries on %s", source_dir); return (1); } aclp = &acl->ats_acl; if (aclp->acl_cnt != 0 && aclsetf(dest_dir, ACL_TYPE_DEFAULT, acl) < 0) { warn("failed to set default acl entries on %s", dest_dir); acl_free(acl); return (1); } acl_free(acl); } acl = aclgetf(source_dir, acl_type); if (acl == NULL) { warn("failed to get acl entries on %s", source_dir); return (1); } if (acl_is_trivial_np(acl, &trivial)) { warn("acl_is_trivial() failed on %s", source_dir); acl_free(acl); return (1); } if (trivial) { acl_free(acl); return (0); } if (aclsetf(dest_dir, acl_type, acl) < 0) { warn("failed to set acl entries on %s", dest_dir); acl_free(acl); return (1); } acl_free(acl); #endif return (0); } netatalk-2.2.2/bin/ad/ad_mv.c0000644000175200017500000003274311655731126012651 00000000000000/* * Copyright (c) 2010, Frank Lahm * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ad.h" #define STRIP_TRAILING_SLASH(p) { \ while ((p).p_end > (p).p_path + 1 && (p).p_end[-1] == '/') \ *--(p).p_end = 0; \ } static int fflg, iflg, nflg, vflg; static afpvol_t svolume, dvolume; static cnid_t did, pdid; static volatile sig_atomic_t alarmed; static char *netatalk_dirs[] = { ".AppleDouble", ".AppleDB", ".AppleDesktop", NULL }; static int copy(const char *, const char *); static int do_move(const char *, const char *); static void preserve_fd_acls(int source_fd, int dest_fd, const char *source_path, const char *dest_path); /* Check for netatalk special folders e.g. ".AppleDB" or ".AppleDesktop" Returns pointer to name or NULL. */ static const char *check_netatalk_dirs(const char *name) { int c; for (c=0; netatalk_dirs[c]; c++) { if ((strcmp(name, netatalk_dirs[c])) == 0) return netatalk_dirs[c]; } return NULL; } /* SIGNAL handling: catch SIGINT and SIGTERM which cause clean exit. Ignore anything else. */ static void sig_handler(int signo) { alarmed = 1; return; } static void set_signal(void) { struct sigaction sv; sv.sa_handler = sig_handler; sv.sa_flags = SA_RESTART; sigemptyset(&sv.sa_mask); if (sigaction(SIGTERM, &sv, NULL) < 0) ERROR("error in sigaction(SIGTERM): %s", strerror(errno)); if (sigaction(SIGINT, &sv, NULL) < 0) ERROR("error in sigaction(SIGINT): %s", strerror(errno)); memset(&sv, 0, sizeof(struct sigaction)); sv.sa_handler = SIG_IGN; sigemptyset(&sv.sa_mask); if (sigaction(SIGABRT, &sv, NULL) < 0) ERROR("error in sigaction(SIGABRT): %s", strerror(errno)); if (sigaction(SIGHUP, &sv, NULL) < 0) ERROR("error in sigaction(SIGHUP): %s", strerror(errno)); if (sigaction(SIGQUIT, &sv, NULL) < 0) ERROR("error in sigaction(SIGQUIT): %s", strerror(errno)); } static void usage_mv(void) { printf( "Usage: ad mv [-f | -i | -n] [-v] source target\n" " ad mv [-f | -i | -n] [-v] source ... directory\n\n" "Move files around within an AFP volume, updating the CNID\n" "database as needed. If either:\n" " - source or destination is not an AFP volume\n" " - source volume != destinatio volume\n" "the files are copied and removed from the source.\n\n" "The following options are available:\n\n" " -f Do not prompt for confirmation before overwriting the destination\n" " path. (The -f option overrides any previous -i or -n options.)\n" " -i Cause mv to write a prompt to standard error before moving a file\n" " that would overwrite an existing file. If the response from the\n" " standard input begins with the character `y' or `Y', the move is\n" " attempted. (The -i option overrides any previous -f or -n\n" " options.)\n" " -n Do not overwrite an existing file. (The -n option overrides any\n" " previous -f or -i options.)\n" " -v Cause mv to be verbose, showing files after they are moved.\n" ); exit(EXIT_FAILURE); } int ad_mv(int argc, char *argv[]) { size_t baselen, len; int rval; char *p, *endp; struct stat sb; int ch; char path[MAXPATHLEN]; pdid = htonl(1); did = htonl(2); argc--; argv++; while ((ch = getopt(argc, argv, "finv")) != -1) switch (ch) { case 'i': iflg = 1; fflg = nflg = 0; break; case 'f': fflg = 1; iflg = nflg = 0; break; case 'n': nflg = 1; fflg = iflg = 0; break; case 'v': vflg = 1; break; default: usage_mv(); } argc -= optind; argv += optind; if (argc < 2) usage_mv(); set_signal(); cnid_init(); if (openvol(argv[argc - 1], &dvolume) != 0) { SLOG("Error opening CNID database for source \"%s\": ", argv[argc - 1]); return 1; } /* * If the stat on the target fails or the target isn't a directory, * try the move. More than 2 arguments is an error in this case. */ if (stat(argv[argc - 1], &sb) || !S_ISDIR(sb.st_mode)) { if (argc > 2) usage_mv(); if (openvol(argv[0], &svolume) != 0) { SLOG("Error opening CNID database for destination \"%s\": ", argv[0]); return 1; } rval = do_move(argv[0], argv[1]); closevol(&svolume); closevol(&dvolume); return 1; } /* It's a directory, move each file into it. */ if (strlen(argv[argc - 1]) > sizeof(path) - 1) ERROR("%s: destination pathname too long", *argv); (void)strcpy(path, argv[argc - 1]); baselen = strlen(path); endp = &path[baselen]; if (!baselen || *(endp - 1) != '/') { *endp++ = '/'; ++baselen; } for (rval = 0; --argc; ++argv) { /* * Find the last component of the source pathname. It * may have trailing slashes. */ p = *argv + strlen(*argv); while (p != *argv && p[-1] == '/') --p; while (p != *argv && p[-1] != '/') --p; if ((baselen + (len = strlen(p))) >= PATH_MAX) { SLOG("%s: destination pathname too long", *argv); rval = 1; } else { memmove(endp, p, (size_t)len + 1); openvol(*argv, &svolume); if (do_move(*argv, path)) rval = 1; closevol(&svolume); } } exit: closevol(&dvolume); return rval; } static int do_move(const char *from, const char *to) { struct stat sb; int ask, ch, first; /* * Check access. If interactive and file exists, ask user if it * should be replaced. Otherwise if file exists but isn't writable * make sure the user wants to clobber it. */ if (!fflg && !access(to, F_OK)) { /* prompt only if source exist */ if (lstat(from, &sb) == -1) { SLOG("%s: %s", from, strerror(errno)); return (1); } ask = 0; if (nflg) { if (vflg) printf("%s not overwritten\n", to); return (0); } else if (iflg) { (void)fprintf(stderr, "overwrite %s? (y/n [n]) ", to); ask = 1; } else if (access(to, W_OK) && !stat(to, &sb)) { (void)fprintf(stderr, "override for %s? (y/n [n]) ", to); ask = 1; } if (ask) { first = ch = getchar(); while (ch != '\n' && ch != EOF) ch = getchar(); if (first != 'y' && first != 'Y') { (void)fprintf(stderr, "not overwritten\n"); return (0); } } } int mustcopy = 0; /* * Besides the usual EXDEV we copy instead of moving if * 1) source AFP volume != dest AFP volume * 2) either source or dest isn't even an AFP volume */ if (!svolume.volinfo.v_path || !dvolume.volinfo.v_path || strcmp(svolume.volinfo.v_path, dvolume.volinfo.v_path) != 0) mustcopy = 1; cnid_t cnid = 0; if (!mustcopy) { if ((cnid = cnid_for_path(&svolume, from, &did)) == CNID_INVALID) { SLOG("Couldn't resolve CNID for %s", from); return -1; } if (stat(from, &sb) != 0) { SLOG("Cant stat %s: %s", to, strerror(errno)); return -1; } if (rename(from, to) != 0) { if (errno == EXDEV) { mustcopy = 1; char path[MAXPATHLEN]; /* * If the source is a symbolic link and is on another * filesystem, it can be recreated at the destination. */ if (lstat(from, &sb) == -1) { SLOG("%s: %s", from, strerror(errno)); return (-1); } if (!S_ISLNK(sb.st_mode)) { /* Can't mv(1) a mount point. */ if (realpath(from, path) == NULL) { SLOG("cannot resolve %s: %s: %s", from, path, strerror(errno)); return (1); } } } else { /* != EXDEV */ SLOG("rename %s to %s: %s", from, to, strerror(errno)); return (1); } } /* rename != 0*/ switch (sb.st_mode & S_IFMT) { case S_IFREG: if (dvolume.volume.vfs->vfs_renamefile(&dvolume.volume, -1, from, to) != 0) { SLOG("Error moving adouble file for %s", from); return -1; } break; case S_IFDIR: break; default: SLOG("Not a file or dir: %s", from); return -1; } /* get CNID of new parent dir */ cnid_t newpdid, newdid; if ((newdid = cnid_for_paths_parent(&dvolume, to, &newpdid)) == CNID_INVALID) { SLOG("Couldn't resolve CNID for parent of %s", to); return -1; } if (stat(to, &sb) != 0) { SLOG("Cant stat %s: %s", to, strerror(errno)); return 1; } char *p = strdup(to); char *name = basename(p); if (cnid_update(dvolume.volume.v_cdb, cnid, &sb, newdid, name, strlen(name)) != 0) { SLOG("Cant update CNID for: %s", to); return 1; } free(p); struct adouble ad; ad_init(&ad, dvolume.volinfo.v_adouble, dvolume.volinfo.v_ad_options); if (ad_open_metadata(to, S_ISDIR(sb.st_mode) ? ADFLAGS_DIR : 0, O_RDWR, &ad) != 0) { SLOG("Error opening adouble for: %s", to); return 1; } ad_setid(&ad, sb.st_dev, sb.st_ino, cnid, newdid, dvolume.db_stamp); ad_flush(&ad); ad_close_metadata(&ad); if (vflg) printf("%s -> %s\n", from, to); return (0); } if (mustcopy) return copy(from, to); /* If we get here it's an error */ return -1; } static int copy(const char *from, const char *to) { struct stat sb; int pid, status; if (lstat(to, &sb) == 0) { /* Destination path exists. */ if (S_ISDIR(sb.st_mode)) { if (rmdir(to) != 0) { SLOG("rmdir %s: %s", to, strerror(errno)); return (1); } } else { if (unlink(to) != 0) { SLOG("unlink %s: %s", to, strerror(errno)); return (1); } } } else if (errno != ENOENT) { SLOG("%s: %s", to, strerror(errno)); return (1); } /* Copy source to destination. */ if (!(pid = fork())) { execl(_PATH_AD, "ad", "cp", vflg ? "-Rpv" : "-Rp", from, to, (char *)NULL); _exit(1); } while ((waitpid(pid, &status, 0)) == -1) { if (errno == EINTR) continue; SLOG("%s cp -R %s %s: waitpid: %s", _PATH_AD, from, to, strerror(errno)); return (1); } if (!WIFEXITED(status)) { SLOG("%s cp -R %s %s: did not terminate normally", _PATH_AD, from, to); return (1); } switch (WEXITSTATUS(status)) { case 0: break; default: SLOG("%s cp -R %s %s: terminated with %d (non-zero) status", _PATH_AD, from, to, WEXITSTATUS(status)); return (1); } /* Delete the source. */ if (!(pid = fork())) { execl(_PATH_AD, "ad", "rm", "-R", from, (char *)NULL); _exit(1); } while ((waitpid(pid, &status, 0)) == -1) { if (errno == EINTR) continue; SLOG("%s rm -R %s: waitpid: %s", _PATH_AD, from, strerror(errno)); return (1); } if (!WIFEXITED(status)) { SLOG("%s rm -R %s: did not terminate normally", _PATH_AD, from); return (1); } switch (WEXITSTATUS(status)) { case 0: break; default: SLOG("%s rm -R %s: terminated with %d (non-zero) status", _PATH_AD, from, WEXITSTATUS(status)); return (1); } return 0; } static void preserve_fd_acls(int source_fd, int dest_fd, const char *source_path, const char *dest_path) { ; } netatalk-2.2.2/bin/ad/ad_find.c0000644000175200017500000001107411655731126013141 00000000000000/* Copyright (c) 2010 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ad.h" static volatile sig_atomic_t alarmed; /* SIGNAL handling: catch SIGINT and SIGTERM which cause clean exit. Ignore anything else. */ static void sig_handler(int signo) { alarmed = 1; return; } static void set_signal(void) { struct sigaction sv; sv.sa_handler = sig_handler; sv.sa_flags = SA_RESTART; sigemptyset(&sv.sa_mask); if (sigaction(SIGTERM, &sv, NULL) < 0) ERROR("error in sigaction(SIGTERM): %s", strerror(errno)); if (sigaction(SIGINT, &sv, NULL) < 0) ERROR("error in sigaction(SIGINT): %s", strerror(errno)); memset(&sv, 0, sizeof(struct sigaction)); sv.sa_handler = SIG_IGN; sigemptyset(&sv.sa_mask); if (sigaction(SIGABRT, &sv, NULL) < 0) ERROR("error in sigaction(SIGABRT): %s", strerror(errno)); if (sigaction(SIGHUP, &sv, NULL) < 0) ERROR("error in sigaction(SIGHUP): %s", strerror(errno)); if (sigaction(SIGQUIT, &sv, NULL) < 0) ERROR("error in sigaction(SIGQUIT): %s", strerror(errno)); } static void usage_find(void) { printf( "Usage: ad find [-v VOLUME_PATH] NAME\n" ); } int ad_find(int argc, char **argv) { int c, ret; afpvol_t vol; const char *srchvol = getcwdpath(); while ((c = getopt(argc-1, &argv[1], ":v:")) != -1) { switch(c) { case 'v': srchvol = strdup(optarg); break; case ':': case '?': usage_find(); return -1; break; } } optind++; if ((argc - optind) != 1) { usage_find(); exit(1); } set_signal(); cnid_init(); if (openvol(srchvol, &vol) != 0) ERROR("Cant open volume \"%s\"", srchvol); uint16_t flags = CONV_TOLOWER; char namebuf[MAXPATHLEN + 1]; if (convert_charset(vol.volinfo.v_volcharset, vol.volinfo.v_volcharset, vol.volinfo.v_maccharset, argv[optind], strlen(argv[optind]), namebuf, MAXPATHLEN, &flags) == (size_t)-1) { ERROR("conversion error"); } int count; char resbuf[DBD_MAX_SRCH_RSLTS * sizeof(cnid_t)]; if ((count = cnid_find(vol.volume.v_cdb, namebuf, strlen(namebuf), resbuf, sizeof(resbuf))) < 1) { ret = 1; } else { ret = 0; cnid_t cnid; char *bufp = resbuf; bstring sep = bfromcstr("/"); while (count--) { memcpy(&cnid, bufp, sizeof(cnid_t)); bufp += sizeof(cnid_t); bstring path = NULL; bstring volpath = bfromcstr(vol.volinfo.v_path); BSTRING_STRIP_SLASH(volpath); char buffer[12 + MAXPATHLEN + 1]; int buflen = 12 + MAXPATHLEN + 1; char *name; cnid_t did = cnid; struct bstrList *pathlist = bstrListCreateMin(32); while (did != DIRDID_ROOT) { if ((name = cnid_resolve(vol.volume.v_cdb, &did, buffer, buflen)) == NULL) goto next; bstrListPush(pathlist, bfromcstr(name)); } bstrListPush(pathlist, volpath); path = bjoinInv(pathlist, sep); printf("%s\n", cfrombstr(path)); next: bstrListDestroy(pathlist); bdestroy(path); } bdestroy(sep); } closevol(&vol); return ret; } netatalk-2.2.2/bin/ad/ad.h0000644000175200017500000000475211655731243012153 00000000000000/* Copyright (c) 2009,2011 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef AD_H #define AD_H #include #include #include #include #include #include #include #define DIR_DOT_OR_DOTDOT(a) \ ((strcmp(a, ".") == 0) || (strcmp(a, "..") == 0)) #ifndef TIMESPEC_TO_TIMEVAL #define TIMESPEC_TO_TIMEVAL(tv, ts) { \ (tv)->tv_sec = (ts)->tv_sec; \ (tv)->tv_usec = (ts)->tv_nsec / 1000; \ } #endif enum logtype {STD, DBG}; #define SLOG(...) \ _log(STD, __VA_ARGS__) #define ERROR(...) \ do { \ _log(STD, __VA_ARGS__); \ exit(1); \ } while (0) typedef struct { struct volinfo volinfo; struct vol volume; char db_stamp[ADEDLEN_PRIVSYN]; } afpvol_t; extern int log_verbose; /* Logging flag */ extern void _log(enum logtype lt, char *fmt, ...); extern int ad_ls(int argc, char **argv); extern int ad_cp(int argc, char **argv); extern int ad_rm(int argc, char **argv); extern int ad_mv(int argc, char **argv); extern int ad_find(int argc, char **argv); /* ad_util.c */ extern int openvol(const char *path, afpvol_t *vol); extern void closevol(afpvol_t *vol); extern cnid_t cnid_for_path(const afpvol_t *vol, const char *path, cnid_t *did); extern cnid_t cnid_for_paths_parent(const afpvol_t *vol, const char *path, cnid_t *did); extern char *utompath(const struct volinfo *volinfo, const char *upath); extern int convert_dots_encoding(const afpvol_t *svol, const afpvol_t *dvol, char *path, size_t buflen); typedef struct { char *p_end;/* pointer to NULL at end of path */ char *target_end;/* pointer to end of target base */ char p_path[MAXPATHLEN + 2];/* pointer to the start of a path */ } PATH_T; extern PATH_T to; extern int fflag, iflag, lflag, nflag, pflag, vflag; #endif /* AD_H */ netatalk-2.2.2/bin/psorder/0000777000175200017500000000000011704770424012563 500000000000000netatalk-2.2.2/bin/psorder/psorder.c0000644000175200017500000003246311655731126014332 00000000000000/* * $Id: psorder.c,v 1.10 2010-04-12 14:28:47 franklahm Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include "pa.h" #include "psorder.h" #include /* * Global Variables */ static u_char psbuf[ 8192 ]; static struct psinfo_st psinfo; static int orderflag, forceflag; static void filecleanup( int errorcode, int tfd, char *tfile) { /* Close and unlink the temporary file. */ if ( tfd != 0 ) { if ( close( tfd ) != 0 ) { perror( tfile ); exit( errorcode ); } if ( unlink( tfile ) != 0 ) { perror( tfile ); exit( errorcode ); } } exit( errorcode ); } static void filesetup( char *inputfile, int *infd, char *tfile, int *tfd) { struct stat st; char *template = _PATH_TMPPAGEORDER; if ( strcmp( inputfile, STDIN ) != 0 ) { if ( stat( inputfile, &st ) < 0 ) { perror( inputfile ); filecleanup( -1, -1, "" ); } if ( st.st_mode & S_IFMT & S_IFDIR ) { fprintf( stderr, "%s is a directory.\n", inputfile ); filecleanup( 0, -1, "" ); } if (( *infd = open( inputfile, O_RDONLY, 0600 )) < 0 ) { perror( inputfile ); filecleanup( -1, -1, "" ); } } else { *infd = 0; } #if DEBUG fprintf( stderr, "Input file or stdin and stdout opened.\n" ); fprintf( stderr, "Input file descriptor is %d .\n", *infd ); #endif /* DEBUG */ /* make temporary file */ #if defined(NAME_MAX) (void *)strncpy( tfile, template, NAME_MAX ); #else (void *)strncpy( tfile, template, MAXNAMLEN ); #endif if (( *tfd = mkstemp( tfile )) == -1 ) { fprintf( stderr, "can't create temporary file %s\n", tfile ); filecleanup( -1, -1, "" ); } #if DEBUG fprintf( stderr, "Temporary file %s created and opened.\n", tfile ); fprintf( stderr, "Temporary file descriptor is %d .\n", *tfd ); #endif /* DEBUG */ psinfo.firstpage = NULL; psinfo.lastpage = NULL; psinfo.trailer = 0; psinfo.pages.offset = 0; psinfo.pages.end = 0; psinfo.pages.num[0] = '\0'; psinfo.pages.order[0] = '\0'; return; } static struct pspage_st *getpspage(off_t off) { struct pspage_st *newpspage; newpspage = (struct pspage_st *)malloc( sizeof( struct pspage_st )); if ( newpspage != NULL ) { newpspage->offset = off; newpspage->nextpage = NULL; *newpspage->lable = '\0'; *newpspage->ord = '\0'; } return( newpspage ); } static int handletok(off_t count, char *token) { int incdoc = 0; struct pspage_st *newpage; char *tmp; if (( strncmp( PENDDOC, token, strlen( PENDDOC )) == 0 ) && incdoc ) { incdoc--; #if DEBUG fprintf( stderr, "found an EndDoc\n" ); #endif /* DEBUG */ } else if ( strncmp( PBEGINDOC, token, strlen( PBEGINDOC )) == 0 ) { incdoc++; #if DEBUG fprintf( stderr, "found a BeginDoc\n" ); #endif /* DEBUG */ } else if ( !incdoc && ( strncmp( PPAGE, token, strlen( PPAGE )) == 0 )) { #if DEBUG fprintf( stderr, "found a Page\n" ); #endif /* DEBUG */ if (( newpage = getpspage( count )) == NULL ) { return( -1 ); } if ( psinfo.firstpage == NULL ) { newpage->prevpage = NULL; psinfo.firstpage = newpage; } else { newpage->prevpage = psinfo.lastpage; psinfo.lastpage->nextpage = newpage; } psinfo.lastpage = newpage; while ( *token++ != ':' ); if (( tmp = strtok( token, WHITESPACE )) != NULL ) { (void)strncpy( newpage->lable, tmp, NUMLEN ); if (( tmp = strtok( NULL, WHITESPACE )) != NULL ) { (void)strncpy( newpage->ord, tmp, ORDLEN ); } } #if DEBUG fprintf( stderr, "page lable %s, page ord %s\n", newpage->lable, newpage->ord ); #endif /* DEBUG */ } else if ( !incdoc && ( strncmp( PPAGES, token, strlen( PPAGES )) == 0 )) { #if DEBUG fprintf( stderr, "found a Pages\n" ); #endif /* DEBUG */ psinfo.pages.offset = count; psinfo.pages.end = strlen( token ) + count; while ( *token++ != ':' ); while ( isspace( *token )) token++; if ( strncmp( ATEND, token, strlen( ATEND )) == 0 ) { #if DEBUG fprintf( stderr, "it is a Pages: (atend)\n" ); #endif /* DEBUG */ psinfo.pages.offset = 0; psinfo.pages.end = 0; } else { if (( tmp = strtok( token, WHITESPACE )) != NULL ) { (void)strncpy( psinfo.pages.num, tmp, NUMLEN ); if (( tmp = strtok( NULL, WHITESPACE )) != NULL ) { (void)strncpy( psinfo.pages.order, tmp, ORDERLEN ); } } #if DEBUG fprintf( stderr, "number of pages %s\n", psinfo.pages.num ); fprintf( stderr, "order control number %s\n", psinfo.pages.order ); #endif /* DEBUG */ } } else if ( !incdoc && ( strncmp( PTRAILER, token, strlen( PTRAILER )) == 0 )) { #if DEBUG fprintf( stderr, "found the Trailer\n" ); #endif /* DEBUG */ if ( psinfo.trailer == 0 ) { psinfo.trailer = count; } } return( 0 ); } static void readps(int inputfd, int tempfd, char *tempfile) { off_t ccread = 0; off_t ccmatch; char *curtok = NULL; FILE *tempstream; pa_buf_t *pb; int n; char c = -1; char pc, cc = 0; pb = pa_init( inputfd ); if (( tempstream = fdopen( tempfd, "w" )) == NULL ) { perror( "fdopen fails for tempfile" ); filecleanup( -1, tempfd, tempfile ); } if (( c = pa_getchar( pb )) != 0 ) { ccread++; (void)putc( c, tempstream ); pc = 0; cc = c; pa_match( pb ); n = strlen( PPSADOBE ); for ( ; ( n > 0 ) && (( c = pa_getchar( pb )) != 0 ) ; n-- ) { ccread++ ; (void)putc( c, tempstream ); pc = cc; cc = c; } curtok = pa_gettok( pb ); } #if DEBUG fprintf( stderr, "%s\n", curtok ); #endif /* DEBUG */ /* * not postscript */ if ( strcmp( curtok, PPSADOBE ) != 0 ) { #if DEBUG fprintf( stderr, "in the not postscript section of readps\n" ); #endif /* DEBUG */ while (( c = pa_getchar( pb )) != 0 ) { ccread++; (void)putc( c, tempstream ); pc = cc; cc = c; } (void)fflush( tempstream ); return; } /* * postscript */ #if DEBUG fprintf( stderr, "in the postscript section of readps\n" ); #endif /* DEBUG */ while (( c = pa_getchar( pb )) != 0 ) { ccread++; (void)putc( c, tempstream ); pc = cc; cc = c; if ((( pc == '\r' ) || ( pc == '\n' )) && ( cc == '%' )) { #if DEBUG fprintf( stderr, "supposed start of match, cc = %c\n", cc ); #endif /* DEBUG */ pa_match( pb ); ccmatch = ccread - 1; while ( ( c = pa_getchar( pb ) ) ) { if ( c != 0 ) { ccread++; (void)putc( c, tempstream ); pc = cc; cc = c; } if (( c == '\r' ) || ( c == '\n' ) || ( cc == '\0' )) { curtok = pa_gettok( pb ); #if DEBUG fprintf( stderr, "%s\n", curtok ); #endif /* DEBUG */ if ( handletok( ccmatch, curtok ) < 0 ) { perror( "malloc died" ); filecleanup( -1, tempfd, tempfile ); } break; } if ( c == 0 ) break; } if ( c == 0 ) break; } } (void)fflush( tempstream ); return; } static void temp2out(int tempfd, char *tempfile, off_t length) { int ccread; int ccwrite; int size; while ( length > 0 ) { if ( length > sizeof( psbuf )) { size = sizeof( psbuf ); } else size = length; if (( ccread = read( tempfd, psbuf, size )) > 0 ) { size = ccread; while ( ccread > 0 ) { ccwrite = write( 1, psbuf, ccread ); if ( ccwrite < 0 ) { perror( "stdout" ); filecleanup( ccwrite, tempfd, tempfile ); } else { ccread -= ccwrite; } } } if ( ccread < 0 ) { perror( "temporary file" ); filecleanup( ccread, tempfd, tempfile ); } length -= size; } } static void writelable(int tempfd, char *tempfile, char *lable) { char line[256]; int ccwrite; int linelen; char *argone; char *argtwo; if ( strcmp( lable, PPAGES ) == 0 ) { argone = psinfo.pages.num; argtwo = psinfo.pages.order; } else { argone = argtwo = NULL; } (void)sprintf( line, "%s %s %s", lable, argone, argtwo ); linelen = strlen( line ); ccwrite = write( 1, line, linelen ); if ( ccwrite < 0 ) { perror( "stdout" ); filecleanup( ccwrite, tempfd, tempfile ); } else { linelen -= ccwrite; } } static void writeps(int tempfd, char *tempfile) { struct stat st; off_t endofpage; int order; if ( stat( tempfile, &st ) < 0 ) { perror( "stat failed" ); filecleanup( -1, tempfd, tempfile ); } if ( psinfo.trailer == 0 ) { endofpage = st.st_size; } else endofpage = psinfo.trailer; if (( psinfo.firstpage == NULL ) || ( psinfo.firstpage == psinfo.lastpage )) { order = FORWARD; } else if ( psinfo.pages.offset == 0 ) { order = orderflag; } else if (( strncmp( psinfo.pages.order, "", ORDERLEN ) == 0 ) || ( strncmp( psinfo.pages.order, "1", ORDERLEN ) == 0 )) { order = orderflag; if ( order == REVERSE ) strcpy( psinfo.pages.order, "-1" ); } else if ( strncmp( psinfo.pages.order, "-1", ORDERLEN ) == 0 ) { if ( orderflag == FORWARD ) { order = REVERSE; strcpy( psinfo.pages.order, "1" ); } else order = FORWARD; } else if (( strncmp( psinfo.pages.order, "0", ORDERLEN ) == 0 ) && forceflag ) { order = orderflag; } else order = FORWARD; if ( order == FORWARD ) { temp2out( tempfd, tempfile, st.st_size ); } else { /* * output the header stuff and rewrite the $$Pages line * if it is in the header and not %%Pages: (atend) */ if ( psinfo.firstpage->offset > 0 ) { if (( psinfo.firstpage->offset > psinfo.pages.offset ) && ( psinfo.pages.offset != 0 )) { temp2out( tempfd, tempfile, psinfo.pages.offset ); writelable( tempfd, tempfile, PPAGES ); if ( lseek( tempfd, psinfo.pages.end, SEEK_SET ) < 0 ) { perror( tempfile ); filecleanup( -1, tempfd, tempfile ); } temp2out( tempfd, tempfile, psinfo.firstpage->offset - psinfo.pages.end ); } else temp2out( tempfd, tempfile, psinfo.firstpage->offset ); } /* * output the pages, last to first */ while ( psinfo.lastpage != NULL ) { if ( lseek( tempfd, psinfo.lastpage->offset, SEEK_SET ) < 0 ) { perror( tempfile ); filecleanup( -1, tempfd, tempfile ); } temp2out( tempfd, tempfile, endofpage - psinfo.lastpage->offset ); endofpage = psinfo.lastpage->offset; psinfo.lastpage = psinfo.lastpage->prevpage; if ( psinfo.lastpage != NULL ) { (void)free( psinfo.lastpage->nextpage ); psinfo.lastpage->nextpage = NULL; } } /* * output the trailer stuff and rewrite the $$Pages line * if it is in the trailer */ if ( psinfo.trailer != 0 ) { if ( lseek( tempfd, psinfo.trailer, SEEK_SET ) < 0 ) { perror( tempfile ); filecleanup( -1, tempfd, tempfile ); } if ( psinfo.trailer < psinfo.pages.offset ) { temp2out( tempfd, tempfile, psinfo.pages.offset - psinfo.trailer ); writelable( tempfd, tempfile, PPAGES ); if ( lseek( tempfd, psinfo.pages.end, SEEK_SET ) < 0 ) { perror( tempfile ); filecleanup( -1, tempfd, tempfile ); } temp2out( tempfd, tempfile, st.st_size - psinfo.pages.end ); } else temp2out( tempfd, tempfile, st.st_size - psinfo.trailer ); } } return; } static int psorder(char *path) { int tempfd; int inputfd; #if defined(NAME_MAX) char tempfile[NAME_MAX]; #else char tempfile[MAXNAMLEN]; #endif filesetup( path, &inputfd, tempfile, &tempfd ); readps( inputfd, tempfd, tempfile ); if ( lseek( tempfd, REWIND, SEEK_SET ) < 0 ) { perror( tempfile ); filecleanup( -1, tempfd, tempfile ); } writeps( tempfd, tempfile ); filecleanup( 0, tempfd, tempfile ); return( 0 ); } int main(int argc, char **argv) { extern int optind; char *progname; int errflag = 0; int c; while (( c = getopt( argc, argv, OPTSTR )) != -1 ) { switch ( c ) { case REVCHAR: if ( orderflag ) errflag++; else orderflag = REVERSE; break; case FORWCHAR: if ( orderflag ) errflag++; else orderflag = FORWARD; break; case FORCECHAR: if ( forceflag ) errflag++; else forceflag++; break; } } if ( errflag ) { if (( progname = strrchr( argv[ 0 ], '/' )) == NULL ) { progname = argv[ 0 ]; } else progname++; fprintf( stderr, "usage: %s [-duf] [sourcefile]\n", progname ); return( -1 ); } else if ( !orderflag ) orderflag = FORWARD; if ( optind >= argc ) { return( psorder( STDIN )); } return( psorder( argv[ optind ] )); } netatalk-2.2.2/bin/psorder/psorder.h0000644000175200017500000000365711655731126014342 00000000000000/* * $Id: psorder.h,v 1.3 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef STDIN # define STDIN "-" #endif /* ! STDIN */ #ifndef FALSE # define FALSE 0 # define TRUE 1 #endif /* ! FALSE */ #define REVCHAR 'd' #define FORWCHAR 'u' #define FORCECHAR 'f' #define OPTSTR "duf" #define WHITESPACE " \t" #define ATEND "(atend)" #define PPSADOBE "%!PS-Adobe-" #define PPAGE "%%Page:" #define PPAGES "%%Pages:" #define PTRAILER "%%Trailer" #define PBEGINDOC "%%BeginDocument:" #define PENDDOC "%%EndDocument" #define PBEGINBIN "%%BeginBinary:" #define PENDBIN "%%EndBinary" #define REWIND 0L #define REVERSE 1 #define FORWARD 2 #define LABELLEN 32 #define ORDLEN 4 struct pspage_st { struct pspage_st *nextpage; struct pspage_st *prevpage; off_t offset; char lable[ LABELLEN ]; char ord[ ORDLEN ]; }; #define NUMLEN 10 #define ORDERLEN 3 struct pages_st { off_t offset; off_t end; char num[ NUMLEN ]; char order[ ORDERLEN ]; }; struct psinfo_st { struct pspage_st *firstpage; struct pspage_st *lastpage; off_t trailer; struct pages_st pages; }; netatalk-2.2.2/bin/psorder/Makefile.am0000644000175200017500000000034611655731126014537 00000000000000# Makefile.am for bin/psorder INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys bin_PROGRAMS = psorder psorder_SOURCES = psorder.c pa.c psorder_LDADD = $(top_builddir)/libatalk/libatalk.la noinst_HEADERS = psorder.h pa.h netatalk-2.2.2/bin/psorder/Makefile.in0000644000175200017500000004144611703521723014550 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for bin/psorder VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = psorder$(EXEEXT) subdir = bin/psorder DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_psorder_OBJECTS = psorder.$(OBJEXT) pa.$(OBJEXT) psorder_OBJECTS = $(am_psorder_OBJECTS) psorder_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(psorder_SOURCES) DIST_SOURCES = $(psorder_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys psorder_SOURCES = psorder.c pa.c psorder_LDADD = $(top_builddir)/libatalk/libatalk.la noinst_HEADERS = psorder.h pa.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bin/psorder/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign bin/psorder/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done psorder$(EXEEXT): $(psorder_OBJECTS) $(psorder_DEPENDENCIES) @rm -f psorder$(EXEEXT) $(LINK) $(psorder_OBJECTS) $(psorder_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psorder.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/bin/psorder/pa.h0000644000175200017500000000421211655731126013250 00000000000000/* * $Id: pa.h,v 1.3 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ /* * Functions to aid in parsing: * * pa_init( fd ) Allocate and return a handle. Reads * from fd. Call this first, always. * pa_getchar( h ) Return a single character or nul, 0, * to indicate end-of-file. * pa_match( h ) Mark the character last read as the start * of a match. * pa_gettok( h ) The match up to but excluding the last * character is returned. * pa_cont( h ) Continue match with previous match. Call * immediately after pa_gettok() to get * correct behavior. * pa_cancel( h ) Cancel previous match start. */ #ifndef _PA_H #define _PA_H 1 #ifndef FILE_H #include #endif /* FILE_H */ #define PA_BUFBLK 1024 #define PA_NORMAL 0 #define PA_MATCHING 1 typedef struct pa_buf_t { char *buf; char *cur; char *mark; char *end; int fd; int state; unsigned bufsz; char tmp; } pa_buf_t; extern pa_buf_t *pa_init(int fd); extern char _pa_fixbuf(pa_buf_t *h); extern char *pa_gettok(pa_buf_t *h); #define pa_getchar(h) (((h)->cur==(h)->end)?(_pa_fixbuf(h)):\ (*(++((h)->cur)))) #define pa_match(h) ((h)->state=PA_MATCHING,(h)->mark=(h)->cur) #define pa_cont(h) (*((h)->cur)=(h)->tmp,(h)->state=PA_MATCHING) #define pa_cancel(h) ((h)->state=PA_NORMAL) #define pa_back(h) (--((h)->cur)) #endif /* _PA_H */ netatalk-2.2.2/bin/psorder/pa.c0000644000175200017500000000440011655731126013242 00000000000000/* * $Id: pa.c,v 1.6 2009-10-14 02:24:05 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ /* This is used with pa.h */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include "pa.h" pa_buf_t *pa_init(int fd) { pa_buf_t *h; int rc; h = (pa_buf_t *) malloc( sizeof( pa_buf_t )); h->buf = (char *) malloc( PA_BUFBLK * 2 ); h->bufsz = PA_BUFBLK * 2; if (( rc = read( fd, h->buf, PA_BUFBLK )) < 0 ) { return( NULL ); } h->cur = h->buf - 1; h->end = h->buf + rc - 1; h->state = PA_NORMAL; h->fd = fd; return( h ); } char *pa_gettok(pa_buf_t *h) { h->state = PA_NORMAL; h->tmp = *(h->cur); *(h->cur) = 0; return( h->mark ); } char _pa_fixbuf(pa_buf_t *h) { int rc; char *t; if ( h->state == PA_NORMAL ) { *(h->buf) = *(h->cur); h->cur = h->buf; } else { bcopy( h->mark, h->buf, h->end - h->mark + 1 ); h->cur = h->buf + ( h->cur - h->mark ); h->end = h->buf + ( h->end - h->mark ); h->mark = h->buf; } if ( h->bufsz - (( h->cur - h->buf ) + 1 ) < PA_BUFBLK ) { t = h->buf; h->buf = (char *) realloc( h->buf, h->bufsz + PA_BUFBLK ); h->bufsz += PA_BUFBLK; h->mark = h->buf + ( h->mark - t ); h->cur = h->buf + ( h->cur - t ); h->end = h->buf + ( h->end - t ); } if (( rc = read( h->fd, h->cur + 1, PA_BUFBLK )) <= 0 ) { return( (char) 0 ); } h->end = h->cur + rc; return( *(++(h->cur)) ); } netatalk-2.2.2/bin/getzones/0000777000175200017500000000000011704770424012743 500000000000000netatalk-2.2.2/bin/getzones/Makefile.am0000644000175200017500000000030611655731126014713 00000000000000# Makefile.am for bin/getzones/ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys bin_PROGRAMS = getzones getzones_SOURCES = getzones.c getzones_LDADD = $(top_builddir)/libatalk/libatalk.la netatalk-2.2.2/bin/getzones/Makefile.in0000644000175200017500000004121411703521723014721 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for bin/getzones/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = getzones$(EXEEXT) subdir = bin/getzones DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_getzones_OBJECTS = getzones.$(OBJEXT) getzones_OBJECTS = $(am_getzones_OBJECTS) getzones_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(getzones_SOURCES) DIST_SOURCES = $(getzones_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys getzones_SOURCES = getzones.c getzones_LDADD = $(top_builddir)/libatalk/libatalk.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bin/getzones/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign bin/getzones/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done getzones$(EXEEXT): $(getzones_OBJECTS) $(getzones_DEPENDENCIES) @rm -f getzones$(EXEEXT) $(LINK) $(getzones_OBJECTS) $(getzones_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getzones.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/bin/getzones/getzones.c0000644000175200017500000000704711655731126014672 00000000000000/* * $Id: getzones.c,v 1.9 2009-10-14 01:38:28 didg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #ifdef HAVE_NETDB_H #include #endif /* HAVE_NETDB_H */ #include #include #include #include #include #include #include #include #include static void print_zones(short n, char *buf); static void usage( char *s) { fprintf( stderr, "usage:\t%s [-m | -l] [address]\n", s ); exit( 1 ); } int main( int argc, char *argv[]) { struct atp_handle *ah; struct atp_block atpb; struct sockaddr_at saddr; struct servent *se; char reqdata[4], buf[ ATP_MAXDATA ]; struct iovec iov; short temp, index = 0; int c, myzoneflg = 0, localzonesflg = 0, errflg = 0; extern int optind; reqdata[ 0 ] = ZIPOP_GETZONELIST; while (( c = getopt( argc, argv, "ml" )) != EOF ) { switch (c) { case 'm': if ( localzonesflg ) { ++errflg; } ++myzoneflg; reqdata[ 0 ] = ZIPOP_GETMYZONE; break; case 'l': if ( myzoneflg ) { ++errflg; } ++localzonesflg; reqdata[ 0 ] = ZIPOP_GETLOCALZONES; break; default: ++errflg; } } if ( errflg || argc - optind > 1 ) { usage( argv[ 0 ] ); } memset( &saddr, 0, sizeof( struct sockaddr_at )); #ifdef BSD4_4 saddr.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ saddr.sat_family = AF_APPLETALK; if (( se = getservbyname( "zip", "ddp" )) == NULL ) saddr.sat_port = 6; else saddr.sat_port = ntohs( se->s_port ); if ( argc == optind ) { saddr.sat_addr.s_net = ATADDR_ANYNET; saddr.sat_addr.s_node = ATADDR_ANYNODE; } else { if ( !atalk_aton( argv[ optind ], &saddr.sat_addr )) { fprintf( stderr, "Bad address.\n" ); exit( 1 ); } } if (( ah = atp_open( ATADDR_ANYPORT, &saddr.sat_addr )) == NULL ) { perror( "atp_open" ); exit( 1 ); } index = ( myzoneflg ? 0 : 1 ); reqdata[1] = 0; do { atpb.atp_saddr = &saddr; temp = htons( index ); memcpy( reqdata + 2, &temp, 2 ); atpb.atp_sreqdata = reqdata; atpb.atp_sreqdlen = 4; atpb.atp_sreqto = 2; atpb.atp_sreqtries = 5; /* send getzone request zones (or get my zone) */ if ( atp_sreq( ah, &atpb, 1, 0 ) < 0 ) { perror( "atp_sreq" ); exit( 1 ); } iov.iov_base = buf; iov.iov_len = ATP_MAXDATA; atpb.atp_rresiov = &iov; atpb.atp_rresiovcnt = 1; if ( atp_rresp( ah, &atpb ) < 0 ) { perror( "atp_rresp" ); exit( 1 ); } memcpy( &temp, (char *) iov.iov_base + 2, 2 ); temp = ntohs( temp ); print_zones( temp, (char *) iov.iov_base+4 ); index += temp; } while ( !myzoneflg && !((char *)iov.iov_base)[ 0 ] ); if ( atp_close( ah ) != 0 ) { perror( "atp_close" ); exit( 1 ); } exit( 0 ); } /* * n: number of zones in this packet * buf: zone length/name pairs */ static void print_zones( short n, char *buf ) { size_t zone_len; char *zone; for ( ; n--; buf += (*buf) + 1 ) { if ((size_t)(-1) == (zone_len = convert_string_allocate( CH_MAC, CH_UNIX, buf+1, *buf, &zone)) ) { zone_len = *buf; if (( zone = strdup(buf+1)) == NULL ) { perror( "strdup" ); exit( 1 ); } } printf( "%.*s\n", (int)zone_len, zone ); free(zone); } } netatalk-2.2.2/bin/cnid/0000777000175200017500000000000011704770423012021 500000000000000netatalk-2.2.2/bin/cnid/Makefile.am0000644000175200017500000000014711655731126013775 00000000000000# Makefile.am for bin/cnid/ EXTRA_DIST = cnid2_create.in if USE_BDB bin_SCRIPTS = cnid2_create endif netatalk-2.2.2/bin/cnid/Makefile.in0000644000175200017500000003053411703521723014003 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for bin/cnid/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = bin/cnid DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/cnid2_create.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = cnid2_create am__installdirs = "$(DESTDIR)$(bindir)" binSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = cnid2_create.in @USE_BDB_TRUE@bin_SCRIPTS = cnid2_create all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bin/cnid/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign bin/cnid/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cnid2_create: $(top_builddir)/config.status $(srcdir)/cnid2_create.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binSCRIPTS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-binSCRIPTS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/bin/cnid/cnid2_create.in0000755000175200017500000002052011655731126014613 00000000000000#!@PERL@ # # Upgrade version 1 CNID databases to version 2 # # $Id: cnid2_create.in,v 1.2 2005-04-28 20:49:19 bfernhomberg Exp $ # # Copyright (C) Joerg Lenneis 2003 # All Rights Reserved. See COPYING. # # use strict; ### Globals my $toplevel = $ARGV[0]; # Assume our current directory is .AppleDB in the share directory as the default. $toplevel = ".." unless $toplevel; # Main file information data structure. Each entry in did_table points # to a list of hashes. Key is a DID and each list member is a hash # describing a file or directory in the directory corresponding to the # DID. n_entries is the number of items found, output_list contains # all entries that are eventually written to the output file. my %did_table; my $n_entries; my @output_list; # RootInfo values in the new format my $ri_cnid = "00000000"; my $ri_dev = "1122334400000000"; my $ri_ino = "0000000000000000"; my $ri_did = "00000000"; my $ri_hexname = "526f6f74496e666f00"; # RootInfo\0 # Current CNID found in didname.db my $current_cnid; # Largest CNID from cnid.db, used if we cannot find the current CNID in didname.db my $max_cnid; # Number of bogus/invalid entries found in the DB my $errors_found; # Filenames my $didname_dump = "didname.dump"; my $cnid_dump = "cnid.dump"; my $cnid2_dump = "cnid2.dump"; ### Subroutines sub skip_header($) { my $handle = shift; my $header_ok; while (<$handle>) { chomp; if ($_ eq "HEADER=END") { $header_ok = 1; last; } } die "No valid header found, invalid input file?" unless $header_ok; } sub print_eentry($$) { my $reason = shift; my $entry = shift; printf "??:%s %-9s%-9s%-9s%-9s%s\n", $reason, $entry->{cnid}, $entry->{dev}, $entry->{ino}, $entry->{did}, $entry->{name}; $errors_found++; } sub find_current_cnid() { my $key; my $val; my $cnid; my $compare = " " . $ri_did . $ri_hexname; # get rid of "00" at the end, RootInfo in the old format does not have a trailing \0 $compare =~ s/00$//; open DIDNAME, "< $didname_dump" or die "Unable to open $didname_dump: $!"; skip_header(*DIDNAME); while (1) { $key = ; chomp $key; last if $key eq "DATA=END"; $val = ; chomp $val; last unless defined($key) and defined($val); if ($key eq $compare) { # \00\00\00\00RootInfo $val =~ s/^ //; $cnid = $val; last; } } close DIDNAME; return $cnid; } sub verify_entry($) { my $entry = shift; if (length($entry->{cnid}) != 8 or length($entry->{name}) == 0) { print_eentry("fmt", $entry); return 0; } else { return 1; } } sub create_did_table() { my $data_ok; my $key; my $val; my $len; my $i; my $name; my $cmax; open CNID, "< $cnid_dump" or die "Unable to open $cnid_dump: $!"; skip_header(*CNID); while (1) { $key = ; chomp $key; $key =~ s/^ //; if ($key eq "DATA=END") { $data_ok = 1; last; } my $val = ; chomp $val; $val =~ s/^ //; last unless defined($key) and defined($val); # We do not worry about converting any of the # integer values into binary form. They are in network byte order, # so we know how to extend them. We just treat them as hexadecimal ASCII strings. # The file name is also stored as a proper string, since we need to # look for it in the file system. my $entry; $entry->{cnid} = $key; $entry->{dev} = substr($val, 0, 8); $entry->{ino} = substr($val, 8, 8); $entry->{did} = substr($val, 16, 8); $entry->{hexname} = substr($val, 24); $len = length($entry->{hexname}) - 2; $i = 0; $name = ''; while ($i < $len) { $name .= chr(hex(substr($entry->{hexname}, $i, 2))); $i += 2; } $entry->{name} = $name; if (verify_entry($entry)) { push @{$did_table{$entry->{did}}}, $entry; $n_entries++; $cmax = $entry->{cnid} if $entry->{cnid} gt $cmax; } } close CNID; die "No valid end of data found, invalid input file?" unless $data_ok; return $cmax; } sub output_header($$$) { my $handle = shift; my $dbname = shift; my $n = shift; printf $handle "VERSION=3\nformat=bytevalue\ndatabase=%s\ntype=btree\nHEADER=END\n", $dbname; } sub expand_did_table($$) { my $did = shift; my $basename = shift; my $entry; my $name; foreach $entry (@{$did_table{$did}}) { $name = $basename . "/" . $entry->{name}; if ( -e $name ) { if ( -d $name ) { $entry->{type} = "00000001"; } else { $entry->{type} = "00000000"; } } else { # The file/dir does not exist in the file system. This could result # from a non-afpd rename that has not yet been picked up by afpd and is # fixable. We need a guess at the type, though. if ($did_table{$entry->{cnid}} and scalar(@{$did_table{$entry->{cnid}}}) > 0) { # We have entries hanging off this entry in our table, # so this must be a directory $entry->{type} = "00000001"; } else { # If this is actually an empty directory that was renamed, # the entry will be deleted by afpd on the next access, # so this should be safe $entry->{type} = "00000000"; } } $entry->{reached} = 1; push @output_list, $entry; expand_did_table($entry->{cnid}, $name); } } sub find_unreachable() { my $did; my $list; my $entry; while (($did, $list) = each %did_table) { foreach $entry (@{$list}) { print_eentry("reach", $entry) unless $entry->{reached}; } } } sub find_duplicates() { my %seen_cnid; my %seen_devino; my %seen_didname; my $cnid; my $devino; my $didname; my $err; my $entry; for (my $i = 0; $i < scalar(@output_list); $i++) { $err = 0; $entry = $output_list[$i]; $cnid = $entry->{cnid}; $devino = $entry->{dev} . $entry->{ino}; $didname = $entry->{did} . $entry->{name}; if ($seen_cnid{$cnid}) { print_eentry("exist_cnid", $entry); $err++; } if ($seen_cnid{$cnid}) { print_eentry("dupl_cnid", $entry); $err++; } if ($seen_devino{$devino}) { print_eentry("dupl_devino", $entry); $err++; } if ($seen_didname{$didname}) { print_eentry("dupl_didname", $entry); $err++; } if ($err) { splice(@output_list, $i, 1); } else { $seen_cnid{$cnid} = 1; $seen_devino{$devino} = 1; $seen_didname{$didname} = 1; } } } print "Finding the current CNID from $didname_dump\n"; $current_cnid = find_current_cnid(); print "Reading in entries from $cnid_dump\n"; $max_cnid = create_did_table(); print "Found $n_entries entries\n"; if (not $current_cnid) { print "Warning: could not find a valid entry for the current CNID in $didname_dump.\n"; print "Using maximum CNID value $max_cnid from $cnid_dump instead\n"; $current_cnid = $max_cnid; } else { print "Current CNID is $current_cnid\n"; } print "Building directory tree according to cnid.db\n"; expand_did_table("00000002", $toplevel); if ($n_entries > scalar(@output_list)) { print "Looking for unreachable nodes in the directory tree:\n"; find_unreachable(); } print "Looking for duplicate entries\n"; find_duplicates(); print "Creating $cnid2_dump\n"; open CNID2, "> $cnid2_dump" or die "Unable to open $cnid2_dump for writing: $!"; output_header(*CNID2, "cnid2.db", scalar(@output_list) + 1); foreach my $entry (@output_list) { print CNID2 " ", $entry->{cnid}, "\n"; print CNID2 " ", $entry->{cnid}, "00000000", $entry->{dev}, "00000000", $entry->{ino}, $entry->{type}, $entry->{did}, $entry->{hexname}, "\n"; } print CNID2 " ", $ri_cnid, "\n"; print CNID2 " ", $ri_cnid, $ri_dev, $ri_ino, $current_cnid, $ri_did, $ri_hexname, "\n"; print CNID2 "DATA=END\n"; output_header(*CNID2, "devino.db", scalar(@output_list) + 1); foreach my $entry (@output_list) { print CNID2 " ", "00000000", $entry->{dev}, "00000000", $entry->{ino}, "\n"; print CNID2 " ", $entry->{cnid}, "\n"; } print CNID2 " ", $ri_dev, $ri_ino, "\n"; print CNID2 " ", $ri_cnid, "\n"; print CNID2 "DATA=END\n"; output_header(*CNID2, "didname.db", scalar(@output_list) + 1); foreach my $entry (@output_list) { print CNID2 " ", $entry->{did}, $entry->{hexname}, "\n"; print CNID2 " ", $entry->{cnid}, "\n"; } print CNID2 " ", $ri_did, $ri_hexname, "\n"; print CNID2 " ", $ri_cnid, "\n"; print CNID2 "DATA=END\n"; close CNID2; exit 0; netatalk-2.2.2/bin/megatron/0000777000175200017500000000000011704770424012721 500000000000000netatalk-2.2.2/bin/megatron/Makefile.am0000644000175200017500000000115211655731126014671 00000000000000# Makefile.am for bin/megatron/ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys bin_PROGRAMS = megatron megatron_SOURCES = asingle.c hqx.c macbin.c megatron.c nad.c updcrc.c megatron_LDADD = $(top_builddir)/libatalk/libatalk.la noinst_HEADERS = asingle.h megatron.h hqx.h macbin.h nad.h updcrc.h LINKS = unbin unhex unsingle hqx2bin single2bin macbinary binheader nadheader install-exec-hook: @for LINK in $(LINKS); do \ rm -f $(DESTDIR)$(bindir)/$$LINK; \ $(LN_S) megatron $(DESTDIR)$(bindir)/$$LINK; \ done uninstall-hook: @for LINK in $(LINKS); do \ rm -f $(DESTDIR)$(bindir)/$$LINK; \ done netatalk-2.2.2/bin/megatron/hqx.h0000644000175200017500000000077611655731126013621 00000000000000/* * $Id: hqx.h,v 1.3 2010-01-27 21:27:53 didg Exp $ */ #ifndef _HQX_H #define _HQX_H 1 /* Forward Declarations */ struct FHeader; int skip_junk(int line); int hqx_open(char *hqxfile, int flags, struct FHeader *fh, int options); int hqx_close(int keepflag); ssize_t hqx_read(int fork, char *buffer, size_t length); int hqx_header_read(struct FHeader *fh); int hqx_header_write(struct FHeader *fh); size_t hqx_7tobin(char *outbuf, size_t datalen); ssize_t hqx7_fill(u_char *hqx7_ptr); #endif /* _HQX_H */ netatalk-2.2.2/bin/megatron/Makefile.in0000644000175200017500000004332011703521723014677 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for bin/megatron/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = megatron$(EXEEXT) subdir = bin/megatron DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_megatron_OBJECTS = asingle.$(OBJEXT) hqx.$(OBJEXT) macbin.$(OBJEXT) \ megatron.$(OBJEXT) nad.$(OBJEXT) updcrc.$(OBJEXT) megatron_OBJECTS = $(am_megatron_OBJECTS) megatron_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(megatron_SOURCES) DIST_SOURCES = $(megatron_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys megatron_SOURCES = asingle.c hqx.c macbin.c megatron.c nad.c updcrc.c megatron_LDADD = $(top_builddir)/libatalk/libatalk.la noinst_HEADERS = asingle.h megatron.h hqx.h macbin.h nad.h updcrc.h LINKS = unbin unhex unsingle hqx2bin single2bin macbinary binheader nadheader all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bin/megatron/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign bin/megatron/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done megatron$(EXEEXT): $(megatron_OBJECTS) $(megatron_DEPENDENCIES) @rm -f megatron$(EXEEXT) $(LINK) $(megatron_OBJECTS) $(megatron_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asingle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hqx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/macbin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/megatron.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/updcrc.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-exec-am install-strip uninstall-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-hook install-exec-hook: @for LINK in $(LINKS); do \ rm -f $(DESTDIR)$(bindir)/$$LINK; \ $(LN_S) megatron $(DESTDIR)$(bindir)/$$LINK; \ done uninstall-hook: @for LINK in $(LINKS); do \ rm -f $(DESTDIR)$(bindir)/$$LINK; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/bin/megatron/megatron.c0000644000175200017500000001725411655731243014627 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #include #include #include #include #include "asingle.h" #include "megatron.h" #include "hqx.h" #include "macbin.h" #include "nad.h" char *forkname[] = { "data", "resource" }; static char forkbuf[8192]; static char *name[] = { "unhex", "unbin", "unsingle", "macbinary", "hqx2bin", "single2bin", "nadheader", "binheader", "megatron" }; static int from_open(int un, char *file, struct FHeader *fh, int flags) { switch ( un ) { case MEGATRON : case HEX2NAD : case HEX2BIN : return( hqx_open( file, O_RDONLY, fh, flags )); break; case BIN2NAD : case BINHEADER: return( bin_open( file, O_RDONLY, fh, flags )); break; case NAD2BIN : case NADHEADER: return( nad_open( file, O_RDONLY, fh, flags )); break; case SINGLE2NAD : case SINGLE2BIN : return( single_open( file, O_RDONLY, fh, flags )); default : return( -1 ); break; } } static ssize_t from_read(int un, int fork, char *buf, size_t len) { switch ( un ) { case MEGATRON : case HEX2NAD : case HEX2BIN : return( hqx_read( fork, buf, len )); break; case BIN2NAD : return( bin_read( fork, buf, len )); break; case NAD2BIN : return( nad_read( fork, buf, len )); break; case SINGLE2NAD : case SINGLE2BIN : return( single_read( fork, buf, len )); default : return( -1 ); break; } } static int from_close(int un) { switch ( un ) { case MEGATRON : case HEX2NAD : case HEX2BIN : return( hqx_close( KEEP )); break; case BIN2NAD : return( bin_close( KEEP )); break; case NAD2BIN : return( nad_close( KEEP )); break; case SINGLE2NAD : case SINGLE2BIN : return( single_close( KEEP )); default : return( -1 ); break; } } static int to_open(int to, char *file, struct FHeader *fh, int flags) { switch ( to ) { case MEGATRON : case HEX2NAD : case BIN2NAD : case SINGLE2NAD : return( nad_open( file, O_RDWR|O_CREAT|O_EXCL, fh, flags )); break; case NAD2BIN : case HEX2BIN : case SINGLE2BIN : return( bin_open( file, O_RDWR|O_CREAT|O_EXCL, fh, flags )); break; default : return( -1 ); break; } } static ssize_t to_write(int to, int fork, size_t bufc) { switch ( to ) { case MEGATRON : case HEX2NAD : case BIN2NAD : case SINGLE2NAD : return( nad_write( fork, forkbuf, bufc )); break; case NAD2BIN : case HEX2BIN : case SINGLE2BIN : return( bin_write( fork, forkbuf, bufc )); break; default : return( -1 ); break; } } static int to_close(int to, int keepflag) { switch ( to ) { case MEGATRON : case HEX2NAD : case BIN2NAD : case SINGLE2NAD : return( nad_close( keepflag )); break; case NAD2BIN : case HEX2BIN : case SINGLE2BIN : return( bin_close( keepflag )); break; default : return( -1 ); break; } } static int megatron( char *path, int module, char *newname, int flags) { struct stat st; struct FHeader fh; ssize_t bufc; int fork; size_t forkred; /* * If the source file is not stdin, make sure it exists and * that it is not a directory. */ if ( strcmp( path, STDIN ) != 0 ) { if ( stat( path, &st ) < 0 ) { perror( path ); return( -1 ); } if ( S_ISDIR( st.st_mode )) { fprintf( stderr, "%s is a directory.\n", path ); return( 0 ); } } /* * Open the source file and fill in the file header structure. */ memset( &fh, 0, sizeof( fh )); if ( from_open( module, path, &fh, flags ) < 0 ) { return( -1 ); } if ( flags & OPTION_HEADERONLY ) { time_t t; char buf[5] = ""; int i; printf("name: %s\n",fh.name); printf("comment: %s\n",fh.comment); memcpy(&buf, &fh.finder_info.fdCreator, sizeof(u_int32_t)); printf("creator: '%4s'\n", buf); memcpy(&buf, &fh.finder_info.fdType, sizeof(u_int32_t)); printf("type: '%4s'\n", buf); for(i=0; i < NUMFORKS; ++i) printf("fork length[%d]: %u\n", i, ntohl(fh.forklen[i])); t = AD_DATE_TO_UNIX(fh.create_date); printf("creation date: %s", ctime(&t)); t = AD_DATE_TO_UNIX(fh.mod_date); printf("modification date: %s", ctime(&t)); t = AD_DATE_TO_UNIX(fh.backup_date); printf("backup date: %s", ctime(&t)); return( from_close( module )); } /* * Open the target file and write out the file header info. * set the header to the new filename if it has been supplied. */ if (*newname) strcpy(fh.name, newname); if ( to_open( module, path, &fh, flags ) < 0 ) { (void)from_close( module ); return( -1 ); } /* * Read in and write out the data and resource forks. */ for ( fork = 0; fork < NUMFORKS ; fork++ ) { forkred = 0; while(( bufc = from_read( module, fork, forkbuf, sizeof( forkbuf ))) > 0 ) { if ( to_write( module, fork, bufc ) != bufc ) { fprintf( stderr, "%s: Probable write error\n", path ); to_close( module, TRASH ); (void)from_close( module ); return( -1 ); } forkred += bufc; } #if DEBUG fprintf( stderr, "megatron: forkred is \t\t%d\n", forkred ); fprintf( stderr, "megatron: fh.forklen[%d] is \t%d\n", fork, ntohl( fh.forklen[ fork ] )); #endif /* DEBUG */ if (( bufc < 0 ) || ( forkred != ntohl( fh.forklen[ fork ] ))) { fprintf( stderr, "%s: Problem with input, dude\n", path ); to_close( module, TRASH ); (void)from_close( module ); return( -1 ); } } /* * Close up the files, and get out of here. */ if ( to_close( module, KEEP ) < 0 ) { perror( "megatron:" ); (void)to_close( module, TRASH ); } return( from_close( module )); } int main(int argc, char **argv) { int rc, c; int rv = 0; int converts = sizeof(name) / sizeof(char *); int module = -1; int flags = 0; char *progname, newname[ADEDLEN_NAME + 1]; progname = strrchr( argv[ 0 ], '/' ); if (( progname == NULL ) || ( *progname == '\0' )) { progname = argv[ 0 ]; } else progname++; #if DEBUG if ( CONVERTS != converts ) { fprintf( stderr, "megatron: list of program links messed up\n" ); return( -1 ); } #endif /* DEBUG */ for ( c = 0 ; (( c < converts ) && ( module < 0 )) ; ++c ) { if ( strcmp( name[ c ], progname ) == 0 ) module = c; } if ( module == -1 ) module = ( converts - 1 ); if ((module == NADHEADER) || (module == BINHEADER)) flags |= OPTION_HEADERONLY; if ( argc == 1 ) { return( megatron( STDIN, module, newname, flags )); } *newname = '\0'; for ( c = 1 ; c < argc ; ++c ) { if ( strcmp( argv [ c ], "--version" ) == 0 ) { printf("%s (Netatalk %s megatron)\n", argv[0], VERSION); return( -1 ); } if ( strcmp( argv [ c ], "-v" ) == 0 ) { printf("%s (Netatalk %s megatron)\n", argv[0], VERSION); return( -1 ); } if ( strcmp( argv [ c ], "--header" ) == 0 ) { flags |= OPTION_HEADERONLY; continue; } if ( strcmp( argv [ c ], "--filename" ) == 0 ) { if(++c < argc) strncpy(newname,argv[c], ADEDLEN_NAME); continue; } if (strcmp(argv[c], "--stdout") == 0) { flags |= OPTION_STDOUT; continue; } if (strcmp(argv[c], "--euc") == 0) { flags |= OPTION_EUCJP; continue; } if (strcmp(argv[c], "--sjis") == 0) { flags |= OPTION_SJIS; continue; } rc = megatron( argv[ c ], module, newname, flags); if ( rc != 0 ) { rv = rc; } *newname = '\0'; } return( rv ); } netatalk-2.2.2/bin/megatron/updcrc.h0000644000175200017500000000060711655731126014272 00000000000000/* * $Id: updcrc.h,v 1.1 2009-10-13 22:55:36 didg Exp $ */ #ifndef _UPDCRC_H #define _UPDCRC_H 1 #define W 16 /* bits in CRC:16 16 16 */ /* data type that holds a W-bit unsigned integer */ #if W <= 16 # define WTYPE unsigned short #else /* W <= 16 */ # define WTYPE u_int32_t #endif /* W <= 16 */ WTYPE updcrc(WTYPE icrc, unsigned char *icp, int icnt); #endif /* _UPDCRC_H */ netatalk-2.2.2/bin/megatron/hqx.c0000644000175200017500000004331511655731126013610 00000000000000/* * $Id: hqx.c,v 1.18 2010-01-27 21:27:53 didg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #include #include #include "megatron.h" #include "nad.h" #include "hqx.h" #include "updcrc.h" #define HEXOUTPUT 0 /* String used to indicate standard input instead of a disk file. Should be a string not normally used for a file */ #ifndef STDIN # define STDIN "-" #endif /* ! STDIN */ /* Yes and no */ #define NOWAY 0 #define SURETHANG 1 /* Looking for the first or any other line of a binhex file */ #define FIRST 0 #define OTHER 1 /* This is the binhex run length encoding character */ #define RUNCHAR 0x90 /* These are field sizes in bytes of various pieces of the binhex header */ #define BHH_VERSION 1 #define BHH_TCSIZ 8 #define BHH_FLAGSIZ 2 #define BHH_DATASIZ 4 #define BHH_RESSIZ 4 #define BHH_CRCSIZ 2 #define BHH_HEADSIZ 21 #if HEXOUTPUT FILE *rawhex, *expandhex; #endif /* HEXOUTPUT */ static struct hqx_file_data { u_int32_t forklen[ NUMFORKS ]; u_short forkcrc[ NUMFORKS ]; char path[ MAXPATHLEN + 1]; u_short headercrc; int filed; } hqx; extern char *forkname[]; static u_char hqx7_buf[8192]; static u_char *hqx7_first; static u_char *hqx7_last; static int first_flag; /* hqx_open must be called first. pass it a filename that is supposed to contain a binhqx file. an hqx struct will be allocated and somewhat initialized; hqx_fd is set. skip_junk is called from here; skip_junk leaves hqx7_first and hqx7_last set. */ int hqx_open(char *hqxfile, int flags, struct FHeader *fh, int options) { int maxlen; #if DEBUG fprintf( stderr, "megatron: entering hqx_open\n" ); #endif /* DEBUG */ select_charset( options); if ( flags == O_RDONLY ) { #if HEXOUTPUT rawhex = fopen( "rawhex.unhex", "w" ); expandhex = fopen( "expandhex.unhex", "w" ); #endif /* HEXOUTPUT */ first_flag = 0; if ( strcmp( hqxfile, STDIN ) == 0 ) { hqx.filed = fileno( stdin ); } else if (( hqx.filed = open( hqxfile, O_RDONLY )) < 0 ) { perror( hqxfile ); return( -1 ); } if ( skip_junk( FIRST ) == 0 ) { if ( hqx_header_read( fh ) == 0 ) { #if DEBUG off_t pos; pos = lseek( hqx.filed, 0, SEEK_CUR ); fprintf( stderr, "megatron: current position is %ld\n", pos ); #endif /* DEBUG */ return( 0 ); } } hqx_close( KEEP ); fprintf( stderr, "%s\n", hqxfile ); return( -1 ); } else { maxlen = sizeof( hqx.path ) -1; strncpy( hqx.path, fh->name, maxlen ); strncpy( hqx.path, mtoupath( hqx.path ), maxlen ); strncat( hqx.path, ".hqx", maxlen - strlen( hqx.path )); if (( hqx.filed = open( hqx.path, flags, 0666 )) < 0 ) { perror( hqx.path ); return( -1 ); } if ( hqx_header_write( fh ) != 0 ) { hqx_close( TRASH ); fprintf( stderr, "%s\n", hqx.path ); return( -1 ); } return( 0 ); } } /* * hqx_close must be called before a second file can be opened using * hqx_open. Upon successful completion, a value of 0 is returned. * Otherwise, a value of -1 is returned. */ int hqx_close(int keepflag) { if ( keepflag == KEEP ) { return( close( hqx.filed )); } else if ( keepflag == TRASH ) { if (( strcmp( hqx.path, STDIN ) != 0 ) && ( unlink( hqx.path ) < 0 )) { perror( hqx.path ); } return( 0 ); } else return( -1 ); } /* * hqx_read is called until it returns zero for each fork. when it is * and finds that there is zero left to give, it reads in and compares * the crc with the calculated one, and returns zero if all is well. * it returns negative is the crc was bad or if has been called too many * times for the same fork. hqx_read must be called enough times to * return zero and no more than that. */ ssize_t hqx_read(int fork, char *buffer, size_t length) { u_short storedcrc; size_t readlen; size_t cc; #if DEBUG >= 3 { off_t pos; pos = lseek( hqx.filed, 0, SEEK_CUR ); fprintf( stderr, "hqx_read: current position is %ld\n", pos ); } fprintf( stderr, "hqx_read: fork is %s\n", forkname[ fork ] ); fprintf( stderr, "hqx_read: remaining length is %d\n", hqx.forklen[fork] ); #endif /* DEBUG >= 3 */ if (hqx.forklen[fork] > 0x7FFFFFFF) { fprintf(stderr, "This should never happen, dude!, fork length == %u\n", hqx.forklen[fork]); return -1; } if ( hqx.forklen[ fork ] == 0 ) { cc = hqx_7tobin( (char *)&storedcrc, sizeof( storedcrc )); if ( cc == sizeof( storedcrc )) { storedcrc = ntohs ( storedcrc ); #if DEBUG >= 4 fprintf( stderr, "hqx_read: storedcrc\t\t%x\n", storedcrc ); fprintf( stderr, "hqx_read: observed crc\t\t%x\n\n", hqx.forkcrc[fork] ); #endif /* DEBUG >= 4 */ if ( storedcrc == hqx.forkcrc[ fork ] ) { return( 0 ); } fprintf( stderr, "hqx_read: Bad %s fork crc, dude\n", forkname[ fork ] ); } return( -1 ); } if ( hqx.forklen[ fork ] < length ) { readlen = hqx.forklen[ fork ]; } else { readlen = length; } #if DEBUG >= 3 fprintf( stderr, "hqx_read: readlen is %d\n", readlen ); #endif /* DEBUG >= 3 */ cc = hqx_7tobin( buffer, readlen ); if ( cc > 0 ) { hqx.forkcrc[ fork ] = updcrc( hqx.forkcrc[ fork ], (u_char *)buffer, cc ); hqx.forklen[ fork ] -= cc; } #if DEBUG >= 3 fprintf( stderr, "hqx_read: chars read is %d\n", cc ); #endif /* DEBUG >= 3 */ return( cc ); } /* * hqx_header_read is called by hqx_open, and before any information can * read from the hqx_header substruct. it must be called before any * of the bytes of the other two forks can be read, as well. * returns a negative number if it was unable to pull enough information * to fill the hqx_header fields. */ int hqx_header_read(struct FHeader *fh) { char *headerbuf, *headerptr; u_int32_t time_seconds; u_short mask; u_short header_crc; char namelen; #if HEXOUTPUT int headerfork; headerfork = open( "headerfork", O_WRONLY|O_CREAT, 0622 ); #endif /* HEXOUTPUT */ mask = htons( 0xfcee ); hqx.headercrc = 0; if ( hqx_7tobin( &namelen, sizeof( namelen )) == 0 ) { fprintf( stderr, "Premature end of file :" ); return( -2 ); } hqx.headercrc = updcrc( hqx.headercrc, (u_char *)&namelen, sizeof( namelen )); #if HEXOUTPUT write( headerfork, &namelen, sizeof( namelen )); #endif /* HEXOUTPUT */ if (( headerbuf = (char *)malloc( (unsigned int)( namelen + BHH_HEADSIZ ))) == NULL ) { return( -1 ); } if ( hqx_7tobin( headerbuf, ( namelen + BHH_HEADSIZ )) == 0 ) { free( headerbuf ); fprintf( stderr, "Premature end of file :" ); return( -2 ); } headerptr = headerbuf; hqx.headercrc = updcrc( hqx.headercrc, (u_char *)headerbuf, ( namelen + BHH_HEADSIZ - BHH_CRCSIZ )); #if HEXOUTPUT write( headerfork, headerbuf, ( namelen + BHH_HEADSIZ )); #endif /* HEXOUTPUT */ /* * stuff from the hqx file header */ memcpy( fh->name, headerptr, (int)namelen ); headerptr += namelen; headerptr += BHH_VERSION; memcpy(&fh->finder_info, headerptr, BHH_TCSIZ ); headerptr += BHH_TCSIZ; memcpy(&fh->finder_info.fdFlags, headerptr, BHH_FLAGSIZ ); fh->finder_info.fdFlags = fh->finder_info.fdFlags & mask; headerptr += BHH_FLAGSIZ; memcpy(&fh->forklen[ DATA ], headerptr, BHH_DATASIZ ); hqx.forklen[ DATA ] = ntohl( fh->forklen[ DATA ] ); headerptr += BHH_DATASIZ; memcpy( &fh->forklen[ RESOURCE ], headerptr, BHH_RESSIZ ); hqx.forklen[ RESOURCE ] = ntohl( fh->forklen[ RESOURCE ] ); headerptr += BHH_RESSIZ; memcpy(&header_crc, headerptr, BHH_CRCSIZ ); headerptr += BHH_CRCSIZ; header_crc = ntohs( header_crc ); /* * stuff that should be zero'ed out */ fh->comment[0] = '\0'; fh->finder_info.fdLocation = 0; fh->finder_info.fdFldr = 0; #if DEBUG >= 5 { short flags; fprintf( stderr, "Values read by hqx_header_read\n" ); fprintf( stderr, "name length\t\t%d\n", namelen ); fprintf( stderr, "file name\t\t%s\n", fh->name ); fprintf( stderr, "get info comment\t%s\n", fh->comment ); fprintf( stderr, "type\t\t\t%.*s\n", sizeof( fh->finder_info.fdType ), &fh->finder_info.fdType ); fprintf( stderr, "creator\t\t\t%.*s\n", sizeof( fh->finder_info.fdCreator ), &fh->finder_info.fdCreator ); memcpy( &flags, &fh->finder_info.fdFlags, sizeof( flags )); flags = ntohs( flags ); fprintf( stderr, "flags\t\t\t%x\n", flags ); fprintf( stderr, "data fork length\t%ld\n", hqx.forklen[DATA] ); fprintf( stderr, "resource fork length\t%ld\n", hqx.forklen[RESOURCE] ); fprintf( stderr, "header_crc\t\t%x\n", header_crc ); fprintf( stderr, "observed crc\t\t%x\n", hqx.headercrc ); fprintf( stderr, "\n" ); } #endif /* DEBUG >= 5 */ /* * create and modify times are figured from right now */ time_seconds = AD_DATE_FROM_UNIX(time( NULL )); memcpy( &fh->create_date, &time_seconds, sizeof( fh->create_date )); memcpy( &fh->mod_date, &time_seconds, sizeof( fh->mod_date )); fh->backup_date = AD_DATE_START; /* * stuff that should be zero'ed out */ fh->comment[0] = '\0'; memset( &fh->finder_info.fdLocation, 0, sizeof( fh->finder_info.fdLocation )); memset( &fh->finder_info.fdFldr, 0, sizeof( fh->finder_info.fdFldr )); hqx.forkcrc[ DATA ] = 0; hqx.forkcrc[ RESOURCE ] = 0; free( headerbuf ); if ( header_crc != hqx.headercrc ) { fprintf( stderr, "Bad Header crc, dude :" ); return( -3 ); } return( 0 ); } /* * hqx_header_write. */ int hqx_header_write(struct FHeader *fh _U_) { return( -1 ); } /* * hqx7_fill is called from skip_junk and hqx_7tobin. it pulls from the * binhqx file into the hqx7 buffer. returns number of bytes read * or a zero for end of file. * it sets the pointers to the hqx7 buffer up to point to the valid data. */ ssize_t hqx7_fill(u_char *hqx7_ptr) { ssize_t cc; size_t cs; cs = hqx7_ptr - hqx7_buf; if ( cs >= sizeof( hqx7_buf )) return( -1 ); hqx7_first = hqx7_ptr; cc = read( hqx.filed, (char *)hqx7_first, ( sizeof( hqx7_buf ) - cs )); if ( cc < 0 ) { perror( "" ); return( cc ); } hqx7_last = ( hqx7_first + cc ); return( cc ); } /* char tr[] = "!\"#$%&'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr"; 0 123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef 0 1 2 3 Input characters are translated to a number between 0 and 63 by direct array lookup. 0xFF signals a bad character. 0xFE is signals a legal character that should be skipped, namely '\n', '\r'. 0xFD signals ':'. 0xFC signals a whitespace character. */ static const u_char hqxlookup[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFE, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0xFF, 0xFF, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0xFF, 0x14, 0x15, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0xFF, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0xFF, 0x2C, 0x2D, 0x2E, 0x2F, 0xFF, 0xFF, 0xFF, 0xFF, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0xFF, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0xFF, 0xFF, 0x3D, 0x3E, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; /* * skip_junk is called from hqx_open. it skips over junk in the file until * it comes to a line containing a valid first line of binhqx encoded file. * returns a 0 for success, negative if it never finds good data. * pass a FIRST when looking for the first valid binhex line, a value of * OTHER when looking for any subsequent line. */ int skip_junk(int line) { int found = NOWAY; int stopflag; int nc = 0; u_char c; u_char prevchar; if ( line == FIRST ) { if ( hqx7_fill( hqx7_buf ) <= 0 ) { fprintf( stderr, "Premature end of file :" ); return( -1 ); } } while ( found == NOWAY ) { if ( line == FIRST ) { if ( *hqx7_first == ':' ) { nc = c = 0; stopflag = NOWAY; hqx7_first++; while (( stopflag == NOWAY ) && ( nc < ( hqx7_last - hqx7_first ))) { switch ( c = hqxlookup[ hqx7_first[ nc ]] ) { case 0xFC : case 0xFF : case 0xFE : case 0xFD : stopflag = SURETHANG; break; default : nc++; break; } } if (( nc > 30 ) && ( nc < 64 ) && (( c == 0xFE ) || ( c == 0xFD ))) found = SURETHANG; } else { hqx7_first++; } } else { if (( prevchar = hqxlookup[ *hqx7_first ] ) == 0xFE ) { nc = c = 0; stopflag = NOWAY; hqx7_first++; while (( stopflag == NOWAY ) && ( nc < ( hqx7_last - hqx7_first ))) { switch ( c = hqxlookup[ hqx7_first[ nc ]] ) { case 0xFC : case 0xFE : if (( prevchar == 0xFC ) || ( prevchar == 0xFE )) { nc++; break; } case 0xFF : case 0xFD : stopflag = SURETHANG; break; default : prevchar = c; nc++; break; } } if ( c == 0xFD ) { found = SURETHANG; } else if (( nc > 30 ) && ( c == 0xFE )) { found = SURETHANG; } } else { hqx7_first++; } } if (( hqx7_last - hqx7_first ) == nc ) { if ( line == FIRST ) { *hqx7_buf = ':'; } else *hqx7_buf = '\n'; memcpy(hqx7_buf + 1, hqx7_first, nc ); hqx7_first = hqx7_buf + ( ++nc ); if ( hqx7_fill( hqx7_first ) <= 0 ) { fprintf( stderr, "Premature end of file :" ); return( -1 ); } hqx7_first = hqx7_buf; } } return( 0 ); } /* * hqx_7tobin is used to read the data, converted to binary. It is * called by hqx_header_read to get the header information, and must be * called to get the data for each fork, and the crc data for each * fork. it has the same basic calling structure as unix read. the * number of valid bytes read is returned. It does buffering so as to * return the requested length of data every time, unless the end of * file is reached. */ size_t hqx_7tobin( char *outbuf, size_t datalen) { static u_char hqx8[3]; static int hqx8i; static u_char prev_hqx8; static u_char prev_out; static u_char prev_hqx7; static int eofflag; u_char hqx7[4]; int hqx7i = 0; char *out_first; char *out_last; #if DEBUG fprintf( stderr, "hqx_7tobin: datalen entering %d\n", datalen ); fprintf( stderr, "hqx_7tobin: hqx8i entering %d\n", hqx8i ); #endif /* DEBUG */ if ( first_flag == 0 ) { prev_hqx8 = 0; prev_hqx7 = 0; prev_out = 0; hqx8i = 3; first_flag = 1; eofflag = 0; } #if DEBUG fprintf( stderr, "hqx_7tobin: hqx8i entering %d\n", hqx8i ); #endif /* DEBUG */ out_first = outbuf; out_last = out_first + datalen; while (( out_first < out_last ) && ( eofflag == 0 )) { if ( hqx7_first == hqx7_last ) { if ( hqx7_fill( hqx7_buf ) == 0 ) { eofflag = 1; continue; } } if ( hqx8i > 2 ) { while (( hqx7i < 4 ) && ( hqx7_first < hqx7_last )) { hqx7[ hqx7i ] = hqxlookup[ *hqx7_first ]; switch ( hqx7[ hqx7i ] ) { case 0xFC : if (( prev_hqx7 == 0xFC ) || ( prev_hqx7 == 0xFE )) { hqx7_first++; break; } case 0xFD : case 0xFF : eofflag = 1; while ( hqx7i < 4 ) { hqx7[ hqx7i++ ] = 0; } break; case 0xFE : prev_hqx7 = hqx7[ hqx7i ]; if ( skip_junk( OTHER ) < 0 ) { fprintf( stderr, "\n" ); eofflag = 1; while ( hqx7i < 4 ) { hqx7[ hqx7i++ ] = 0; } } break; default : prev_hqx7 = hqx7[ hqx7i++ ]; hqx7_first++; break; } } if ( hqx7i == 4 ) { hqx8[ 0 ] = (( hqx7[ 0 ] << 2 ) | ( hqx7[ 1 ] >> 4 )); hqx8[ 1 ] = (( hqx7[ 1 ] << 4 ) | ( hqx7[ 2 ] >> 2 )); hqx8[ 2 ] = (( hqx7[ 2 ] << 6 ) | ( hqx7[ 3 ] )); hqx7i = hqx8i = 0; } } while (( hqx8i < 3 ) && ( out_first < out_last )) { #if HEXOUTPUT putc( hqx8i, rawhex ); putc( hqx8[ hqx8i ], rawhex ); #endif /* HEXOUTPUT */ if ( prev_hqx8 == RUNCHAR ) { if ( hqx8[ hqx8i ] == 0 ) { *out_first = prev_hqx8; #if HEXOUTPUT putc( *out_first, expandhex ); #endif /* HEXOUTPUT */ prev_out = prev_hqx8; out_first++; } while (( out_first < out_last ) && ( hqx8[ hqx8i ] > 1 )) { *out_first = prev_out; #if HEXOUTPUT putc( *out_first, expandhex ); #endif /* HEXOUTPUT */ hqx8[ hqx8i ]--; out_first++; } if ( hqx8[ hqx8i ] < 2 ) { prev_hqx8 = hqx8[ hqx8i ]; hqx8i++; } continue; } prev_hqx8 = hqx8[ hqx8i ]; if ( prev_hqx8 != RUNCHAR ) { *out_first = prev_hqx8; #if HEXOUTPUT putc( *out_first, expandhex ); #endif /* HEXOUTPUT */ prev_out = prev_hqx8; out_first++; } hqx8i++; } } return( out_first - outbuf ); } netatalk-2.2.2/bin/megatron/megatron.h0000644000175200017500000000520011655731126014620 00000000000000/* * $Id: megatron.h,v 1.5 2009-10-14 01:38:28 didg Exp $ */ #ifndef _MEGATRON_H #define _MEGATRON_H 1 #include #ifndef STDIN # define STDIN "-" #endif /* ! STDIN */ /* Where it matters, data stored in either of these two structs is in network byte order. Any routines that need to interpret this data locally would need to do the conversion. Mostly this affects the fork length variables. Time values are affected as well, if any routines actually need to look at them. */ #define DATA 0 #define RESOURCE 1 #define NUMFORKS 2 #define HEX2NAD 0 /* unhex */ #define BIN2NAD 1 /* unbin */ #define SINGLE2NAD 2 /* unsingle */ #define NAD2BIN 3 /* macbinary */ #define HEX2BIN 4 /* hqx2bin */ #define SINGLE2BIN 5 /* single2bin */ #define NADHEADER 6 /* header */ #define BINHEADER 7 /* mac binary header */ #define MEGATRON 8 /* megatron, default, usually HEX2NAD */ #define CONVERTS 9 /* # conversions defined */ #define OPTION_NONE (0) #define OPTION_HEADERONLY (1 << 0) #define OPTION_STDOUT (1 << 2) #define OPTION_EUCJP (1 << 3) #define OPTION_SJIS (1 << 4) struct FInfo { u_int32_t fdType; u_int32_t fdCreator; u_int16_t fdFlags; u_int32_t fdLocation; u_int16_t fdFldr; }; struct FXInfo { u_int16_t fdIconID; u_int16_t fdUnused[3]; u_int8_t fdScript; u_int8_t fdXFlags; u_int16_t fdComment; u_int32_t fdPutAway; }; struct FHeader { char name[ ADEDLEN_NAME ]; char comment[ ADEDLEN_COMMENT ]; u_int32_t forklen[ NUMFORKS ]; u_int32_t create_date; u_int32_t mod_date; u_int32_t backup_date; struct FInfo finder_info; struct FXInfo finder_xinfo; }; #define MAC_DATE_TO_UNIX(a) (ntohl(a) - 2082844800U) #define MAC_DATE_FROM_UNIX(a) (htonl((a) + 2082844800U)) #define AD_DATE_FROM_MAC(a) (htonl(ntohl(a) - 3029529600U)) #define AD_DATE_TO_MAC(a) (htonl(ntohl(a) + 3029529600U)) #define FILEIOFF_CREATE 0 #define FILEIOFF_MODIFY 4 #define FILEIOFF_BACKUP 8 #define FILEIOFF_ATTR 14 #define FINDERIOFF_TYPE 0 #define FINDERIOFF_CREATOR 4 #define FINDERIOFF_FLAGS 8 #define FINDERIOFF_LOC 10 #define FINDERIOFF_FLDR 14 #define FINDERIOFF_SCRIPT 24 #define FINDERIOFF_XFLAGS 25 #define TRASH 0 #define KEEP 1 #ifndef S_ISDIR # define S_ISDIR(s) (( s & S_IFMT ) == S_IFDIR ) #endif /* ! S_ISDIR */ extern char *forkname[]; extern char *(*_mtoupath) ( char *); extern char *(*_utompath) ( char *); #define mtoupath(s) (*_mtoupath)(s) #define utompath(s) (*_utompath)(s) #endif /* _MEGATRON_H */ netatalk-2.2.2/bin/megatron/macbin.h0000644000175200017500000000077211655731126014246 00000000000000/* * $Id: macbin.h,v 1.4 2010-01-27 21:27:53 didg Exp $ */ #ifndef _MACBIN_H #define _MACBIN_H 1 /* Forward Declarations */ struct FHeader; int bin_open(char *binfile, int flags, struct FHeader *fh, int options); int bin_close(int keepflag); ssize_t bin_read(int fork, char *buffer, size_t length); ssize_t bin_write(int fork, char *buffer, size_t length); int bin_header_read(struct FHeader *fh, int revision); int bin_header_write(struct FHeader *fh); int test_header(void); #endif /* _MACBIN_H */ netatalk-2.2.2/bin/megatron/asingle.h0000644000175200017500000000065711655731126014441 00000000000000/* * $Id: asingle.h,v 1.4 2010-01-27 21:27:53 didg Exp $ */ #ifndef _ASINGLE_H #define _ASINGLE_H 1 /* Forward Declarations */ struct FHeader; int single_open(char *singlefile, int flags, struct FHeader *fh, int options); int single_close(int readflag); int single_header_read(struct FHeader *fh, int version); int single_header_test(void); ssize_t single_read(int fork, char *buffer, size_t length); #endif /* _ASINGLE_H */ netatalk-2.2.2/bin/megatron/nad.h0000644000175200017500000000075111655731126013554 00000000000000/* * $Id: nad.h,v 1.5 2010-01-27 21:27:53 didg Exp $ */ #ifndef _NAD_H #define _NAD_H 1 /* Forward Declarations */ struct FHeader; int nad_open(char *path, int openflags, struct FHeader *fh, int options); int nad_header_read(struct FHeader *fh); int nad_header_write(struct FHeader *fh); ssize_t nad_read(int fork, char *forkbuf, size_t bufc); ssize_t nad_write(int fork, char *forkbuf, size_t bufc); int nad_close(int status); void select_charset(int options); #endif /* _NAD_H */ netatalk-2.2.2/bin/megatron/asingle.c0000644000175200017500000003240511655731126014430 00000000000000/* * $Id: asingle.c,v 1.14 2010-01-27 21:27:53 didg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include "asingle.h" #include "megatron.h" /* String used to indicate standard input instead of a disk file. Should be a string not normally used for a file */ #ifndef STDIN # define STDIN "-" #endif /* Yes and no */ #define NOWAY 0 #define SURETHANG 1 /* This structure holds an entry description, consisting of three four byte entities. The first is the Entry ID, the second is the File Offset and the third is the Length. */ /* Both input and output routines use this struct and the following globals; therefore this module can only be used for one of the two functions at a time. */ static struct single_file_data { int filed; char path[ MAXPATHLEN + 1]; struct ad_entry entry[ ADEID_MAX ]; } single; extern char *forkname[]; static u_char header_buf[ AD_HEADER_LEN ]; /* * single_open must be called first. pass it a filename that is supposed * to contain a AppleSingle file. an single struct will be allocated and * somewhat initialized; single_filed is set. */ int single_open(char *singlefile, int flags, struct FHeader *fh, int options _U_) { int rc; if ( flags == O_RDONLY ) { if ( strcmp( singlefile, STDIN ) == 0 ) { single.filed = fileno( stdin ); } else if (( single.filed = open( singlefile, flags )) < 0 ) { perror( singlefile ); return( -1 ); } strncpy( single.path, singlefile, MAXPATHLEN ); #if DEBUG fprintf( stderr, "opened %s for read\n", single.path ); #endif /* DEBUG */ if ((( rc = single_header_test()) > 0 ) && ( single_header_read( fh, rc ) == 0 )) { return( 0 ); } single_close( KEEP ); return( -1 ); } return( 0 ); } /* * single_close must be called before a second file can be opened using * single_open. Upon successful completion, a value of 0 is returned. * Otherwise, a value of -1 is returned. */ int single_close( int keepflag) { if ( keepflag == KEEP ) { return( close( single.filed )); } else if ( keepflag == TRASH ) { if (( strcmp( single.path, STDIN ) != 0 ) && ( unlink( single.path ) < 0 )) { perror ( single.path ); } return( 0 ); } else return( -1 ); } /* * single_header_read is called by single_open, and before any information * can read from the fh substruct. it must be called before any of the * bytes of the other two forks can be read, as well. */ int single_header_read( struct FHeader *fh, int version) { /* * entry_buf is used for reading in entry descriptors, and for reading in * the actual entries of FILEINFO, FINDERINFO, and DATES. */ u_char entry_buf[ADEDLEN_FINDERI]; u_int32_t entry_id; u_int32_t time_seconds; u_short mask = 0xfcee; u_short num_entries; int n; int readlen; int date_entry = 0; off_t pos; /* * Go through and initialize the array of entry_info structs. Read in the * number of entries, and then read in the info for each entry and save it * in the array. */ for ( n = 0 ; n < ADEID_MAX; n++ ) { single.entry[ n ].ade_off = 0; single.entry[ n ].ade_len = 0; } memcpy( &num_entries, header_buf + 24, sizeof( num_entries )); num_entries = ntohs( num_entries ); #if DEBUG >= 2 fprintf( stderr, "The number of entries is %d\n", num_entries ); #endif /* DEBUG */ for ( ; num_entries > 0 ; num_entries-- ) { if ( read( single.filed, (char *)entry_buf, AD_ENTRY_LEN ) != AD_ENTRY_LEN ) { perror( "Premature end of file :" ); return( -1 ); } memcpy(&entry_id, entry_buf, sizeof( entry_id )); entry_id = ntohl( entry_id ); memcpy(&single.entry[ entry_id ].ade_off, entry_buf + 4, sizeof( single.entry[ entry_id ].ade_off )); single.entry[ entry_id ].ade_off = ntohl( single.entry[ entry_id ].ade_off ); memcpy(&single.entry[ entry_id ].ade_len, entry_buf + 8, sizeof( single.entry[ entry_id ].ade_len )); single.entry[ entry_id ].ade_len = ntohl( single.entry[ entry_id ].ade_len ); #if DEBUG >= 2 fprintf( stderr, "entry_id\t%d\n", entry_id ); fprintf( stderr, "\toffset\t\t%d\n", single.entry[ entry_id ].ade_off ); fprintf( stderr, "\tlength\t\t%d\n", single.entry[ entry_id ].ade_len ); #endif /* DEBUG */ } /* * Now that the entries have been identified, check to make sure * it is a Macintosh file if dealing with version two format file. */ if ( version == 1 ) { if ( single.entry[ ADEID_FILEI ].ade_len > 0 ) date_entry = ADEID_FILEI; } else if ( version == 2 ) { if ( single.entry[ ADEID_FILEDATESI ].ade_len > 0 ) date_entry = ADEID_FILEDATESI; } #if DEBUG fprintf( stderr, "date_entry = %d\n", date_entry ); #endif /* DEBUG */ /* * Go through and copy all the information you can get from * the informational entries into the fh struct. The ENTRYID_DATA * must be the last one done, because it leaves the file pointer in * the right place for the first read of the data fork. */ if ( single.entry[ ADEID_NAME ].ade_off == 0 ) { fprintf( stderr, "%s has no name for the mac file.\n", single.path ); return( -1 ); } else { pos = lseek( single.filed, single.entry[ ADEID_NAME ].ade_off, SEEK_SET ); readlen = single.entry[ ADEID_NAME ].ade_len > ADEDLEN_NAME ? ADEDLEN_NAME : single.entry[ ADEID_NAME ].ade_len; if ( read( single.filed, (char *)fh->name, readlen ) != readlen ) { perror( "Premature end of file :" ); return( -1 ); } } if (( single.entry[ ADEID_FINDERI ].ade_len < ADEDLEN_FINDERI ) || ( single.entry[ ADEID_FINDERI ].ade_off <= AD_HEADER_LEN )) { fprintf( stderr, "%s has bogus FinderInfo.\n", single.path ); return( -1 ); } else { pos = lseek( single.filed, single.entry[ ADEID_FINDERI ].ade_off, SEEK_SET ); if ( read( single.filed, (char *)entry_buf, ADEDLEN_FINDERI) != ADEDLEN_FINDERI) { perror( "Premature end of file :" ); return( -1 ); } memcpy( &fh->finder_info.fdType, entry_buf + FINDERIOFF_TYPE, sizeof( fh->finder_info.fdType )); memcpy( &fh->finder_info.fdCreator, entry_buf + FINDERIOFF_CREATOR, sizeof( fh->finder_info.fdCreator )); memcpy( &fh->finder_info.fdFlags, entry_buf + FINDERIOFF_FLAGS, sizeof( fh->finder_info.fdFlags )); fh->finder_info.fdFlags = fh->finder_info.fdFlags & mask; memcpy( &fh->finder_info.fdLocation, entry_buf + FINDERIOFF_LOC, sizeof( fh->finder_info.fdLocation )); memcpy(&fh->finder_info.fdFldr, entry_buf + FINDERIOFF_FLDR, sizeof( fh->finder_info.fdFldr )); fh->finder_xinfo.fdScript = *(entry_buf + FINDERIOFF_SCRIPT); fh->finder_xinfo.fdXFlags = *(entry_buf + FINDERIOFF_XFLAGS); #if DEBUG { char type[5]; char creator[5]; strncpy( type, &fh->finder_info.fdType, 4 ); strncpy( creator, &fh->finder_info.fdCreator, 4 ); type[4] = creator[4] = '\0'; fprintf( stderr, "type is %s, creator is %s\n", type, creator ); } #endif /* DEBUG */ } if (( single.entry[ ADEID_COMMENT ].ade_len == 0 ) || ( single.entry[ ADEID_COMMENT ].ade_off <= AD_HEADER_LEN )) { fh->comment[0] = '\0'; } else { pos = lseek( single.filed, single.entry[ ADEID_COMMENT ].ade_off, SEEK_SET ); readlen = single.entry[ ADEID_COMMENT ].ade_len > ADEDLEN_COMMENT ? ADEDLEN_COMMENT : single.entry[ ADEID_COMMENT ].ade_len; if ( read( single.filed, (char *)fh->comment, readlen ) != readlen ) { perror( "Premature end of file :" ); return( -1 ); } } /* * If date_entry is 7, we have an AppleSingle version one, do the * appropriate stuff. If it is 8, we have an AppleSingle version two, * do the right thing. If date_entry is neither, just use the current date. * Unless I can't get the current date, in which case use time zero. */ if (( date_entry < 7 ) || ( date_entry > 8 )) { if (( time_seconds = time( NULL )) == (u_int32_t)-1 ) { time_seconds = AD_DATE_START; } else { time_seconds = AD_DATE_FROM_UNIX(time_seconds); } memcpy(&fh->create_date, &time_seconds, sizeof( fh->create_date )); memcpy(&fh->mod_date, &time_seconds, sizeof( fh->mod_date )); fh->backup_date = AD_DATE_START; } else if ( single.entry[ date_entry ].ade_len != 16 ) { fprintf( stderr, "%s has bogus FileInfo or File Dates Info.\n", single.path ); return( -1 ); } else if ( date_entry == ADEID_FILEI ) { pos = lseek( single.filed, single.entry[ date_entry ].ade_off, SEEK_SET ); if ( read( single.filed, (char *)entry_buf, sizeof( entry_buf )) != sizeof( entry_buf )) { perror( "Premature end of file :" ); return( -1 ); } memcpy( &fh->create_date, entry_buf + FILEIOFF_CREATE, sizeof( fh->create_date )); memcpy( &fh->mod_date, entry_buf + FILEIOFF_MODIFY, sizeof( fh->mod_date )); memcpy( &fh->backup_date, entry_buf + FILEIOFF_BACKUP, sizeof(fh->backup_date)); } else if ( date_entry == ADEID_FILEDATESI ) { pos = lseek( single.filed, single.entry[ date_entry ].ade_off, SEEK_SET ); if ( read( single.filed, (char *)entry_buf, sizeof( entry_buf )) != sizeof( entry_buf )) { perror( "Premature end of file :" ); return( -1 ); } memcpy( &fh->create_date, entry_buf + FILEIOFF_CREATE, sizeof( fh->create_date )); memcpy( &fh->mod_date, entry_buf + FILEIOFF_MODIFY, sizeof( fh->mod_date )); memcpy( &fh->backup_date, entry_buf + FILEIOFF_BACKUP, sizeof(fh->backup_date)); } if ( single.entry[ ADEID_RFORK ].ade_off == 0 ) { fh->forklen[RESOURCE] = 0; } else { fh->forklen[RESOURCE] = htonl( single.entry[ ADEID_RFORK ].ade_len ); } if ( single.entry[ ADEID_DFORK ].ade_off == 0 ) { fh->forklen[ DATA ] = 0; } else { fh->forklen[ DATA ] = htonl( single.entry[ ADEID_DFORK ].ade_len ); pos = lseek( single.filed, single.entry[ ADEID_DFORK ].ade_off, SEEK_SET ); } return( 0 ); } /* * single_header_test is called from single_open. It checks certain * values of the file and determines if the file is an AppleSingle version * one file something else, and returns a one, or negative one to indicate * file type. * * The Magic Number of the file, the first four bytes, must be hex * 0x00051600. Bytes 4 through 7 are the version number and must be hex * 0x00010000. Bytes 8 through 23 identify the home file system, and we * are only interested in files from Macs. Therefore these bytes must * contain hex 0x4d6163696e746f736820202020202020 which is ASCII * "Macintosh " (that is seven blanks of padding). */ #define MACINTOSH "Macintosh " static u_char sixteennulls[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int single_header_test(void) { ssize_t cc; u_int32_t templong; cc = read( single.filed, (char *)header_buf, sizeof( header_buf )); if ( cc < (ssize_t)sizeof( header_buf )) { perror( "Premature end of file :" ); return( -1 ); } memcpy( &templong, header_buf, sizeof( templong )); if ( ntohl( templong ) != AD_APPLESINGLE_MAGIC ) { fprintf( stderr, "%s is not an AppleSingle file.\n", single.path ); return( -1 ); } memcpy(&templong, header_buf + 4, sizeof( templong )); templong = ntohl( templong ); if ( templong == AD_VERSION1 ) { cc = 1; if ( memcmp( MACINTOSH, header_buf + 8, sizeof( MACINTOSH ) - 1 ) != 0 ) { fprintf( stderr, "%s is not a Macintosh AppleSingle file.\n", single.path ); return( -1 ); } } else if ( templong == AD_VERSION2 ) { cc = 2; if ( memcmp( sixteennulls, header_buf + 8, sizeof( sixteennulls )) != 0 ) { fprintf( stderr, "Warning: %s may be a corrupt AppleSingle file.\n", single.path ); return( -1 ); } } else { fprintf( stderr, "%s is a version of AppleSingle I don't understand!\n", single.path ); return( -1 ); } return( cc ); } /* * single_read is called until it returns zero for each fork. When * it returns zero for the first fork, it seeks to the proper place * to read in the next, if there is one. single_read must be called * enough times to return zero for each fork and no more. * */ ssize_t single_read( int fork, char *buffer, size_t length) { u_int32_t entry_id; char *buf_ptr; size_t readlen; ssize_t cc = 1; off_t pos; switch ( fork ) { case DATA : entry_id = ADEID_DFORK; break; case RESOURCE : entry_id = ADEID_RFORK; break; default : return( -1 ); break; } if (single.entry[entry_id].ade_len > 0x7FFFFFFF) { fprintf(stderr, "single_read: Trying to read past end of fork!, ade_len == %u\n", single.entry[entry_id].ade_len); return -1; } if ( single.entry[ entry_id ].ade_len == 0 ) { if ( fork == DATA ) { pos = lseek( single.filed, single.entry[ ADEID_RFORK ].ade_off, SEEK_SET ); } return( 0 ); } if ( single.entry[ entry_id ].ade_len < length ) { readlen = single.entry[ entry_id ].ade_len; } else { readlen = length; } buf_ptr = buffer; while (( readlen > 0 ) && ( cc > 0 )) { if (( cc = read( single.filed, buf_ptr, readlen )) > 0 ) { readlen -= cc; buf_ptr += cc; } } if ( cc >= 0 ) { cc = buf_ptr - buffer; single.entry[ entry_id ].ade_len -= cc; } return( cc ); } netatalk-2.2.2/bin/megatron/nad.c0000644000175200017500000005155311655731126013555 00000000000000/* * $Id: nad.c,v 1.18 2010-01-27 21:27:53 didg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #include #include #include #include "megatron.h" #include "nad.h" static struct volinfo vol; static char hexdig[] = "0123456789abcdef"; static char mtou_buf[MAXPATHLEN + 1], utom_buf[MAXPATHLEN + 1]; static char *mtoupathcap(char *mpath) { char *m, *u, *umax; int i = 0; m = mpath; u = mtou_buf; umax = u + sizeof(mtou_buf) - 4; while ( *m != '\0' && u < umax) { #if AD_VERSION == AD_VERSION1 if ( !isascii( *m ) || *m == '/' || ( i == 0 && *m == '.' )) { #else /* AD_VERSION == AD_VERSION1 */ if (!isprint(*m) || *m == '/' || ( i == 0 && (*m == '.' ))) { #endif /* AD_VERSION == AD_VERSION1 */ *u++ = ':'; *u++ = hexdig[ ( *m & 0xf0 ) >> 4 ]; *u++ = hexdig[ *m & 0x0f ]; } else { #ifdef DOWNCASE *u++ = ( isupper( *m )) ? tolower( *m ) : *m; #else /* DOWNCASE */ *u++ = *m; #endif /* DOWNCASE */ } i++; m++; } *u = '\0'; return( mtou_buf ); } #define hextoint( c ) ( isdigit( c ) ? c - '0' : c + 10 - 'a' ) #define islxdigit(x) (!isupper(x)&&isxdigit(x)) static char *utompathcap( char *upath) { char *m, *u; int h; m = utom_buf; u = upath; while ( *u != '\0' ) { if (*u == ':' && *(u + 1) != '\0' && islxdigit(*(u+1)) && *(u+2) != '\0' && islxdigit(*(u+2))) { u++; h = hextoint(*u) << 4; u++; h |= hextoint(*u); *m = h; } else { #ifdef DOWNCASE *m = diatolower(*u); #else /* DOWNCASE */ *m = *u; #endif /* DOWNCASE */ } u++; m++; } *m = '\0'; return( utom_buf ); } static void euc2sjis( int *p1, int *p2) /* agrees w/ Samba on valid codes */ { int row_offset, cell_offset; unsigned char c1, c2; /* first convert EUC to ISO-2022 */ c1 = *p1 & 0x7F; c2 = *p2 & 0x7F; /* now convert ISO-2022 to Shift-JIS */ row_offset = c1 < 95 ? 112 : 176; cell_offset = c1 % 2 ? (c2 > 95 ? 32 : 31) : 126; *p1 = ((c1 + 1) >> 1) + row_offset; *p2 = c2 + cell_offset; } static void sjis2euc( int *p1, int *p2) /* agrees w/ Samba on valid codes */ { int row_offset, cell_offset, adjust; unsigned char c1, c2; c1 = *p1; c2 = *p2; /* first convert Shift-JIS to ISO-2022 */ adjust = c2 < 159; row_offset = c1 < 160 ? 112 : 176; cell_offset = adjust ? (c2 > 127 ? 32 : 31) : 126; c1 = ((c1 - row_offset) << 1) - adjust; c2 -= cell_offset; /* now convert ISO-2022 to EUC */ *p1 = c1 | 0x80; *p2 = c2 | 0x80; } static char *mtoupatheuc( char *from) { unsigned char *in, *out, *maxout; int p, p2, i = 0; in = (unsigned char *) from; out = (unsigned char *) mtou_buf; if( *in ) { maxout = out + sizeof( mtou_buf) - 3; while( out < maxout ) { p = *in++; if( ((0x81 <= p) && (p <= 0x9F)) || ((0xE0 <= p) && (p <= 0xEF)) ) { /* JIS X 0208 */ p2 = *in++; if( ((0x40 <= p2) && (p2 <= 0x7E)) || ((0x80 <= p2) && (p2 <= 0xFC)) ) sjis2euc( &p, &p2); *out++ = p; p = p2; } else if( (0xA1 <= p) && (p <= 0xDF) ) { *out++ = 0x8E; /* halfwidth katakana */ } else if( p < 0x80 ) { #ifdef DOWNCASE p = ( isupper( p )) ? tolower( p ) : p; #endif /* DOWNCASE */ } if( ( p == '/') || ( i == 0 && p == '.' ) ) { *out++ = ':'; *out++ = hexdig[ ( p & 0xf0 ) >> 4 ]; p = hexdig[ p & 0x0f ]; } i++; *out++ = p; if( p ) continue; break; } } else { *out++ = '.'; *out = 0; } return mtou_buf; } static char *utompatheuc( char *from) { unsigned char *in, *out, *maxout; int p, p2; in = (unsigned char *) from; out = (unsigned char *) utom_buf; maxout = out + sizeof( utom_buf) - 3; while( out < maxout ) { p = *in++; if( (0xA1 <= p) && (p <= 0xFE) ) { /* JIS X 0208 */ p2 = *in++; if( (0xA1 <= p2) && (p2 <= 0xFE) ) euc2sjis( &p, &p2); *out++ = p; p = p2; } else if( p == 0x8E ) { /* halfwidth katakana */ p = *in++; } else if( p < 0x80 ) { #ifdef DOWNCASE p = ( isupper( p )) ? tolower( p ) : p; #endif /* DOWNCASE */ } if ( p == ':' && *(in) != '\0' && islxdigit( *(in)) && *(in+1) != '\0' && islxdigit( *(in+1))) { p = hextoint( *in ) << 4; in++; p |= hextoint( *in ); in++; } *out++ = p; if( p ) continue; break; } return utom_buf; } static char *mtoupathsjis( char *from) { unsigned char *in, *out, *maxout; int p, p2, i = 0; in = (unsigned char *) from; out = (unsigned char *) mtou_buf; if( *in ) { maxout = out + sizeof( mtou_buf) - 3; while( out < maxout ) { p = *in++; if( ((0x81 <= p) && (p <= 0x9F)) || ((0xE0 <= p) && (p <= 0xEF)) ) { /* JIS X 0208 */ p2 = *in++; *out++ = p; p = p2; } else if( (0xA1 <= p) && (p <= 0xDF) ) { ; /* halfwidth katakana */ } else if(p < 0x80 ) { #ifdef DOWNCASE p = ( isupper( p )) ? tolower( p ) : p; #endif /* DOWNCASE */ } if( ( p == '/') || ( i == 0 && p == '.' ) ) { *out++ = ':'; *out++ = hexdig[ ( p & 0xf0 ) >> 4 ]; p = hexdig[ p & 0x0f ]; } i++; *out++ = p; if( p ) continue; break; } } else { *out++ = '.'; *out = 0; } return mtou_buf; } static char *utompathsjis( char *from) { unsigned char *in, *out, *maxout; int p, p2; in = (unsigned char *) from; out = (unsigned char *) utom_buf; maxout = out + sizeof( utom_buf) - 3; while( out < maxout ) { p = *in++; if( (0xA1 <= p) && (p <= 0xFE) ) { /* JIS X 0208 */ p2 = *in++; *out++ = p; p = p2; } else if( p == 0x8E ) { /* do nothing */ ; } else if( p < 0x80 ) { #ifdef DOWNCASE p = ( isupper( p )) ? tolower( p ) : p; #endif /* DOWNCASE */ } if ( p == ':' && *(in) != '\0' && islxdigit( *(in)) && *(in+1) != '\0' && islxdigit( *(in+1))) { p = hextoint( *in ) << 4; in++; p |= hextoint( *in ); in++; } *out++ = p; if( p ) continue; break; } return utom_buf; } static char *utompathiconv(char *upath) { char *m, *u; u_int16_t flags = CONV_IGNORE | CONV_UNESCAPEHEX; size_t outlen; static char mpath[MAXPATHLEN +2]; /* for convert_charset dest_len parameter +2 */ m = mpath; outlen = strlen(upath); #if 0 if (vol->v_casefold & AFPVOL_UTOMUPPER) flags |= CONV_TOUPPER; else if (vol->v_casefold & AFPVOL_UTOMLOWER) flags |= CONV_TOLOWER; #endif u = upath; /* convert charsets */ if ((size_t)-1 == ( outlen = convert_charset ( vol.v_volcharset, vol.v_maccharset, vol.v_maccharset, u, outlen, mpath, MAXPATHLEN, &flags)) ) { fprintf( stderr, "Conversion from %s to %s for %s failed.", vol.v_volcodepage, vol.v_maccodepage, u); goto utompath_error; } if (flags & CONV_REQMANGLE) goto utompath_error; return(m); utompath_error: return(utompathcap( upath )); } static char *mtoupathiconv(char *mpath) { char *m, *u; size_t inplen; size_t outlen; u_int16_t flags = 0; static char upath[MAXPATHLEN +2]; /* for convert_charset dest_len parameter +2 */ if ( *mpath == '\0' ) { return( "." ); } /* set conversion flags */ if (!(vol.v_flags & AFPVOL_NOHEX)) flags |= CONV_ESCAPEHEX; if (!(vol.v_flags & AFPVOL_USEDOTS)) flags |= CONV_ESCAPEDOTS; #if 0 if ((vol->v_casefold & AFPVOL_MTOUUPPER)) flags |= CONV_TOUPPER; else if ((vol->v_casefold & AFPVOL_MTOULOWER)) flags |= CONV_TOLOWER; #endif m = mpath; u = upath; inplen = strlen(m); outlen = MAXPATHLEN; if ((size_t)-1 == (outlen = convert_charset ( vol.v_maccharset, vol.v_volcharset, vol.v_maccharset, m, inplen, u, outlen, &flags)) ) { fprintf (stderr, "conversion from %s to %s for %s failed.", vol.v_maccodepage, vol.v_volcodepage, mpath); return(mtoupathcap( upath )); } return( upath ); } char * (*_mtoupath) ( char *mpath) = mtoupathcap; char * (*_utompath) ( char *upath) = utompathcap; /* choose translators for optional character set */ void select_charset( int options) { if( options & OPTION_EUCJP ) { _mtoupath = mtoupatheuc; _utompath = utompatheuc; } else if( options & OPTION_SJIS ) { _mtoupath = mtoupathsjis; _utompath = utompathsjis; } else { _mtoupath = mtoupathcap; _utompath = utompathcap; } } #if HEXOUTPUT int hexfork[ NUMFORKS ]; #endif /* HEXOUTPUT */ static struct nad_file_data { char macname[ MAXPATHLEN + 1 ]; char adpath[ 2 ][ MAXPATHLEN + 1]; int offset[ NUMFORKS ]; struct adouble ad; } nad; static void initvol(char *path) { if (!loadvolinfo(path, &vol)) { vol_load_charsets(&vol); ad_init(&nad.ad, vol.v_adouble, 0); _mtoupath = mtoupathiconv; _utompath = utompathiconv; } else ad_init(&nad.ad, 0, 0); } int nad_open( char *path, int openflags, struct FHeader *fh, int options) { struct stat st; int fork; /* * Depending upon openflags, set up nad.adpath for the open. If it * is for write, then stat the current directory to get its mode. * Open the file. Either fill or grab the adouble information. */ select_charset( options); memset(&nad.ad, 0, sizeof(nad.ad)); if ( openflags == O_RDONLY ) { initvol(path); strcpy( nad.adpath[0], path ); strcpy( nad.adpath[1], nad.ad.ad_ops->ad_path( nad.adpath[0], ADFLAGS_HF )); for ( fork = 0 ; fork < NUMFORKS ; fork++ ) { if ( stat( nad.adpath[ fork ], &st ) < 0 ) { if ( errno == ENOENT ) { fprintf( stderr, "%s is not an adouble file.\n", path ); } else { perror( "stat of adouble file failed" ); } return( -1 ); } } #if DEBUG fprintf(stderr, "%s is adpath[0]\n", nad.adpath[0]); fprintf(stderr, "%s is adpath[1]\n", nad.adpath[1]); #endif /* DEBUG */ if ( ad_open( nad.adpath[ 0 ], ADFLAGS_DF|ADFLAGS_HF, openflags, (int)( st.st_mode & 0666 ), &nad.ad) < 0 ) { perror( nad.adpath[ 0 ] ); return( -1 ); } return( nad_header_read( fh )); } else { initvol ("."); strcpy( nad.macname, fh->name ); strcpy( nad.adpath[0], mtoupath( nad.macname )); strcpy( nad.adpath[1], nad.ad.ad_ops->ad_path( nad.adpath[0], ADFLAGS_HF )); #if DEBUG fprintf(stderr, "%s\n", nad.macname); fprintf(stderr, "%s is adpath[0]\n", nad.adpath[0]); fprintf(stderr, "%s is adpath[1]\n", nad.adpath[1]); #endif /* DEBUG */ if ( stat( ".", &st ) < 0 ) { perror( "stat of . failed" ); return( -1 ); } (void)umask( 0 ); if ( ad_open( nad.adpath[ 0 ], ADFLAGS_DF|ADFLAGS_HF, openflags, (int)( st.st_mode & 0666 ), &nad.ad) < 0 ) { perror( nad.adpath[ 0 ] ); return( -1 ); } return( nad_header_write( fh )); } } int nad_header_read(struct FHeader *fh) { u_int32_t temptime; struct stat st; char *p; #if 0 memcpy( nad.macname, ad_entry( &nad.ad, ADEID_NAME ), ad_getentrylen( &nad.ad, ADEID_NAME )); nad.macname[ ad_getentrylen( &nad.ad, ADEID_NAME ) ] = '\0'; strcpy( fh->name, nad.macname ); #endif /* just in case there's nothing in macname */ if (*fh->name == '\0') { if ( NULL == (p = strrchr(nad.adpath[DATA], '/')) ) p = nad.adpath[DATA]; else p++; #if 0 strcpy(fh->name, utompath(nad.adpath[DATA])); #endif strcpy(fh->name, utompath(p)); } if ( stat( nad.adpath[ DATA ], &st ) < 0 ) { perror( "stat of datafork failed" ); return( -1 ); } fh->forklen[ DATA ] = htonl( st.st_size ); fh->forklen[ RESOURCE ] = htonl( ad_getentrylen( &nad.ad, ADEID_RFORK )); fh->comment[0] = '\0'; #if DEBUG fprintf( stderr, "macname of file\t\t\t%.*s\n", strlen( fh->name ), fh->name ); fprintf( stderr, "size of data fork\t\t%d\n", ntohl( fh->forklen[ DATA ] )); fprintf( stderr, "size of resource fork\t\t%d\n", ntohl( fh->forklen[ RESOURCE ] )); fprintf( stderr, "get info comment\t\t\"%s\"\n", fh->comment ); #endif /* DEBUG */ ad_getdate(&nad.ad, AD_DATE_CREATE, &temptime); memcpy( &fh->create_date, &temptime, sizeof( temptime )); ad_getdate(&nad.ad, AD_DATE_MODIFY, &temptime); memcpy( &fh->mod_date, &temptime, sizeof( temptime )); ad_getdate(&nad.ad, AD_DATE_BACKUP, &temptime); memcpy( &fh->backup_date, &temptime, sizeof( temptime )); #if DEBUG memcpy( &temptime, &fh->create_date, sizeof( temptime )); temptime = AD_DATE_TO_UNIX(temptime); fprintf( stderr, "create_date seconds\t\t%lu\n", temptime ); memcpy( &temptime, &fh->mod_date, sizeof( temptime )); temptime = AD_DATE_TO_UNIX(temptime); fprintf( stderr, "mod_date seconds\t\t%lu\n", temptime ); memcpy( &temptime, &fh->backup_date, sizeof( temptime )); temptime = AD_DATE_TO_UNIX(temptime); fprintf( stderr, "backup_date seconds\t\t%lu\n", temptime ); fprintf( stderr, "size of finder_info\t\t%d\n", sizeof( fh->finder_info )); #endif /* DEBUG */ memcpy(&fh->finder_info.fdType, ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_TYPE, sizeof( fh->finder_info.fdType )); memcpy(&fh->finder_info.fdCreator, ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_CREATOR, sizeof( fh->finder_info.fdCreator )); memcpy(&fh->finder_info.fdFlags, ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_FLAGS, sizeof( fh->finder_info.fdFlags )); memcpy(&fh->finder_info.fdLocation, ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_LOC, sizeof( fh->finder_info.fdLocation )); memcpy(&fh->finder_info.fdFldr, ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_FLDR, sizeof( fh->finder_info.fdFldr )); memcpy(&fh->finder_xinfo.fdScript, ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_SCRIPT, sizeof(fh->finder_xinfo.fdScript)); memcpy(&fh->finder_xinfo.fdXFlags, ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_XFLAGS, sizeof(fh->finder_xinfo.fdXFlags)); #if DEBUG { short flags; fprintf( stderr, "finder_info.fdType\t\t%.*s\n", sizeof( fh->finder_info.fdType ), &fh->finder_info.fdType ); fprintf( stderr, "finder_info.fdCreator\t\t%.*s\n", sizeof( fh->finder_info.fdCreator ), &fh->finder_info.fdCreator ); fprintf( stderr, "nad type and creator\t\t%.*s\n\n", sizeof( fh->finder_info.fdType ) + sizeof( fh->finder_info.fdCreator ), ad_entry( &nad.ad, ADEID_FINDERI )); memcpy(&flags, ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_FLAGS, sizeof( flags )); fprintf( stderr, "nad.ad flags\t\t\t%x\n", flags ); fprintf( stderr, "fh flags\t\t\t%x\n", fh->finder_info.fdFlags ); fprintf(stderr, "fh script\t\t\t%x\n", fh->finder_xinfo.fdScript); fprintf(stderr, "fh xflags\t\t\t%x\n", fh->finder_xinfo.fdXFlags); } #endif /* DEBUG */ nad.offset[ DATA ] = nad.offset[ RESOURCE ] = 0; return( 0 ); } int nad_header_write(struct FHeader *fh) { u_int32_t temptime; ad_setentrylen( &nad.ad, ADEID_NAME, strlen( nad.macname )); memcpy( ad_entry( &nad.ad, ADEID_NAME ), nad.macname, ad_getentrylen( &nad.ad, ADEID_NAME )); ad_setentrylen( &nad.ad, ADEID_COMMENT, strlen( fh->comment )); memcpy( ad_entry( &nad.ad, ADEID_COMMENT ), fh->comment, ad_getentrylen( &nad.ad, ADEID_COMMENT )); ad_setentrylen( &nad.ad, ADEID_RFORK, ntohl( fh->forklen[ RESOURCE ] )); #if DEBUG fprintf( stderr, "ad_getentrylen\n" ); fprintf( stderr, "ADEID_FINDERI\t\t\t%d\n", ad_getentrylen( &nad.ad, ADEID_FINDERI )); fprintf( stderr, "ADEID_RFORK\t\t\t%d\n", ad_getentrylen( &nad.ad, ADEID_RFORK )); fprintf( stderr, "ADEID_NAME\t\t\t%d\n", ad_getentrylen( &nad.ad, ADEID_NAME )); fprintf( stderr, "ad_entry of ADEID_NAME\t\t%.*s\n", ad_getentrylen( &nad.ad, ADEID_NAME ), ad_entry( &nad.ad, ADEID_NAME )); fprintf( stderr, "ADEID_COMMENT\t\t\t%d\n", ad_getentrylen( &nad.ad, ADEID_COMMENT )); #endif /* DEBUG */ memcpy( &temptime, &fh->create_date, sizeof( temptime )); ad_setdate(&nad.ad, AD_DATE_CREATE, temptime); memcpy( &temptime, &fh->mod_date, sizeof( temptime )); ad_setdate(&nad.ad, AD_DATE_MODIFY, temptime); #if DEBUG ad_getdate(&nad.ad, AD_DATE_CREATE, &temptime); temptime = AD_DATE_TO_UNIX(temptime); fprintf(stderr, "FILEIOFF_CREATE seconds\t\t%ld\n", temptime ); ad_getdate(&nad.ad, AD_DATE_MODIFY, &temptime); temptime = AD_DATE_TO_UNIX(temptime); fprintf(stderr, "FILEIOFF_MODIFY seconds\t\t%ld\n", temptime ); #endif /* DEBUG */ memset( ad_entry( &nad.ad, ADEID_FINDERI ), 0, ADEDLEN_FINDERI ); memcpy( ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_TYPE, &fh->finder_info.fdType, sizeof( fh->finder_info.fdType )); memcpy( ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_CREATOR, &fh->finder_info.fdCreator, sizeof( fh->finder_info.fdCreator )); memcpy( ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_FLAGS, &fh->finder_info.fdFlags, sizeof( fh->finder_info.fdFlags )); memcpy( ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_LOC, &fh->finder_info.fdLocation,sizeof( fh->finder_info.fdLocation )); memcpy( ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_FLDR, &fh->finder_info.fdFldr, sizeof( fh->finder_info.fdFldr )); memcpy( ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_SCRIPT, &fh->finder_xinfo.fdScript, sizeof( fh->finder_xinfo.fdScript )); memcpy( ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_XFLAGS, &fh->finder_xinfo.fdXFlags, sizeof( fh->finder_xinfo.fdXFlags)); #if DEBUG { short flags; memcpy(&flags, ( ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_FLAGS), sizeof( flags )); fprintf( stderr, "nad.ad flags\t\t\t%x\n", flags ); fprintf( stderr, "fh flags\t\t\t%x\n", fh->finder_info.fdFlags ); fprintf( stderr, "fh xflags\t\t\t%x\n", fh->finder_xinfo.fdXFlags ); fprintf( stderr, "type and creator\t\t%.*s\n\n", sizeof( fh->finder_info.fdType ) + sizeof( fh->finder_info.fdCreator ), ad_entry( &nad.ad, ADEID_FINDERI )); } #endif /* DEBUG */ #if HEXOUTPUT hexfork[ DATA ] = open( "datafork", O_WRONLY|O_CREAT, 0622 ); hexfork[ RESOURCE ] = open( "resfork", O_WRONLY|O_CREAT, 0622 ); #endif /* HEXOUTPUT */ nad.offset[ DATA ] = nad.offset[ RESOURCE ] = 0; ad_flush( &nad.ad ); return( 0 ); } static int forkeid[] = { ADEID_DFORK, ADEID_RFORK }; ssize_t nad_read(int fork, char *forkbuf, size_t bufc) { ssize_t cc = 0; #if DEBUG fprintf( stderr, "Entering nad_read\n" ); #endif /* DEBUG */ if (( cc = ad_read( &nad.ad, forkeid[ fork ], nad.offset[ fork ], forkbuf, bufc)) < 0 ) { perror( "Reading the appledouble file:" ); return( cc ); } nad.offset[ fork ] += cc; #if DEBUG fprintf( stderr, "Exiting nad_read\n" ); #endif /* DEBUG */ return( cc ); } ssize_t nad_write(int fork, char *forkbuf, size_t bufc) { char *buf_ptr; size_t writelen; ssize_t cc = 0; #if DEBUG fprintf( stderr, "Entering nad_write\n" ); #endif /* DEBUG */ #if HEXOUTPUT write( hexfork[ fork ], forkbuf, bufc ); #endif /* HEXOUTPUT */ writelen = bufc; buf_ptr = forkbuf; while (( writelen > 0 ) && ( cc >= 0 )) { cc = ad_write( &nad.ad, forkeid[ fork ], nad.offset[ fork ], 0, buf_ptr, writelen); nad.offset[ fork ] += cc; buf_ptr += cc; writelen -= cc; } if ( cc < 0 ) { perror( "Writing the appledouble file:" ); return( cc ); } return( bufc ); } int nad_close(int status) { int rv; if ( status == KEEP ) { if (( rv = ad_flush( &nad.ad )) < 0 ) { fprintf( stderr, "nad_close rv for flush %d\n", rv ); return( rv ); } if (( rv = ad_close( &nad.ad, ADFLAGS_DF|ADFLAGS_HF )) < 0 ) { fprintf( stderr, "nad_close rv for close %d\n", rv ); return( rv ); } } else if ( status == TRASH ) { if ( unlink( nad.adpath[ 0 ] ) < 0 ) { perror ( nad.adpath[ 0 ] ); } if ( unlink( nad.adpath[ 1 ] ) < 0 ) { perror ( nad.adpath[ 1 ] ); } return( 0 ); } else return( -1 ); return( 0 ); } netatalk-2.2.2/bin/megatron/updcrc.c0000644000175200017500000001333411655731126014266 00000000000000/* * $Id: updcrc.c,v 1.5 2009-10-13 22:55:36 didg Exp $ * * updcrc(3), crc(1) - calculate crc polynomials * * Calculate, intelligently, the CRC of a dataset incrementally given a * buffer full at a time. * * Usage: * newcrc = updcrc( oldcrc, bufadr, buflen ) * unsigned int oldcrc, buflen; * char *bufadr; * * Compiling with -DTEST creates a program to print the CRC of stdin to stdout. * Compile with -DMAKETAB to print values for crctab to stdout. If you change * the CRC polynomial parameters, be sure to do this and change * crctab's initial value. * * Notes: * Regards the data stream as an integer whose MSB is the MSB of the first * byte recieved. This number is 'divided' (using xor instead of subtraction) * by the crc-polynomial P. * XMODEM does things a little differently, essentially treating the LSB of * the first data byte as the MSB of the integer. Define SWAPPED to make * things behave in this manner. * * Author: Mark G. Mendel, 7/86 * UUCP: ihnp4!umn-cs!hyper!mark, GEnie: mgm */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include "updcrc.h" /* The CRC polynomial. * These 4 values define the crc-polynomial. * If you change them, you must change crctab[]'s initial value to what is * printed by initcrctab() [see 'compile with -DMAKETAB' above]. */ /* Value used by: CCITT XMODEM ARC */ #define P 0x1021 /* the poly: 0x1021 0x1021 A001 */ #define INIT_CRC 0L /* init value: -1 0 0 */ #if 0 #define SWAPPED /* bit order: undef defined defined */ #endif /* 0 */ /* the number of bits per char: don't change it. */ #define B 8 static WTYPE crctab[1<>(W-B)) ^ *cp++]; #else /* SWAPPED */ crc = (crc>>B) ^ crctab[(crc & ((1< int main(void) { initcrctab(); } void initcrctab(void) { register int b, i; WTYPE v; for( b = 0; b <= (1<= 0; ) v = v & ((WTYPE)1<<(W-1)) ? (v<<1)^P : v<<1; #else for( v = b, i = B; --i >= 0; ) v = v & 1 ? (v>>1)^P : v>>1; #endif crctab[b] = v; printf( "0x%lx,", v & ((1L< #include #define MAXBUF 4096 main( int ac, char **av) { int fd; int nr; int i; char buf[MAXBUF]; WTYPE crc, crc2; fd = 0; if( ac > 1 ) if( (fd = open( av[1], O_RDONLY )) < 0 ) { perror( av[1] ); exit( -1 ); } crc = crc2 = INIT_CRC; while( (nr = read( fd, buf, MAXBUF )) > 0 ) { crc = updcrc( crc, buf, nr ); } if( nr != 0 ) perror( "reading" ); else { printf( "%lx\n", crc ); } #ifdef MAGICCHECK /* tack one's complement of crc onto data stream, and continue crc calculation. Should get a constant (magic number) dependent only on P, not the data. */ crc2 = crc ^ -1L; for( nr = W-B; nr >= 0; nr -= B ) { buf[0] = (crc2 >> nr); crc = updcrc(crc, buf, 1); } /* crc should now equal magic */ buf[0] = buf[1] = buf[2] = buf[3] = 0; printf( "magic test: %lx =?= %lx\n", crc, updcrc(-1, buf, W/B)); #endif /* MAGICCHECK */ } #endif /* TEST */ netatalk-2.2.2/bin/megatron/macbin.c0000644000175200017500000004067311655731126014245 00000000000000/* * $Id: macbin.c,v 1.15 2010-01-27 21:27:53 didg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #include #include #include #include #include "megatron.h" #include "macbin.h" #include "updcrc.h" /* This allows megatron to generate .bin files that won't choke other well-known converter apps. It also makes sure that checksums always match. (RLB) */ #define MACBINARY_PLAY_NICE_WITH_OTHERS /* String used to indicate standard input instead of a disk file. Should be a string not normally used for a file */ #ifndef STDIN # define STDIN "-" #endif /* STDIN */ /* Yes and no */ #define NOWAY 0 #define SURETHANG 1 /* Size of a macbinary file header */ #define HEADBUFSIZ 128 /* Both input and output routines use this struct and the following globals; therefore this module can only be used for one of the two functions at a time. */ static struct bin_file_data { u_int32_t forklen[ NUMFORKS ]; char path[ MAXPATHLEN + 1]; int filed; u_short headercrc; time_t gmtoff; /* to convert from/to localtime */ } bin; extern char *forkname[]; static u_char head_buf[HEADBUFSIZ]; /* * bin_open must be called first. pass it a filename that is supposed * to contain a macbinary file. an bin struct will be allocated and * somewhat initialized; bin_filed is set. */ int bin_open(char *binfile, int flags, struct FHeader *fh, int options) { int maxlen; int rc; time_t t; struct tm *tp; #if DEBUG fprintf( stderr, "entering bin_open\n" ); #endif /* DEBUG */ /* call localtime so that we get the timezone offset */ bin.gmtoff = 0; #ifndef NO_STRUCT_TM_GMTOFF time(&t); tp = localtime(&t); if (tp) bin.gmtoff = tp->tm_gmtoff; #endif /* ! NO_STRUCT_TM_GMTOFF */ if ( flags == O_RDONLY ) { /* input */ if ( strcmp( binfile, STDIN ) == 0 ) { bin.filed = fileno( stdin ); } else if (( bin.filed = open( binfile, flags )) < 0 ) { perror( binfile ); return( -1 ); } #if DEBUG fprintf( stderr, "opened %s for read\n", binfile ); #endif /* DEBUG */ if ((( rc = test_header() ) > 0 ) && ( bin_header_read( fh, rc ) == 0 )) { return( 0 ); } fprintf( stderr, "%s is not a macbinary file.\n", binfile ); return( -1 ); } else { /* output */ if (options & OPTION_STDOUT) bin.filed = fileno(stdout); else { maxlen = sizeof( bin.path ) - 1; #if DEBUG fprintf( stderr, "sizeof bin.path\t\t\t%d\n", sizeof( bin.path )); fprintf( stderr, "maxlen \t\t\t\t%d\n", maxlen ); #endif /* DEBUG */ strncpy( bin.path, fh->name, maxlen ); strncpy( bin.path, mtoupath( bin.path ), maxlen ); strncat( bin.path, ".bin", maxlen - strlen( bin.path )); if (( bin.filed = open( bin.path, flags, 0666 )) < 0 ) { perror( bin.path ); return( -1 ); } #if DEBUG fprintf( stderr, "opened %s for write\n", (options & OPTION_STDOUT) ? "(stdout)" : bin.path ); #endif /* DEBUG */ } if ( bin_header_write( fh ) != 0 ) { bin_close( TRASH ); fprintf( stderr, "%s\n", bin.path ); return( -1 ); } return( 0 ); } } /* * bin_close must be called before a second file can be opened using * bin_open. Upon successful completion, a value of 0 is returned. * Otherwise, a value of -1 is returned. */ int bin_close(int keepflag) { #if DEBUG fprintf( stderr, "entering bin_close\n" ); #endif /* DEBUG */ if ( keepflag == KEEP ) { return( close( bin.filed )); } else if ( keepflag == TRASH ) { if (( strcmp( bin.path, STDIN ) != 0 ) && ( unlink( bin.path ) < 0 )) { perror ( bin.path ); } return( 0 ); } else return( -1 ); } /* * bin_read is called until it returns zero for each fork. when it is * and finds that there is zero left to give, it seeks to the position * of the next fork (if there is one ). * bin_read must be called enough times to * return zero and no more than that. */ ssize_t bin_read( int fork, char *buffer, size_t length) { char *buf_ptr; size_t readlen; ssize_t cc = 1; off_t pos; #if DEBUG >= 3 fprintf( stderr, "bin_read: fork is %s\n", forkname[ fork ] ); fprintf( stderr, "bin_read: remaining length is %d\n", bin.forklen[fork] ); #endif /* DEBUG >= 3 */ if (bin.forklen[fork] > 0x7FFFFFFF) { fprintf(stderr, "This should never happen, dude! fork length == %u\n", bin.forklen[fork]); return -1; } if ( bin.forklen[ fork ] == 0 ) { if ( fork == DATA ) { pos = lseek( bin.filed, 0, SEEK_CUR ); #if DEBUG fprintf( stderr, "current position is %ld\n", pos ); #endif /* DEBUG */ pos %= HEADBUFSIZ; if (pos != 0) { pos = lseek( bin.filed, HEADBUFSIZ - pos, SEEK_CUR ); } #if DEBUG fprintf( stderr, "current position is %ld\n", pos ); #endif /* DEBUG */ } return( 0 ); } if ( bin.forklen[ fork ] < length ) { readlen = bin.forklen[ fork ]; } else { readlen = length; } #if DEBUG >= 3 fprintf( stderr, "bin_read: readlen is %d\n", readlen ); fprintf( stderr, "bin_read: cc is %d\n", cc ); #endif /* DEBUG >= 3 */ buf_ptr = buffer; while (( readlen > 0 ) && ( cc > 0 )) { if (( cc = read( bin.filed, buf_ptr, readlen )) > 0 ) { #if DEBUG >= 3 fprintf( stderr, "bin_read: cc is %d\n", cc ); #endif /* DEBUG >= 3 */ readlen -= cc; buf_ptr += cc; } } if ( cc >= 0 ) { cc = buf_ptr - buffer; bin.forklen[ fork ] -= cc; } #if DEBUG >= 3 fprintf( stderr, "bin_read: chars read is %d\n", cc ); #endif /* DEBUG >= 3 */ return( cc ); } /* * bin_write */ ssize_t bin_write(int fork, char *buffer, size_t length) { char *buf_ptr; ssize_t writelen; ssize_t cc = 0; off_t pos; u_char padchar = 0x7f; /* Not sure why, but it seems this must be 0x7f to match other converters, not 0. (RLB) */ #if DEBUG >= 3 fprintf( stderr, "bin_write: fork is %s\n", forkname[ fork ] ); fprintf( stderr, "bin_write: remaining length is %d\n", bin.forklen[fork] ); #endif /* DEBUG >= 3 */ if (( fork == RESOURCE ) && ( bin.forklen[ DATA ] != 0 )) { fprintf( stderr, "Forklength error.\n" ); return( -1 ); } buf_ptr = (char *)buffer; if ( bin.forklen[ fork ] >= length ) { writelen = length; } else { fprintf( stderr, "Forklength error.\n" ); return( -1 ); } #if DEBUG >= 3 fprintf( stderr, "bin_write: write length is %d\n", writelen ); #endif /* DEBUG >= 3 */ while (( writelen > 0 ) && ( cc >= 0 )) { cc = write( bin.filed, buf_ptr, writelen ); buf_ptr += cc; writelen -= cc; } if ( cc < 0 ) { perror( "Couldn't write to macbinary file:" ); return( cc ); } bin.forklen[fork] -= length; /* * add the padding at end of data and resource forks */ if ( bin.forklen[ fork ] == 0 ) { pos = lseek( bin.filed, 0, SEEK_CUR ); #if DEBUG fprintf( stderr, "current position is %ld\n", pos ); #endif /* DEBUG */ pos %= HEADBUFSIZ; if (pos != 0) { /* pad only if we need to */ pos = lseek( bin.filed, HEADBUFSIZ - pos - 1, SEEK_CUR ); if ( write( bin.filed, &padchar, 1 ) != 1 ) { perror( "Couldn't write to macbinary file:" ); return( -1 ); } } #if DEBUG fprintf( stderr, "current position is %ld\n", pos ); #endif /* DEBUG */ } #if DEBUG fprintf( stderr, "\n" ); #endif /* DEBUG */ return( length ); } /* * bin_header_read is called by bin_open, and before any information can * read from the fh substruct. it must be called before any * of the bytes of the other two forks can be read, as well. */ int bin_header_read(struct FHeader *fh, int revision) { u_short mask; /* * Set the appropriate finder flags mask for the type of macbinary * file it is, and copy the extra macbinary II stuff from the header. * If it is not a macbinary file revision of I or II, then return * negative. */ switch ( revision ) { case 3: case 2 : mask = htons( 0xfcee ); memcpy(&fh->finder_info.fdFlags + 1, head_buf + 101,1 ); break; case 1 : mask = htons( 0xfc00 ); break; default : return( -1 ); break; } /* * Go through and copy all the stuff you can get from the * MacBinary header into the fh struct. What fun! */ memcpy(fh->name, head_buf + 2, head_buf[ 1 ] ); memcpy(&fh->create_date, head_buf + 91, 4 ); fh->create_date = MAC_DATE_TO_UNIX(fh->create_date) - bin.gmtoff; fh->create_date = AD_DATE_FROM_UNIX(fh->create_date); memcpy( &fh->mod_date, head_buf + 95, 4 ); fh->mod_date = MAC_DATE_TO_UNIX(fh->mod_date) - bin.gmtoff; fh->mod_date = AD_DATE_FROM_UNIX(fh->mod_date); fh->backup_date = AD_DATE_START; memcpy( &fh->finder_info, head_buf + 65, 8 ); #ifndef MACBINARY_PLAY_NICE_WITH_OTHERS /* (RLB) */ memcpy( &fh->finder_info.fdFlags, head_buf + 73, 1 ); fh->finder_info.fdFlags &= mask; #else /* ! MACBINARY_PLAY_NICE_WITH_OTHERS */ memcpy( &fh->finder_info.fdFlags, head_buf + 73, 2 ); #endif /* ! MACBINARY_PLAY_NICE_WITH_OTHERS */ memcpy(&fh->finder_info.fdLocation, head_buf + 75, 4 ); memcpy(&fh->finder_info.fdFldr, head_buf + 79, 2 ); memcpy(&fh->forklen[ DATA ], head_buf + 83, 4 ); bin.forklen[ DATA ] = ntohl( fh->forklen[ DATA ] ); memcpy(&fh->forklen[ RESOURCE ], head_buf + 87, 4 ); bin.forklen[ RESOURCE ] = ntohl( fh->forklen[ RESOURCE ] ); fh->comment[0] = '\0'; if (revision == 3) { fh->finder_xinfo.fdScript = *(head_buf + 106); fh->finder_xinfo.fdXFlags = *(head_buf + 107); } #if DEBUG >= 5 { short flags; long flags_long; fprintf( stderr, "Values read by bin_header_read\n" ); fprintf( stderr, "name length\t\t%d\n", head_buf[ 1 ] ); fprintf( stderr, "file name\t\t%s\n", fh->name ); fprintf( stderr, "get info comment\t%s\n", fh->comment ); fprintf( stderr, "type\t\t\t%.*s\n", sizeof( fh->finder_info.fdType ), &fh->finder_info.fdType ); fprintf( stderr, "creator\t\t\t%.*s\n", sizeof( fh->finder_info.fdCreator ), &fh->finder_info.fdCreator ); memcpy( &flags, &fh->finder_info.fdFlags, sizeof( flags )); flags = ntohs( flags ); fprintf( stderr, "flags\t\t\t%x\n", flags ); /* Show fdLocation too (RLB) */ memcpy( &flags_long, &fh->finder_info.fdLocation, sizeof( flags_long )); flags_long = ntohl( flags_long ); fprintf( stderr, "location flags\t\t%lx\n", flags_long ); fprintf( stderr, "data fork length\t%ld\n", bin.forklen[DATA] ); fprintf( stderr, "resource fork length\t%ld\n", bin.forklen[RESOURCE] ); fprintf( stderr, "\n" ); } #endif /* DEBUG >= 5 */ return( 0 ); } /* * bin_header_write is called by bin_open, and relies on information * from the fh substruct. it must be called before any * of the bytes of the other two forks can be written, as well. * bin_header_write and bin_header_read are opposites. */ int bin_header_write(struct FHeader *fh) { char *write_ptr; u_int32_t t; int wc; int wr; memset(head_buf, 0, sizeof( head_buf )); head_buf[ 1 ] = (u_char)strlen( fh->name ); memcpy( head_buf + 2, fh->name, head_buf[ 1 ] ); memcpy( head_buf + 65, &fh->finder_info, 8 ); #ifndef MACBINARY_PLAY_NICE_WITH_OTHERS /* (RLB) */ memcpy( head_buf + 73, &fh->finder_info.fdFlags, 1 ); #else /* ! MACBINARY_PLAY_NICE_WITH_OTHERS */ memcpy( head_buf + 73, &fh->finder_info.fdFlags, 2 ); #endif /* ! MACBINARY_PLAY_NICE_WITH_OTHERS */ memcpy( head_buf + 75, &fh->finder_info.fdLocation, 4 ); memcpy( head_buf + 79, &fh->finder_info.fdFldr, 2 ); memcpy( head_buf + 83, &fh->forklen[ DATA ], 4 ); memcpy( head_buf + 87, &fh->forklen[ RESOURCE ], 4 ); t = AD_DATE_TO_UNIX(fh->create_date) + bin.gmtoff; t = MAC_DATE_FROM_UNIX(t); memcpy( head_buf + 91, &t, sizeof(t) ); t = AD_DATE_TO_UNIX(fh->mod_date) + bin.gmtoff; t = MAC_DATE_FROM_UNIX(t); memcpy( head_buf + 95, &t, sizeof(t) ); memcpy( head_buf + 101, &fh->finder_info.fdFlags + 1, 1); /* macbinary III */ memcpy( head_buf + 102, "mBIN", 4); *(head_buf + 106) = fh->finder_xinfo.fdScript; *(head_buf + 107) = fh->finder_xinfo.fdXFlags; head_buf[ 122 ] = 130; head_buf[ 123 ] = 129; bin.headercrc = htons( updcrc( (u_short) 0, head_buf, 124 )); memcpy(head_buf + 124, &bin.headercrc, sizeof( bin.headercrc )); bin.forklen[ DATA ] = ntohl( fh->forklen[ DATA ] ); bin.forklen[ RESOURCE ] = ntohl( fh->forklen[ RESOURCE ] ); #if DEBUG >= 5 { short flags; long flags_long; fprintf( stderr, "Values written by bin_header_write\n" ); fprintf( stderr, "name length\t\t%d\n", head_buf[ 1 ] ); fprintf( stderr, "file name\t\t%s\n", (char *)&head_buf[ 2 ] ); fprintf( stderr, "type\t\t\t%.4s\n", (char *)&head_buf[ 65 ] ); fprintf( stderr, "creator\t\t\t%.4s\n", (char *)&head_buf[ 69 ] ); memcpy( &flags, &fh->finder_info.fdFlags, sizeof( flags )); flags = ntohs( flags ); fprintf( stderr, "flags\t\t\t%x\n", flags ); /* Show fdLocation too (RLB) */ memcpy( &flags_long, &fh->finder_info.fdLocation, sizeof( flags_long )); flags_long = ntohl( flags_long ); fprintf( stderr, "location flags\t\t%ldx\n", flags_long ); fprintf( stderr, "data fork length\t%ld\n", bin.forklen[DATA] ); fprintf( stderr, "resource fork length\t%ld\n", bin.forklen[RESOURCE] ); fprintf( stderr, "\n" ); } #endif /* DEBUG >= 5 */ write_ptr = (char *)head_buf; wc = sizeof( head_buf ); wr = 0; while (( wc > 0 ) && ( wr >= 0 )) { wr = write( bin.filed, write_ptr, wc ); write_ptr += wr; wc -= wr; } if ( wr < 0 ) { perror( "Couldn't write macbinary header:" ); return( wr ); } return( 0 ); } /* * test_header is called from bin_open. it checks certain values of * the first 128 bytes, determines if the file is a MacBinary, * MacBinary II, MacBinary III, or non-MacBinary file, and returns a * one, two, three or negative one to indicate the file type. * * If the signature at 102 is equal to "mBIN," then it's a MacBinary * III file. Bytes 0 and 74 must be zero for the file to be any type * of MacBinary. If the crc of bytes 0 through 123 equals the value * at offset 124 then it is a MacBinary II. If not, then if byte 82 * is zero, byte 2 is a valid value for a mac filename length (between * one and sixty-three), and bytes 101 through 125 are all zero, then * the file is a MacBinary. * * NOTE: apple's MacBinary II files have a non-zero value at byte 74. * so, the check for byte 74 isn't very useful. */ int test_header(void) { const char zeros[25] = ""; ssize_t cc; u_short header_crc; u_char namelen; #if DEBUG fprintf( stderr, "entering test_header\n" ); #endif /* DEBUG */ cc = read( bin.filed, (char *)head_buf, sizeof( head_buf )); if ( cc < sizeof( head_buf )) { perror( "Premature end of file :" ); return( -1 ); } #if DEBUG fprintf( stderr, "was able to read HEADBUFSIZ bytes\n" ); #endif /* DEBUG */ /* check for macbinary III header */ if (memcmp(head_buf + 102, "mBIN", 4) == 0) return 3; /* check for macbinary II even if only one of the bytes is zero */ if (( head_buf[ 0 ] == 0 ) || ( head_buf[ 74 ] == 0 )) { #if DEBUG fprintf( stderr, "byte 0 and 74 are both zero\n" ); #endif /* DEBUG */ bin.headercrc = updcrc( (u_short) 0, head_buf, 124 ); memcpy(&header_crc, head_buf + 124, sizeof( header_crc )); header_crc = ntohs( header_crc ); if ( header_crc == bin.headercrc ) { return( 2 ); } #if DEBUG fprintf( stderr, "header crc didn't pan out\n" ); #endif /* DEBUG */ } /* now see if we have a macbinary file. */ if ( head_buf[ 82 ] != 0 ) { return( -1 ); } memcpy( &namelen, head_buf + 1, sizeof( namelen )); #if DEBUG fprintf( stderr, "name length is %d\n", namelen ); #endif /* DEBUG */ if (( namelen < 1 ) || ( namelen > 63 )) { return( -1 ); } /* bytes 101 - 125 should be zero */ if (memcmp(head_buf + 101, zeros, sizeof(zeros)) != 0) return -1; /* macbinary forks aren't larger than 0x7FFFFF */ /* we allow forks to be larger, breaking the specs */ memcpy(&cc, head_buf + 83, sizeof(cc)); cc = ntohl(cc); if (cc > 0x7FFFFFFF) return -1; memcpy(&cc, head_buf + 87, sizeof(cc)); cc = ntohl(cc); if (cc > 0x7FFFFFFF) return -1; #if DEBUG fprintf( stderr, "byte 82 is zero and name length is cool\n" ); #endif /* DEBUG */ return( 1 ); } netatalk-2.2.2/bin/misc/0000777000175200017500000000000011704770424012040 500000000000000netatalk-2.2.2/bin/misc/Makefile.am0000644000175200017500000000111611655731126014010 00000000000000# Makefile.am for bin/misc pkgconfdir = @PKGCONFDIR@ bin_PROGRAMS = noinst_PROGRAMS = netacnv logger_test fce netacnv_SOURCES = netacnv.c netacnv_LDADD = $(top_builddir)/libatalk/libatalk.la logger_test_SOURCES = logger_test.c logger_test_LDADD = $(top_builddir)/libatalk/libatalk.la fce_SOOURCE = fce.c fce_LDADD = $(top_builddir)/libatalk/libatalk.la fce_CFLAGS = -I$(top_srcdir)/include bin_PROGRAMS += afpldaptest afpldaptest_SOURCES = uuidtest.c afpldaptest_CFLAGS = -D_PATH_ACL_LDAPCONF=\"$(pkgconfdir)/afp_ldap.conf\" afpldaptest_LDADD = $(top_builddir)/libatalk/libatalk.la netatalk-2.2.2/bin/misc/Makefile.in0000644000175200017500000005362511703521723014027 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for bin/misc VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = afpldaptest$(EXEEXT) noinst_PROGRAMS = netacnv$(EXEEXT) logger_test$(EXEEXT) fce$(EXEEXT) subdir = bin/misc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_afpldaptest_OBJECTS = afpldaptest-uuidtest.$(OBJEXT) afpldaptest_OBJECTS = $(am_afpldaptest_OBJECTS) afpldaptest_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la afpldaptest_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(afpldaptest_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ fce_SOURCES = fce.c fce_OBJECTS = fce-fce.$(OBJEXT) fce_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la fce_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(fce_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_logger_test_OBJECTS = logger_test.$(OBJEXT) logger_test_OBJECTS = $(am_logger_test_OBJECTS) logger_test_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la am_netacnv_OBJECTS = netacnv.$(OBJEXT) netacnv_OBJECTS = $(am_netacnv_OBJECTS) netacnv_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(afpldaptest_SOURCES) fce.c $(logger_test_SOURCES) \ $(netacnv_SOURCES) DIST_SOURCES = $(afpldaptest_SOURCES) fce.c $(logger_test_SOURCES) \ $(netacnv_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgconfdir = @PKGCONFDIR@ netacnv_SOURCES = netacnv.c netacnv_LDADD = $(top_builddir)/libatalk/libatalk.la logger_test_SOURCES = logger_test.c logger_test_LDADD = $(top_builddir)/libatalk/libatalk.la fce_SOOURCE = fce.c fce_LDADD = $(top_builddir)/libatalk/libatalk.la fce_CFLAGS = -I$(top_srcdir)/include afpldaptest_SOURCES = uuidtest.c afpldaptest_CFLAGS = -D_PATH_ACL_LDAPCONF=\"$(pkgconfdir)/afp_ldap.conf\" afpldaptest_LDADD = $(top_builddir)/libatalk/libatalk.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bin/misc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign bin/misc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done afpldaptest$(EXEEXT): $(afpldaptest_OBJECTS) $(afpldaptest_DEPENDENCIES) @rm -f afpldaptest$(EXEEXT) $(afpldaptest_LINK) $(afpldaptest_OBJECTS) $(afpldaptest_LDADD) $(LIBS) fce$(EXEEXT): $(fce_OBJECTS) $(fce_DEPENDENCIES) @rm -f fce$(EXEEXT) $(fce_LINK) $(fce_OBJECTS) $(fce_LDADD) $(LIBS) logger_test$(EXEEXT): $(logger_test_OBJECTS) $(logger_test_DEPENDENCIES) @rm -f logger_test$(EXEEXT) $(LINK) $(logger_test_OBJECTS) $(logger_test_LDADD) $(LIBS) netacnv$(EXEEXT): $(netacnv_OBJECTS) $(netacnv_DEPENDENCIES) @rm -f netacnv$(EXEEXT) $(LINK) $(netacnv_OBJECTS) $(netacnv_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpldaptest-uuidtest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fce-fce.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logger_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netacnv.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< afpldaptest-uuidtest.o: uuidtest.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpldaptest_CFLAGS) $(CFLAGS) -MT afpldaptest-uuidtest.o -MD -MP -MF $(DEPDIR)/afpldaptest-uuidtest.Tpo -c -o afpldaptest-uuidtest.o `test -f 'uuidtest.c' || echo '$(srcdir)/'`uuidtest.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpldaptest-uuidtest.Tpo $(DEPDIR)/afpldaptest-uuidtest.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uuidtest.c' object='afpldaptest-uuidtest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpldaptest_CFLAGS) $(CFLAGS) -c -o afpldaptest-uuidtest.o `test -f 'uuidtest.c' || echo '$(srcdir)/'`uuidtest.c afpldaptest-uuidtest.obj: uuidtest.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpldaptest_CFLAGS) $(CFLAGS) -MT afpldaptest-uuidtest.obj -MD -MP -MF $(DEPDIR)/afpldaptest-uuidtest.Tpo -c -o afpldaptest-uuidtest.obj `if test -f 'uuidtest.c'; then $(CYGPATH_W) 'uuidtest.c'; else $(CYGPATH_W) '$(srcdir)/uuidtest.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpldaptest-uuidtest.Tpo $(DEPDIR)/afpldaptest-uuidtest.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uuidtest.c' object='afpldaptest-uuidtest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpldaptest_CFLAGS) $(CFLAGS) -c -o afpldaptest-uuidtest.obj `if test -f 'uuidtest.c'; then $(CYGPATH_W) 'uuidtest.c'; else $(CYGPATH_W) '$(srcdir)/uuidtest.c'; fi` fce-fce.o: fce.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fce_CFLAGS) $(CFLAGS) -MT fce-fce.o -MD -MP -MF $(DEPDIR)/fce-fce.Tpo -c -o fce-fce.o `test -f 'fce.c' || echo '$(srcdir)/'`fce.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/fce-fce.Tpo $(DEPDIR)/fce-fce.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fce.c' object='fce-fce.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fce_CFLAGS) $(CFLAGS) -c -o fce-fce.o `test -f 'fce.c' || echo '$(srcdir)/'`fce.c fce-fce.obj: fce.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fce_CFLAGS) $(CFLAGS) -MT fce-fce.obj -MD -MP -MF $(DEPDIR)/fce-fce.Tpo -c -o fce-fce.obj `if test -f 'fce.c'; then $(CYGPATH_W) 'fce.c'; else $(CYGPATH_W) '$(srcdir)/fce.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/fce-fce.Tpo $(DEPDIR)/fce-fce.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fce.c' object='fce-fce.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fce_CFLAGS) $(CFLAGS) -c -o fce-fce.obj `if test -f 'fce.c'; then $(CYGPATH_W) 'fce.c'; else $(CYGPATH_W) '$(srcdir)/fce.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-noinstPROGRAMS ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/bin/misc/logger_test.c0000644000175200017500000000716111655731243014444 00000000000000#include #include #include int main(int argc, char *argv[]) { set_processname("logger_Test"); #if 0 LOG(log_severe, logtype_logger, "Logging Test starting: this should only log to syslog"); /* syslog testing */ LOG(log_severe, logtype_logger, "Disabling syslog logging."); unsetuplog("Default"); LOG(log_error, logtype_default, "This shouldn't log to syslog: LOG(log_error, logtype_default)."); LOG(log_error, logtype_logger, "This shouldn't log to syslog: LOG(log_error, logtype_logger)."); setuplog("Default LOG_INFO"); LOG(log_info, logtype_logger, "Set syslog logging to 'log_info', so this should log again. LOG(log_info, logtype_logger)."); LOG(log_error, logtype_logger, "This should log to syslog: LOG(log_error, logtype_logger)."); LOG(log_error, logtype_default, "This should log to syslog. LOG(log_error, logtype_default)."); LOG(log_debug, logtype_logger, "This shouldn't log to syslog. LOG(log_debug, logtype_logger)."); LOG(log_debug, logtype_default, "This shouldn't log to syslog. LOG(log_debug, logtype_default)."); LOG(log_severe, logtype_logger, "Disabling syslog logging."); unsetuplog("Default"); #endif /* filelog testing */ setuplog("DSI log_maxdebug test.log"); LOG(log_info, logtype_dsi, "This should log."); LOG(log_error, logtype_default, "This should not log."); setuplog("Default log_debug test.log"); LOG(log_debug, logtype_default, "This should log."); LOG(log_maxdebug, logtype_default, "This should not log."); LOG(log_maxdebug, logtype_dsi, "This should still log."); /* flooding prevention check */ LOG(log_debug, logtype_default, "Flooding 3x"); for (int i = 0; i < 3; i++) { LOG(log_debug, logtype_default, "Flooding..."); } /* wipe the array */ LOG(log_debug, logtype_default, "1"); LOG(log_debug, logtype_default, "2"); LOG(log_debug, logtype_default, "3"); LOG(log_debug, logtype_default, "-============"); LOG(log_debug, logtype_default, "Flooding 5x"); for (int i = 0; i < 5; i++) { LOG(log_debug, logtype_default, "Flooding..."); } LOG(log_debug, logtype_default, "1"); LOG(log_debug, logtype_default, "2"); LOG(log_debug, logtype_default, "3"); LOG(log_debug, logtype_default, "o============"); LOG(log_debug, logtype_default, "Flooding 2005x"); for (int i = 0; i < 2005; i++) { LOG(log_debug, logtype_default, "Flooding..."); } LOG(log_debug, logtype_default, "1"); LOG(log_debug, logtype_default, "2"); LOG(log_debug, logtype_default, "3"); LOG(log_debug, logtype_default, "0============"); LOG(log_debug, logtype_default, "Flooding 11x1"); for (int i = 0; i < 11; i++) { LOG(log_error, logtype_default, "flooding 11x1 1"); } LOG(log_debug, logtype_default, "1============"); LOG(log_debug, logtype_default, "Flooding 11x2"); for (int i = 0; i < 11; i++) { LOG(log_error, logtype_default, "flooding 11x2 1"); LOG(log_error, logtype_default, "flooding 11x2 2"); } LOG(log_debug, logtype_default, "2============"); LOG(log_debug, logtype_default, "Flooding 11x3"); for (int i = 0; i < 11; i++) { LOG(log_error, logtype_default, "flooding 11x3 1"); LOG(log_error, logtype_default, "flooding 11x3 2"); LOG(log_error, logtype_default, "flooding 11x3 3"); } LOG(log_debug, logtype_default, "3============"); LOG(log_debug, logtype_default, "Flooding 11x4"); for (int i = 0; i < 11; i++) { LOG(log_error, logtype_default, "flooding 11x4 1"); LOG(log_error, logtype_default, "flooding 11x4 2"); LOG(log_error, logtype_default, "flooding 11x4 3"); LOG(log_error, logtype_default, "flooding 11x4 4"); } return 0; } netatalk-2.2.2/bin/misc/netacnv.c0000644000175200017500000000507411655731126013565 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #define MACCHARSET "MAC_ROMAN" #define flag(x) {x, #x} struct flag_map { int flag; const char *flagname; }; struct flag_map flag_map[] = { flag(CONV_ESCAPEHEX), flag(CONV_ALLOW_COLON), flag(CONV_UNESCAPEHEX), flag(CONV_ESCAPEDOTS), flag(CONV_IGNORE), flag(CONV_FORCE), flag(CONV__EILSEQ), flag(CONV_TOUPPER), flag(CONV_TOLOWER), flag(CONV_PRECOMPOSE), flag(CONV_DECOMPOSE) }; char buffer[MAXPATHLEN +2]; int main(int argc, char **argv) { int opt; uint16_t flags = 0; char *string; char *f = NULL, *t = NULL; charset_t from, to, mac; while ((opt = getopt(argc, argv, ":o:f:t:")) != -1) { switch(opt) { case 'o': for (int i = 0; i < sizeof(flag_map)/sizeof(struct flag_map) - 1; i++) if ((strcmp(flag_map[i].flagname, optarg)) == 0) flags |= flag_map[i].flag; break; case 'f': f = optarg; break; case 't': t = optarg; break; } } if ((optind + 1) != argc) { printf("Usage: test [-o [...]] [-f ] [-t ] \n"); printf("Defaults: -f: UTF8-MAC , -t: UTF8 \n"); printf("Available conversion options:\n"); for (int i = 0; i < (sizeof(flag_map)/sizeof(struct flag_map) - 1); i++) { printf("%s\n", flag_map[i].flagname); } return 1; } string = argv[optind]; if ( (charset_t) -1 == (from = add_charset(f ? f : "UTF8-MAC")) ) { fprintf( stderr, "Setting codepage %s as from codepage failed\n", f ? f : "UTF8-MAC"); return (-1); } if ( (charset_t) -1 == (to = add_charset(t ? t : "UTF8")) ) { fprintf( stderr, "Setting codepage %s as to codepage failed\n", t ? t : "UTF8"); return (-1); } if ( (charset_t) -1 == (mac = add_charset(MACCHARSET)) ) { fprintf( stderr, "Setting codepage %s as Mac codepage failed\n", MACCHARSET); return (-1); } if ((size_t)-1 == (convert_charset(from, to, mac, string, strlen(string), buffer, MAXPATHLEN, &flags)) ) { perror("Conversion error"); return 1; } printf("from: %s\nto: %s\n", string, buffer); return 0; } netatalk-2.2.2/bin/misc/fce.c0000644000175200017500000001005411655731126012656 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define MAXBUFLEN 1024 static char *fce_ev_names[] = { "", "FCE_FILE_MODIFY", "FCE_FILE_DELETE", "FCE_DIR_DELETE", "FCE_FILE_CREATE", "FCE_DIR_CREATE", "FCE_TM_SIZE" }; // get sockaddr, IPv4 or IPv6: static void *get_in_addr(struct sockaddr *sa) { if (sa->sa_family == AF_INET) { return &(((struct sockaddr_in*)sa)->sin_addr); } return &(((struct sockaddr_in6*)sa)->sin6_addr); } static int unpack_fce_packet(unsigned char *buf, struct fce_packet *packet) { unsigned char *p = buf; memcpy(&packet->magic[0], p, sizeof(packet->magic)); p += sizeof(packet->magic); packet->version = *p; p++; packet->mode = *p; p++; memcpy(&packet->event_id, p, sizeof(packet->event_id)); p += sizeof(packet->event_id); packet->event_id = ntohl(packet->event_id); memcpy(&packet->datalen, p, sizeof(packet->datalen)); p += sizeof(packet->datalen); packet->datalen = ntohs(packet->datalen); memcpy(&packet->data[0], p, packet->datalen); p += packet->datalen; return 0; } int main(void) { int sockfd; struct addrinfo hints, *servinfo, *p; int rv; int numbytes; struct sockaddr_storage their_addr; char buf[MAXBUFLEN]; socklen_t addr_len; char s[INET6_ADDRSTRLEN]; uint64_t tmsize; memset(&hints, 0, sizeof hints); hints.ai_family = AF_UNSPEC; // set to AF_INET to force IPv4 hints.ai_socktype = SOCK_DGRAM; if ((rv = getaddrinfo(NULL, FCE_DEFAULT_PORT_STRING, &hints, &servinfo)) != 0) { fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv)); return 1; } // loop through all the results and bind to the first we can for(p = servinfo; p != NULL; p = p->ai_next) { if ((sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) { perror("listener: socket"); continue; } if (bind(sockfd, p->ai_addr, p->ai_addrlen) == -1) { close(sockfd); perror("listener: bind"); continue; } break; } if (p == NULL) { fprintf(stderr, "listener: failed to bind socket\n"); return 2; } freeaddrinfo(servinfo); printf("listener: waiting to recvfrom...\n"); addr_len = sizeof their_addr; struct fce_packet packet; while (1) { if ((numbytes = recvfrom(sockfd, buf, MAXBUFLEN - 1, 0, (struct sockaddr *)&their_addr, &addr_len)) == -1) { perror("recvfrom"); exit(1); } unpack_fce_packet(buf, &packet); if (memcmp(packet.magic, FCE_PACKET_MAGIC, sizeof(packet.magic)) == 0) { switch (packet.mode) { case FCE_TM_SIZE: memcpy(&tmsize, packet.data, sizeof(uint64_t)); tmsize = ntoh64(tmsize); printf("ID: %" PRIu32 ", Event: %s, Volume: %s, TM used size: %" PRIu64 " \n", packet.event_id, fce_ev_names[packet.mode], packet.data + sizeof(uint64_t), tmsize); break; case FCE_CONN_START: printf("FCE Start\n"); break; case FCE_CONN_BROKEN: printf("Broken FCE connection\n"); break; default: printf("ID: %" PRIu32 ", Event: %s, Path: %s\n", packet.event_id, fce_ev_names[packet.mode], packet.data); break; } } } close(sockfd); return 0; } netatalk-2.2.2/bin/misc/uuidtest.c0000644000175200017500000001046511655731126013775 00000000000000/* Copyright (c) 2008,2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #ifdef HAVE_LDAP #define LDAP_DEPRECATED 1 #include #endif #include #include #include #define STRNCMP(a, R, b, l) (strncmp(a,b,l) R 0) static void usage() { printf("Usage: afpldaptest -u | -g | -i \n"); } static void parse_ldapconf() { static int inited = 0; if (! inited) { #ifdef HAVE_LDAP /* Parse afp_ldap.conf */ printf("Start parsing afp_ldap.conf\n"); acl_ldap_readconfig(_PATH_ACL_LDAPCONF); printf("Finished parsing afp_ldap.conf\n"); if (ldap_config_valid) { if (ldap_auth_method == LDAP_AUTH_NONE) printf("afp_ldap.conf is ok. Using anonymous bind.\n"); else if (ldap_auth_method == LDAP_AUTH_SIMPLE) printf("afp_ldap.conf is ok. Using simple bind.\n"); else { ldap_config_valid = 0; printf("afp_ldap.conf wants SASL which is not yet supported.\n"); exit(EXIT_FAILURE); } } else { printf("afp_ldap.conf is not ok, not using LDAP. Only local UUID testing available.\n"); } #else printf("Built without LDAP support, only local UUID testing available.\n"); #endif inited = 1; } } int main( int argc, char **argv) { int ret, c; int verbose = 0; atalk_uuid_t uuid; int logsetup = 0; uuidtype_t type; char *name = NULL; while ((c = getopt(argc, argv, ":vu:g:i:")) != -1) { switch(c) { case 'v': if (! verbose) { verbose = 1; setuplog("default log_maxdebug /dev/tty"); logsetup = 1; } break; case 'u': if (! logsetup) setuplog("default log_info /dev/tty"); parse_ldapconf(); printf("Searching user: %s\n", optarg); ret = getuuidfromname( optarg, UUID_USER, uuid); if (ret == 0) { printf("User: %s ==> UUID: %s\n", optarg, uuid_bin2string(uuid)); } else { printf("User %s not found.\n", optarg); } break; case 'g': if (! logsetup) setuplog("default log_info /dev/tty"); parse_ldapconf(); printf("Searching group: %s\n", optarg); ret = getuuidfromname( optarg, UUID_GROUP, uuid); if (ret == 0) { printf("Group: %s ==> UUID: %s\n", optarg, uuid_bin2string(uuid)); } else { printf("Group %s not found.\n", optarg); } break; case 'i': if (! logsetup) setuplog("default log_info /dev/tty"); parse_ldapconf(); printf("Searching uuid: %s\n", optarg); uuid_string2bin(optarg, uuid); ret = getnamefromuuid( uuid, &name, &type); if (ret == 0) { switch (type) { case UUID_USER: printf("UUID: %s ==> User: %s\n", optarg, name); break; case UUID_GROUP: printf("UUID: %s ==> Group: %s\n", optarg, name); break; default: printf("???: %s\n", optarg); break; } free(name); } else { printf("UUID: %s not found.\n", optarg); } break; case ':': case '?': case 'h': usage(); exit(EXIT_FAILURE); } } return 0; } netatalk-2.2.2/bin/adv1tov2/0000777000175200017500000000000011704770423012552 500000000000000netatalk-2.2.2/bin/adv1tov2/adv1tov2.c0000644000175200017500000000633111655731243014305 00000000000000/* * $Id: adv1tov2.c,v 1.5 2009-10-14 01:38:28 didg Exp $ * v1tov2: given a root directory, run down and convert all the * files/directories into appledouble v2. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #include #include #include #include #if AD_VERSION == AD_VERSION2 #if 0 /* translate characters */ static void xlate(char *name, int flags) { static const char hexdig[] = "0123456789abcdef"; char upath[MAXPATHLEN + 1]; char *m, *u; int doit = 0; m = name; u = upath; while (*m != '\0') { if (isascii(*m) && !isprint(*m)) { doit = 1; *u++ = ':'; *u++ = hexdig[(*m & 0xf0) >> 4]; *u++ = hexdig[*m & 0x0f]; } else *u++ = *m; m++; } if (doit) { *u = '\0'; rename(name, upath); if ((flags & ADFLAGS_DIR) == 0) rename(ad_path(name, flags), ad_path(upath, flags)); /* rename rfork */ } } #endif #define MAXDESCEND 0xFFFF /* recursively descend subdirectories. * oh the stack space we use up! */ static void descend(DIR *dp) { DIR *dpnew; struct dirent *de; struct stat st; struct adouble ad; int flags; static int count = 0; ad_init(&ad, AD_VERSION2, 0); if (count++ > MAXDESCEND) { fprintf(stderr, "FAILURE: too many subdirectories! possible infinite recursion."); return; } putc('(', stderr); for (de = readdir(dp); de; de = readdir(dp)) { if (de->d_name[0] == '.') continue; if (stat(de->d_name, &st) < 0) { fprintf(stderr, "FAILURE: can't stat %s\n", de->d_name); continue; } /* go down subdirectory */ flags = ADFLAGS_HF; if (S_ISDIR(st.st_mode) && (dpnew = opendir(de->d_name))) { chdir(de->d_name); descend(dpnew); closedir(dpnew); chdir(".."); flags |= ADFLAGS_DIR; } if (ad_open(de->d_name, flags, O_RDWR, 0, &ad) < 0) { if (errno != ENOENT) fprintf(stderr, "\nFAILURE: can't convert %s, %s\n", fullpathname(de->d_name), strerror(errno)); continue; } ad_close(&ad, ADFLAGS_HF); fputc('.', stderr); } putc(')', stderr); } int main(int argc, char **argv) { DIR *dp; struct adouble ad; ad_init(&ad, AD_VERSION2, 0); if (argc != 2) { fprintf(stderr, "%s \n", *argv); return -1; } /* convert main directory */ if (ad_open(argv[1], ADFLAGS_HF | ADFLAGS_DIR, O_RDWR, 0, &ad) < 0) { fprintf(stderr, "FAILURE: can't convert %s\n", argv[1]); return -1; } ad_close(&ad, ADFLAGS_HF); if ((dp = opendir(argv[1])) == NULL) { fprintf(stderr, "%s: unable to open %s\n", *argv, argv[1]); return -1; } chdir(argv[1]); descend(dp); closedir(dp); chdir(".."); putc('\n', stderr); return 0; } #else /* AD_VERSION == AD_VERSION2 */ int main(int argc, char **argv) { fprintf(stderr, "%s not built for v2 AppleDouble files.\n", *argv); return -1; } #endif /* AD_VERSION == AD_VERSION2 */ netatalk-2.2.2/bin/adv1tov2/Makefile.am0000644000175200017500000000030611655731126014523 00000000000000# Makefile.am for bin/adv1tov2/ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys bin_PROGRAMS = adv1tov2 adv1tov2_SOURCES = adv1tov2.c adv1tov2_LDADD = $(top_builddir)/libatalk/libatalk.la netatalk-2.2.2/bin/adv1tov2/Makefile.in0000644000175200017500000004121411703521723014531 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for bin/adv1tov2/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = adv1tov2$(EXEEXT) subdir = bin/adv1tov2 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_adv1tov2_OBJECTS = adv1tov2.$(OBJEXT) adv1tov2_OBJECTS = $(am_adv1tov2_OBJECTS) adv1tov2_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(adv1tov2_SOURCES) DIST_SOURCES = $(adv1tov2_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys adv1tov2_SOURCES = adv1tov2.c adv1tov2_LDADD = $(top_builddir)/libatalk/libatalk.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bin/adv1tov2/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign bin/adv1tov2/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done adv1tov2$(EXEEXT): $(adv1tov2_OBJECTS) $(adv1tov2_DEPENDENCIES) @rm -f adv1tov2$(EXEEXT) $(LINK) $(adv1tov2_OBJECTS) $(adv1tov2_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adv1tov2.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/bin/aecho/0000777000175200017500000000000011704770424012164 500000000000000netatalk-2.2.2/bin/aecho/Makefile.am0000644000175200017500000000026711655731126014142 00000000000000# Makefile.am for bin/aecho/ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys bin_PROGRAMS = aecho aecho_SOURCES = aecho.c aecho_LDADD = $(top_builddir)/libatalk/libatalk.la netatalk-2.2.2/bin/aecho/Makefile.in0000644000175200017500000004111211703521723014137 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for bin/aecho/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = aecho$(EXEEXT) subdir = bin/aecho DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_aecho_OBJECTS = aecho.$(OBJEXT) aecho_OBJECTS = $(am_aecho_OBJECTS) aecho_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(aecho_SOURCES) DIST_SOURCES = $(aecho_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys aecho_SOURCES = aecho.c aecho_LDADD = $(top_builddir)/libatalk/libatalk.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bin/aecho/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign bin/aecho/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done aecho$(EXEEXT): $(aecho_OBJECTS) $(aecho_DEPENDENCIES) @rm -f aecho$(EXEEXT) $(LINK) $(aecho_OBJECTS) $(aecho_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aecho.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/bin/aecho/aecho.c0000644000175200017500000001504311655731126013327 00000000000000/* * $Id: aecho.c,v 1.9 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ /* * AppleTalk Echo Protocol Client */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #ifdef HAVE_NETDB_H #include #endif /* HAVE_NETDB_H */ #include #include #include #include #include #include #include #include /* FIXME/SOCKLEN_T: socklen_t is a unix98 feature */ #ifndef SOCKLEN_T #define SOCKLEN_T unsigned int #endif /* ! SOCKLEN_T */ static struct sockaddr_at target; static int sock; static unsigned int nsent = 0, nrecv = 0; static time_t totalms = 0, minms = -1, maxms = -1; static unsigned int pings = 0; static void usage(char *); static void done(int sig _U_) { if ( nsent) { printf( "\n----%d.%d AEP Statistics----\n", ntohs( target.sat_addr.s_net ), target.sat_addr.s_node ); printf( "%d packets sent, %d packets received, %d%% packet loss\n", nsent, nrecv, (( nsent - nrecv ) * 100 ) / nsent ); if ( nrecv ) { printf( "round-trip (ms) min/avg/max = %ld/%ld/%ld\n", minms, totalms / nrecv, maxms ); } } exit( 0 ); } static void aep_send(int sig _U_) { struct timeval tv; char *p, buf[ 1024 ]; static unsigned int seq = 0; p = buf; *p++ = DDPTYPE_AEP; *p++ = AEPOP_REQUEST; memcpy( p, &seq, sizeof( unsigned int )); p += sizeof( unsigned int ); seq++; if ( gettimeofday( &tv, (struct timezone *)0 ) < 0 ) { perror( "gettimeofday" ); exit( 1 ); } memcpy( p, &tv, sizeof( struct timeval )); p += sizeof( struct timeval ); if ( netddp_sendto( sock, buf, p - buf, 0, (struct sockaddr *) &target, sizeof( struct sockaddr_at )) < 0 ) { perror( "sendto" ); exit( 1 ); } nsent++; if (pings && nsent > pings) done(0); } int main(int ac, char **av) { struct servent *se; struct sigaction sv; struct itimerval it; struct sockaddr_at sat, saddr; struct timeval tv, atv; struct nbpnve nn; char *obj = NULL, *type = "Workstation", *zone = "*"; int cc; SOCKLEN_T satlen; unsigned int seq; time_t ms; char buf[ 1024 ], *p; unsigned char port; extern char *optarg; extern int optind; memset(&saddr, 0, sizeof(saddr)); while (( cc = getopt( ac, av, "c:A:" )) != EOF ) { switch ( cc ) { case 'A': if (!atalk_aton(optarg, &saddr.sat_addr)) { fprintf(stderr, "Bad address.\n"); exit(1); } break; case 'c' : pings = atoi( optarg ); break; default : usage( av[ 0 ] ); exit( 1 ); } } if ( ac - optind != 1 ) { usage( av[ 0 ] ); exit( 1 ); } /* * Save the port, since nbp_lookup calls getservbyname() to get the * nbp port. */ if (( se = getservbyname( "echo", "ddp" )) == NULL ) port = 4; else port = ntohs( se->s_port ); memset( &target, 0, sizeof( struct sockaddr_at )); #ifdef BSD4_4 target.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ target.sat_family = AF_APPLETALK; if ( !atalk_aton( av[ optind ], &target.sat_addr )) { if ( nbp_name( av[ optind ], &obj, &type, &zone ) || !obj ) { fprintf( stderr, "Bad name: %s\n", av[ optind ] ); exit( 1 ); } if ( nbp_lookup( obj, type, zone, &nn, 1, &saddr.sat_addr) <= 0 ) { fprintf( stderr, "Can't find: %s\n", av[ optind ] ); exit( 1 ); } memcpy( &target, &nn.nn_sat, sizeof( struct sockaddr_at )); } target.sat_port = port; if ((sock = netddp_open(saddr.sat_addr.s_net || saddr.sat_addr.s_node ? &saddr : NULL, NULL)) < 0) { perror("ddp_open"); exit(1); } sv.sa_handler = aep_send; sigemptyset( &sv.sa_mask ); sigaddset( &sv.sa_mask, SIGINT ); sv.sa_flags = SA_RESTART; if ( sigaction( SIGALRM, &sv, (struct sigaction *)0 ) < 0 ) { perror( "sigaction" ); exit( 1 ); } sv.sa_handler = done; sigemptyset( &sv.sa_mask ); sigaddset( &sv.sa_mask, SIGALRM ); sv.sa_flags = SA_RESTART; if ( sigaction( SIGINT, &sv, (struct sigaction *)0 ) < 0 ) { perror( "sigaction" ); exit( 1 ); } it.it_interval.tv_sec = 1L; it.it_interval.tv_usec = 0L; it.it_value.tv_sec = 1L; it.it_value.tv_usec = 0L; if ( setitimer( ITIMER_REAL, &it, (struct itimerval *)0 ) < 0 ) { perror( "setitimer" ); exit( 1 ); } for (;;) { satlen = sizeof( struct sockaddr_at ); if (( cc = netddp_recvfrom( sock, buf, sizeof( buf ), 0, (struct sockaddr *) &sat, &satlen )) < 0 ) { if ( errno == EINTR ) { errno = 0; continue; } else { perror( "recvfrom" ); exit( 1 ); } } p = buf; if ( *p++ != DDPTYPE_AEP || *p++ != AEPOP_REPLY ) { fprintf( stderr, "%s: bad packet!\n", av[ 0 ] ); continue; } if ( gettimeofday( &tv, (struct timezone *)0 ) < 0 ) { perror( "gettimeofday" ); exit( 1 ); } memcpy( &seq, p, sizeof( unsigned int )); p += sizeof( unsigned int ); memcpy( &atv, p, sizeof( struct timeval )); nrecv++; ms = ( tv.tv_sec - atv.tv_sec ) * 1000 + ( tv.tv_usec - atv.tv_usec ) / 1000; totalms += ms; if ( ms > maxms ) { maxms = ms; } if ( ms < minms || minms == -1 ) { minms = ms; } printf( "%d bytes from %u.%u: aep_seq=%d. time=%ld. ms\n", cc, ntohs( sat.sat_addr.s_net ), sat.sat_addr.s_node, seq, ms ); if (pings && seq + 1 >= pings) done(0); } } static void usage( char * av0 ) { fprintf( stderr, "usage:\t%s [-A source address ] [-c count] ( addr | nbpname )\n", av0 ); exit( 1 ); } netatalk-2.2.2/bin/uniconv/0000777000175200017500000000000011704770424012566 500000000000000netatalk-2.2.2/bin/uniconv/Makefile.am0000644000175200017500000000037411655731126014543 00000000000000# Makefile.am for bin/aecho/ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys bin_PROGRAMS = uniconv uniconv_SOURCES = uniconv.c iso8859_1_adapted.c uniconv_LDADD = $(top_builddir)/libatalk/cnid/libcnid.la $(top_builddir)/libatalk/libatalk.la netatalk-2.2.2/bin/uniconv/Makefile.in0000644000175200017500000004151211703521724014546 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for bin/aecho/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = uniconv$(EXEEXT) subdir = bin/uniconv DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_uniconv_OBJECTS = uniconv.$(OBJEXT) iso8859_1_adapted.$(OBJEXT) uniconv_OBJECTS = $(am_uniconv_OBJECTS) uniconv_DEPENDENCIES = $(top_builddir)/libatalk/cnid/libcnid.la \ $(top_builddir)/libatalk/libatalk.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(uniconv_SOURCES) DIST_SOURCES = $(uniconv_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys uniconv_SOURCES = uniconv.c iso8859_1_adapted.c uniconv_LDADD = $(top_builddir)/libatalk/cnid/libcnid.la $(top_builddir)/libatalk/libatalk.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bin/uniconv/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign bin/uniconv/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done uniconv$(EXEEXT): $(uniconv_OBJECTS) $(uniconv_DEPENDENCIES) @rm -f uniconv$(EXEEXT) $(LINK) $(uniconv_OBJECTS) $(uniconv_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_1_adapted.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uniconv.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/bin/uniconv/uniconv.c0000644000175200017500000003404511655731126014336 00000000000000/* uniconv - convert volume encodings Copyright (C) Bjoern Fernhomberg 2004 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "atalk/cnid.h" #ifndef MAXPATHLEN #define MAXPATHLEN 4096 #endif static struct _cnid_db *cdb; static char curpath[MAXPATHLEN]; static cnid_t cdir_id; static char db_stamp[ADEDLEN_PRIVSYN]; static charset_t ch_from; char* from_charset; static charset_t ch_to; char* to_charset; static charset_t ch_mac; char* mac_charset; static int usedots = 0; static u_int16_t conv_flags = 0; static int dry_run = 0; static int verbose=0; char *cnid_type; char Cnid_srv[256] = "localhost"; int Cnid_port = 4700; extern struct charset_functions charset_iso8859_adapted; #ifndef MAX #define MAX(a,b) (((a)>(b))?(a):(b)) #endif #define VETO "./../.AppleDB/.AppleDouble/.AppleDesktop/.Parent/" static int veto(const char *path) { int i,j; char *veto_str = VETO; if ((path == NULL)) return 0; for(i=0, j=0; veto_str[i] != '\0'; i++) { if (veto_str[i] == '/') { if ((j>0) && (path[j] == '\0')) return 1; j = 0; } else { if (veto_str[i] != path[j]) { while ((veto_str[i] != '/') && (veto_str[i] != '\0')) i++; j = 0; continue; } j++; } } return 0; } static int do_rename( char* src, char *dst, struct stat *st) { char adsrc[ MAXPATHLEN + 1]; struct stat tmp_st; if (!stat(dst, &tmp_st)) { fprintf (stderr, "error: cannot rename %s to %s, destination exists\n", src, dst); return -1; } if ( rename( src, dst ) < 0 ) { fprintf (stderr, "error: cannot rename %s to %s, %s\n", src, dst, strerror(errno)); return -1; } if (S_ISDIR(st->st_mode)) return 0; strcpy( adsrc, ad_path( src, 0 )); if (rename( adsrc, ad_path( dst, 0 )) < 0 ) { struct stat ad_st; if (errno == ENOENT) { if (stat(adsrc, &ad_st)) /* source has no ressource fork, */ return 0; } else { fprintf (stderr, "failed to rename resource fork, error: %s\n", strerror(errno)); return -1; } } return 0; } static char *convert_name(char *name, struct stat *st, cnid_t cur_did) { static char buffer[MAXPATHLEN +2]; /* for convert_charset dest_len parameter +2 */ size_t outlen = 0; unsigned char *p,*q; int require_conversion = 0; u_int16_t flags = conv_flags; cnid_t id; p = (unsigned char *)name; q = (unsigned char *)buffer; /* optimize for ascii case */ while (*p != 0) { if ( *p >= 0x80 || *p == ':') { require_conversion = 1; break; } p++; } if (!require_conversion) { if (verbose > 1) fprintf(stdout, "no conversion required\n"); return name; } /* convert charsets */ q=(unsigned char *)buffer; p=(unsigned char *)name; outlen = convert_charset(ch_from, ch_to, ch_mac, (char *)p, strlen((char *)p), (char *)q, sizeof(buffer) -2, &flags); if ((size_t)-1 == outlen) { if ( ch_to == CH_UTF8) { /* maybe name is already in UTF8? */ flags = conv_flags; q = (unsigned char *)buffer; p = (unsigned char *)name; outlen = convert_charset(ch_to, ch_to, ch_mac, (char *)p, strlen((char *)p), (char *)q, sizeof(buffer) -2, &flags); if ((size_t)-1 == outlen) { /* it's not UTF8... */ fprintf(stderr, "ERROR: conversion from '%s' to '%s' for '%s' in DID %u failed!!!\n", from_charset, to_charset, name, ntohl(cur_did)); return name; } if (!strcmp(buffer, name)) { return name; } } fprintf(stderr, "ERROR: conversion from '%s' to '%s' for '%s' in DID %u failed. Please check this!\n", from_charset, to_charset, name, ntohl(cur_did)); return name; } if (strcmp (name, buffer)) { if (dry_run) { fprintf(stdout, "dry_run: would rename %s to %s.\n", name, buffer); } else if (!do_rename(name, buffer, st)) { if (CNID_INVALID != (id = cnid_add(cdb, st, cur_did, buffer, strlen(buffer), 0))) fprintf(stdout, "converted '%s' to '%s' (ID %u, DID %u).\n", name, buffer, ntohl(id), ntohl(cur_did)); } } else if (verbose > 1) fprintf(stdout, "no conversion required\n"); return (buffer); } static int check_dirent(char** name, cnid_t cur_did) { struct stat st; int ret = 0; if (veto(*name)) return 0; if (stat(*name, &st) != 0) { switch (errno) { case ELOOP: case ENOENT: return 0; default: return (-1); } } if (S_ISDIR(st.st_mode)){ ret = 1; } if (verbose > 1) fprintf(stdout, "Checking: '%s' - ", *name); *name = convert_name(*name, &st, cur_did); return ret; } static int check_adouble(DIR *curdir, char * path _U_) { DIR *adouble; struct dirent* entry; struct dirent* ad_entry; int found = 0; strlcat(curpath, "/", sizeof(curpath)); strlcat(curpath, ".AppleDouble", sizeof(curpath)); if (NULL == (adouble = opendir(curpath))) { return(-1); } while (NULL != (ad_entry=readdir(adouble)) ) { if (veto(ad_entry->d_name)) break; found = 0; rewinddir(curdir); while (NULL != (entry=readdir(curdir)) ) { if (!strcmp(ad_entry->d_name, entry->d_name)) { found = 1; break; } } if (!found) { fprintf (stderr, "found orphaned resource file %s", ad_entry->d_name); } } rewinddir(curdir); closedir(adouble); return (0); } static cnid_t add_dir_db(char *name, cnid_t cur_did) { cnid_t id, did; struct stat st; if (CNID_INVALID != ( id = cnid_get(cdb, cur_did, name, strlen(name))) ) return id; if (dry_run) { return 0; } did = cur_did; if (stat(name, &st)) { fprintf( stderr, "dir '%s' cannot be stat'ed, error %u\n", name, errno); return 0; } id = cnid_add(cdb, &st, did, name, strlen(name), 0); fprintf (stderr, "added '%s' to DID %u as %u\n", name, ntohl(did), ntohl(id)); return id; } static int getdir(DIR *curdir, char ***names) { struct dirent* entry; char **tmp = NULL, **new=NULL; char *name; int i=0; while ((entry=readdir(curdir)) != NULL) { new = (char **) realloc (tmp, (i+1) * sizeof(char*)); if (new == NULL) { fprintf(stderr, "out of memory"); exit (-1); } tmp = new; name = strdup(entry->d_name); if (name == NULL) { fprintf(stderr, "out of memory"); exit (-1); } tmp[i]= (char*) name; i++; }; *names = tmp; return i; } static int checkdir(DIR *curdir, char *path, cnid_t cur_did) { DIR* cdir; int ret = 0; cnid_t id; char *name, *tmp; int n; size_t len=strlen(curpath); char **names; chdir(path); check_adouble(curdir, path); curpath[len] = 0; if (verbose) fprintf( stdout, "\nchecking DIR '%s' with ID %u\n", path, ntohl(cur_did)); n = getdir(curdir, &names); while (n--) { name = names[n]; tmp = strdup(name); ret = check_dirent(&name, cur_did); if (ret==1) { id = add_dir_db(name, cur_did); if ( id == 0 && !dry_run ) continue; /* skip, no ID */ if ( dry_run ) name = tmp; strlcat(curpath, "/", sizeof(curpath)); strlcat(curpath, name, sizeof(curpath)); cdir = opendir(curpath); if (cdir == NULL) { fprintf( stderr, "ERROR: cannot open DIR '%s' with ID %u\n", curpath, ntohl(cur_did)); continue; } checkdir(cdir, curpath, id); closedir(cdir); curpath[len] = 0; chdir(path); if (verbose) fprintf( stdout, "returned to DIR '%s' with ID %u\n", path, ntohl(cur_did)); } free(names[n]); free(tmp); } free(names); if (verbose) fprintf( stdout, "leaving DIR '%s' with ID %u\n\n", path, ntohl(cur_did)); return 0; } static int init(char* path) { DIR* startdir; if (NULL == (cdb = cnid_open (path, 0, cnid_type, 0, "localhost", "4700")) ) { fprintf (stderr, "ERROR: cannot open CNID database in '%s'\n", path); fprintf (stderr, "ERROR: check the logs for reasons, aborting\n"); return -1; } cnid_getstamp(cdb, db_stamp, sizeof(db_stamp)); cdir_id = htonl(2); startdir = opendir(path); strlcpy(curpath, path, sizeof(curpath)); checkdir (startdir, path, cdir_id); closedir(startdir); cnid_close(cdb); return (0); } static void usage( char * name ) { fprintf( stderr, "usage:\t%s [-ndv] -c cnid -f fromcode -t tocode [-m maccode] path\n", name ); fprintf( stderr, "Try `%s -h' for more information.\n", name ); exit( 1 ); } static void print_version (void) { fprintf( stderr, "uniconv - Netatalk %s\n", VERSION ); } static void help (void) { fprintf (stdout, "\nuniconv, a tool to convert between various Netatalk volume encodings\n"); fprintf (stdout, "\nUsage: uniconv [-ndv] -c cnid -f fromcode -t tocode [-m maccode] path\n\n"); fprintf (stdout, "Examples:\n"); fprintf (stdout, " uniconv -c dbd -f ASCII -t UTF8 -m MAC_ROMAN /path/to/share\n"); fprintf (stdout, " uniconv -c cdb -f ISO-8859-1 -t UTF8 -m MAC_ROMAN /path/to/share\n"); fprintf (stdout, " uniconv -c cdb -f ISO-8859-ADAPTED -t ASCII -m MAC_ROMAN /path/to/share\n"); fprintf (stdout, " uniconv -f UTF8 -t ASCII -m MAC_ROMAN /path/to/share\n\n"); fprintf (stdout, "Options:\n"); fprintf (stdout, "\t-f\tencoding to convert from, use ASCII for CAP encoded volumes\n"); fprintf (stdout, "\t-t\tvolume encoding to convert to, e.g. UTF8.\n"); fprintf (stdout, "\t-m\tMacintosh client codepage, required for CAP encoded volumes.\n"); fprintf (stdout, "\t\tDefaults to `MAC_ROMAN'\n"); fprintf (stdout, "\t-n\t`dry run', don't change anything.\n"); fprintf (stdout, "\t-d\tDon't CAP encode leading dots (:2e).\n"); fprintf (stdout, "\t-c\tCNID backend used on this volume, usually cdb or dbd.\n"); fprintf (stdout, "\t\tIf not specified, the default cnid backend `%s' is used\n", DEFAULT_CNID_SCHEME); fprintf (stdout, "\t-v\tVerbose output, use twice for maximum logging.\n"); fprintf (stdout, "\t-V\tPrint version and exit\n"); fprintf (stdout, "\t-h\tThis help screen\n\n"); fprintf (stdout, "WARNING:\n"); fprintf (stdout, " Setting the wrong options might render your data unusable!!!\n"); fprintf (stdout, " Make sure you know what you are doing. Always backup your data first.\n\n"); fprintf (stdout, " It is *strongly* recommended to do a `dry run' first and to check the\n"); fprintf (stdout, " output for conversion errors.\n"); fprintf (stdout, " USE AT YOUR OWN RISK!!!\n\n"); } int main(int argc, char *argv[]) { char path[MAXPATHLEN]; int c; path[0]= 0; conv_flags = CONV_UNESCAPEHEX | CONV_ESCAPEHEX | CONV_ESCAPEDOTS; #ifdef HAVE_SETLINEBUF setlinebuf(stdout); #endif while ((c = getopt (argc, argv, "f:m:t:c:dnvVh")) != -1) switch (c) { case 'f': from_charset = strdup(optarg); break; case 't': to_charset = strdup(optarg); break; case 'm': mac_charset = strdup(optarg); break; case 'd': conv_flags &= ~CONV_ESCAPEDOTS; usedots = 1; break; case 'n': fprintf (stderr, "doing dry run, volume will *not* be changed\n"); dry_run = 1; break; case 'c': cnid_type = strdup(optarg); fprintf (stderr, "CNID backend set to: %s\n", cnid_type); break; case 'v': verbose++; break; case 'V': print_version(); exit (1); break; case 'h': help(); exit(1); break; default: break; } if ( argc - optind != 1 ) { usage( argv[0] ); exit( 1 ); } set_processname("uniconv"); if ( from_charset == NULL || to_charset == NULL) { fprintf (stderr, "required charsets not specified\n"); exit(-1); } if ( mac_charset == NULL ) mac_charset = "MAC_ROMAN"; if ( cnid_type == NULL) cnid_type = DEFAULT_CNID_SCHEME; /* get path */ strlcpy(path, argv[optind], sizeof(path)); /* deal with relative path */ if (chdir(path)) { fprintf (stderr, "ERROR: cannot chdir to '%s'\n", path); return (-1); } if (NULL == (getcwd(path, sizeof(path))) ) { fprintf (stderr, "ERROR: getcwd failed\n"); return (-1); } /* set charsets */ atalk_register_charset(&charset_iso8859_adapted); if ( (charset_t) -1 == ( ch_from = add_charset(from_charset)) ) { fprintf( stderr, "Setting codepage %s as source codepage failed", from_charset); exit (-1); } if ( (charset_t) -1 == ( ch_to = add_charset(to_charset)) ) { fprintf( stderr, "Setting codepage %s as destination codepage failed", to_charset); exit (-1); } if ( (charset_t) -1 == ( ch_mac = add_charset(mac_charset)) ) { fprintf( stderr, "Setting codepage %s as mac codepage failed", mac_charset); exit (-1); } cnid_init(); init(path); return (0); } netatalk-2.2.2/bin/uniconv/iso8859_1_adapted.c0000644000175200017500000000743211655731126015707 00000000000000/* iso-8859-1.adapted conversion routines Copyright (C) Bjoern Fernhomberg 2002,2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include "../../libatalk/unicode/byteorder.h" static size_t iso8859_adapted_pull(void *,char **, size_t *, char **, size_t *); static size_t iso8859_adapted_push(void *,char **, size_t *, char **, size_t *); struct charset_functions charset_iso8859_adapted = { "ISO-8859-ADAPTED", 0, iso8859_adapted_pull, iso8859_adapted_push, CHARSET_MULTIBYTE | CHARSET_PRECOMPOSED, NULL, NULL, NULL }; /* ------------------------ * from unicode to iso8859_adapted code page */ static size_t iso8859_adapted_push( void *cd _U_, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { int len = 0; while (*inbytesleft >= 2 && *outbytesleft >= 1) { ucs2_t inptr = SVAL((*inbuf),0); if ( inptr == 0x2122) { SSVAL((*outbuf),0,0xAA); } else if ( inptr == 0x0192) { SSVAL((*outbuf),0,0xC5); } else if ( inptr == 0x2014) { SSVAL((*outbuf),0,0xD1); } else if ( inptr == 0x201C) { SSVAL((*outbuf),0,0xD2); } else if ( inptr == 0x201D) { SSVAL((*outbuf),0,0xD3); } else if ( inptr == 0x2018) { SSVAL((*outbuf),0,0xD4); } else if ( inptr == 0x2019) { SSVAL((*outbuf),0,0xD5); } else if ( inptr == 0x25CA) { SSVAL((*outbuf),0,0xD7); } else if ( inptr > 0x0100) { errno = EILSEQ; return -1; } else { SSVAL((*outbuf), 0, inptr); } (*inbuf) +=2; (*outbuf) +=1; (*inbytesleft) -=2; (*outbytesleft)-=1; len++; } if (*inbytesleft > 0) { errno = E2BIG; return -1; } return len; } /* ------------------------ */ static size_t iso8859_adapted_pull ( void *cd _U_, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { unsigned char *inptr; size_t len = 0; while (*inbytesleft >= 1 && *outbytesleft >= 2) { inptr = (unsigned char *) *inbuf; if ( *inptr == 0xAA) { SSVAL((*outbuf),0,0x2122); } else if ( *inptr == 0xC5) { SSVAL((*outbuf),0,0x0192); } else if ( *inptr == 0xD1) { SSVAL((*outbuf),0,0x2014); } else if ( *inptr == 0xD2) { SSVAL((*outbuf),0,0x201C); } else if ( *inptr == 0xD3) { SSVAL((*outbuf),0,0x201D); } else if ( *inptr == 0xD4) { SSVAL((*outbuf),0,0x2018); } else if ( *inptr == 0xD5) { SSVAL((*outbuf),0,0x2019); } else if ( *inptr == 0xD7) { SSVAL((*outbuf),0,0x25CA); } else { SSVAL((*outbuf),0,(*inptr)); } (*outbuf) +=2; (*outbytesleft)-=2; (*inbuf) +=1; (*inbytesleft) -=1; len++; } if (*inbytesleft > 0) { errno = E2BIG; return (size_t) -1; } return len; } netatalk-2.2.2/COPYRIGHT0000644000175200017500000000377011655731126011554 00000000000000Copyright (c) 1990,1996 Regents of The University of Michigan. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appears in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of The University of Michigan not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. This software is supplied as is without expressed or implied warranties of any kind. This product includes software developed by the University of California, Berkeley and its contributors. Solaris code is encumbered by the following: Copyright (C) 1996 by Sun Microsystems Computer Co. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software is provided "as is" without express or implied warranty. Modifications for Appleshare IP and other files copyrighted by Adrian Sun are under the following copyright: Copyright (c) 1997,1998,1999,2000 Adrian Sun (asun@cobalt.com) All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appears in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software is supplied as is without expressed or implied warranties of any kind. Research Systems Unix Group The University of Michigan c/o Wesley Craig 535 W. William Street Ann Arbor, Michigan +1-313-764-2278 netatalk@umich.edu netatalk-2.2.2/man/0000777000175200017500000000000011704770431011106 500000000000000netatalk-2.2.2/man/Makefile.am0000644000175200017500000000007311655731130013054 00000000000000# Makefile.am for man/ SUBDIRS = man1 man3 man4 man5 man8 netatalk-2.2.2/man/man5/0000777000175200017500000000000011704770431011746 500000000000000netatalk-2.2.2/man/man5/Makefile.am0000644000175200017500000000200411655731130013710 00000000000000# Makefile.am for man/man5/ pkgconfdir = @PKGCONFDIR@ SUFFIXES = .tmpl . .tmpl: sed -e "s@:SBINDIR:@${sbindir}@g" \ -e "s@:BINDIR:@${bindir}@g" \ -e "s@:ETCDIR:@${pkgconfdir}@g" \ -e "s@:LIBDIR:@${libdir}@g" \ -e "s@:DEFAULT_CNID_SCHEME:@${DEFAULT_CNID_SCHEME}@g" \ -e "s@:COMPILED_BACKENDS:@${compiled_backends}@g" \ <$< >$@ GENERATED_MANS = AppleVolumes.default.5 \ afpd.conf.5 \ netatalk.conf.5 \ afp_ldap.conf.5 \ afp_signature.conf.5 \ afp_voluuid.conf.5 TEMPLATE_FILES = AppleVolumes.default.5.tmpl \ afpd.conf.5.tmpl \ netatalk.conf.5.tmpl \ afp_ldap.conf.5.tmpl \ afp_signature.conf.5.tmpl \ afp_voluuid.conf.5.tmpl ATALK_MANS = atalkd.conf.5.tmpl papd.conf.5.tmpl if USE_APPLETALK GENERATED_MANS += atalkd.conf.5 papd.conf.5 TEMPLATE_FILES += $(ATALK_MANS) endif NONGENERATED_MANS = AppleVolumes.5 AppleVolumes.system.5 man_MANS = $(GENERATED_MANS) $(NONGENERATED_MANS) CLEANFILES = $(GENERATED_MANS) EXTRA_DIST = $(TEMPLATE_FILES) $(NONGENERATED_MANS) $(ATALK_MANS) netatalk-2.2.2/man/man5/atalkd.conf.5.tmpl0000644000175200017500000000604611704763240015115 00000000000000'\" t .\" Title: atalkd.conf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 22 September 2000 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "ATALKD\&.CONF" "5" "22 September 2000" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" atalkd.conf \- Configuration file used by atalkd(8) to determine the interfaces used by the master Netatalk daemon .SH "DESCRIPTION" .PP \fB:ETCDIR:/atalkd\&.conf\fR is the configuration file used by atalkd to configure the Appletalk interfaces and their behavior .PP Any line not prefixed with \fB#\fR is interpreted\&. The configuration lines are composed like: .PP \fIInterface\fR \fB[\fR \fIoptions\fR \fB]\fR .PP The simplest case is to have either no atalkd\&.conf, or to have one that has no active lines\&. In this case, atalkd should auto\-discover the local interfaces on the machine\&. Please note that you cannot split lines\&. .PP The interface is the network interface that this to work over, such as \fBeth0\fR for Linux, or \fBle0\fR for Sun\&. .PP The possible options and their meanings are: .PP \fB\-addr \fR\fB\fInet\&.node\fR\fR .RS 4 Allows specification of the net and node numbers for this interface, specified in Appletalk numbering format (example: \fB\-addr 66\&.6\fR)\&. .RE .PP \fB\-dontroute\fR .RS 4 Disables Appletalk routing\&. It is the opposite of \fB\-router\fR\&. .RE .PP \fB\-net first[\-last]\fR .RS 4 Allows the available net to be set, optionally as a range\&. .RE .PP \fB\-noallmulti\fR (linux only) .RS 4 On linux the interfaces, atalkd uses, are set to ALLMULTI by default caused by countless NICs having problems without being forced into this mode (some even don\'t work with allmulti set)\&. In case, you\'ve a NIC known to support multicasts properly, you might want to set this option causing less packets to be processed .RE .PP \fB\-phase ( 1 | 2 )\fR .RS 4 Specifies the Appletalk phase that this interface is to use (either Phase 1 or Phase 2)\&. .RE .PP \fB\-router\fR .RS 4 Like \fB\-seed\fR, but allows single interface routing\&. It is the opposite of \fB\-dontroute\fR\&. .RE .PP \fB\-seed\fR .RS 4 The seed option only works if you have multiple interfaces\&. It also causes all missing arguments to be automagically configured from the network\&. .RE .PP \fB\-zone \fR\fB\fIzonename\fR\fR .RS 4 Specifies a specific zone that this interface should appear on (example: \fB\-zone "Parking Lot"\fR)\&. Please note that zones with spaces and other special characters should be enclosed in parentheses\&. .RE .SH "SEE ALSO" .PP \fBatalkd\fR(8) netatalk-2.2.2/man/man5/Makefile.in0000644000175200017500000003370611703521731013734 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for man/man5/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @USE_APPLETALK_TRUE@am__append_1 = atalkd.conf.5 papd.conf.5 @USE_APPLETALK_TRUE@am__append_2 = $(ATALK_MANS) subdir = man/man5 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = man5dir = $(mandir)/man5 am__installdirs = "$(DESTDIR)$(man5dir)" NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgconfdir = @PKGCONFDIR@ SUFFIXES = .tmpl . GENERATED_MANS = AppleVolumes.default.5 afpd.conf.5 netatalk.conf.5 \ afp_ldap.conf.5 afp_signature.conf.5 afp_voluuid.conf.5 \ $(am__append_1) TEMPLATE_FILES = AppleVolumes.default.5.tmpl afpd.conf.5.tmpl \ netatalk.conf.5.tmpl afp_ldap.conf.5.tmpl \ afp_signature.conf.5.tmpl afp_voluuid.conf.5.tmpl \ $(am__append_2) ATALK_MANS = atalkd.conf.5.tmpl papd.conf.5.tmpl NONGENERATED_MANS = AppleVolumes.5 AppleVolumes.system.5 man_MANS = $(GENERATED_MANS) $(NONGENERATED_MANS) CLEANFILES = $(GENERATED_MANS) EXTRA_DIST = $(TEMPLATE_FILES) $(NONGENERATED_MANS) $(ATALK_MANS) all: all-am .SUFFIXES: .SUFFIXES: .tmpl . $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/man5/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign man/man5/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man5: $(man5_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)" @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.5*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 5*) ;; \ *) ext='5' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \ done uninstall-man5: @$(NORMAL_UNINSTALL) @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.5*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 5*) ;; \ *) ext='5' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man5dir)/$$inst"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man5dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-man5 install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man5 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man5 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-man uninstall-man5 .tmpl: sed -e "s@:SBINDIR:@${sbindir}@g" \ -e "s@:BINDIR:@${bindir}@g" \ -e "s@:ETCDIR:@${pkgconfdir}@g" \ -e "s@:LIBDIR:@${libdir}@g" \ -e "s@:DEFAULT_CNID_SCHEME:@${DEFAULT_CNID_SCHEME}@g" \ -e "s@:COMPILED_BACKENDS:@${compiled_backends}@g" \ <$< >$@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/man/man5/afp_signature.conf.5.tmpl0000644000175200017500000000514611704763240016504 00000000000000'\" t .\" Title: afp_signature.conf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 08 Mar 2011 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "AFP_SIGNATURE\&.CONF" "5" "08 Mar 2011" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" afp_signature.conf \- Configuration file used by afpd(8) to specify server signature .SH "DESCRIPTION" .PP :ETCDIR:/afp_signature\&.conf is the configuration file used by \fBafpd\fR to specify server signature automagically\&. The configuration lines are composed like: .PP \fI"server name"\fR \fIhexa\-string\fR .PP The first field is server name\&. Server names must be quoted if they contain spaces\&. The second field is the hexadecimal string of 32 characters for 16\-bytes server signature\&. .PP The leading spaces and tabs are ignored\&. Blank lines are ignored\&. The lines prefixed with # are ignored\&. The illegal lines are ignored\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP Server Signature is unique 16\-bytes identifier used to prevent logging on to the same server twice\&. .PP Netatalk 2\&.0 and earlier generated server signature by using gethostid()\&. There was a problem that another servers have the same signature because the hostid is not unique enough\&. .PP Current netatalk generates the signature from random numbers and saves it into afp_signature\&.conf\&. When starting next time, it is read from this file\&. .PP This file should not be thoughtlessly edited and be copied onto another server\&. If it wants to set the signature intentionally, use the option "\-signature user:xxxx" in afpd\&.conf\&. In this case, afp_signature\&.conf is not used\&. .sp .5v .RE .PP .SH "EXAMPLES" .PP \fBExample.\ \&afp_signature.conf three servers on one netatalk\fR .sp .if n \{\ .RS 4 .\} .nf # This is a comment\&. "Guest Server" 251D25569CB29AFDF296C6B5B3A385B7 "User Server" 26B5D785046C019F55718F76B1C13BFB special 74A0BB94EC8C13988B2E75042347E528 .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP \fBafpd\fR(8), \fBafpd.conf\fR(5), \fBasip-status.pl\fR(1) netatalk-2.2.2/man/man5/afp_ldap.conf.5.tmpl0000644000175200017500000000576411704763240015431 00000000000000'\" t .\" Title: afp_ldap.conf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 30 Mar 2011 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "AFP_LDAP\&.CONF" "5" "30 Mar 2011" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" afp_ldap.conf \- Configuration file used by afpd(8) to configure a LDAP connection to an LDAP server\&. That is needed for ACL support in order to be able to query LDAP for UUIDs\&. .SH "DESCRIPTION" .PP :ETCDIR:/afp_ldap\&.conf is the configuration file used by \fBafpd\fR to set up an LDAP connection to an LDAP server\&. .PP Any line not prefixed with # is interpreted\&. .PP .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP You can use \fBafpldaptest\fR(1) to syntactically check your config .sp .5v .RE The required parameters and their meanings are: .SH "PARAMETER" .PP ldap_server .RS 4 Name or IP address of your LDAP Server .sp .RE .PP ldap_auth_method .RS 4 Authentication method: \fBnone | simple | sasl\fR .PP none .RS 4 anonymous LDAP bind .RE .PP simple .RS 4 simple LDAP bind .RE .PP sasl .RS 4 SASL\&. Not yet supported ! .RE .RE .PP ldap_auth_dn .RS 4 Distinguished Name of the user for simple bind\&. .sp .RE .PP ldap_auth_pw .RS 4 Distinguished Name of the user for simple bind\&. .sp .RE .PP ldap_userbase .RS 4 DN of the user container in LDAP\&. .sp .RE .PP ldap_userscope .RS 4 Search scope for user search: \fBbase | one | sub\fR .sp .RE .PP ldap_groupbase .RS 4 DN of the group container in LDAP\&. .sp .RE .PP ldap_groupscope .RS 4 Search scope for user search: \fBbase | one |\ \&sub\fR .sp .RE .PP ldap_uuuid_attr .RS 4 Name of the LDAP attribute with the UUIDs\&. .sp Note: this is used both for users and groups\&. .sp .RE .PP ldap_name_attr .RS 4 Name of the LDAP attribute with the users short name\&. .sp .RE .PP ldap_group_attr .RS 4 Name of the LDAP attribute with the groups short name\&. .sp .RE .SH "EXAMPLES" .PP \fBExample.\ \&afp_ldap.conf setup with simple bind\fR .sp .if n \{\ .RS 4 .\} .nf ldap_server = localhost ldap_auth_method = simple ldap_auth_dn = cn=admin,dc=domain,dc=org ldap_auth_pw = notthisone ldap_userbase = ou=users,dc=domain,dc=org ldap_userscope = one ldap_groupbase = ou=groups,dc=domain,dc=org ldap_groupscope = one ldap_uuid_attr = some_attribute ldap_name_attr = cn ldap_group_attr = cn .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP \fBafpd\fR(8), \fBAppleVolumes.default\fR(5), \fBafpldaptest\fR(1) netatalk-2.2.2/man/man5/AppleVolumes.system.50000644000175200017500000000004011704763240015701 00000000000000.so man5/AppleVolumes.default.5 netatalk-2.2.2/man/man5/AppleVolumes.50000644000175200017500000000004011704763240014356 00000000000000.so man5/AppleVolumes.default.5 netatalk-2.2.2/man/man5/afpd.conf.5.tmpl0000644000175200017500000005217211704763240014570 00000000000000'\" t .\" Title: afpd.conf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 15 Aug 2011 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "AFPD\&.CONF" "5" "15 Aug 2011" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" afpd.conf \- Configuration file used by afpd(8) to determine the setup of its file sharing services .SH "DESCRIPTION" .PP :ETCDIR:/afpd\&.conf is the configuration file used by \fBafpd\fR to determine the behavior and configuration of the different virtual file servers that it provides\&. .PP Any line not prefixed with # is interpreted\&. The configuration lines are composed like: server name [ options ] If a \fB\-\fR is used instead of a server name, the default server is specified\&. Server names must be quoted if they contain spaces\&. They must not contain ":" or "@"\&. The path name must be a fully qualified path name, or a path name using either the ~ shell shorthand or any of the substitution variables, which are listed below\&. .PP .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP Each server has to be configured on a \fBsingle\fR line\&. Though, using "\e" character, newline escaping is supported\&. .sp .5v .RE The possible options and their meanings are: .SH "APPLEVOLUMES FILES" .PP \-defaultvol \fI[path]\fR .RS 4 Specifies path to AppleVolumes\&.default file (default is :ETCDIR:/AppleVolumes\&.default)\&. .RE .PP \-systemvol \fI[path]\fR .RS 4 Specifies path to AppleVolumes\&.system file (default is :ETCDIR:/AppleVolumes\&.system)\&. .RE .PP \-[no]uservol .RS 4 Enables or disables reading of the users\' individual volumes file entirely\&. .RE .PP \-[no]uservolfirst .RS 4 Enables or disables reading of the users\' individual volumes file before processing the global AppleVolumes\&.default file\&. .RE .SH "AUTHENTICATION METHODS" .PP \-uamlist \fI[uams list]\fR .RS 4 Comma separated list of UAMs\&. (The default is uams_dhx\&.so,uams_dhx2\&.so)\&. .sp The most commonly used UAMs are: .PP uams_guest\&.so .RS 4 allows guest logins .RE .PP uams_clrtxt\&.so .RS 4 (uams_pam\&.so or uams_passwd\&.so) Allow logins with passwords transmitted in the clear\&. (legacy) .RE .PP uams_randum\&.so .RS 4 allows Random Number and Two\-Way Random Number Exchange for authentication (requires a separate file containing the passwords, either :ETCDIR:/afppasswd file or the one specified via \fB\-passwdfile\fR\&. See \fBafppasswd\fR(1) for details\&. (legacy) .RE .PP uams_dhx\&.so .RS 4 (uams_dhx_pam\&.so or uams_dhx_passwd\&.so) Allow Diffie\-Hellman eXchange (DHX) for authentication\&. .RE .PP uams_dhx2\&.so .RS 4 (uams_dhx2_pam\&.so or uams_dhx2_passwd\&.so) Allow Diffie\-Hellman eXchange 2 (DHX2) for authentication\&. .RE .PP uam_gss\&.so .RS 4 Allow Kerberos V for authentication (optional) .RE .RE .PP \-uampath \fI[path]\fR .RS 4 Sets the default path for UAMs for this server (default is :ETCDIR:/uams)\&. .RE .PP \-k5keytab \fI[path]\fR, \-k5service \fI[service]\fR, \-k5realm \fI[realm]\fR .RS 4 These are required if the server supports the Kerberos 5 authentication UAM\&. .RE .PP \-ntdomain, \-ntseparator .RS 4 Use for eg\&. winbind authentication, prepends both strings before the username from login and then tries to authenticate with the result through the availabel and active UAM authentication modules\&. .RE .PP \-adminauthuser .RS 4 Specifying eg \fB\-adminauthuser root\fR whenever a normal user login fails, afpd will try to authenticate as the specified \fBadminauthuser\fR\&. If this succeeds, a normal session is created for the original connecting user\&. Said differently: if you know the password of \fBadminauthuser\fR, you can authenticate as any other user\&. .RE .SH "CODEPAGE OPTIONS" .PP With OS X Apple introduced the AFP3 protocol\&. One of the big changes was, that AFP3 uses Unicode names encoded as Decomposed UTF\-8 (UTF8\-MAC)\&. Previous AFP/OS versions used codepages like MacRoman, MacCentralEurope, etc\&. .PP To be able to serve AFP3 and older clients at the same time, \fBafpd\fR needs to be able to convert between UTF\-8 and Mac codepages\&. Even OS X clients partly still rely on codepages\&. As there\'s no way, \fBafpd\fR can detect the codepage a pre AFP3 client uses, you have to specify it using the \fB\-maccodepage\fR option\&. The default is MacRoman, which should be fine for most western users\&. .PP As \fBafpd\fR needs to interact with unix operating system as well, it need\'s to be able to convert from UTF8\-MAC/MacCodepage to the unix codepage\&. By default \fBafpd\fR uses the systems LOCALE, or ASCII if your system doesn\'t support locales\&. You can set the unix codepage using the \fB\-unixcodepage\fR option\&. If you\'re using extended characters in the configuration files for \fBafpd\fR, make sure your terminal matches the \fB\-unixcodepage\fR\&. .PP \-unixcodepage [\fICODEPAGE\fR] .RS 4 Specifies the servers unix codepage, e\&.g\&. "ISO\-8859\-15" or "UTF8"\&. This is used to convert strings to/from the systems locale, e\&.g\&. for authenthication, server messages and volume names\&. Defaults to LOCALE if your system supports it, otherwise ASCII will be used\&. .RE .PP \-maccodepage [\fICODEPAGE\fR] .RS 4 Specifies the mac clients codepage, e\&.g\&. "MAC_ROMAN"\&. This is used to convert strings and filenames to the clients codepage for OS9 and Classic, i\&.e\&. for authentication and AFP messages (SIGUSR2 messaging)\&. This will also be the default for the volumes maccharset\&. Defaults to MAC_ROMAN\&. .RE .SH "PASSWORD OPTIONS" .PP \-loginmaxfail [\fInumber\fR] .RS 4 Sets the maximum number of failed logins, if supported by the UAM (currently none) .RE .PP \-passwdfile [\fIpath\fR] .RS 4 Sets the path to the Randnum UAM passwd file for this server (default is :ETCDIR:/afppasswd)\&. .RE .PP \-passwdminlen [\fInumber\fR] .RS 4 Sets the minimum password length, if supported by the UAM .RE .PP \-[no]savepassword .RS 4 Enables or disables the ability of clients to save passwords locally .RE .PP \-[no]setpassword .RS 4 Enables or disables the ability of clients to change their passwords via chooser or the "connect to server" dialog .RE .SH "TRANSPORT PROTOCOLS" .PP \-[no]ddp .RS 4 Enables or disables AFP\-over\-Appletalk\&. If \fB\-proxy\fR is specified, you must instead use \fB\-uamlist ""\fR to prevent DDP connections from working\&. (default is \-noddp) .RE .PP \-[no]tcp .RS 4 Enables or disables AFP\-over\-TCP (default is \-tcp) .RE .PP \-transall .RS 4 Make both available .RE .SH "TRANSPORT OPTIONS" .PP \-advertise_ssh .RS 4 Allows Mac OS X clients (10\&.3\&.3\-10\&.4) to automagically establish a tunneled AFP connection through SSH\&. If this option is set, the server\'s answers to client\'s FPGetSrvrInfo requests contain an additional entry\&. It depends on both client\'s settings and a correctly configured and running \fBsshd\fR(8) on the server to let things work\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br Setting this option is not recommended since globally encrypting AFP connections via SSH will increase the server\'s load significantly\&. On the other hand, Apple\'s client side implementation of this feature in MacOS X versions prior to 10\&.3\&.4 contained a security flaw\&. .sp .5v .RE .RE .PP \-ddpaddr \fI[ddp address]\fR .RS 4 Specifies the DDP address of the server\&. The default is to auto\-assign an address (0\&.0)\&. This is only useful if you are running AppleTalk on more than one interface\&. .RE .PP \-fqdn \fI[name:port]\fR .RS 4 Specifies a fully\-qualified domain name, with an optional port\&. This is discarded if the server cannot resolve it\&. This option is not honored by AppleShare clients <= 3\&.8\&.3\&. This option is disabled by default\&. Use with caution as this will involve a second name resolution step on the client side\&. Also note that afpd will advertise this name:port combination but not automatically listen to it\&. .RE .PP \-hostname\fI [name]\fR .RS 4 Use this instead of the result from calling hostname for dertermening which IP address to advertise, therfore the hostname is resolved to an IP which is the advertised\&. This is NOT used for listening and it is also overwritten by \fB\-ipaddr\fR\&. .RE .PP \-ipaddr \fI[ip address]\fR .RS 4 Specifies the IP address that the server should advertise \fBand\fR listens to\&. The default is advertise the first IP address of the system, but to listen for any incoming request\&. The network address may be specified either in dotted\-decimal format for IPv4 or in hexadecimal format for IPv6\&. This option also allows to use one machine to advertise the AFP\-over\-TCP/IP settings of another machine via NBP when used together with the \fB\-proxy\fR option\&. .PP \fBExample.\ \&afpd.conf onfiguration line\fR .sp .if n \{\ .RS 4 .\} .nf fluxxus \-hostname afp\&.example\&.org \-ipaddr 192\&.168\&.0\&.1 \-fqdn www\&.example\&.com .fi .if n \{\ .RE .\} .sp \fBResult\fR .sp (UTF8) Server name: fluxxus, Listening and advertised network address: 192\&.168\&.0\&.1, Advertised network address: www\&.example\&.com, hostname is not used\&. .RE .PP \-port \fI[port number]\fR .RS 4 Allows a different TCP port to be used for AFP\-over\-TCP\&. The default is 548\&. .RE .PP \-proxy .RS 4 Runs an AppleTalk proxy server for the specified AFP\-over\-TCP server\&. If the address and port aren\'t given, then the first IP address of the system and port 548 will be used\&. If you don\'t want the proxy server to act as a DDP server as well, set \fB\-uamlist ""\fR\&. .RE .PP \-server_quantum \fI[number]\fR .RS 4 This specifies the DSI server quantum\&. The default value is 303840\&. The maximum value is 0xFFFFFFFFF, the minimum is 32000\&. If you specify a value that is out of range, the default value will be set\&. Do not change this value unless you\'re absolutely sure, what you\'re doing .RE .PP \-dsireadbuf \fI[number]\fR .RS 4 Scale factor that determines the size of the DSI/TCP readahead buffer, default is 12\&. This is multiplies with the DSI server quantum (default ~300k) to give the size of the buffer\&. Increasing this value might increase throughput in fast local networks for volume to volume copies\&. \fINote\fR: This buffer is allocated per afpd child process, so specifying large values will eat up large amount of memory (buffer size * number of clients)\&. .RE .PP \-tcprcvbuf \fI[number]\fR .RS 4 Try to set TCP receive buffer using setsockpt()\&. Often OSes impose restrictions on the applications ability to set this value\&. .RE .PP \-tcpsndbuf \fI[number]\fR .RS 4 Try to set TCP send buffer using setsockpt()\&. Often OSes impose restrictions on the applications ability to set this value\&. .RE .PP \-nozeroconf .RS 4 Disable automatic Zeroconf service registration if support was compiled in\&. .RE .PP \-slp .RS 4 Register this server using the Service Location Protocol (if SLP support was compiled in)\&. .RE .SH "MISCELLANEOUS OPTIONS" .PP \-admingroup \fI[group]\fR .RS 4 Allows users of a certain group to be seen as the superuser when they log in\&. This option is disabled by default\&. .RE .PP \-authprintdir \fI[path]\fR .RS 4 Specifies the path to be used (per server) to store the files required to do CAP\-style print authentication which papd will examine to determine if a print job should be allowed\&. These files are created at login and if they are to be properly removed, this directory probably needs to be umode 1777\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br \fB\-authprintdir\fR will only work for clients connecting via DDP\&. Almost all modern Clients will use TCP\&. .sp .5v .RE .RE .PP \-client_polling .RS 4 With this switch enabled, afpd won\'t advertise that it is capable of server notifications, so that connected clients poll the server every 10 seconds to detect changes in opened server windows\&. \fINote\fR: Depending on the number of simultaneously connected clients and the network\'s speed, this can lead to a significant higher load on your network! .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br Do not use this option any longer as Netatalk 2\&.x correctly supports server notifications, allowing connected clients to update folder listings in case another client changed the contents\&. .sp .5v .RE .RE .PP \-closevol .RS 4 Immediately unmount volumes removed from AppleVolumes files on SIGHUP sent to the afp master process\&. .RE .PP \-cnidserver \fI[ipaddress:port]\fR .RS 4 Specifies the IP address and port of a cnid_metad server, required for CNID dbd backend\&. Defaults to localhost:4700\&. The network address may be specified either in dotted\-decimal format for IPv4 or in hexadecimal format for IPv6\&.\- .RE .PP \-dircachesize\fI entries\fR .RS 4 Maximum possible entries in the directory cache\&. The cache stores directories and files\&. It is used to cache the full path to directories and CNIDs which considerably speeds up directory enumeration\&. .sp Default size is 8192, maximum size is 131072\&. Given value is rounded up to nearest power of 2\&. Each entry takes about 100 bytes, which is not much, but remember that every afpd child process for every connected user has its cache\&. .RE .PP \-fcelistener \fIhost[:port]\fR .RS 4 Enables sending FCE events to the specified \fIhost\fR, default \fIport\fR is 12250 if not specified\&. Specifying mutliple listeners is done by having this option once for each of them\&. .RE .PP \-fceevents \fIfmod,fdel,ddel,fcre,dcre,tmsz\fR .RS 4 Speficies which FCE events are active, default is \fIfmod,fdel,ddel,fcre,dcre\fR\&. .RE .PP \-fcecoalesce \fIall|delete|create\fR .RS 4 Coalesce FCE events\&. .RE .PP \-fceholdfmod \fIseconds\fR .RS 4 This determines the time delay in seconds which is always waited if another file modification for the same file is done by a client before sending an FCE file modification event (fmod)\&. For example saving a file in Photoshop would generate multiple events by itself because the application is opening, modifying and closing a file mutliple times for every "save"\&. Defautl: 60 seconds\&. .RE .PP \-guestname \fI[name]\fR .RS 4 Specifies the user that guests should use (default is "nobody")\&. The name should be quoted\&. .RE .PP \-[no]icon .RS 4 [Don\'t] Use the platform\-specific icon\&. Recent Mac OS don\'t display it any longer\&. .RE .PP \-keepsessions .RS 4 Enable "Continuous AFP Service"\&. This means the ability to stop the master afpd process with a SIGQUIT signal, possibly install an afpd update and start the afpd process\&. Existing AFP sessions afpd processes will remain unaffected\&. Technically they will be notified of the master afpd shutdown, sleep 15\-20 seconds and then try to reconnect their IPC channel to the master afpd process\&. If this reconnect fails, the sessions are in an undefined state\&. Therefor it\'s absolutely critical to restart the master process in time! .RE .PP \-loginmesg \fI[message]\fR .RS 4 Sets a message to be displayed when clients logon to the server\&. The message should be in \fBunixcodepage\fR and should be quoted\&. Extended characters are allowed\&. .RE .PP \-mimicmodel \fImodel\fR .RS 4 Specifies the icon model that appears on clients\&. Defaults to off\&. Examples: RackMac (same as Xserve), PowerBook, PowerMac, Macmini, iMac, MacBook, MacBookPro, MacBookAir, MacPro, AppleTV1,1, AirPort\&. .RE .PP \-noacl2maccess .RS 4 Don\'t map filesystem ACLs to effective permissions\&. .RE .PP \-nodebug .RS 4 Disables debugging\&. .RE .PP \-sleep \fI[number]\fR .RS 4 AFP 3\&.x waits \fInumber\fR hours before disconnecting clients in sleep mode\&. Default is 10 hours\&. .RE .PP \-signature { user: | auto } .RS 4 Specify a server signature\&. This option is useful while running multiple independent instances of afpd on one machine (eg\&. in clustered environments, to provide fault isolation etc\&.)\&. Default is "auto"\&. "auto" signature type allows afpd generating signature and saving it to :ETCDIR:/afp_signature\&.conf automatically (based on random number)\&. "host" signature type switches back to "auto" because it is obsoleted\&. "user" signature type allows administrator to set up a signature string manually\&. The maximum length is 16 characters\&. .PP \fBExample.\ \&Three server definitions using 2 different server signatures\fR .sp .if n \{\ .RS 4 .\} .nf first \-signature user:USERS second \-signature user:USERS third \-signature user:ADMINS .fi .if n \{\ .RE .\} First two servers will appear as one logical AFP service to the clients \- if user logs in to first one and then connects to second one, session will be automatically redirected to the first one\&. But if client connects to first and then to third, will be asked for password twice and will see resources of both servers\&. Traditional method of signature generation causes two independent afpd instances to have the same signature and thus cause clients to be redirected automatically to server (s)he logged in first\&. .RE .PP \-volnamelen \fI[number] \fR .RS 4 Max length of UTF8\-MAC volume name for Mac OS X\&. Note that Hangul is especially sensitive to this\&. .sp .if n \{\ .RS 4 .\} .nf 73: limit of Mac OS X 10\&.1 80: limit for Mac OS X 10\&.4/10\&.5 (default) 255: limit of spec .fi .if n \{\ .RE .\} .sp Mac OS 9 and earlier are not influenced by this, because Maccharset volume name is always limitted to 27 bytes\&. .RE .SH "LOGGING OPTIONS" .PP \-setuplog "\fI []\fR" .RS 4 Specify that any message of a loglevel up to the given \fBloglevel\fR should be logged to the given file\&. If the filename is ommited the loglevel applies to messages passed to syslog\&. .sp By default (no explicit \fB\-setuplog\fR and no buildtime configure flag \fB\-\-with\-logfile\fR) afpd logs to syslog with a default logging setup equivalent to \fB"\-setuplog default log_info\fR"\&. .sp If build with \fB\-\-with\-logfile\fR (default logfile \fI/var/log/netatalk\&.log\fR) or \fB\-\-with\-logfile=somefile\fR afpd defaults to a setup that is equivalent to "\fB\-setuplog default log_info [\fR\fB\fInetatalk\&.log|somefile]\fR\fR"\&. .sp logtypes: Default, AFPDaemon, Logger, UAMSDaemon .sp loglevels: LOG_SEVERE, LOG_ERROR, LOG_WARN, LOG_NOTE, LOG_INFO, LOG_DEBUG, LOG_DEBUG6, LOG_DEBUG7, LOG_DEBUG8, LOG_DEBUG9, LOG_MAXDEBUG .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br The config is case\-ignoring .sp .5v .RE .PP \fBExample.\ \&Useful default config\fR .sp .if n \{\ .RS 4 .\} .nf \- \-setuplog "default log_info /var/log/afpd\&.log" .fi .if n \{\ .RE .\} .PP \fBExample.\ \&Debugging config\fR .sp .if n \{\ .RS 4 .\} .nf \- \-setuplog "default log_maxdebug /var/log/afpd\&.log" .fi .if n \{\ .RE .\} .PP \fBExample.\ \&afpd logging to different files\fR .sp .if n \{\ .RS 4 .\} .nf \- \-setuplog "default log_info /var/log/afpd\&.log" \e \-setuplog "UAMSDaemon log_maxdebug /var/log/uams\&.log" .fi .if n \{\ .RE .\} .RE .PP \-unsetuplog "\fI []\fR" .RS 4 Note that for \fBunsetuplog\fR specifying any string as filename is sufficient for the config parser to distinguish between requests to disable syslog logging or file\-logging\&. .PP \fBExample.\ \&Disable afpd logging set at build-time from configure\fR .sp .if n \{\ .RS 4 .\} .nf \- \-unsetuplog "default \-" .fi .if n \{\ .RE .\} .RE .SH "DEBUG OPTIONS" .PP These options are useful for debugging only\&. .PP \-tickleval \fI[number]\fR .RS 4 Sets the tickle timeout interval (in seconds)\&. Defaults to 30\&. .RE .PP \-timeout \fI[number]\fR .RS 4 Specify the number of tickles to send before timing out a connection\&. The default is 4, therefore a connection will timeout after 2 minutes\&. .RE .SH "EXAMPLES" .PP \fBExample.\ \&afpd.conf default configuration\fR .sp .if n \{\ .RS 4 .\} .nf \- \-tcp \-noddp \-uamlist uams_dhx\&.so,uams_dhx2\&.so \-nosavepassword .fi .if n \{\ .RE .\} .PP \fBExample.\ \&afpd.conf MacCyrillic setup / UTF8 unix locale\fR .sp .if n \{\ .RS 4 .\} .nf \- \-maccodepage mac_cyrillic \-unixcodepage utf8 .fi .if n \{\ .RE .\} .PP \fBExample.\ \&afpd.conf setup for Kerberos V auth with newline escaping\fR .sp .if n \{\ .RS 4 .\} .nf \- \-uamlist uams_dhx\&.so,uams_dhx2\&.so,uams_guest\&.so,uams_gss\&.so \e \-k5service afpserver \-k5keytab /path/to/afpserver\&.keytab \e \-k5realm YOUR\&.REALM \-fqdn your\&.fqdn\&.namel:548 .fi .if n \{\ .RE .\} .PP \fBExample.\ \&afpd.conf letting afpd appear as three servers on the net\fR .sp .if n \{\ .RS 4 .\} .nf "Guest Server" \-uamlist uams_guest\&.so \-loginmesg "Welcome guest!" "User Server" \-uamlist uams_dhx2\&.so \-port 12000 "special" \-ddp \-notcp \-defaultvol \-systemvol .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP \fBafpd\fR(8), \fBafppasswd\fR(1), \fBAppleVolumes.default\fR(5), \fBafp_signature.conf\fR(5), \fBcnid_metad\fR(8) netatalk-2.2.2/man/man5/afp_voluuid.conf.5.tmpl0000644000175200017500000000445211704763240016171 00000000000000'\" t .\" Title: afp_voluuid.conf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 8 March 2011 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "AFP_VOLUUID\&.CONF" "5" "8 March 2011" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" afp_voluuid.conf \- Configuration file used by afpd(8) to specify UUID for Time Machine volume .SH "DESCRIPTION" .PP :ETCDIR:/afp_voluuid\&.conf is the configuration file used by \fBafpd\fR to specify UUID of Time Machine volume automagically\&. The configuration lines are composed like: .PP \fI"volume name"\fR \fIuuid\-string\fR .PP The first field is volume name\&. Volume names must be quoted if they contain spaces\&. The second field is the 36 character hexadecimal ASCII string representation of a UUID\&. .PP The leading spaces and tabs are ignored\&. Blank lines are ignored\&. The lines prefixed with # are ignored\&. The illegal lines are ignored\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP This UUID is advertised by Zeroconf in order to provide robust disambiguation of Time Machine volume\&. .PP The afpd generates the UUID from random numbers and saves it into afp_voluuid\&.conf, only when setting "tm" option in AppleVolumes file\&. .PP This file should not be thoughtlessly edited and be copied onto another server\&. .sp .5v .RE .PP .SH "EXAMPLES" .PP \fBExample.\ \&afp_voluuid.conf three TM volumes on one netatalk\fR .sp .if n \{\ .RS 4 .\} .nf # This is a comment\&. "Backup for John Smith" 1573974F\-0ABD\-69CC\-C40A\-8519B681A0E1 "bob" 39A487F4\-55AA\-8240\-E584\-69AA01800FE9 mary 6331E2D1\-446C\-B68C\-3066\-D685AADBE911 .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP \fBafpd\fR(8), \fBAppleVolumes.default\fR(5), \fBavahi-daemon\fR(8) netatalk-2.2.2/man/man5/netatalk.conf.5.tmpl0000644000175200017500000000666011704763240015462 00000000000000'\" t .\" Title: netatalk.conf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 30 Mar 2011 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "NETATALK\&.CONF" "5" "30 Mar 2011" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" netatalk.conf \- Configuration file used by Netatalk to determine its general configuration .SH "SYNOPSIS" .HP \w'\fB:ETCDIR:/netatalk\&.conf\fR\fB\fR\fB:DESTDIR:/etc/default/netatalk\fR\fB\fR\ 'u \fB:ETCDIR:/netatalk\&.conf\fR\fB\fR .br \fB:DESTDIR:/etc/default/netatalk\fR\fB\fR .SH "DESCRIPTION" .PP \fB:ETCDIR:/netatalk\&.conf\fR is the configuration file used by afpd to determine what portions of the file system will be shared via AFP, as well as their behaviors\&. .PP If netatalk has been configured with \-\-enable\-debian, it is not \fB:ETCDIR:/netatalk\&.conf\fR but \fB:DESTDIR:/etc/default/netatalk\fR\&. .PP Any line not prefixed with \fB#\fR is interpreted\&. The configuration lines are composed like: .PP \fIoption\fR \fB=\fR \fIvalue\fR .PP The possible options and their meanings are: .PP \fBAFPD_GUEST\fR .RS 4 Sets the id of the guest user to a local user on the system\&. .RE .PP \fBAFPD_MAX_CLIENTS\fR .RS 4 Sets the maximum number of clients that can simultaneously connect to the server\&. .RE .PP \fBAFPD_RUN\fR .RS 4 Enables the afpd daemon if set to "yes"\&. This should be enabled if you are planning on using netatalk as a file server\&. .RE .PP \fBAFPD_UAM_LIST\fR .RS 4 Sets the default UAMs for afpd (and papd, if printer authentication is compiled in) to use\&. .sp \fIExample:\fR \fBAFPD_UAMLIST\fR=\fB"\-U uams_guest\&.so,uams_randnum\&.so"\fR .RE .PP \fBCNID_METAD_RUN\fR .RS 4 Enables the cnid_metad daemon if set to "yes"\&. This should be enabled if you are going to use the dbd CNID backend\&. .RE .PP \fBCNID_CONFIG\fR .RS 4 Configuration options for cnid_metad\&. See: \fBcnid_metad\fR(8) .RE .PP \fBATALK_BGROUND\fR .RS 4 "yes" will set netatalk to initialize in the background, and "no" will cause normal initialization\&. .RE .PP \fBATALK_NAME\fR .RS 4 Sets the machines\' Appletalk name\&. .RE .PP \fBATALK_ZONE\fR .RS 4 Sets the machines\' Appletalk zone\&. .RE .PP \fBATALKD_RUN\fR .RS 4 Enables the atalkd daemon if set to "yes"\&. This should be enabled if you are planning on providing Appletalk services\&. .RE .PP \fBPAPD_RUN\fR .RS 4 Enables the papd daemon if set to "yes"\&. This should be enabled if you are planning on using netatalk as a print server\&. .RE .PP \fBATALK_MAC_CHARSET\fR .RS 4 Set the Mac client codepage, used by atalkd and papd to convert extended characters from the Unix to the Mac codepage\&. .RE .PP \fBATALK_UNIX_CHARSET\fR .RS 4 Set the Unix codepage, used by atalkd and papd to convert extended characters from the Unix to the Mac codepage\&. Has to match the codepage of the configuration files\&. .RE .SH "SEE ALSO" .PP \fBafpd\fR(8), \fBafpd.conf\fR(5), \fBcnid_metad\fR(8), \fBatalkd\fR(8), \fBatalkd.conf\fR(5) netatalk-2.2.2/man/man5/papd.conf.5.tmpl0000644000175200017500000001646711704763240014611 00000000000000'\" t .\" Title: papd.conf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 06 Sep 2004 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "PAPD\&.CONF" "5" "06 Sep 2004" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" papd.conf \- Configuration file used by papd(8) to determine the configuration of printers used by the Netatalk printing daemon .SH "DESCRIPTION" .PP \fB:ETCDIR:/papd\&.conf\fR is the configuration file used by papd to configure the printing services offered by netatalk\&. Please note that papd must be enabled in \fB:ETCDIR:/netatalk\&.conf\fR for this to take any effect\&. \fBpapd\fR shares the same defaults as lpd on many systems, but not Solaris\&. .PP Any line not prefixed with \fB#\fR is interpreted\&. The configuration lines are composed like: .PP \fIprintername:[options]\fR .PP On systems running a System V printing system the simplest case is to have either no papd\&.conf, or to have one that has no active lines\&. In this case, atalkd should auto\-discover the local printers on the machine\&. Please note that you can split lines by using \fB\e\efR\&.\fR .PP printername may be just a name (\fBPrinter 1\fR), or it may be a full name in nbp_name format (\fBPrinter 1:LaserWriter@My Zone\fR)\&. .PP Systems using a BSD printing system should make use of a pipe to the printing command in question within the \fBpr\fR option (eg\&. \fBpr=|/usr/bin/lpr\fR)\&. .PP When CUPS support is compiled in, then \fBcupsautoadd \fR as the first entry in papd\&.conf will automagically share all CUPS printers by papd utilizing the PPDs assigned in CUPS (customizable \-\- see below)\&. This can be overwritten for individal printers by subsequently adding individual entries using the CUPS queue name as \fBpr \fR entry\&. Note: CUPS support is mutually exclusive with System V support described above\&. .PP The possible options are colon delimited (\fB:\fR), and lines must be terminated with colons\&. The possible options and flags are: .PP \fBam=(uams list)\fR .RS 4 The \fBam\fR option allows specific UAMs to be specified for a particular printer\&. It has no effect if the \fBau\fR flag is not present or if papd authentication was not built into netatalk\&. Note: possible values are \fBuams_guest\&.so\fR and \fB uams_clrtxt\&.so\fR only\&. The first method requires a valid username, but no password\&. The second requires both a valid username and the correct password\&. .RE .PP \fBau\fR .RS 4 If present, this flag enables authentication for the printer\&. Please note that papd authentication must be built into netatalk for this to take effect\&. .RE .PP \fBco=(CUPS options)\fR .RS 4 The \fBco\fR option allows options to be passed through to CUPS (eg\&. \fBco="protocol=TBCP" \fR or \fBco="raw"\fR)\&. .RE .PP \fBcupsautoadd[:type][@zone]\fR .RS 4 If used as the first entry in papd\&.conf this will share all CUPS printers via papd\&. type/zone settings as well as other parameters assigned to this special printer share will apply to all CUPS printers\&. Unless the \fBpd\fR option is set, the CUPS PPDs will be used\&. To overwrite these global settings for individual printers simply add them subsequently to papd\&.conf and assign different settings\&. .RE .PP \fBfo\fR .RS 4 If present, this flag enables a hack to translate line endings originating from pre Mac OS X LaserWriter drivers to let \fBfoomatic\-rip\fR recognize foomatic PPD options set in the printer dialog\&. Attention: Use with caution since this might corrupt binary print jobs! .RE .PP \fBop=(operator)\fR .RS 4 This specifies the operator name, for lpd spooling\&. .RE .PP \fBpa=(appletalk address)\fR .RS 4 Allows specification of Appletalk addresses\&. Usually not needed\&. .RE .PP \fBpd=(path to ppd file)\fR .RS 4 Specifies a particular PPD (printer description file) to associate with the selected printer\&. .RE .PP \fBpr=(lpd/CUPS printer name or pipe command)\fR .RS 4 Sets the \fBlpd\fR or \fBCUPS\fR printer that this is spooled to\&. .RE .SH "EXAMPLES" .PP Unless CUPS support has been compiled in (which is default from Netatalk 2\&.0 on) one simply defines the lpd queue in question by setting the \fBpr\fR parameter to the queue name, in the following example "ps"\&. If no \fBpr\fR parameter is set, the default printer will be used\&. .PP \fBExample.\ \&papd.conf System V printing system examples\fR .PP The first spooler is known by the AppleTalk name Mac Printer Spooler, and uses a PPD file located in /usr/share/lib/ppd\&. In addition, the user mcs will be the owner of all jobs that are spooled\&. The second spooler is known as HP Printer and all options are the default\&. .sp .if n \{\ .RS 4 .\} .nf Mac Printer Spooler:\e :pr=ps:\e :pd=/usr/share/lib/ppd/HPLJ_4M\&.PPD:\e :op=mcs: HP Printer:\e : .fi .if n \{\ .RE .\} .PP An alternative to the technique outlined above is to direct papd\'s output via a pipe into another program\&. Using this mechanism almost all printing systems can be driven\&. .PP \fBExample.\ \&papd.conf examples using pipes\fR .PP The first spooler is known as HP 8100\&. It pipes the print job to \fB/usr/bin/lpr\fR for printing\&. PSSP authenticated printing is enabled, as is CAP\-style authenticated printing\&. Both methods support guest and cleartext authentication as specified by the \'\fBam\fR\' option\&. The PPD used is /etc/atalk/ppds/hp8100\&.ppd\&. .sp .if n \{\ .RS 4 .\} .nf HP 8100:\e :pr=|/usr/bin/lpr \-Plp:\e :sp:\e :ca=/tmp/print:\e :am=uams_guest\&.so,uams_pam\&.so:\e :pd=/etc/atalk/ppds/hp8100\&.ppd: .fi .if n \{\ .RE .\} .sp .PP Starting with Netatalk 2\&.0 direct CUPS integration is available\&. In this case, defining only a queue name as \fBpr\fR parameter won\'t invoke the SysV lpd daemon but uses CUPS instead\&. Unless a specific PPD has been assigned using the \fBpd\fR switch, the PPD configured in CUPS will be used by \fBpapd\fR, too\&. .PP There exists one special share named "cupsautoadd"\&. If this is present as the first entry then all available CUPS queues will be served automagically using the parameters assigned to this global share\&. But subsequent printer definitions can be used to override these global settings for individual spoolers\&. .PP \fBExample.\ \&papd.conf CUPS examples\fR .PP The first entry sets up automatic sharing of all CUPS printers\&. All those shares appear in the zone "1st floor" and since no additional settings have been made, they use the CUPS printer name as NBP name and use the PPD configured in CUPS\&. The second entry defines different settings for one single CUPS printer\&. It\'s NBP name is differing from the printer\'s name and the registration happens in another zone\&. .sp .if n \{\ .RS 4 .\} .nf cupsautoadd@1st floor:op=root: Boss\' LaserWriter@2nd floor:\e :pr=laserwriter\-chief: .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP \fBpapd\fR(8), \fBatalkd.conf\fR(5), \fBlpd\fR(8), \fBlpoptions\fR(8) netatalk-2.2.2/man/man5/AppleVolumes.default.5.tmpl0000644000175200017500000005135011704763240016766 00000000000000'\" t .\" Title: AppleVolumes.default .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 13 Oct 2011 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "APPLEVOLUMES\&.DEFAU" "5" "13 Oct 2011" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" AppleVolumes.default, AppleVolumes.system, AppleVolumes \- Configuration file used by \fBafpd\fR(8) to determine the shares made available through AFP and specify file name extension mappings\&. .SH "SYNOPSIS" .HP \w'\fB:ETCDIR:/AppleVolumes\&.default\fR\fB\fR\fB:ETCDIR:/AppleVolumes\&.system\fR\fB\fR\fB~/AppleVolumes\fR\fB\fR\fB~/\&.AppleVolumes\fR\fB\fR\fB~/applevolumes\fR\fB\fR\fB~/\&.applevolumes\fR\fB\fR\ 'u \fB:ETCDIR:/AppleVolumes\&.default\fR\fB\fR .br \fB:ETCDIR:/AppleVolumes\&.system\fR\fB\fR .br \fB~/AppleVolumes\fR\fB\fR .br \fB~/\&.AppleVolumes\fR\fB\fR .br \fB~/applevolumes\fR\fB\fR .br \fB~/\&.applevolumes\fR\fB\fR .SH "DESCRIPTION" .PP :ETCDIR:/AppleVolumes\&.system and one of :ETCDIR:/AppleVolumes\&.default, ~/AppleVolumes, ~/\&.AppleVolumes, ~/applevolumes, or ~/\&.applevolumes are the configuration files used by \fBafpd\fR to determine what portions of the file system will be shared via Apple Filing Protocol, as well as their behaviour\&. .PP Any line not prefixed with # is interpreted\&. Newline escaping is supported\&. The configuration lines are composed like: .PP path \fI[ volume name ] [ options ]\fR .PP \&.extension \fI[ type [ creator ] ]\fR .PP The path name must be a fully qualified path name, or a path name using either the ~ shell shorthand or any of the substitution variables, which are listed below\&. .PP The volume name is the name that appears in the Chooser ot the "connect to server" dialog on Macintoshes to represent the appropriate share\&. If volumename is unspecified, the last component of pathname is used\&. No two volumes may have the same name\&. If there are spaces in the name, it should be in quotes (i\&.e\&. "File Share")\&. The volume name cannot contain the \':\' character\&. The volume name is mangled if it is very long\&. Mac codepage volume name is limited to 27 characters\&. UTF8\-MAC volume name is limited to \-volnamelen parameter in afpd\&.conf .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP Each volume has to be configured on a \fBsingle\fR line\&. Though newline escaping is supported\&. .sp .5v .RE .PP The leading\-dot lines specify file name extension mappings\&. The extension \'\&.\' sets the default creator and type for otherwise untyped Unix files\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP File name extension mapping is useful for Mac OS 9 and earlier\&. But it should not use for Mac OS X\&. .sp .5v .RE .PP It is possible to specify default options for all volumes with a \fI:DEFAULT: \fRline preceeding these volume definitions: .PP \fBExample.\ \&:DEFAULT: configuration line\fR .sp .if n \{\ .RS 4 .\} .nf :DEFAULT: options:upriv,usedots dbpath:/var/dbd/AppleDB/$v dperm:0775 fperm:0664 .fi .if n \{\ .RE .\} .PP The possible options and their meanings are: .PP adouble:\fI[v1|v2|osx]\fR .RS 4 Specify the format of the metadata files, which are used for saving Mac resource fork as well\&. Earlier versions used AppleDouble V1, the new default format is V2\&. Starting with Netatalk 2\&.0, the scheme MacOS X 10\&.3\&.x uses, is also supported\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br \fBadouble:osx\fR \fBcannot\fR be treated normally any longer\&. Its only aim was to temporarely share eg\&. FAT32 formatted FireWire harddrives written on a Macintosh with afpd\&. Apple\'s metadata scheme lacks several essential features, so using it on the server\'s side will break both CNIDs and MacOS 9 compatibility\&. AppleDouble file of Mac OS X 10\&.6 is incompatible to V1 and V2\&. .sp .5v .RE .RE .PP volsizelimit:\fIsize in MiB\fR .RS 4 Useful for TimeMachine: limits the reported volume size, thus preventing TM from using the whole real disk space for backup\&. Example: "volsizelimit:1000" would limit the reported disk space to 1 GB\&. \fBIMPORTANT: \fR This is an approximated calculation taking into accout the contents of TM sparsebundle images\&. Therefor you MUST NOT use this volume to store other content when using this option, because it would NOT be accounted\&. The calculation works by reading the band size from the Info\&.plist XML file of the sparsebundle, reading the bands/ directory counting the number of band files, and then multiplying one with the other\&. .RE .PP allow:\fI[users/groups]\fR .RS 4 The allow option allows the users and groups that access a share to be specified\&. Users and groups are specified, delimited by commas\&. Groups are designated by a @ prefix\&. Example: allow:user1,user2,@group .RE .PP deny:\fI[users/groups]\fR .RS 4 The deny option specifies users and groups who are not allowed access to the share\&. It follows the same format as the allow option\&. .RE .PP allowed_hosts:\fI[IP host address/IP netmask bits[, \&.\&.\&. ]]\fR .RS 4 Only listed hosts and networks are allowed, all others are rejected\&. The network address may be specified either in dotted\-decimal format for IPv4 or in hexadecimal format for IPv6\&. .sp Example: allowed_hosts:10\&.1\&.0\&.0/16,10\&.2\&.1\&.100,2001:0db8:1234::/48 .RE .PP denied_hosts:\fI[IP host address/IP netmask bits[, \&.\&.\&.]]\fR .RS 4 Listed hosts and nets are rejected, all others are allowed\&. .sp Example: denied_hosts: 192\&.168\&.100/24,10\&.1\&.1\&.1,2001:db8::1428:57ab .RE .PP cnidscheme:\fI[backend]\fR .RS 4 set the CNID backend to be used for the volume, default is [:DEFAULT_CNID_SCHEME:] available schemes: [:COMPILED_BACKENDS:] .RE .PP dbpath:\fI[path]\fR .RS 4 Sets the database information to be stored in path\&. You have to specifiy a writable location, even if the volume is read only\&. .RE .PP cnidserver:\fI[fqdn|IP[:port]]\fR .RS 4 Query this servername or IP address (default:\fIlocalhost\fR) and port (default: \fI4700\fR) for CNIDs\&. Only used with CNID backend "\fIdbd\fR"\&. This option here overrides any setting from afpd\&.conf:\fBcnidserver\fR\&. .RE .PP ea:\fI[none|auto|sys|ad]\fR .RS 4 Specify how Extended Attributes are stored\&. \fBauto\fR is the default\&. .PP auto .RS 4 Try \fBsys\fR (by setting an EA on the shared directory itself), fallback to \fBad\fR\&. Requires writeable volume for perfoming test\&. \fBoptions:ro\fR overwrites \fBauto\fR with \fBnone\fR\&. Use explicit \fBea:sys|ad\fR for read\-only volumes where appropiate\&. .RE .PP sys .RS 4 Use filesystem Extended Attributes\&. .RE .PP ad .RS 4 Use files in \fI\&.AppleDouble\fR directories\&. .RE .PP none .RS 4 No Extended Attributes support\&. .RE .RE .PP maccharset:\fI[charset]\fR .RS 4 specifies the mac client codepage for this Volume, e\&.g\&. "MAC_ROMAN", "MAC_CYRILLIC"\&. If not specified the setting from afpd\&.conf is inherited\&. This setting is only required if you need volumes, where the mac codepage differs from the one globally set in afpd\&.conf\&. .RE .PP options:\fI[option]\fR .RS 4 This allows multiple options to be specified in a comma delimited format\&. The available options are: .PP searchdb .RS 4 Use fast CNID database namesearch instead of slow recursive filesystem search\&. Relies on a consistent CNID database, ie Samba or local filesystem access lead to inaccurate or wrong results\&. Works only for "dbd" CNID db volumes\&. .RE .PP tm .RS 4 Enable Time Machine suport for this volume\&. .RE .PP invisibledots .RS 4 Use with \fBusedots\fR: make dot files invisible\&. .RE .PP nonetids .RS 4 Try to force ACL unawareness on the client\&. .RE .PP limitsize .RS 4 Limit disk size reporting to 2GB\&. This can be used for older Macintoshes using newer Appleshare clients\&. .RE .PP preexec_close .RS 4 a non\-zero return code from preexec close the volume being immediately, preventing clients to mount/see the volume in question\&. .RE .PP ro .RS 4 Specifies the share as being read only for all users\&. The \&.AppleDB directory has to be writeable, you can use the \fB\-dbpath\fR option to relocate it\&. Overwrites \fBea:auto\fR with \fBea:none\fR .RE .PP root_preexec_close .RS 4 a non\-zero return code from root_preexec closes the volume immediately, preventing clients to mount/see the volume in question\&. .RE .PP upriv .RS 4 use AFP3 unix privileges\&. This should be set for OS X clients\&. Starting with Netatalk 2\&.1 it\'s part of the default config :DEFAULT: line\&. See also: \fBperm|fperm|dperm\fR\&. .RE .PP usedots .RS 4 Don\'t do :hex translation for dot files\&. note: when this option gets set, certain file names become illegal\&. These are \&.Parent and anything that starts with \&.Apple\&. See also \fBinvisibledots\fR\&. .RE .RE .PP password:\fI[password]\fR .RS 4 This option allows you to set a volume password, which can be a maximum of 8 characters long (using ASCII strongly recommended at the time of this writing)\&. .RE .PP perm|fperm|dperm:\fI[mode]\fR .RS 4 Add(or) with the client requested permissions: \fBperm\fR affects files and directories, \fBfperm\fR is for files only, \fBdperm\fR is for directories only\&. Use with \fBoptions:upriv\fR\&. .PP \fBExample.\ \&Volume for a collaborative workgroup\fR .sp .if n \{\ .RS 4 .\} .nf /path/to/volume "Workgroup" options:upriv dperm:0770 fperm:0660 .fi .if n \{\ .RE .\} .RE .PP umask:\fI[mode]\fR .RS 4 set perm mask\&. Use with \fBoptions:upriv\fR\&. .RE .PP preexec:\fI[command]\fR .RS 4 command to be run when the volume is mounted, ignored for user defined volumes .RE .PP postexec:\fI[command]\fR .RS 4 command to be run when the volume is closed, ignored for user defined volumes .RE .PP root_preexec:\fI[command]\fR .RS 4 command to be run as root when the volume is mounted, ignored for user defined volumes .RE .PP root_postexec:\fI[command]\fR .RS 4 command to be run as root when the volume is closed, ignored for user defined volumes .RE .PP rolist:[\fBusers/groups\fR] .RS 4 Allows certain users and groups to have read\-only access to a share\&. This follows the allow option format\&. .RE .PP rwlist:\fI[users/groups]\fR .RS 4 Allows certain users and groups to have read/write access to a share\&. This follows the allow option format\&. .RE .PP veto:\fI[vetoed names]\fR .RS 4 hide files and directories,where the path matches one of the \'/\' delimited vetoed names\&. The veto string must always be terminated with a \'/\', eg\&. "veto1/", "veto1/veto2/"\&. .RE .PP volcharset:\fI[charset]\fR .RS 4 specifies the volume codepage, e\&.g\&. "UTF8", "UTF8\-MAC", "ISO\-8859\-15"\&. Defaults to "UTF8"\&. .RE .SH "VARIABLE SUBSTITUTIONS" .PP You can use variables in both volume path and volume name\&. .sp .RS 4 .ie n \{\ \h'-04' 1.\h'+01'\c .\} .el \{\ .sp -1 .IP " 1." 4.2 .\} if you specify an unknown variable, it will not get converted\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 2.\h'+01'\c .\} .el \{\ .sp -1 .IP " 2." 4.2 .\} if you specify a known variable, but that variable doesn\'t have a value, it will get ignored\&. .RE .PP The variables which can be used for substitutions are: .PP $b .RS 4 basename .RE .PP $c .RS 4 client\'s ip or appletalk address .RE .PP $d .RS 4 volume pathname on server .RE .PP $f .RS 4 full name (contents of the gecos field in the passwd file) .RE .PP $g .RS 4 group name .RE .PP $h .RS 4 hostname .RE .PP $i .RS 4 client\'s ip, without port .RE .PP $s .RS 4 server name (this can be the hostname) .RE .PP $u .RS 4 user name (if guest, it is the user that guest is running as) .RE .PP $v .RS 4 volume name (either ADEID_NAME or basename of path) .RE .PP $z .RS 4 appletalk zone (may not exist) .RE .PP $$ .RS 4 prints dollar sign ($) .RE .PP \fBExample.\ \&Using variable substitution when defining volumes\fR .PP .if n \{\ .RS 4 .\} .nf /home/groups/$g "Groupdir for $g" ~ "$f is the best one" .fi .if n \{\ .RE .\} .sp We define "groupdirs" for each primary group and use a personalized server name for homedir shares\&. .SH "CNID BACKENDS" .PP The AFP protocol mostly refers to files and directories by ID and not by name\&. Netatalk needs a way to store these ID\'s in a persistent way, to achieve this several different CNID backends are available\&. The CNID Databases are by default located in the \&.AppleDB folder in the volume root\&. .PP cdb .RS 4 "Concurrent database", backend is based on Sleepycat\'s Berkely DB\&. With this backend several \fBafpd\fR deamons access the CNID database directly\&. Berkeley DB locking is used to synchronize access, if more than one \fBafpd\fR process is active for a volume\&. The drawback is, that the crash of a single \fBafpd\fR process might corrupt the database\&. .RE .PP dbd .RS 4 Access to the CNID database is restricted to the \fBcnid_metad\fR daemon process\&. \fBafpd\fR processes communicate with the daemon for database reads and updates\&. If built with Berkeley DB transactions the probability for database corruption is practically zero, but performance can be slower than with \fBcdb\fR .RE .PP last .RS 4 This backend is an exception, in terms of ID persistency\&. ID\'s are only valid for the current session\&. This is basically what \fBafpd\fR did in the 1\&.5 (and 1\&.6) versions\&. This backend is still available, as it is useful for e\&.g\&. sharing cdroms\&. .sp \fBWarning\fR: It is \fINOT\fR recommended to use this backend for volumes anymore, as \fBafpd\fR now relies heavily on a persistent ID database\&. Aliases will likely not work and filename mangling is not supported\&. .RE .PP Even though \fB\&./configure \-\-help\fR might show that there are other CNID backends available, be warned those are likely broken or mainly used for testing\&. Don\'t use them unless you know what you\'re doing, they may be removed without further notice from future versions\&. .SH "CHARSET OPTIONS" .PP With OS X Apple introduced the AFP3 protocol\&. One of the most important changes was that AFP3 uses unicode names encoded as UTF\-8 decomposed\&. Previous AFP/OS versions used codepages, like MacRoman, MacCentralEurope, etc\&. .PP \fBafpd\fR needs a way to preserve extended macintosh characters, or characters illegal in unix filenames, when saving files on a unix filesystem\&. Earlier versions used the the so called CAP encoding\&. An extended character (>0x7F) would be converted to a :xx sequence, e\&.g\&. the Apple Logo (MacRoman: 0XF0) was saved as :f0\&. Some special characters will be converted as to :xx notation as well\&. \'/\' will be encoded to :2f, if \fBusedots\fR is not specified, a leading dot \'\&.\' will be encoded as :2e\&. .PP This version now uses UTF\-8 as the default encoding for names\&. Special characters, like \'/\' and a leading \'\&.\' will still be CAP style encoded \&. .PP The \fB\-volcharset\fR option will allow you to select another volume encoding\&. E\&.g\&. for western users another useful setting could be \-volcharset ISO\-8859\-15\&. \fBapfd\fR will accept any \fBiconv\fR(1) provided charset\&. If a character cannot be converted from the mac codepage to the selected volcharset, afpd will save it as a CAP encoded character\&. For AFP3 clients, \fBafpd\fR will convert the UTF\-8 character to \fB\-maccharset\fR first\&. If this conversion fails, you\'ll receive a \-50 error on the mac\&. .PP \fINote\fR: Whenever you can, please stick with the default UTF\-8 volume format\&. .SH "COMPATIBILITY WITH EARLIER VERSIONS" .PP To use a volume created with an earlier \fBafpd\fR version, you\'ll have to specify the following options: .PP \fBExample.\ \&use a 1.x style volume\fR .sp .if n \{\ .RS 4 .\} .nf /path/to/volume "Volname" adouble:v1 volcharset:ASCII .fi .if n \{\ .RE .\} .PP In case you used an NLS you could try using a compatible iconv charset for \fB\-volcharset\fR\&. .PP \fBExample.\ \&use a 1.x style volume, created with maccode.iso8859-1\fR .sp .if n \{\ .RS 4 .\} .nf /path/to/volume "Volname" adouble:v1 volcharset:ISO\-8859\-1 .fi .if n \{\ .RE .\} .PP You should consider converting old style volumes to the new UTF\-8/AD2 format\&. The safest way to do this, is to create a new volume with the default options and copy the files between this volumes with a mac\&. .PP \fINote\fR: Using above example options will allow you to downgrade to 1\&.x netatalk again\&. .PP \fINote\fR: Some 1\&.x NLS files used non standard mappings, e\&.g\&. maccode\&.iso8859\-1\&.adapted\&. Three 1\&.x CAP double\-byte maccharsets are incompatible to netatalk 2\&.x; "MAC_CHINESE_TRAD", "MAC_JAPANESE" and "MAC_KOREAN"\&. These are not supported anymore\&. You\'ll have to copy the contents of those volumes files to a Mac and then back to the netatalk server, preferably to an UTF\-8 volume\&. .SH "ADVANCED OPTIONS" .PP The following options should only be used after serious consideration\&. Be sure you fully understood the, sometimes complex, consequences, before using them\&. .PP casefold:\fB[option]\fR .RS 4 The casefold option handles, if the case of filenames should be changed\&. The available options are: .sp \fBtolower\fR \- Lowercases names in both directions\&. .sp \fBtoupper\fR \- Uppercases names in both directions\&. .sp \fBxlatelower\fR \- Client sees lowercase, server sees uppercase\&. .sp \fBxlateupper\fR \- Client sees uppercase, server sees lowercase\&. .RE .PP options:[\fBoption\fR] .RS 4 This allows multiple options to be specified in a comma delimited format\&. The available options are: .PP caseinsensitive .RS 4 The underlying filesystem is case insensitive (only tested with JFS in OS2 mode)\&. .RE .PP crlf .RS 4 Enables crlf translation for TEXT files, automatically converting macintosh line breaks into Unix ones\&. Use of this option might be dangerous since some older programs store binary data files as type "TEXT" when saving and switch the filetype in a second step\&. \fBAfpd\fR will potentially destroy such files when "erroneously" changing bytes in order to do line break translation\&. .RE .PP dropbox .RS 4 Allows a volume to be declared as being a "dropbox\&." Note that netatalk must be compiled with dropkludge support for this to function\&. \fIWarning\fR: This option is deprecated and might not work as expected\&. .RE .PP dropkludge .RS 4 same as "dropbox"\&. .RE .PP mswindows .RS 4 Forces filename restrictions imposed by MS WinXX\&. \fIWarning\fR: This is \fINOT\fR recommened for volumes mainly used by Macs\&. Please make sure you fully understand this option before using it\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBWarning\fR .ps -1 .br This option breaks direct saving to netatalk volumes from some applications, i\&.e\&. OfficeX\&. .sp .5v .RE .RE .PP noadouble .RS 4 Forces \fBafpd\fR to not create \&.AppleDouble directories unless macintosh metadata needs to be written\&. This option is only useful if you want to share files mostly used NOT by macs, causing \fBafpd\fR to not automatically create \&.AppleDouble subdirs containing AD header files in every directory it enters (which will it do by default)\&. .sp In case, you save or change files from mac clients, AD metadata files have to be written even in case you set this option\&. So you can\'t avoid the creation of \&.AppleDouble directories and its contents when you give macs write access to a share and they make use of it\&. .sp Try to avoid \fBnoadouble\fR whenever possible\&. .RE .PP nocnidcache .RS 4 If set \fBafpd\fR doesn\'t store the ID information in AppleDouble V2 header files\&. As these IDs are used for caching and as a database backup, this option normally shouldn\'t be set\&. .RE .PP nodev .RS 4 always use 0 for device number, helps when the device number is not constant across a reboot, cluster, \&.\&.\&. .RE .PP nofileid .RS 4 don\'t advertise createfileid, resolveid, deleteid calls\&. .RE .PP nohex .RS 4 Disables :hex translations for anything except dot files\&. This option makes the \'/\' character illegal\&. .RE .PP nostat .RS 4 don\'t stat volume path when enumerating volumes list, useful for automounting or volumes created by a preexec script\&. .RE .PP prodos .RS 4 Provides compatibility with Apple II clients\&. (legacy) .RE .RE .SH "FILE NAME EXTENSION MAPPINGS" .PP \fBExample.\ \&Extension is jpg. Type is "JPEG". Creator is "ogle".\fR .sp .if n \{\ .RS 4 .\} .nf \&.jpg "JPEG" "ogle" .fi .if n \{\ .RE .\} .PP \fBExample.\ \&Extension is lzh. Type is "LHA ". Creator is not defined.\fR .sp .if n \{\ .RS 4 .\} .nf \&.lzh "LHA " .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP \fBafpd.conf\fR(5), \fBafpd\fR(8), \fBcnid_metad\fR(8) netatalk-2.2.2/man/Makefile.in0000644000175200017500000004126111703521730013066 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for man/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = man DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = man1 man3 man4 man5 man8 all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign man/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/man/man3/0000777000175200017500000000000011704770431011744 500000000000000netatalk-2.2.2/man/man3/Makefile.am0000644000175200017500000000021611655731130013711 00000000000000# Makefile.am for man/man3 ATALK_MANS = atalk_aton.3 nbp_name.3 if USE_APPLETALK man_MANS = $(ATALK_MANS) endif EXTRA_DIST = $(ATALK_MANS) netatalk-2.2.2/man/man3/Makefile.in0000644000175200017500000003176411703521731013734 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for man/man3 VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = man/man3 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = man3dir = $(mandir)/man3 am__installdirs = "$(DESTDIR)$(man3dir)" NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ATALK_MANS = atalk_aton.3 nbp_name.3 @USE_APPLETALK_TRUE@man_MANS = $(ATALK_MANS) EXTRA_DIST = $(ATALK_MANS) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/man3/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign man/man3/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man3: $(man3_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)" @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.3*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 3*) ;; \ *) ext='3' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst"; \ done uninstall-man3: @$(NORMAL_UNINSTALL) @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.3*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 3*) ;; \ *) ext='3' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man3dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man3dir)/$$inst"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man3dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-man3 install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man3 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man3 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-man uninstall-man3 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/man/man3/nbp_name.30000644000175200017500000000433411704763240013527 00000000000000'\" t .\" Title: nbp_name .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12 Jan 1994 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "NBP_NAME" "3" "12 Jan 1994" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" nbp_name \- NBP name parsing .SH "SYNOPSIS" .HP \w'int\ nbp_name('u .BI "int nbp_name(char\ *" "name" ", char\ **" "obj" ", char\ **" "type" ", char\ **" "zone" ");" .SH "DESCRIPTION" .PP \fBnbp_name()\fR parses user supplied names into their component object, type, and zone\&. \fBobj\fR, \fBtype\fR, and \fIzone\fR should be passed by reference, and should point to the caller\'s default values\&. \fBnbp_name()\fR will change the pointers to the parsed\-out values\&. \fBname\fR is of the form \fIobject\fR\fB:\fR\fItype\fR\fB@\fR\fIzone\fR, where each of \fIobject\fR, \fB:\fR\fItype\fR\fB,\fR and \fB@\fR\fIzone\fR replace \fBobj\fR, \fBtype\fR, and \fBzone,\fR respectively\&. \fItype\fR must be proceeded by `\fB:\fR\', and \fIzone\fR must be preceded by `\fB@\fR\'\&. .SH "EXAMPLE" .PP The argument of \fBafpd\fR(8)\'s \fB\-n\fR option is parsed with \fBnbp_name()\fR\&. The default value of \fBobj\fR is the first component of the machine\'s hostname (as returned by \fBgethostbyname\fR(3))\&. The default value of \fBtype\fR is ``AFPServer\'\', and of \fIzone\fR is ``*\'\', the default zone\&. To cause \fBafpd\fR to register itself in some zone other than the default, one would invoke it as .sp .if n \{\ .RS 4 .\} .nf afpd \-n @some\-other\-zone .fi .if n \{\ .RE .\} .PP \fBobj\fR and \fBtype\fR would retain their default values\&. .SH "BUGS" .PP \fBobj\fR, \fBtype\fR, and \fIzone\fR return pointers into static area which may be over\-written on each call\&. netatalk-2.2.2/man/man3/atalk_aton.30000644000175200017500000000305511704763240014064 00000000000000'\" t .\" Title: atalk_aton .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12 Jan 1994 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "ATALK_ATON" "3" "12 Jan 1994" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" atalk_aton \- AppleTalk address parsing .SH "SYNOPSIS" .sp .ft B .nf #include #include .fi .ft .HP \w'atalk_aton('u .BI "atalk_aton(char\ *\ " "cp" ", struct\ at_addr\ *\ " "ata" ");" .SH "DESCRIPTION" .PP The \fBatalk_aton()\fR routine converts an ASCII representation of an AppleTalk address to a format appropriate for system calls\&. Acceptable ASCII representations include both hex and base 10, in triples or doubles\&. For instance, the address `0x1f6b\&.77\' has a network part of `8043\' and a node part of `119\'\&. This same address could be written `8043\&.119\', `31\&.107\&.119\', or `0x1f\&.6b\&.77\'\&. If the address is in hex and the first digit is one of `A\-F\', a leading `0x\' is redundant\&. .SH "SEE ALSO" .PP \fBatalk\fR(4)\&. netatalk-2.2.2/man/man4/0000777000175200017500000000000011704770431011745 500000000000000netatalk-2.2.2/man/man4/Makefile.am0000644000175200017500000000017711655731130013720 00000000000000# Makefile.am for man/man4/ ATALK_MANS = atalk.4 if USE_APPLETALK man_MANS = $(ATALK_MANS) endif EXTRA_DIST = $(ATALK_MANS) netatalk-2.2.2/man/man4/Makefile.in0000644000175200017500000003174511703521731013734 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for man/man4/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = man/man4 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = man4dir = $(mandir)/man4 am__installdirs = "$(DESTDIR)$(man4dir)" NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ATALK_MANS = atalk.4 @USE_APPLETALK_TRUE@man_MANS = $(ATALK_MANS) EXTRA_DIST = $(ATALK_MANS) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/man4/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign man/man4/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man4: $(man4_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man4dir)" || $(MKDIR_P) "$(DESTDIR)$(man4dir)" @list='$(man4_MANS) $(dist_man4_MANS) $(nodist_man4_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.4*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 4*) ;; \ *) ext='4' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man4dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man4dir)/$$inst"; \ done uninstall-man4: @$(NORMAL_UNINSTALL) @list='$(man4_MANS) $(dist_man4_MANS) $(nodist_man4_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.4*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 4*) ;; \ *) ext='4' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man4dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man4dir)/$$inst"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man4dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-man4 install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man4 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man4 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-man uninstall-man4 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/man/man4/atalk.40000644000175200017500000000463311704763240013050 00000000000000'\" t .\" Title: atalk .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 17 Dec 1991 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "ATALK" "4" "17 Dec 1991" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" atalk \- AppleTalk protocol family .SH "SYNOPSIS" .sp .ft B .nf #include #include .fi .ft .SH "DESCRIPTION" .PP The AppleTalk protocol family is a collection of protocols layered above the Datagram Delivery Protocol (DDP), and using AppleTalk address format\&. The AppleTalk family may provide SOCK_STREAM (ADSP), SOCK_DGRAM (DDP), SOCK_RDM (ATP), and SOCK_SEQPACKET (ASP)\&. Currently, only DDP is implemented in the kernel; ATP and ASP are implemented in user level libraries; and ADSP is planned\&. .SH "ADDRESSING" .PP AppleTalk addresses are three byte quantities, stored in network byte order\&. The include file <\fBnetatalk/at\&.h\fR> defines the AppleTalk address format\&. .PP Sockets in the AppleTalk protocol family use the following address structure: .sp .if n \{\ .RS 4 .\} .nf struct sockaddr_at { short sat_family; u_char sat_port; struct at_addr sat_addr; char sat_zero[ 8 ]; }; .fi .if n \{\ .RE .\} .PP The port of a socket may be set with \fBbind\fR(2)\&. The node for \fBbind\fR must always be \fBATADDR_ANYNODE\fR: ``this node\&.\'\' The net may be \fBATADDR_ANYNET\fR or \fBATADDR_LATENET\fR\&. \fBATADDR_ANYNET\fR coresponds to the machine\'s ``primary\'\' address (the first configured)\&. \fBATADDR_LATENET\fR causes the address in outgoing packets to be determined when a packet is sent, i\&.e\&. determined late\&. \fBATADDR_LATENET\fR is equivalent to opening one socket for each network interface\&. The port of a socket and either the primary address or \fBATADDR_LATENET\fR are returned with \fBgetsockname\fR(2)\&. .SH "SEE ALSO" .PP \fBbind\fR(2), \fBgetsockname\fR(2), \fBatalkd\fR(8)\&. netatalk-2.2.2/man/man1/0000777000175200017500000000000011704770430011741 500000000000000netatalk-2.2.2/man/man1/Makefile.am0000644000175200017500000000175411655731245013726 00000000000000# Makefile.am for man/man1/ pkgconfdir = @PKGCONFDIR@ SUFFIXES= .tmpl . .tmpl: sed -e s@:SBINDIR:@${sbindir}@ \ -e s@:BINDIR:@${bindir}@ \ -e s@:ETCDIR:@${pkgconfdir}@ \ -e s@:LIBDIR:@${libdir}@ \ -e s@:DEFAULT_CNID_SCHEME:@${DEFAULT_CNID_SCHEME}@ \ <$< >$@ GENERATED_MANS = uniconv.1 asip-status.pl.1 afpldaptest.1 TEMPLATE_FILES = uniconv.1.tmpl asip-status.pl.1.tmpl afpldaptest.1.tmpl NONGENERATED_MANS = ad.1 \ afppasswd.1 \ apple_dump.1 \ dbd.1 \ hqx2bin.1 \ macbinary.1 \ macusers.1 \ megatron.1 \ netatalk-config.1 \ single2bin.1 \ unbin.1 \ unhex.1 \ unsingle.1 ATALK_MANS = aecho.1 \ getzones.1 \ nbp.1 \ nbplkup.1 \ nbprgstr.1 \ nbpunrgstr.1 \ pap.1 \ papstatus.1 \ psorder.1 if USE_APPLETALK NONGENERATED_MANS += $(ATALK_MANS) endif man_MANS = $(GENERATED_MANS) $(NONGENERATED_MANS) CLEANFILES = $(GENERATED_MANS) EXTRA_DIST = $(TEMPLATE_FILES) $(NONGENERATED_MANS) $(ATALK_MANS) netatalk-2.2.2/man/man1/asip-status.pl.1.tmpl0000644000175200017500000000663011704763240015607 00000000000000'\" t .\" Title: asip-status.pl .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 02 Sep 2011 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "ASIP\-STATUS\&.PL" "1" "02 Sep 2011" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" asip-status.pl \- Queries AFP servers for their capabilities .SH "SYNOPSIS" .HP \w'\fBasip\-status\&.pl\fR\fB\fR\ 'u \fBasip\-status\&.pl\fR\fB\fR [\-d] [\-i] [\-x] HOSTNAME[:PORT] .br .HP \w'\fBasip\-status\&.pl\fR\fB\fR\ 'u \fBasip\-status\&.pl\fR\fB\fR \-v | \-version | \-\-version .SH "DESCRIPTION" .PP \fBasip\-status\&.pl\fR is a perl script that sends a FPGetSrvrInfo request to an AFP server at HOSTNAME:PORT and displays the results, namely "Machine type", the server\'s name, supported AFP versions, UAMs and AFP flags, the "server signature" and the network addresses, the server provides AFP services on\&. .PP When you don\'t supply :PORT, then the default AFP port, 548, will be used\&. .SH "OPTIONS" .PP \fB\-d\fR .RS 4 Enable debug output\&. .RE .PP \fB\-i\fR .RS 4 Show icon if it exists\&. .RE .PP \fB\-x\fR .RS 4 Enable hex dump output\&. .RE .PP \fB\-v, \-version, \-\-version\fR .RS 4 Show version\&. .RE .SH "EXAMPLES" .PP .if n \{\ .RS 4 .\} .nf \fBasip\-status\&.pl\fR 192\&.168\&.21\&.2 AFP reply from 192\&.168\&.21\&.2:548 Flags: 1 Cmd: 3 ID: 57005 Reply: DSIGetStatus Request ID: 57005 Machine type: Macintosh AFP versions: AFPVersion 1\&.1,AFPVersion 2\&.0,AFPVersion 2\&.1,AFP2\&.2 UAMs: Cleartxt passwrd,Randnum exchange,2\-Way Randnum exchange Flags: SupportsCopyFile,SupportsChgPwd,SupportsServerMessages, SupportsServerSignature,SupportsTCP/IP,SupportsSuperClient Server name: PowerMac 9600/200 Signature: 04 c1 6e 59 04 c1 6e 59 04 c1 6e 59 04 c1 6e 59 \&.\&.nY\&.\&.nY\&.\&.nY\&.\&.nY Network address: 192\&.168\&.21\&.2:548 (tcp/ip address and port) Network address: 10\&.20 (ddp address) .fi .if n \{\ .RE .\} .PP .if n \{\ .RS 4 .\} .nf \fBasip\-status\&.pl\fR myserver:10548 AFP reply from myserver:10548 Flags: 1 Cmd: 3 ID: 57005 Reply: DSIGetStatus Request ID: 57005 Machine type: Netatalk AFP versions: AFPVersion 1\&.1,AFPVersion 2\&.0,AFPVersion 2\&.1,AFP2\&.2,AFPX03, AFP3\&.1 UAMs: Cleartxt passwrd,Randnum exchange,2\-Way Randnum exchange,DHCAST128 Flags: SupportsCopyFile,SupportsServerMessages,SupportsServerSignature, SupportsTCP/IP,SupportsSrvrNotifications,SupportsOpenDirectory, SupportsUTF8Servername,SupportsSuperClient Server name: Fire V480 Signature: 83 29 cc 60 83 29 cc 60 83 29 cc 60 83 29 cc 60 \&.)\&.`\&.)\&.`\&.)\&.`\&.)\&.` Network address: 192\&.168\&.21\&.1:10548 (TCP/IP address and port) Network address: 65282\&.142 (ddp address) UTF8 Servername: Fire V480 .fi .if n \{\ .RE .\} .SH "REPORTING BUGS" .PP Report bugs to the Netatalk\-devel list \&. netatalk-2.2.2/man/man1/Makefile.in0000644000175200017500000003353611703521730013730 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for man/man1/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @USE_APPLETALK_TRUE@am__append_1 = $(ATALK_MANS) subdir = man/man1 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgconfdir = @PKGCONFDIR@ SUFFIXES = .tmpl . GENERATED_MANS = uniconv.1 asip-status.pl.1 afpldaptest.1 TEMPLATE_FILES = uniconv.1.tmpl asip-status.pl.1.tmpl afpldaptest.1.tmpl NONGENERATED_MANS = ad.1 afppasswd.1 apple_dump.1 dbd.1 hqx2bin.1 \ macbinary.1 macusers.1 megatron.1 netatalk-config.1 \ single2bin.1 unbin.1 unhex.1 unsingle.1 $(am__append_1) ATALK_MANS = aecho.1 \ getzones.1 \ nbp.1 \ nbplkup.1 \ nbprgstr.1 \ nbpunrgstr.1 \ pap.1 \ papstatus.1 \ psorder.1 man_MANS = $(GENERATED_MANS) $(NONGENERATED_MANS) CLEANFILES = $(GENERATED_MANS) EXTRA_DIST = $(TEMPLATE_FILES) $(NONGENERATED_MANS) $(ATALK_MANS) all: all-am .SUFFIXES: .SUFFIXES: .tmpl . $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/man1/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign man/man1/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-man1 install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-man uninstall-man1 .tmpl: sed -e s@:SBINDIR:@${sbindir}@ \ -e s@:BINDIR:@${bindir}@ \ -e s@:ETCDIR:@${pkgconfdir}@ \ -e s@:LIBDIR:@${libdir}@ \ -e s@:DEFAULT_CNID_SCHEME:@${DEFAULT_CNID_SCHEME}@ \ <$< >$@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/man/man1/pap.10000644000175200017500000001014511704763240012521 00000000000000'\" t .\" Title: pap .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 6 May 2002 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "PAP" "1" "6 May 2002" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" pap \- client interface to remote printers using Printer Access Protocol .SH "SYNOPSIS" .HP \w'\fBpap\fR\fB\fR\ 'u \fBpap\fR\fB\fR [\-A\ \fIaddress\fR] [\-c] [\-d] [\-e] [\-E] [\-p\ \fInbpname\fR] [\-s\ \fIstatusfile\fR] [\-w] [\-W] [\fIFILES\fR] .SH "DESCRIPTION" .PP \fBpap\fR is used to connect and send files to an AppleTalk connected printer using the Apple Printer Access Protocol (PAP)\&. When \fBpap\fR starts execution, it tries to open a session with the printer using PAP, and then downloads the \fIfiles\fR to the printer\&. .PP If no \fIfiles\fR are given on the command line, \fBpap\fR begins reading from standard input\&. .PP If no printer is specified on the command line, \fBpap\fR looks for a file called \fB\&.paprc\fR in the current working directory and reads it to obtain the \fInbpname\fR of a printer\&. Blank lines and lines that begin with a `\fB#\fR\' are ignored\&. \fItype\fR and \fIzone\fR default to \fBLaserWriter\fR and the zone of the local host, respectively\&. .PP Note that \fBpap\fR is designed to be useful as a communication filter for sending \fBlpd\fR(8) spooled print jobs to AppleTalk connected printers\&. See \fBpsf\fR(8) for hints on how to use it this way\&. .SH "OPTIONS" .PP \fB\-A \fR\fIaddress\fR .RS 4 Connect to the printer with Appletalk address \fIaddress\fR and do not consult the \fB\&.paprc\fR file to find a printer name\&. See \fBatalk_aton\fR(3) for the syntax of \fIaddress\fR\&. .RE .PP \fB\-c\fR .RS 4 Take cuts\&. The PAP protocol specified a simple queuing procedure, such that the clients tell the printer how long they have been waiting to print\&. This option causes \fBpap\fR to lie about how long it has been waiting\&. .RE .PP \fB\-d\fR .RS 4 Enable debug output\&. .RE .PP \fB\-e\fR .RS 4 Send any message from the printer to stderr instead of stdout\&. \fBpsf\fR(8) invokes \fBpap\fR with this option\&. .RE .PP \fB\-E\fR .RS 4 Don\'t wait for EOF from the printer\&. This option is useful for printers which don\'t implement PAP correctly\&. In a correct implementation, the client side should wait for the printer to return EOF before closing the connection\&. Some clients don\'t wait, and hence some printers have related bugs in their implementation\&. .RE .PP \fB\-p\fR \fInbpname\fR .RS 4 Connect to the printer named \fInbpname\fR and do not consult the \fB\&.paprc\fR file to find a printer name\&. See \fBnbp_name\fR(3) for the syntax of \fInbpname\fR\&. .RE .PP \fB\-s\fR \fIstatusfile\fR .RS 4 Update the file called \fIstatusfile\fR to contain the most recent status message from the printer\&. \fBpap\fR gets the status from the printer when it is waiting for the printer to process input\&. The \fIstatusfile\fR will contain a single line terminated with a newline\&. This is useful when \fBpap\fR is invoked by \fBpsf\fR(8) within \fBlpd\fR\'s spool directory\&. .RE .PP \fB\-w\fR .RS 4 Wait for the printer status to contain the word "waiting" before sending the job\&. This is to defeat printer\-side spool available on HP IV and V printers\&. .RE .PP \fB\-W\fR .RS 4 Wait for the printer status to contain the word "idle" before sending the job\&. This is to defeat printer\-side spool available on HP IV and V printers\&. .RE .SH "FILES" .PP \fB\&.paprc\fR .RS 4 file read to obtain printer name if not specified on command line .RE .SH "SEE ALSO" .PP \fBnbp_name\fR(3), \fBatalk_aton\fR(3), \fBlpd\fR(8), \fBpsf\fR(8)\&. netatalk-2.2.2/man/man1/unhex.10000644000175200017500000000002411704763240013063 00000000000000.so man1/megatron.1 netatalk-2.2.2/man/man1/afpldaptest.1.tmpl0000644000175200017500000000272111704763240015224 00000000000000'\" t .\" Title: afpldaptest .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 30 Mar 2011 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "AFPLDAPTEST" "1" "30 Mar 2011" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" afpldaptest \- Syntactically check an afp_ldap\&.conf .SH "SYNOPSIS" .HP \w'\fBafpldaptest\fR\fB\fR\fBafpldaptest\fR\fB\fR\ 'u \fBafpldaptest\fR\fB\fR {\-u\ \fIUSER\fR | \-g\ \fIGROUP\fR | \-i\ \fIUUID\fR} .br \fBafpldaptest\fR\fB\fR {\-h | \-? | \-:} .SH "DESCRIPTION" .PP \fBafpldaptest\fR is a simple command to syntactically check :ETCDIR:/afp_ldap\&.conf\&. .SH "OPTIONS" .PP \fB\-u\fR \fIUSER\fR .RS 4 Show uuid for \fIUSER\fR\&. .RE .PP \fB\-g\fR \fIGROUP\fR .RS 4 Show uuid for \fIGROUP\fR\&. .RE .PP \fB\-i\fR \fIUUID\fR .RS 4 Show user, group or local\-uuid for \fIUUID\fR\&. .RE .PP \fB\-h, \-?, \-:\fR .RS 4 Show the help and exit\&. .RE .SH "SEE ALSO" .PP \fBafp_ldap.conf\fR(5) netatalk-2.2.2/man/man1/nbprgstr.10000644000175200017500000000001711704763240013577 00000000000000.so man1/nbp.1 netatalk-2.2.2/man/man1/ad.10000644000175200017500000001571211704763240012332 00000000000000'\" t .\" Title: ad .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 02 Sep 2011 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "AD" "1" "02 Sep 2011" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" ad \- Netatalk compatible UNIX file utility suite\&. .SH "SYNOPSIS" .HP \w'\fBad\fR\ 'u \fBad\fR {ls\ |\ cp\ |\ mv\ |\ rm} [\&.\&.\&.] .HP \w'\fBad\fR\ 'u \fBad\fR {\-v\ |\ \-\-version} .SH "DESCRIPTION" .PP \fBad\fR is a UNIX file utlity suite with Netatalk compatibity\&. AppleDouble files in \&.AppleDouble directories and the CNID databases are updated as appropiate\&. .SH "AVAILABLE COMMANDS" .HP \w'\fBad\ ls\fR\ 'u \fBad ls\fR [\-dRl\ [u]] {file|dir\ [\&.\&.\&.]} .PP List files and directories\&. .HP \w'\fBad\ cp\fR\ 'u \fBad cp\fR [\-aipvf] {src_file} {dst_file} .HP \w'\fBad\ cp\ \-R\fR\ 'u \fBad cp \-R\fR [\-aipvf] {src_file|src_directory\ \&.\&.\&.} {dst_directory} .PP Copy files and directories\&. .HP \w'\fBad\ mv\fR\ 'u \fBad mv\fR [\-finv] {src_file} {dst_file} .HP \w'\fBad\ mv\fR\ 'u \fBad mv\fR [\-finv] {src_file|src_directory\ \&.\&.\&.} {dst_directory} .PP Move files and directories\&. .HP \w'\fBad\ rm\fR\ 'u \fBad rm\fR [\-Rv] {file|directory} .HP \w'\fBad\ \-v|\-\-version\fR\ 'u \fBad \-v|\-\-version\fR .PP Show version\&. .SH "AD LS" .PP List files and directories\&. Options: .PP \-d .RS 4 Directories are listed as plain files .RE .PP \-R .RS 4 list subdirectories recursively .RE .PP \-l .RS 4 Long output, list AFP info .RE .PP \-u .RS 4 List UNIX info .RE .PP \fILong output description\fR .sp .if n \{\ .RS 4 .\} .nf FinderFlags (valid for (f)iles and/or (d)irectories): d = On Desktop (f/d) e = Hidden extension (f/d) m = Shared (can run multiple times) (f) n = No INIT resources (f) i = Inited (f/d) c = Custom icon (f/d) t = Stationery (f) s = Name locked (f/d) b = Bundle (f/d) v = Invisible (f/d) a = Alias file (f/d) AFP Attributes: y = System (f/d) w = No write (f) p = Needs backup (f/d) r = No rename (f/d) l = No delete (f/d) o = No copy (f) Note: any letter appearing in uppercase means the flag is set but it\'s a directory for which the flag is not allowed\&. .fi .if n \{\ .RE .\} .SH "AD CP" .PP Copy files and directories\&. .PP In the first synopsis form, the cp utility copies the contents of the source_file to the target_file\&. In the second synopsis form, the contents of each named source_file is copied to the destination target_directory\&. The names of the files themselves are not changed\&. If cp detects an attempt to copy a file to itself, the copy will fail\&. .PP Netatalk AFP volumes are detected by means of their "\&.AppleDesktop" directory which is located in their volume root\&. When a copy targetting an AFP volume is detected, its CNID database daemon is connected and all copies will also go through the CNID database\&. AppleDouble files are also copied and created as needed when the target is an AFP volume\&. .PP Options: .PP \-a .RS 4 Archive mode\&. Same as \-Rp\&. .RE .PP \-f .RS 4 For each existing destination pathname, remove it and create a new file, without prompting for confirmation regardless of its permis\- sions\&. (The \-f option overrides any previous \-i or \-n options\&.) .RE .PP \-i .RS 4 Cause cp to write a prompt to the standard error output before copying a file that would overwrite an existing file\&. If the response from the standard input begins with the character \'y\' or \'Y\', the file copy is attempted\&. (The \-i option overrides any pre\- vious \-f or \-n options\&.) .RE .PP \-n .RS 4 Do not overwrite an existing file\&. (The \-n option overrides any previous \-f or \-i options\&.) .RE .PP \-p .RS 4 Cause cp to preserve the following attributes of each source file in the copy: modification time, access time, file flags, file mode, user ID, and group ID, as allowed by permissions\&. If the user ID and group ID cannot be preserved, no error message is displayed and the exit value is not altered\&. .RE .PP \-R .RS 4 If source_file designates a directory, cp copies the directory and the entire subtree connected at that point\&.If the source_file ends in a /, the contents of the directory are copied rather than the directory itself\&. .RE .PP \-v .RS 4 Cause cp to be verbose, showing files as they are copied\&. .RE .PP \-x .RS 4 File system mount points are not traversed\&. .RE .SH "AD MV" .PP Move files and directories\&. .PP Move files around within an AFP volume, updating the CNID database as needed\&. If either: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} source or destination is not an AFP volume .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} source AFP volume != destination AFP volume .RE .sp .RE the files are copied and removed from the source\&. .PP Options: .PP \-f .RS 4 Do not prompt for confirmation before overwriting the destination path\&. (The \-f option overrides any previous \-i or \-n options\&.) .RE .PP \-i .RS 4 Cause mv to write a prompt to standard error before moving a file that would overwrite an existing file\&. If the response from the standard input begins with the character `y\' or `Y\', the move is attempted\&. (The \-i option overrides any previous \-f or \-n options\&.) .RE .PP \-n .RS 4 Do not overwrite an existing file\&. (The \-n option overrides any previous \-f or \-i options\&.) .RE .PP \-v .RS 4 Cause mv to be verbose, showing files after they are moved\&. .RE .SH "AD RM" .PP Remove files and directories\&. .PP The rm utility attempts to remove the non\-directory type files specified on the command line\&. If the files and directories reside on an AFP volume, the corresponding CNIDs are deleted from the volumes database\&. .PP The options are as follows: .PP \-R .RS 4 Attempt to remove the file hierarchy rooted in each file argument\&. .RE .PP \-v .RS 4 Be verbose when deleting files, showing them as they are removed\&. .RE .SH "REPORTING BUGS" .PP Report bugs to the Netatalk\-devel list \&. .SH "SEE ALSO" .PP \fBdbd\fR(1), \fBapple_dump\fR(1)\&. netatalk-2.2.2/man/man1/nbpunrgstr.10000644000175200017500000000001711704763240014142 00000000000000.so man1/nbp.1 netatalk-2.2.2/man/man1/nbplkup.10000644000175200017500000000001711704763240013411 00000000000000.so man1/nbp.1 netatalk-2.2.2/man/man1/single2bin.10000644000175200017500000000002411704763240013770 00000000000000.so man1/megatron.1 netatalk-2.2.2/man/man1/nbp.10000644000175200017500000000544311704763240012525 00000000000000'\" t .\" Title: nbp .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 24 June 2004 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "NBP" "1" "24 June 2004" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" nbp, nbplkup, nbprgstr, nbpunrgstr \- access NBP database .SH "SYNOPSIS" .HP \w'\fBnbplkup\fR\fB\fR\fB\fR\fB\ \fR\ 'u \fBnbplkup\fR\fB\fR\fB\fR\fB \fR [\-r\ \fImaxresponses\fR] [\-A\ \fIaddress\fR] [\-m\ \fImaccodepage\fR] \fInbpname\fR .HP \w'\fBnbprgstr\fR\fB\fR\fB\ \fR\ 'u \fBnbprgstr\fR\fB\fR\fB \fR [\-A\ \fIaddress\fR] [\-p\ \fIport\fR] [\-m\ \fImaccodepage\fR] \fInbpname\fR .HP \w'\fBnbpunrgstr\fR\fB\fR\fB\ \fR\ 'u \fBnbpunrgstr\fR\fB\fR\fB \fR [\-A\ \fIaddress\fR] [\-m\ \fImaccodepage\fR] \fInbpname\fR .SH "DESCRIPTION" .PP \fBnbprgstr\fR registers \fInbpname\fR with \fBatalkd\fR(8), at the given \fIport\fR\&. \fBnbpunrgstr\fR informs \fBatalkd\fR that \fInbpname\fR is no longer to be advertised\&. .PP \fBnbplkup\fR displays up to \fImaxresponses\fR (default 1000) entities registered on the AppleTalk internet\&. \fI\fInbpname\fR\fR is parsed by \fBnbp_name\fR(3)\&. An `\fB=\fR\' for the \fIobject\fR or \fItype\fR matches anything, and an `\fB*\fR\' for \fIzone\fR means the local zone\&. The default values are taken from the \fBNBPLKUP\fR environment variable, parsed as an \fInbpname\fR\&. .SH "ENVIRONMENT VARIABLES" .PP NBPLKUP .RS 4 default nbpname for nbplkup .RE .PP ATALK_MAC_CHARSET .RS 4 the codepage used by the clients on the Appletalk network .RE .PP ATALK_UNIX_CHARSET .RS 4 the codepage used to display extended characters on this shell\&. .RE .SH "EXAMPLE" .PP Find all devices of type \fBLaserWriter\fR in the local zone\&. .sp .if n \{\ .RS 4 .\} .nf example% \fBnbplkup :LaserWriter\fR Petoskey:LaserWriter 7942\&.129:218 Gloucester:LaserWriter 8200\&.188:186 Rahway:LaserWriter 7942\&.2:138 517 Center:LaserWriter 7942\&.2:132 ionia:LaserWriter 7942\&.2:136 Evil DEC from Hell:LaserWriter 7942\&.2:130 Hamtramck:LaserWriter 7942\&.2:134 Iron Mountain :LaserWriter 7942\&.128:250 example% .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP \fBnbp_name\fR(3), \fBatalkd\fR(8)\&. netatalk-2.2.2/man/man1/getzones.10000644000175200017500000000311611704763240013577 00000000000000'\" t .\" Title: getzones .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 17 Dec 1991 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "GETZONES" "1" "17 Dec 1991" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" getzones \- list AppleTalk zone names .SH "SYNOPSIS" .HP \w'\fBgetzones\fR\fB\fR\ 'u \fBgetzones\fR\fB\fR [\-m | \-l] [\fIaddress\fR] .SH "DESCRIPTION" .PP \fBGetzones\fR is used to obtain a list of AppleTalk zone names using the Zone Information Protocol (ZIP)\&. It sends a GetZoneList request to an AppleTalk router\&. By default, it sends the request to the locally running \fBatalkd\fR(8)\&. .SH "OPTIONS" .PP \fB\-m\fR .RS 4 List the name of the local zone only; this is accomplished by sending a ZIP GetMyZone request\&. .RE .PP \fB\-l\fR .RS 4 List the local zones; this is accomplished by sending a GetLocalZones request\&. .RE .PP \fIaddress\fR .RS 4 Contact the AppleTalk router at \fIaddress\&.\fR \fIaddress\fR is parsed by \fBatalk_aton\fR(3)\&. .RE .SH "SEE ALSO" .PP \fBatalk_aton\fR(3), \fBatalkd\fR(8)\&. netatalk-2.2.2/man/man1/uniconv.1.tmpl0000644000175200017500000001244411704763240014401 00000000000000'\" t .\" Title: uniconv .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 24 Jun 2004 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "UNICONV" "1" "24 Jun 2004" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" uniconv \- convert Netatalk volume encoding .SH "SYNOPSIS" .HP \w'\fBuniconv\fR\fB\fR\ 'u \fBuniconv\fR\fB\fR [\-ndv] \-c\ \fIcnidbackend\fR \-f\ \fIfromcode\fR \-t\ \fItocode\fR [\-m\ \fImaccode\fR] \fIvolumepath\fR .SH "DESCRIPTION" .PP \fBuniconv\fR converts the volume encoding of \fIvolumepath\fR from the \fIfromcode\fR to the \fItocode\fR encoding\&. .SH "OPTIONS" .PP \-c .RS 4 CNID backend used on this volume, usually cdb or dbd\&. Should match the backend selected with afpd for this volume\&. If not specified, the default CNID backend `:DEFAULT_CNID_SCHEME:\' is used .RE .PP \-d .RS 4 don\'t CAP encode leading dots (:2e), equivalent to \fBusedots\fR in \fBAppleVolumes.default\fR(5) .RE .PP \-f .RS 4 encoding to convert from, use ASCII for CAP encoded volumes .RE .PP \-h .RS 4 display help .RE .PP \-m .RS 4 Macintosh client codepage, required for CAP encoded volumes\&. Defaults to `MAC_ROMAN\' .RE .PP \-n .RS 4 `dry run\', don\'t do any real changes .RE .PP \-t .RS 4 volume encoding to convert to, e\&.g\&. UTF8 .RE .PP \-v .RS 4 verbose output, use twice for maximum logging\&. .RE .PP \-V .RS 4 print version and exit .RE .PP .SH "WARNING" .PP Setting the wrong options might render your data unusable!!! Make sure you know what you are doing\&. Always backup your data first\&. .PP It is \fB*strongly*\fR recommended to do a `dry run\' first and to check the output for conversion errors\&. .PP \fBafpd\fR(8) should \fInot\fR be running while you change the volume encoding\&. Remember to change \fBvolcodepage\fR in \fBAppleVolumes.default\fR(5) to the new codepage, before restarting afpd\&. .PP In case of \fBMacChineseTraditional\fR, \fBMacJapanese\fR or \fBMacKorean\fR, uniconv cannot be used\&. .PP \fBUSE AT YOUR OWN RISK!!!\fR .SH "SELECTABLE CHARSETS" .PP Netatalk provides internal support for UTF\-8 (pre\- and decomposed) and CAP\&. If you want to use other charsets, they must be provided by \fBiconv\fR(1) .PP \fBuniconv\fR also knows iso\-8859\&.adapted, an old style 1\&.x NLS widely used\&. This is only intended for upgrading old volumes, \fBafpd\fR(8) cannot handle iso\-8859\&.adapted anymore\&. .SH "CNID BACKGROUND" .PP The CNID backends maintains name to ID mappings\&. If you change a filename outside afpd(8) (shell, samba), the CNID db, i\&.e\&. the DIDNAME index, gets inconsistent\&. Netatalk tries to recover from such inconsistencies as gracefully as possible\&. The mechanisms to resolve such inconsistencies may fail sometimes, though, as this is not an easy task to accomplish\&. I\&.e\&. if several names in the path to the file or directory have changed, things may go wrong\&. .PP If you change a lot of filenames at once, chances are higher that the afpds fallback mechanisms fail, i\&.e\&. files will be assigned new IDs, even though the file hasn\'t changed\&. \fBuniconv\fR therefore updates the CNID entry for each file/directory directly after it changes the name to avoid inconsistencies\&. The two supported backends for volumes, dbd and cdb, use the same CNID db format\&. Therefore, you \fIcould\fR use \fBuniconv\fR with cdb and \fBafpd\fR with dbd later\&. .PP \fBWarning\fR: There must not be two processes opening the CNID database using different backends at once! If a volume is still opened with dbd (cnid_metad/cnid_dbd) and you start \fBuniconv\fR with cdb, the result will be a corrupted CNID database, as the two backends use different locking schemes\&. You might run into additional problems, e\&.g\&. if dbd is compiled with transactions, cdb will not update the transaction logs\&. .PP In general, it is recommended to use the same backend for \fBuniconv\fR you are using with \fBafpd\fR(8)\&. .SH "EXAMPLES" .PP convert 1\&.x CAP encoded volume to UTF\-8, clients used MacRoman codepage, cnidscheme is dbd: .sp .if n \{\ .RS 4 .\} .nf example%\fB uniconv \-c dbd \-f ASCII \-t UTF8 \-m MAC_ROMAN /path/to/share\fR .fi .if n \{\ .RE .\} .PP convert iso8859\-1 volume to UTF\-8, cnidscheme is cdb: .sp .if n \{\ .RS 4 .\} .nf example%\fB uniconv \-c cdb \-f ISO\-8859\-1 \-t UTF8 \-m MAC_ROMAN /path/to/share\fR .fi .if n \{\ .RE .\} .PP convert 1\&.x volume using iso8859\-1 adapted NLS to CAP encoding: .sp .if n \{\ .RS 4 .\} .nf example%\fB uniconv \-f ISO\-8859\-ADAPTED \-t ASCII \-m MAC_ROMAN/path/to/share\fR .fi .if n \{\ .RE .\} .PP convert UTF\-8 volume to CAP, for MacCyrillic clients: .sp .if n \{\ .RS 4 .\} .nf example%\fB uniconv \-f UTF8 \-t ASCII \-m MAC_CYRILLIC /path/to/share\fR .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP \fBAppleVolumes.default\fR(5),\fBafpd\fR(8),\fBiconv\fR(1),\fBcnid_metad\fR(8),\fBcnid_dbd\fR(8) netatalk-2.2.2/man/man1/macbinary.10000644000175200017500000000002411704763240013701 00000000000000.so man1/megatron.1 netatalk-2.2.2/man/man1/psorder.10000644000175200017500000000425711704763240013426 00000000000000'\" t .\" Title: psorder .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 17 Dec 1991 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "PSORDER" "1" "17 Dec 1991" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" psorder \- PostScript pageorder filter .SH "SYNOPSIS" .HP \w'\fBpsorder\fR\fB\fR\ 'u \fBpsorder\fR\fB\fR [\-duf] \fIsourcefile\fR .SH "DESCRIPTION" .PP \fBpsorder\fR is a filter that re\-orders the pages of a PostScript document\&. The result is written to the standard output\&. By default, documents are processed into ascending order (the lowest numbered page is printed first)\&. Some PostScript documents specify that the order of their pages should never be changed; the default action of \fBpsorder\fR is to follow this specification\&. .PP If no source file is given, or if \fIsourcefile\fR is `\fB\-\fR\', \fBpsorder\fR reads from the standard input file\&. .SH "OPTIONS" .PP \fB\-d\fR .RS 4 Re\-order the pages of the document in downward or descending order\&. This is typically used to change the order of a document to be printed by a printer that stacks pages face\-up, such as an Apple LaserWriter or LaserWriter Plus\&. .RE .PP \fB\-u\fR .RS 4 Specifies forward order, and is the default\&. It is used to try and ensure the correct ordering when a document will be printed by a printer that stacks the pages face\-down\&. .RE .PP \fB\-f\fR .RS 4 Force \fBpsorder\fR to re\-order the pages, even if the document claims that its page order is not to be trifled with\&. This option should only be used experimentally, as it may cause documents to print incorrectly\&. .RE .SH "SEE ALSO" .PP \fBpsf\fR(8), \fBlpr\fR(1)\&. netatalk-2.2.2/man/man1/hqx2bin.10000644000175200017500000000002411704763240013307 00000000000000.so man1/megatron.1 netatalk-2.2.2/man/man1/aecho.10000644000175200017500000000462211704763240013023 00000000000000'\" t .\" Title: aecho .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 17 Dec 1991 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "AECHO" "1" "17 Dec 1991" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" aecho \- send AppleTalk Echo Protocol packets to network hosts .SH "SYNOPSIS" .PP \fBaecho\fR\fB\fR\fB\fR [ \fB\-c\fR\fI count\fR ] ( \fBaddress\fR | \fBnbpname\fR ) .SH "DESCRIPTION" .PP \fBaecho\fR repeatedly sends an Apple Echo Protocol (AEP) packet to the host specified by the given AppleTalk \fBaddress\fR or \fBnbpname\fR and reports whether a reply was received\&. Requests are sent at the rate of one per second\&. .PP \fBaddress\fR is parsed by \fBatalk_aton\fR(3)\&. \fBnbpname\fR is parsed by \fBnbp_name\fR(3)\&. The nbp type defaults to `\fBWorkstation\fR\'\&. .PP When \fBaecho\fR is terminated, it reports the number of packets sent, the number of responses received, and the percentage of packets lost\&. If any responses were received, the minimum, average, and maximum round trip times are reported\&. .SH "EXAMPLE" .PP Check to see if a particular host is up and responding to AEP packets: .sp .if n \{\ .RS 4 .\} .nf example% \fBaecho bloodsport \fR\fB11 bytes from 8195\&.13: aep_seq=0\&. time=10\&. ms 11 bytes from 8195\&.13: aep_seq=1\&. time=10\&. ms 11 bytes from 8195\&.13: aep_seq=2\&. time=10\&. ms 11 bytes from 8195\&.13: aep_seq=3\&. time=10\&. ms 11 bytes from 8195\&.13: aep_seq=4\&. time=10\&. ms 11 bytes from 8195\&.13: aep_seq=5\&. time=9\&. ms\fR\fB \fR\fB\fB^C\fR\fR\fB \fR\fB\-\-\-\-8195\&.13 AEP Statistics\-\-\-\- 6 packets sent, 6 packets received, 0% packet loss round\-trip (ms) min/avg/max = 9/9/10 \fR .fi .if n \{\ .RE .\} .SH "OPTIONS" .PP \fB\-c\fR\fI count\fR .RS 4 Stop after \fIcount\fR packets\&. .RE .SH "SEE ALSO" .PP \fBping\fR(1), \fBatalk_aton\fR(3), \fBnbp_name\fR(3), \fBaep\fR(4), \fBatalkd\fR(8)\&. netatalk-2.2.2/man/man1/unbin.10000644000175200017500000000002411704763240013047 00000000000000.so man1/megatron.1 netatalk-2.2.2/man/man1/unsingle.10000644000175200017500000000002411704763240013560 00000000000000.so man1/megatron.1 netatalk-2.2.2/man/man1/apple_dump.10000644000175200017500000000452011704763240014067 00000000000000'\" t .\" Title: apple_dump .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 02 Sep 2011 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "APPLE_DUMP" "1" "02 Sep 2011" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" apple_dump \- Dump AppleSingle/AppleDouble format file .SH "SYNOPSIS" .HP \w'\fBapple_dump\fR\fB\fR\fBapple_dump\fR\fB\fR\fBapple_dump\fR\fB\fR\fBapple_dump\fR\fB\fR\fBapple_dump\fR\fB\fR\ 'u \fBapple_dump\fR\fB\fR [\-a] \fIFILE\fR | \fIDIR\fR .br \fBapple_dump\fR\fB\fR \-f \fIFILE\fR .br \fBapple_dump\fR\fB\fR \-d \fIFILE\fR .br \fBapple_dump\fR\fB\fR \-h | \-help | \-\-help .br \fBapple_dump\fR\fB\fR \-v | \-version | \-\-version .SH "DESCRIPTION" .PP \fBapple_dump\fR dump AppleSingle/AppleDouble format file\&. .SH "OPTIONS" .PP \fB\-a\fR \fIFILE\fR|\fIDIR\fR .RS 4 This is default\&. Dump a AppleSingle/AppleDouble file for \fIFILE\fR or \fIDIR\fR automatically\&. Extrapolate FinderInfo type from absolute path\&. If FILE is not AppleSingle/AppleDouble format, look for \fI\&.AppleDouble/FILE\fR and \fI\&._FILE\fR\&. If \fIDIR\fR, look for \fIDIR/\&.AppleDouble/\&.Parent\fR and \fI\&._DIR\fR\&. .RE .PP \fB\-f\fR \fIFILE\fR .RS 4 Dump \fIFILE\fR\&. Assume FinderInfo to be FileInfo\&. .RE .PP \fB\-d\fR \fIFILE\fR .RS 4 Dump \fIFILE\fR\&. Assume FinderInfo to be DirInfo\&. .RE .PP \fB\-h, \-help, \-\-help\fR .RS 4 Display the help and exit .RE .PP \fB\-v, \-version, \-\-version\fR .RS 4 Show version and exit .RE .SH "NOTE" .PP There is no way to detect whether FinderInfo is FileInfo or DirInfo\&. By default, apple_dump examins whether file or directory, a parent directory is \&.AppleDouble, filename is \&._*, filename is \&.Parent, and so on\&. .PP If setting option \-f or \-d, assume FinderInfo and doesn\'t look for another file\&. .SH "SEE ALSO" .PP \fBad\fR(1) netatalk-2.2.2/man/man1/megatron.10000644000175200017500000000703211704763240013556 00000000000000'\" t .\" Title: megatron .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 02 Sep 2011 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "MEGATRON" "1" "02 Sep 2011" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" megatron, unhex, unbin, unsingle, hqx2bin, single2bin, macbinary \- Macintosh file format transformer .SH "SYNOPSIS" .HP \w'\fBmegatron\fR\fB\fR\fBunbin\fR\fB\fR\fBunhex\fR\fB\fR\fBunsingle\fR\fB\fR\fBhqx2bin\fR\fB\fR\fBsingle2bin\fR\fB\fR\fBmacbinary\fR\fB\fR\ 'u \fBmegatron\fR\fB\fR [\fIsourcefile\fR...] .br \fBunbin\fR\fB\fR [\fIsourcefile\fR...] .br \fBunhex\fR\fB\fR [\fIsourcefile\fR...] .br \fBunsingle\fR\fB\fR [\fIsourcefile\fR...] .br \fBhqx2bin\fR\fB\fR [\fIsourcefile\fR...] .br \fBsingle2bin\fR\fB\fR [\fIsourcefile\fR...] .br \fBmacbinary\fR\fB\fR [\fIsourcefile\fR...] .SH "DESCRIPTION" .PP \fBmegatron\fR is used to transform files from BinHex, MacBinary, AppleSingle, or \fBnetatalk\fR style AppleDouble formats into MacBinary or \fBnetatalk\fR style AppleDouble formats\&. The \fBnetatalk\fR style AppleDouble format is the file format used by \fBafpd,\fR the \fBnetatalk\fR Apple Filing Protocol (AppleShare) server\&. BinHex, MacBinary, and AppleSingle are commonly used formats for transferring Macintosh files between machines via email or file transfer protocols\&. \fBmegatron\fR uses its name to determine what type of tranformation is being asked of it\&. .PP If \fBmegatron\fR is called as \fBunhex\fR , \fBunbin\fR or \fBunsingle\fR, it tries to convert file(s) from BinHex, MacBinary, or AppleSingle into AppleDouble format\&. BinHex is the format most often used to send Macintosh files by e\-mail\&. Usually these files have an extension of "\&.hqx"\&. MacBinary is the format most often used by terminal emulators "on the fly" when transferring Macintosh files in binary mode\&. MacBinary files often have an extension of "\&.bin"\&. Some Macintosh LAN\-based email packages use uuencoded AppleSingle format to "attach" or "enclose" files in email\&. AppleSingle files don\'t have a standard filename extension\&. .PP If \fBmegatron\fR is called as \fBhqx2bin\fR, \fBsingle2bin\fR, or \fBmacbinary\fR, it will try to convert the file(s) from BinHex, AppleSingle, or AppleDouble into MacBinary\&. This last translation may be useful in moving Macintosh files from your \fBafpd\fR server to some other machine when you can\'t copy them from the server using a Macintosh for some reason\&. .PP If \fBmegatron\fR is called with any other name, it uses the default translation, namely \fBunhex\fR\&. .PP If no source file is given, or if \fIsourcefile\fR is `\fB\-\fR\', and if the conversion is from a BinHex or MacBinary file, \fBmegatron\fR will read from standard input\&. .PP The filename used to store any output file is the filename that is encoded in the source file\&. MacBinary files are created with a "\&.bin" extension\&. In the case of conflicts, the old file is overwritten! .SH "OPTIONS" .PP \fB\-v, \-\-version\fR .RS 4 Show version\&. .RE .SH "SEE ALSO" .PP \fBafpd\fR(8) netatalk-2.2.2/man/man1/macusers.10000644000175200017500000000237211704763240013566 00000000000000'\" t .\" Title: macusers .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 13 Oct 2011 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "MACUSERS" "1" "13 Oct 2011" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" macusers \- List the users connecting via AFP .SH "SYNOPSIS" .HP \w'\fBmacusers\fR\fB\fR\ 'u \fBmacusers\fR\fB\fR .HP \w'\fBmacusers\fR\fB\fR\ 'u \fBmacusers\fR\fB\fR \-v | \-version | \-\-version | \-h | \-help | \-\-help .SH "DESCRIPTION" .PP \fBmacusers\fR list the users connecting via AFP\&. .SH "OPTIONS" .PP \fB\-v, \-version, \-\-version\fR .RS 4 Show version and exit .RE .PP \fB\-h, \-help, \-\-help\fR .RS 4 Display the help and exit .RE .SH "SEE ALSO" .PP \fBafpd\fR(8) netatalk-2.2.2/man/man1/dbd.10000644000175200017500000001245011704763240012473 00000000000000'\" t .\" Title: dbd .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12 Oct 2010 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "DBD" "1" "12 Oct 2010" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" dbd \- CNID database maintenance .SH "SYNOPSIS" .HP \w'\fBdbd\fR\fB\fR\ 'u \fBdbd\fR\fB\fR [\-evx] {\-d\ [\-i] | \-s\ [\-c|\-n] | \-r\ [\-c|\-f] | \-u} \fIvolumepath\fR .SH "DESCRIPTION" .PP \fBdbd\fR can dump, scan, reindex and rebuild \fINetatalk\fR dbd CNID databases\&. It must be run with appropiate permissions i\&.e\&. as root\&. \fBdbd\fR \fB\-s|\-r\fR can be run on active volumes, but \fBdbd \-rf\fR, which wipes the db before rebuilding it, checks and enforces that the chosen volume is not in use\&. .SH "COMMANDS" .PP \-d .RS 4 Dump CNID database\&. With \fB\-i \fRdump indexes too\&. .RE .PP \-s .RS 4 Scan volume: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Compare CNIDs in database with volume .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Test if \&.AppleDouble directories exist .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Test if AppleDouble files exist .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Report orphaned AppleDouble files .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Report directories inside \&.AppleDouble directories .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Check name encoding by roundtripping, log on error .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Check for orphaned CNIDs in database (requires \fB\-e\fR) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Open and close adouble files .RE .RS 4 .PP Options: .RS 4 \fB\-c\fR Don\'t check \&.AppleDouble stuff, only check orphaned\&. \fB\-n\fR Don\'t open CNID database, skip CNID checks, only traverse filesystem .RE .RE .PP \-r .RS 4 Rebuild volume\&. With \fB\-f\fR wipe database and rebuild from CNIIDs stored in AppleDouble files\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Sync CNIDSs from database with volume .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Ensure \&.AppleDouble directories exist .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Ensure AppleDouble files exist .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Delete orphaned AppleDouble files .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Report directories inside \&.AppleDouble directories .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Check name encoding by roundtripping, log on error .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Delete orphaned CNIDs in database (requires \fB\-e\fR) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Open and close adouble files .RE .RS 4 .PP Options: .RS 4 \fB\-c\fR Don\'t create \&.AppleDouble stuff, only cleanup orphaned\&. \fB\-f\fR Wipe database and rebuild from IDs stored in AppleDouble files, only available for volumes without \fBnocnidcache\fR option\&. Implies \fB\-e\fR\&. .RE .RE .PP \-u .RS 4 Upgrade: .sp Opens the database which triggers any necessary upgrades, then closes and exits\&. .RE .SH "OPTIONS" .PP \-e .RS 4 Only work on inactive volumes and lock them (exclusive) .RE .PP \-x .RS 4 Rebuild indexes (just for completeness, mostly useless!) .RE .PP \-v .RS 4 verbose .RE .SH "WARNING" .PP In order to be able to run \fB\-rf\fR reconstructing the CNIDs in the database from the \fIAppleDouble\fR files, make sure you\'ve run a \fB\-r\fR rebuild sometimes before, where the CNIDs then would have been synched between database and \fIAppleDouble\fR files\&. .PP Also be careful about the option \fBnocnidcache\fR\&. Avoid this option if at all possible, because if prevents you from being able to use \fB\-f\fR\&. .SH "CNID BACKGROUND" .PP The CNID backends maintains name to ID mappings\&. If you change a filename outside afpd(8) (shell, samba), the CNID db will not know and not reflect that change\&. Netatalk tries to recover from such inconsistencies as gracefully as possible\&. The mechanisms to resolve such inconsistencies may fail sometimes, though, as this is not an easy task to accomplish\&. E\&.g\&. if several names in the path to the file or directory have changed, things may go wrong\&. .PP If you change a lot of filenames at once, chances are higher that the afpds fallback mechanisms fail, i\&.e\&. files will be assigned new IDs, even though the file hasn\'t changed\&. .SH "SEE ALSO" .PP \fBcnid_metad\fR(8), \fBcnid_dbd\fR(8) netatalk-2.2.2/man/man1/papstatus.10000644000175200017500000000001711655731130013760 00000000000000.so man1/pap.1 netatalk-2.2.2/man/man1/afppasswd.10000644000175200017500000000551011704763240013731 00000000000000'\" t .\" Title: afppasswd .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 31 May 2011 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "AFPPASSWD" "1" "31 May 2011" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" afppasswd \- netatalk password maintenance utility .SH "SYNOPSIS" .HP \w'\fBafppasswd\fR\fB\fR\fB\fR\ 'u \fBafppasswd\fR\fB\fR\fB\fR [\-acfn] [\-p\ \fIpasswd\fR\ \fIfile\fR] [\-u\ \fIminimum\fR\ \fIuid\fR] .SH "DESCRIPTION" .PP \fBafppasswd\fR allows the maintenance of afppasswd files created by netatalk for use by the uams_randnum\&.so UAM (providing the "Randnum exchange" and "2\-Way Randnum exchange" User Authentication Modules)\&. .PP \fBafppasswd\fR can either be called by root with parameters, or can be called by local system users with no parameters to change their AFP passwords\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP With this utility you can only change the passwords used by two specific UAMs\&. As they provide only weak password encryption, the use of the "Randnum exchange" and "2\-Way Randnum exchange" UAMs is deprecated unless one has to support very old AFP clients, that can not deal with the more secure "DHCAST128" and "DHX2" UAM instead\&. Please compare with the Authentication chapter inside Netatalk\'s documentation\&. .sp .5v .RE .SH "EXAMPLE" .PP Local user changing their own password: .sp .if n \{\ .RS 4 .\} .nf example% \fBafppasswd\fR Enter NEW AFP password: \fB(hidden)\fR Enter NEW AFP password again: \fB(hidden)\fR afppasswd: updated password\&. .fi .if n \{\ .RE .\} .SH "OPTIONS" .PP \fB\-a\fR .RS 4 Add a new user to the \fBafppasswd\fR file\&. .RE .PP \fB\-c\fR .RS 4 Create and/or initialize \fBafppasswd\fR file or specific user\&. .RE .PP \fB\-f\fR .RS 4 Force the current action\&. .RE .PP \fB\-p\fR\fI path\fR .RS 4 Path to \fBafppasswd\fR file\&. .RE .PP \fB\-n\fR .RS 4 If cracklib support is built into \fBnetatalk\fR this option will cause cracklib checking to be disabled, if the superuser does not want to have the password run against the cracklib dictionary\&. .RE .PP \fB\-u\fR\fI minimum uid\fR .RS 4 This is the minimum \fIuser id\fR (uid) that \fBafppasswd\fR will use when creating users\&. .RE .SH "SEE ALSO" .PP \fBafpd\fR(8), \fBatalkd\fR(8)\&. netatalk-2.2.2/man/man1/netatalk-config.10000644000175200017500000000621711704763240015014 00000000000000'\" t .\" Title: netatalk-config .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 09 June 2001 .\" Manual: The Netatalk Project .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "NETATALK\-CONFIG" "1" "09 June 2001" "Netatalk 2.2" "The Netatalk Project" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" netatalk-config \- script to get information about the installed version of netatalk .SH "SYNOPSIS" .HP \w'\fBnetatalk\-config\fR\fB\fR\ 'u \fBnetatalk\-config\fR\fB\fR [\-\-prefix\ [\fI=DIR\fR]] [\-\-exec_prefix\ [\fI=DIR\fR]] [\-\-help] [\-\-version] [\-\-libs] [\-\-libs\-dirs] [\-\-libs\-names] [\-\-cflags] [\-\-macros] .SH "DESCRIPTION" .PP \fBnetatalk\-config\fR is a tool that is used to determine the compiler and linker flags that should be used to compile and link programs that use the \fInetatalk\fR run\-time libraries\&. .SH "OPTIONS" .PP \fBnetatalk\-config\fR accepts the following options: .PP \fB\-\-help\fR .RS 4 Print a short help for this command and exit\&. .RE .PP \fB\-\-version\fR .RS 4 Print the currently installed version of \fInetatalk\fR on the standard output\&. .RE .PP \fB\-\-libs\fR .RS 4 Print the linker flags that are necessary to link against the \fInetatalk\fR run\-time libraries\&. .RE .PP \fB\-\-libs\-dirs\fR .RS 4 Print only the \-l/\-R part of \-\-libs\&. .RE .PP \fB\-\-libs\-names\fR .RS 4 Print only the \-l part of \-\-libs\&. .RE .PP \fB\-\-cflags\fR .RS 4 Print the compiler flags that are necessary to compile a program linked against the \fInetatalk\fR run\-time libraries\&. .RE .PP \fB\-\-macros\fR .RS 4 Print the \fInetatalk\fR m4 directory\&. .RE .PP \fB\-\-prefix=PREFIX\fR .RS 4 If specified, use PREFIX instead of the installation prefix that \fInetatalk\fR was built with when computing the output for the \-\-cflags and \-\-libs options\&. This option is also used for the exec prefix if \-\-exec\-prefix was not specified\&. This option must be specified before any \-\-libs or \-\-cflags options\&. .RE .PP \fB\-\-exec\e_prefix=PREFIX\fR .RS 4 If specified, use PREFIX instead of the installation exec prefix that \fInetatalk\fR was built with when computing the output for the \-\-cflags and \-\-libs options\&. This option must be specified before any \-\-libs or \-\-cflags options\&. .RE .SH "COPYRIGHT" .PP Copyright \(co 1998 Owen Taylor .PP Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation\&. .PP Man page adapted for \fBnetatalk\-config\fR by Sebastian Rittau in 2001\&. netatalk-2.2.2/man/man8/0000777000175200017500000000000011704770431011751 500000000000000netatalk-2.2.2/man/man8/Makefile.am0000644000175200017500000000144411655731130013722 00000000000000## Makefile.am for man/man8/ pkgconfdir = @PKGCONFDIR@ SUFFIXES = .tmpl . .tmpl: sed -e s@:SBINDIR:@${sbindir}@ \ -e s@:BINDIR:@${bindir}@ \ -e s@:ETCDIR:@${pkgconfdir}@ \ -e s@:LIBDIR:@${libdir}@ \ -e s@:LIBEXECDIR:@${libexecdir}@ \ -e s@:NETATALK_VERSION:@${NETATALK_VERSION}@ \ <$< >$@ NONGENERATED_MANS = timelord.8 GENERATED_MANS = afpd.8 cnid_dbd.8 cnid_metad.8 TEMPLATE_FILES = afpd.8.tmpl cnid_dbd.8.tmpl cnid_metad.8.tmpl ATALK_MANS = atalkd.8.tmpl papd.8.tmpl papstatus.8.tmpl psf.8.tmpl if USE_APPLETALK GENERATED_MANS += atalkd.8 papd.8 papstatus.8 psf.8 TEMPLATE_FILES += $(ATALK_MANS) endif man_MANS = $(GENERATED_MANS) $(NONGENERATED_MANS) CLEANFILES = $(GENERATED_MANS) EXTRA_DIST = $(TEMPLATE_FILES) $(NONGENERATED_MANS) $(ATALK_MANS) netatalk-2.2.2/man/man8/Makefile.in0000644000175200017500000003332011703521731013727 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @USE_APPLETALK_TRUE@am__append_1 = atalkd.8 papd.8 papstatus.8 psf.8 @USE_APPLETALK_TRUE@am__append_2 = $(ATALK_MANS) subdir = man/man8 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = man8dir = $(mandir)/man8 am__installdirs = "$(DESTDIR)$(man8dir)" NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgconfdir = @PKGCONFDIR@ SUFFIXES = .tmpl . NONGENERATED_MANS = timelord.8 GENERATED_MANS = afpd.8 cnid_dbd.8 cnid_metad.8 $(am__append_1) TEMPLATE_FILES = afpd.8.tmpl cnid_dbd.8.tmpl cnid_metad.8.tmpl \ $(am__append_2) ATALK_MANS = atalkd.8.tmpl papd.8.tmpl papstatus.8.tmpl psf.8.tmpl man_MANS = $(GENERATED_MANS) $(NONGENERATED_MANS) CLEANFILES = $(GENERATED_MANS) EXTRA_DIST = $(TEMPLATE_FILES) $(NONGENERATED_MANS) $(ATALK_MANS) all: all-am .SUFFIXES: .SUFFIXES: .tmpl . $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/man8/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign man/man8/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man8: $(man8_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 8*) ;; \ *) ext='8' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \ done uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 8*) ;; \ *) ext='8' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man8dir)/$$inst"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-man8 install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man8 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man8 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-man uninstall-man8 .tmpl: sed -e s@:SBINDIR:@${sbindir}@ \ -e s@:BINDIR:@${bindir}@ \ -e s@:ETCDIR:@${pkgconfdir}@ \ -e s@:LIBDIR:@${libdir}@ \ -e s@:LIBEXECDIR:@${libexecdir}@ \ -e s@:NETATALK_VERSION:@${NETATALK_VERSION}@ \ <$< >$@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/man/man8/papstatus.8.tmpl0000644000175200017500000000475411704763240014767 00000000000000'\" t .\" Title: papstatus .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 17 Dec 1991 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "PAPSTATUS" "8" "17 Dec 1991" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" papstatus \- get the status of an AppleTalk\-connected printer .SH "SYNOPSIS" .HP \w'\fB:SBINDIR:/papstatus\fR\fB\fR\ 'u \fB:SBINDIR:/papstatus\fR\fB\fR [\-d] [\-p\ \fIprinter\fR] [\fIretrytime\fR] .SH "DESCRIPTION" .PP \fBpapstatus\fR is used to obtain the current status message from an AppleTalk connected printer\&. It uses the Printer Access Protocol (PAP) to obtain the status information\&. .PP If no printer is specified on the command line, \fBpapstatus\fR looks for a file called \fB\&.paprc\fR in the current directory and reads it to obtain the name of a printer\&. The \fB\&.paprc\fR file should contain a single line of the form \fIobject\fR\fB:\fR\fItype\fR\fB@\fR\fIzone\fR where each of \fIobject\fR, \fB:\fR\fItype\fR\fB,\fR and \fB@\fR\fIzone\fR are optional\&. \fItype\fR and \fIzone\fR must be proceeded by `\fB:\fR\' and `\fB@\fR\' respectively\&. Blank lines and lines the begin with a `\fB#\fR\' are ignored\&. \fItype\fR and \fIzone\fR default to \fBLaserWriter\fR and the zone of the local host, respectively\&. .SH "OPTIONS" .PP \fB\-d\fR .RS 4 Turns on a debugging mode that prints some extra information to standard error\&. .RE .PP \fB\-p\fR \fIprinter\fR .RS 4 Get status from \fIprinter\fR (do not consult any \fB\&.paprc\fR files to find a printer name)\&. The syntax for \fIprinter\fR is the same as discussed above for the \fB\&.paprc\fR file\&. .RE .PP \fIretrytime\fR .RS 4 Normally, \fBpapstatus\fR only gets the status from the printer once\&. If \fIretrytime\fR is specified, the status is obtained repeatedly, with a sleep of \fIretrytime\fR seconds between inquiring the printer\&. .RE .SH "FILES" .PP \fB\&.paprc\fR .RS 4 file that contains printer name .RE .SH "SEE ALSO" .PP \fBnbp\fR(1), \fBpap\fR(1) netatalk-2.2.2/man/man8/timelord.80000644000175200017500000000234411704763240013600 00000000000000'\" t .\" Title: timelord .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 27 Jun 2001 .\" Manual: The Netatalk Project .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "TIMELORD" "8" "27 Jun 2001" "Netatalk 2.2" "The Netatalk Project" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" timelord \- Macintosh time server daemon .SH "SYNOPSIS" .SH "SYNTAX" .PP timelord [\-d] [\-n \fIfilename\fR] .SH "DESCRIPTION" .PP \fBtimelord\fR is a simple time server for Macintosh computers that use the \fBtardis\fR client\&. .SH "OPTIONS" .PP \fB\-d\fR .RS 4 Debug mode, i\&.e\&. don\'t disassociate from controlling TTY\&. .RE .PP \fB\-n\fR \fInbpname\fR .RS 4 Register this server as \fInbpname\fR\&. This defaults to the hostname\&. .RE netatalk-2.2.2/man/man8/papd.8.tmpl0000644000175200017500000001744011704763240013663 00000000000000'\" t .\" Title: papd .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 06 September 2004 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "PAPD" "8" "06 September 2004" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" papd \- AppleTalk print server daemon .SH "SYNOPSIS" .HP \w'\fBpapd\fR\fB\fR\fB\fR\ 'u \fBpapd\fR\fB\fR\fB\fR [\-d] [\-f\ configfile] [\-p\ printcap] .SH "DESCRIPTION" .PP \fBpapd\fR is the AppleTalk printer daemon\&. This daemon accepts print jobs from AppleTalk clients (typically Macintosh computers) using the Printer Access Protocol (PAP)\&. When used with System V printing systems, \fBpapd\fR spools jobs directly into an \fBlpd\fR(8) spool directory and wakes up \fBlpd\fR after accepting a job from the network to have it re\-examine the appropriate spool directory\&. The actual printing and spooling is handled entirely by \fBlpd\fR\&. .PP \fBpapd\fR can also pipe the print job to an external program for processing, and this is the preferred method on systems not using CUPS to avoid compatibility problems with all the flavours of \fBlpd\fR in use\&. .PP As of version 2\&.0, CUPS is also supported\&. Simply using \fBcupsautoadd\fR as first papd\&.conf entry will share all CUPS printers automagically using the PPD files configured in CUPS\&. It ist still possible to overwrite these defaults by individually define printer shares\&. See \fBpapd.conf\fR(5) for details\&. .PP \fBpapd\fR is typically started at boot time, out of system init scripts\&. It first reads from its configuration file, :ETCDIR:/papd\&.conf\&. The file is in the same format as /etc/printcap\&. See \fBprintcap\fR(5) for details\&. The name of the entry is registered with NBP\&. .PP The following options are supported: .TS tab(:); cB cB cB nB. T{ Name T}:T{ Type T}:T{ Default T}:T{ Description T} .T& c l l l c l l l c l l l c l l l c l l l c l l l c l l l c l l l c l l l c l l l. T{ pd T}:T{ str T}:T{ \'\&.ppd\' T}:T{ Pathname to PPD file T} T{ pr T}:T{ str T}:T{ \'lp\' T}:T{ LPD or CUPS printer name (or pipe to a print command) T} T{ op T}:T{ str T}:T{ \'operator\' T}:T{ Operator name for LPD spooling T} T{ au T}:T{ bool T}:T{ false T}:T{ Whether to do authenticated printing or not T} T{ ca T}:T{ str T}:T{ NULL T}:T{ Pathname used for CAP\-style authentification T} T{ sp T}:T{ bool T}:T{ false T}:T{ PSSP\-style authetication T} T{ am T}:T{ str T}:T{ NULL T}:T{ UAMS to use for authentication T} T{ pa T}:T{ str T}:T{ NULL T}:T{ Printer\'s AppleTalk address T} T{ co T}:T{ str T}:T{ NULL T}:T{ CUPS options as supplied to the \fBlp\fR(1) command with "\-o" T} T{ fo T}:T{ bool T}:T{ false T}:T{ adjust lineending for foomatic\-rip T} .TE .sp 1 If no configuration file is given, the hostname of the machine is used as the NBP name and all options take their default value\&. .SH "OPTIONS" .PP \-d .RS 4 Do not fork or disassociate from the terminal\&. Write some debugging information to stderr\&. .RE .PP \-f \fIconfigfile\fR .RS 4 Consult \fIconfigfile\fR instead of :ETCDIR:/papd\&.conf for the configuration information\&. .RE .PP \-p \fIprintcap\fR .RS 4 Consult \fIprintcap\fR instead of /etc/printcap for LPD configuration information\&. .RE .SH "NOTES" .PP PSSP (Print Server Security Protocol) is an authentication protocol carried out through postscript printer queries to the print server\&. Using PSSP requires LaserWriter 8\&.6\&.1 or greater on the client mac\&. The user will be prompted to enter their username and password before they print\&. It may be necessary to re\-setup the printer on each client the first time PSSP is enabled, so that the client can figure out that authentication is required to print\&. You can enable PSSP on a per\-printer basis\&. PSSP is the recommended method of authenticating printers as it is more robust than CAP\-style authentication, described below\&. .PP CAP\-style authentication gets its name from the method the CAP (Columbia APpletalk) package used to authenticate its mac clients\' printing\&. This method requires that a user login to a file share before they print\&. \fBafpd\fR records the username in a temporary file named after the client\'s Appletalk address, and it deletes the temporary file when the user disconnects\&. Therefore CAP style authentification will \fInot\fR work for clients connected to \fBafpd\fR via TCP/IP\&. \fBpapd\fR gets the username from the file with the same Appletalk address as the machine connecting to it\&. CAP\-style authentication will work with any mac client\&. If both CAP and PSSP are enabled for a particular printer, CAP will be tried first, then \fBpapd\fR will fall back to PSSP\&. .PP The list of UAMs to use for authentication (specified with the \'am\' option) applies to all printers\&. It is not possible to define different authentication methods on each printer\&. You can specify the list of UAMS multiple times, but only the last setting will be used\&. Currently only uams_guest\&.so and uams_clrtxt\&.so are supported as printer authentication methods\&. The guest method requires a valid username, but not a password\&. The Cleartext UAM requires both a valid username and the correct password\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP As of this writing, Mac OS X makes no use of PSSP authentication any longer\&. CAP\-style authentication normally won\'t be an option, too caused by the use of AFP over TCP these days\&. .sp .5v .RE .PP .SH "FILES" .PP :ETCDIR:/papd\&.conf .RS 4 Default configuration file\&. .RE .PP /etc/printcap .RS 4 Printer capabilities database\&. .RE .PP \&.ppd .RS 4 PostScript Printer Description file\&. papd answers configuration and font queries from printing clients by consulting the configured PPD file\&. Such files are available for download from Adobe, Inc\&. (\m[blue]\fBhttp://www\&.adobe\&.com/support/downloads/main\&.htm\fR\m[]\&\s-2\u[1]\d\s+2), or from the printer\'s manufacturer\&. If no PPD file is configured, papd will return the default answer, possibly causing the client to send excessively large jobs\&. .RE .SH "CAVEATS" .PP \fBpapd\fR accepts characters with the high bit set (a full 8\-bits) from the clients, but some PostScript printers (including Apple Computer\'s LaserWriter family) only accept 7\-bit characters on their serial interface by default\&. The same applies for some printers when they\'re accessed via TCP/IP methods (remote LPR or socket)\&. You will need to configure your printer to accept a full 8 bits or take special precautions and convert the printjob\'s encoding (eg\&. by using \fBco="protocol=BCP"\fR when using CUPS 1\&.1\&.19 or above)\&. .PP When printing clients run MacOS 10\&.2 or above, take care that PPDs do not make use of \fB*cupsFilter:\fR comments unless the appropriate filters are installed at the client\'s side, too (remember: Starting with 10\&.2 Apple chose to integrate CUPS into MacOS X)\&. For in\-depth information on how CUPS uses PPDs see chapter 3\&.4 in \m[blue]\fBhttp://tinyurl\&.com/zbxn\fR\m[]\&\s-2\u[2]\d\s+2)\&. .SH "SEE ALSO" .PP \fBlpr\fR(1),\fBlprm\fR(1),\fBprintcap\fR(5),\fBlpc\fR(8),\fBlpd\fR(8), \fBlp\fR(1)\&. .SH "NOTES" .IP " 1." 4 http://www.adobe.com/support/downloads/main.htm .RS 4 \%http://www.adobe.com/support/downloads/main.html#Printer .RE .IP " 2." 4 http://tinyurl.com/zbxn .RS 4 \%http://tinyurl.com/zbxn .RE netatalk-2.2.2/man/man8/psf.8.tmpl0000644000175200017500000000734011704763240013525 00000000000000'\" t .\" Title: psf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 17 Dec 1991 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "PSF" "8" "17 Dec 1991" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" psf \- PostScript filter .SH "SYNOPSIS" .HP \w'\fBpsf\fR\fB\fR\ 'u \fBpsf\fR\fB\fR [\-n\ \fIname\fR] [\-h\ \fIhost\fR] [\-w\ \fIwidth\fR] [\-l\ \fIlength\fR] [\-i\ \fIindent\fR] [\-c] .SH "DESCRIPTION" .PP \fBpsf\fR is an \fBlpd\fR filter for PostScript printing\&. \fBpsf\fR interprets the name it was called with to determine what filters to invoke\&. First, if the string ``pap\'\' appears anywhere in the name, \fBpsf\fR invokes \fBpap\fR to talk to a printer via AppleTalk\&. Next, if the string ``rev\'\' appears, \fBpsf\fR invokes \fBpsorder\fR to reverse the pages of the job\&. Finally, if \fBpsf\fR was called with a filter\'s name as the leading string, it invokes that filter\&. If there is no filter to run, \fBpsf\fR examines the magic number of the input, and if the input is not PostScript, converts it to PostScript\&. .SH "KLUDGE" .PP In the default configuration, \fBpsf\fR supports two kludges\&. The first causes \fBpsf\fR to check its name for the letter `m\'\&. If this letter is found and accounting is turned on, \fBpsf\fR calls \fBpap\fR twice, once to get an initial page count and to print the job, and another time to get a final page count\&. This is a work\-around for bugs in a variety of PAP implementions that cause printers to never properly close the PAP output file\&. A notable example is any printer by Hewlett\-Packard\&. .PP The second kludge causes \fBpsf\fR to examine its name for the letter `w\'\&. If this letter is found and accounting is turned on, \fBpsf\fR calls \fBpap\fR with the \fB\-w\fR flag\&. This flag causes \fBpap\fR to wait until the printer\'s status contains the string `idle\'\&. Once this string is found, the job is printed as normal\&. This kludge is a work\-around for printers, notably Hewlett\-Packard\'s LaserJet IV, which will report a page count while a previous jobs is still printing\&. .SH "EXAMPLE" .PP The sample \fBprintcap\fR entry below invokes \fBpsf\fR to print text files, PostScript files, \fBtroff\fR\'s C/A/T output, and \fBTeX\fR\'s DVI output, to an AppleTalk connected LaserWriter Plus\&. Since the LaserWriter Plus stacks pages in descending order, we reverse the pages and print the burst page last\&. .sp .if n \{\ .RS 4 .\} .nf laser|lp|LaserWriter Plus on AppleTalk:\e :sd=/usr/spool/lpd/laser:\e :lp=/usr/spool/lpd/laser/null:\e :lf=/var/adm/lpd\-errs:pw#80:hl:\e :of=:LIBEXECDIR:/ofpap:\e :if=:LIBEXECDIR:/ifpaprev:\e :tf=:LIBEXECDIR:/tfpaprev:\e :df=:LIBEXECDIR:/dfpaprev: .fi .if n \{\ .RE .\} .PP Note that if the host in question spools to more than one AppleTalk printer, /dev/null should not be used for the \fBlp\fR capability\&. Instead, a null device should be created with \fBmknod\fR for each printer, as has been done above\&. .PP Finally, there is a file in the spool directory, /var/spool/lpd/laser, called \fB\&.paprc\fR, which \fBpap\fR reads for the AppleTalk name of the printer\&. .SH "SEE ALSO" .PP \fBpsorder\fR(1), \fBprintcap\fR(5), \fBlpd\fR(1), \fBmknod\fR(1), \fBpap\fR(1)\&. netatalk-2.2.2/man/man8/atalkd.8.tmpl0000644000175200017500000001025111704763240014170 00000000000000'\" t .\" Title: atalkd .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 06 Sep 2004 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "ATALKD" "8" "06 Sep 2004" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" atalkd \- AppleTalk RTMP, NBP, ZIP, and AEP manager .SH "SYNOPSIS" .HP \w'\fBatalkd\fR\fB\fR\fB\fR\fB\fR\fB\fR\fB\fR\fB\fR\ 'u \fBatalkd\fR\fB\fR\fB\fR\fB\fR\fB\fR\fB\fR\fB\fR [\-f\ \fIconfigfile\fR] [\-1] [\-2] .SH "DESCRIPTION" .PP \fBatalkd\fR is responsible for all user level AppleTalk network management\&. This includes routing, name registration and lookup, zone lookup, and the AppleTalk Echo Protocol (similar to \fBping\fR(8))\&. \fBatalkd\fR is typically started at boot time, out of /etc/rc\&. It first reads from its configuration file, :ETCDIR:/atalkd\&.conf\&. If there is no configuration file, \fBatalkd\fR will attempt to configure all available interfaces and will create a configuration file\&. The file consists of a series of interfaces, one per line\&. Lines with `#\' in the first column are ignored, as are blank lines\&. The syntax is .PP \fIinterface\fR [ \fB\-seed\fR ] [ \fB\-phase\fR \fInumber\fR ] [ \fB\-net\fR \fInet\-range\fR ] [ \fB\-addr\fR \fIaddress\fR ] [ \fB\-zone\fR \fIzonename\fR ] \&.\&.\&. .PP Note that all fields except the interface are optional\&. The loopback interface is configured automatically\&. If \fB\-seed\fR is specified, all other fields must be present\&. Also, \fBatalkd\fR will exit during bootstrap\%ping, if a router disagrees with its seed information\&. If \fB\-seed\fR is not given, all other information may be overriden during auto\-configuration\&. If no \fB\-phase\fR option is given, the default phase as given on the command line is used (the default is 2)\&. If \fB\-addr\fR is given and \fB\-net\fR is not, a net\-range of one is assumed\&. .PP The first \-zone directive for each interface is the ``default\'\' zone\&. Under Phase 1, there is only one zone\&. Under Phase 2, all routers on the network are configured with the default zone and must agree\&. \fBatalkd\fR maps ``*\'\' to the default zone of the first interface\&. Note: The default zone for a machine is determined by the configuration of the local routers; to appear in a non\-default zone, each service, e\&.g\&. \fBafpd\fR, must individually specify the desired zone\&. See also \fBnbp_name\fR(3)\&. .SH "ROUTING" .PP If you are connecting a netatalk router to an existing AppleTalk internet, you should first contact your local network administrators to obtain appropriate network addresses\&. .PP \fBatalkd\fR can provide routing between interfaces by configuring multiple interfaces\&. Each interface must be assigned a unique net\-range between 1 and 65279 (0 and 65535 are illegal, and addresses between 65280 and 65534 are reserved for startup)\&. It is best to choose the smallest useful net\-range, i\&.e\&. if you have three machines on an Ethernet, don\'t chose a net\-range of 1000\-2000\&. Each net\-range may have an arbitrary list of zones associated with it\&. .SH "EXAMPLES" .PP Below is an example configuration file for a sun4/40\&. The machine has two interfaces, ``le0\'\' and ``le1\'\'\&. The ``le0\'\' interface is configured automatically from other routers on the network\&. The machine is the only router for the ``le1\'\' interface\&. .PP .if n \{\ .RS 4 .\} .nf le0 le1 \-seed \-net 9461\-9471 \-zone netatalk \-zone Argus .fi .if n \{\ .RE .\} .sp \fBatalkd\fR automatically acts as a router if there is more than one interface\&. .SH "FILES" .PP :ETCDIR:/atalkd\&.conf configuration file .SH "BUGS" .PP On some systems, \fBatalkd\fR can not be restarted\&. .SH "SEE ALSO" .PP \fBatalkd.conf\fR(5) netatalk-2.2.2/man/man8/cnid_dbd.8.tmpl0000644000175200017500000002051711704763240014464 00000000000000'\" t .\" Title: cnid_dbd .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 01 Jan 2012 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "CNID_DBD" "8" "01 Jan 2012" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" cnid_dbd \- implement access to CNID databases through a dedicated daemon process .SH "SYNOPSIS" .HP \w'\fBcnid_dbd\fR\fB\fR\fB\fR\fB\fR\fBcnid_dbd\fR\fB\fR\ 'u \fBcnid_dbd\fR\fB\fR\fB\fR\fB\fR \fIvolpath\fR \fIctrlfd\fR \fIclntfd\fR \fIlogconfig_string\fR .br \fBcnid_dbd\fR\fB\fR \-v | \-V .SH "DESCRIPTION" .PP \fBcnid_dbd\fR provides an interface for storage and retrieval of catalog node IDs (CNIDs) and related information to the \fBafpd\fR daemon\&. CNIDs are a component of Macintosh based file systems with semantics that map not easily onto Unix file systems\&. This makes separate storage in a database necessary\&. \fBcnid_dbd\fR is part of the \fBCNID backend\fR framework of \fBafpd\fR and implements the \fBdbd\fR backend\&. .PP \fBcnid_dbd\fR is never started via the command line or system startup scripts but only by the \fBcnid_metad\fR daemon\&. There is one instance of \fBcnid_dbd\fR per netatalk volume\&. .PP \fBcnid_dbd\fR uses the \fBBerkleley DB\fR database library and uses transactionally protected updates\&. The \fBdbd\fR backend with transactions will avoid corruption of the CNID database even if the system crashes unexpectedly\&. .PP \fBcnid_dbd\fR inherits the effective userid and groupid from \fBcnid_metad\fR on startup, which is normally caused by \fBafpd\fR serving a netatalk volume to a client\&. It changes to the \fBBerkleley DB\fR database home directory \fIdbdir\fR that is associated with the volume\&. If the userid inherited from \fBcnid_metad\fR is 0 (root), \fBcnid_dbd\fR will change userid and groupid to the owner and group of the database home directory\&. Otherwise, it will continue to use the inherited values\&. \fBcnid_dbd\fR will then attempt to open the database and start serving requests using filedescriptor \fIclntfd\fR\&. Subsequent instances of \fBafpd\fR that want to access the same volume are redirected to the running \fBcnid_dbd\fR process by \fBcnid_metad\fR via the filedescriptor \fIctrlfd\fR\&. .PP \fBcnid_dbd\fR uses \fBlogconfig_string\fR which is passed from \fBcnid_metad\fR to configure its logging output\&. .PP \fBcnid_dbd\fR can be configured to run forever or to exit after a period of inactivity\&. If \fBcnid_dbd\fR receives a TERM or an INT signal it will exit cleanly after flushing dirty database buffers to disk and closing \fBBerkleley DB\fR database environments\&. It is safe to terminate \fBcnid_dbd\fR this way, it will be restarted when necessary\&. Other signals are not handled and will cause an immediate exit, possibly leaving the CNID database in an inconsistent state (no transactions) or losing recent updates during recovery (transactions)\&. .PP The \fBBerkleley DB\fR database subsystem will create files named log\&.xxxxxxxxxx in the database home directory \fIdbdir\fR, where xxxxxxxxxx is a monotonically increasing integer\&. These files contain ithe transactional database changes\&. They will be removed regularily, unless the \fBlogfile_autoremove\fR option is specified in the \fIdb_param\fR configuration file (see below) with a value of 0 (default 1)\&. .PP Do not use \fBcnid_dbd\fR for databases on NFS mounted file systems\&. It makes the whole point of securing database changes properly moot\&. Use the dbdir: Option in the appropriate \fBAppleVolumes\fR configuration file to put the database onto a local disk\&. .SH "OPTIONS" .PP \fB\-v, \-V\fR .RS 4 Show version and exit\&. .RE .SH "CONFIGURATION" .PP \fBcnid_dbd\fR reads configuration information from the file \fIdb_param\fR in the database directory \fIdbdir\fR on startup\&. If the file does not exist or a parameter is not listed, suitable default values are used\&. The format for a single parameter is the parameter name, followed by one or more spaces, followed by the parameter value, followed by a newline\&. The following parameters are currently recognized: .PP \fBlogfile_autoremove\fR .RS 4 If set to 0, unused Berkeley DB transactional logfiles (log\&.xxxxxxxxxx in the database home directory) are not removed on startup of \fBcnid_dbd\fR and on a reqular basis\&. Default: 1\&. .RE .PP \fBcachesize\fR .RS 4 Determines the size of the Berkeley DB cache in kilobytes\&. Default: 8192\&. Each \fBcnid_dbd\fR process grabs that much memory on top of its normal memory footprint\&. It can be used to tune database performance\&. The \fBdb_stat\fR utility with the \fB\-m\fR option that comes with Berkely DB can help you determine wether you need to change this value\&. The default is pretty conservative so that a large percentage of requests should be satisfied from the cache directly\&. If memory is not a bottleneck on your system you might want to leave it at that value\&. The \fBBerkeley DB Tutorial and Reference Guide\fR has a section \fBSelecting a cache size\fR that gives more detailed information\&. .RE .PP \fBflush_frequency\fR, \fBflush_interval\fR .RS 4 \fIflush_frequency\fR (Default: 1000) and \fIflush_interval\fR (Default: 1800) control how often changes to the database are checkpointed\&. Both of these operations are performed if either i) more than \fIflush_frequency\fR requests have been received or ii) more than \fIflush_interval\fR seconds have elapsed since the last save/checkpoint\&. Be careful to check your harddisk configuration for on disk cache settings\&. Many IDE disks just cache writes as the default behaviour, so even flushing database files to disk will not have the desired effect\&. .RE .PP \fBfd_table_size\fR .RS 4 is the maximum number of connections (filedescriptors) that can be open for \fBafpd\fR client processes in \fBcnid_dbd\&.\fR Default: 512\&. If this number is exceeded, one of the existing connections is closed and reused\&. The affected \fBafpd\fR process will transparently reconnect later, which causes slight overhead\&. On the other hand, setting this parameter too high could affect performance in \fBcnid_dbd\fR since all descriptors have to be checked in a \fBselect()\fR system call, or worse, you might exceed the per process limit of open file descriptors on your system\&. It is safe to set the value to 1 on volumes where only one \fBafpd\fR client process is expected to run, e\&.g\&. home directories\&. .RE .PP \fBidle_timeout\fR .RS 4 is the number of seconds of inactivity before an idle \fBcnid_dbd\fR exits\&. Default: 600\&. Set this to 0 to disable the timeout\&. .RE .SH "UPDATING" .PP Note that the first version to appear \fIafter\fR Netatalk 2\&.1 ie Netatalk 2\&.1\&.1, will support BerkeleyDB updates on the fly without manual intervention\&. In other words Netatalk 2\&.1 does contain code to prepare the BerkeleyDB database for upgrades and to upgrade it in case it has been prepared before\&. That means it can\'t upgrade a 2\&.0\&.x version because that one didn\'t prepare the database\&. .PP In order to update between older Netatalk releases using different BerkeleyDB library versions, follow this steps: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Stop the to be upgraded old version of Netatalk .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Using the old BerkeleyDB utilities run \fBdb_recover \-h \fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Using the new BerkeleyDB utilities run \fBdb_upgrade \-v \-h \-f cnid2\&.db\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Again using the new BerkeleyDB utilities run \fBdb_checkpoint \-1 \-h \fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Start the the new version of Netatalk .RE .SH "SEE ALSO" .PP \fBcnid_metad\fR(8), \fBafpd\fR(8), \fBdbd\fR(1) netatalk-2.2.2/man/man8/cnid_metad.8.tmpl0000644000175200017500000001061311704763240015021 00000000000000'\" t .\" Title: cnid_metad .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 01 Jan 2012 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "CNID_METAD" "8" "01 Jan 2012" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" cnid_metad \- start cnid_dbd daemons on request .SH "SYNOPSIS" .HP \w'\fBcnid_metad\fR\fB\fR\fBcnid_metad\fR\fB\fR\ 'u \fBcnid_metad\fR\fB\fR [\-l\ \fIloglevel\fR\ [\-f\ \fIfilename\fR]] [\-d] [\-h\ \fIhostname\fR] [\-p\ \fIport\fR] [\-u\ \fIuser\fR] [\-g\ \fIgroup\fR] [\-s\ \fIcnid_dbdpathname\fR] .br \fBcnid_metad\fR\fB\fR \-v | \-V .SH "DESCRIPTION" .PP \fBcnid_metad\fR waits for requests from \fBafpd\fR to start up instances of the \fBcnid_dbd\fR daemon\&. It keeps track of the status of a \fBcnid_dbd\fR instance once started and will restart it if necessary\&. \fBcnid_metad\fR is normally started at boot time from /etc/rc or equivalent and runs until shutdown\&. \fBafpd\fR needs to be configured with the \fB\-cnidserver\fR option in \fBafpd\&.conf\fR in order to access \fBcnid_metad\&.\fR It is possible to run more than one instance of \fBcnid_metad\fR on the same machine if different values for the interface and/or port are specified with the \fB\-h\fR and \fB\-p\fR options\&. .SH "OPTIONS" .PP \fB\-l\fR\fI [\-f ]\fR .RS 4 Specify that any message of a loglevel up to the given \fBloglevel\fR should be logged to the given file\&. If the filename is ommited the loglevel applies to messages passed to syslog\&. Default is logs to syslog with a default logging setup of \fB"log_note\fR"\&. .sp \fBNote:\fR \fBcnid_metad\fR passes this to \fBcnid_dbd\fR which will in turn use this for its logging setup\&. .sp loglevels: LOG_SEVERE, LOG_ERROR, LOG_WARN, LOG_NOTE, LOG_INFO, LOG_DEBUG, LOG_DEBUG6, LOG_DEBUG7, LOG_DEBUG8, LOG_DEBUG9, LOG_MAXDEBUG .PP \fBExample.\ \&Useful default config\fR .sp .if n \{\ .RS 4 .\} .nf \-l log_info \-f /var/log/afpd\&.log .fi .if n \{\ .RE .\} .PP \fBExample.\ \&Debugging config\fR .sp .if n \{\ .RS 4 .\} .nf \-l log_maxdebug \-f /var/log/afpd\&.log .fi .if n \{\ .RE .\} .RE .PP \fB\-d\fR .RS 4 \fBcnid_metad will remain in the foreground and\fR will also leave the standard input, standard output and standard error file descriptors open\&. Useful for debugging\&. .RE .PP \fB\-h\fR\fI hostname\fR .RS 4 Use \fIhostname\fR as the network interface for requests as opposed to the default \fBlocalhost\fR\&. The network address may be specified either in dotted\-decimal format for IPv4 or in hexadecimal format for IPv6\&. .RE .PP \fB\-p\fR\fI port\fR .RS 4 Use \fIport\fR as the port number for reqests\&. Default is 4700\&. .RE .PP \fB\-u\fR\fI user\fR .RS 4 Switch to the userid of \fIuser\fR before serving requests\&. This userid will be inherited by all \fBcnid_dbd\fR daemon processes started\&. .RE .PP \fB\-g\fR\fI group\fR .RS 4 Switch to the groupid of \fIgroup\fR before serving requests\&. This groupid will be inherited by all \fBcnid_dbd\fR daemon processes started\&. Both \fIuser\fR and \fIgroup\fR must be specified as strings\&. .RE .PP \fB\-s\fR\fI cnid_dbd pathname\fR .RS 4 Use \fIcnid_dbd pathname\fR as the pathname of the executeable of the \fBcnid_dbd\fR daemon\&. The default is \fI:SBINDIR:/cnid_dbd\&.\fR .RE .PP \fB\-v, \-V\fR .RS 4 Show version and exit\&. .RE .SH "CAVEATS" .PP The number of \fBcnid_dbd\fR subprocecesses is currently limited to 512\&. .PP \fBcnid_metad\fR does not block or catch any signals apart from SIGPIPE\&. It will therefore exit on most signals received\&. This will also cause all instances of \fBcnid_dbd\'s\fR started by that \fBcnid_metad\fR to exit gracefully\&. Since state about and IPC access to the subprocesses is only maintained in memory by \fBcnid_metad\fR this is desired behaviour\&. As soon as \fBcnid_metad\fR is restarted \fBafpd\fR processes will transparently reconnect\&. .SH "SEE ALSO" .PP \fBcnid_dbd\fR(8), \fBafpd\fR(8), \fBdbd\fR(1) netatalk-2.2.2/man/man8/afpd.8.tmpl0000644000175200017500000001617011704763240013650 00000000000000'\" t .\" Title: afpd .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 08 Mar 2011 .\" Manual: Netatalk 2.2 .\" Source: Netatalk 2.2 .\" Language: English .\" .TH "AFPD" "8" "08 Mar 2011" "Netatalk 2.2" "Netatalk 2.2" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" afpd \- Apple Filing Protocol daemon .SH "SYNOPSIS" .HP \w'\fBafpd\fR\fB\fR\fBafpd\fR\fB\fR\ 'u \fBafpd\fR\fB\fR [\-duptDTI] [\-f\ \fIdefaultvolumes\fR] [\-s\ \fIsystemvolumes\fR] [\-n\ \fInbpname\fR] [\-c\ \fImaxconnections\fR] [\-g\ \fIguest\fR] [\-P\ \fIpidfile\fR] [\-S\ \fIport\fR] [\-L\ \fImessage\fR] [\-F\ \fIconfigfile\fR] [\-U\ \fIuams\fR] [\-m\ \fIumask\fR] .br \fBafpd\fR\fB\fR \-v | \-V | \-h .SH "DESCRIPTION" .PP \fBafpd\fR provides an Apple Filing Protocol (AFP) interface to the Unix file system\&. It is normally started at boot time from /etc/rc\&. .PP :ETCDIR:/afpd\&.conf is the configuration file used by \fBafpd\fR to determine the behavior and configuration of the different virtual file servers that it provides\&. .PP The list of volumes offered to the user is generated from :ETCDIR:/AppleVolumes\&.system and one of :ETCDIR:/AppleVolumes\&.default, ~/AppleVolumes, ~/\&.AppleVolumes, ~/applevolumes, or ~/\&.applevolumes\&. The AppleVolumes files is used to specify volumes to mount and file name extension mappings\&. .PP .SH "OPTIONS" .PP \-d .RS 4 Specifies that the daemon should not fork\&. If netatalk has been configured with \fI\-\-enable\-debug1\fR, a trace of all AFP commands will be written to stdout\&. .RE .PP \-p .RS 4 Prevents clients from saving their passwords\&. (Equivalent to \-\fBnosavepasswd\fR in afpd\&.conf\&.) .RE .PP \-t .RS 4 Allows clients to change their passwords\&. (Equivalent to \fB\-setpasswd\fR in afpd\&.conf\&.) .RE .PP \-D .RS 4 Use DDP (AppleTalk) as transport protocol\&. (Equivalent to \fB\-ddp\fR in afpd\&.cond\&.) .RE .PP \-T .RS 4 Use TCP/IP as transport protocol\&. (Equivalent to \fB\-tcp\fR in afpd\&.conf\&.) .RE .PP \-v .RS 4 Print version information and exit\&. .RE .PP \-V .RS 4 Print verbose information and exit\&. .RE .PP \-h .RS 4 Print help and exit\&. .RE .PP \-I .RS 4 Use a platform specific icon\&. (Equivalent to \fB\-icon\fR in afpd\&.conf\&.) (Recent Mac OS don\'t display it\&.) .RE .PP \-f \fIdefaultvolumes\fR .RS 4 Specifies that \fIdefaultvolumes\fR should be read for a list of default volumes to offer, instead of :ETCDIR:/AppleVolumes\&.default\&. .RE .PP \-s \fIsystemvolumes\fR .RS 4 Specifies that \fIsystemvolumes\fR should be read for a list of volume that all users will be offered, instead of :ETCDIR:/AppleVolumes\&.system\&. .RE .PP \-u .RS 4 Read the user\'s AppleVolumes file first\&. This option causes volume names in the user\'s AppleVolumes file to override volume names in the system\'s AppleVolumes file\&. The default is to read the system AppleVolumes file first\&. Note that this option doesn\'t effect the precendence of filename extension mappings: the user\'s AppleVolumes file always has precedence\&. .RE .PP \-n \fInbpname\fR .RS 4 Specifies that \fInbpname\fR should be used for NBP registration, instead of the first component of the hostname in the local zone\&. .RE .PP \-c \fImaxconnections\fR .RS 4 Specifies the maximum number of connections to allow for this \fBafpd\fR\&. The default is 20\&. .RE .PP \-g \fIguest\fR .RS 4 Specifies the name of the guest account\&. The default is \'\fInobody\fR\'\&. .RE .PP \-P \fIpidfile\fR .RS 4 Specifies the file in which \fBafpd\fR stores its process id\&. .RE .PP \-S \fIport\fR .RS 4 Specifies the port to register with when doing AFPoverTCP\&. Defaults to 548\&. (Equivalent to \fB\-port \fRin afpd\&.conf\&.) .RE .PP \-L \fImessage\fR .RS 4 Specifies the login message that will be sent to clients\&. (Equivalent to \fB\-loginmsg\fR in afpd\&.conf\&.) .RE .PP \-F \fIconfigfile\fR .RS 4 Specifies the configuration file to use\&. (Defaults to :ETCDIR:/netatalk/afpd\&.conf\&.) .RE .PP \-U \fIuams\fR .RS 4 Comma\-separated list of UAMs to use for the authentication process\&. (Equivalent to \fB\-uamlist\fR in afpd\&.conf\&.) .RE .PP \-m \fIumask\fR .RS 4 Use this \fIumask\fR for the creation of folders in Netatalk\&. .RE .SH "SIGNALS" .PP To shut down a user\'s \fBafpd\fR process it is recommended that \fBSIGKILL (\-9)\fR \fINOT\fR be used, except as a last resort, as this may leave the CNID database in an inconsistent state\&. The safe way to terminate an \fBafpd\fR is to send it a \fBSIGTERM (\-15)\fR signal and wait for it to die on its own\&. .PP SIGTERM and SIGUSR1 signals that are sent to the main \fBafpd\fR process are propagated to the children, so all will be affected\&. .PP SIGTERM .RS 4 Clean exit\&. Propagates from master to childs\&. .RE .PP SIGQUIT .RS 4 Send this to the master \fBafpd\fR, it will exit leaving all children running! Can be used to implement AFP service without downtime\&. .RE .PP SIGHUP .RS 4 Sending a \fBSIGHUP\fR to afpd will cause it to reload its configuration files\&. .RE .PP SIGINT .RS 4 Sending a \fBSIGINT\fR to a child \fBafpd\fR enables \fImax_debug\fR logging for this process\&. The log is sent to fhe file /tmp/afpd\&.PID\&.XXXXXX\&. Sending another \fBSIGINT\fR will revert to the original log settings\&. .RE .PP SIGUSR1 .RS 4 The \fBafpd\fR process will send the message "The server is going down for maintenance\&." to the client and shut itself down in 5 minutes\&. New connections are not allowed\&. If this is sent to a child afpd, the other children are not affected\&. However, the main process will still exit, disabling all new connections\&. .RE .PP SIGUSR2 .RS 4 The \fBafpd\fR process will look in the message directory configured at build time for a file named message\&.pid\&. For each one found, a the contents will be sent as a message to the associated AFP client\&. The file is removed after the message is sent\&. This should only be sent to a child \fBafpd\fR\&. .RE .SH "FILES" .PP :ETCDIR:/afpd\&.conf .RS 4 configuration file used by afpd .RE .PP :ETCDIR:/AppleVolumes\&.default .RS 4 list of default volumes to mount .RE .PP :ETCDIR:/AppleVolumes\&.system .RS 4 list of volumes to offer all users .RE .PP ~/AppleVolumes, ~/\&.AppleVolumes, ~/applevolumes, ~/\&.applevolumes .RS 4 user\'s list of volumes to mount .RE .PP :ETCDIR:/afp_signature\&.conf .RS 4 list of server signature .RE .PP :ETCDIR:/afp_voluuid\&.conf .RS 4 list of UUID for Time Machine volume .RE .PP :ETCDIR:/afp_ldap\&.conf .RS 4 configuration file for LDAP and ACL support .RE .PP :ETCDIR:/msg/message\&.pid .RS 4 contains messages to be sent to users\&. .RE .SH "BUGS" .PP .SH "SEE ALSO" .PP \fBhosts_access\fR(5), \fBafpd.conf\fR(5), \fBAppleVolumes.default\fR(5), \fBafp_signature.conf\fR(5), \fBafp_voluuid.conf\fR(5), \fBafp_ldap.conf\fR(5), \fBdbd\fR(1)\&. netatalk-2.2.2/COPYING0000644000175200017500000004311011655731126011304 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. netatalk-2.2.2/NEWS0000644000175200017500000013733311700766070010760 00000000000000Changes in 2.2.2 ================ * NEW: afpd: New option "adminauthuser". Specifying eg "-adminauthuser root" whenever a normal user login fails, afpd tries to authenticate as the specified adminauthuser. If this succeeds, a normal session is created for the original connecting user. Said differently: if you know the password of adminauthuser, you can authenticate as any other user. * NEW: configure option "--enable-suse-systemd" for openSUSE12.1 and later. "--enable-redhat-systemd" and "--enable-suse-systemd" are same as "--enable-systemd". "--enable-suse" is renamed "--enable-suse-sysv". * NEW: experimental systemd service files in distrib/systemd/ * UPD: afpd: Enhanced POSIX ACL mapping semantics, from Laura Mueller * UPD: afpd: Reset options every time a :DEFAULT: line is found in a AppleVolumes file * UPD: afpd: Convert passwords from legacy encoding (wire format) to host encoding, NetAFP Bug ID #14 * UPD: afpd: Don't set ATTRBIT_SHARED flag for directories * UPD: afpd: Use sendfile() on Solaris and FreeBSD for sending data * UPD: afpd: Faster volume used size calculation for "volsizelimit" option, cf man AppleVolume.default for details * FIX: afpd: ACL access checking * FIX: afpd: Fix an error when duplicating files that lacked an AppleDouble file which lead to a possible Finder crash * FIX: afpd: Read-only filesystems lead to afpd processes running as root * FIX: afpd: Fix for filesystem without NFSv4 ACL support on Solaris * FIX: afpd: Fix catsearch bug, NetAFP Bug ID #12 * FIX: afpd: Fix dircache bug, NetAFP Bug ID #13 * FIX: dbd: Better checking for duplicated or bogus CNIDs from AppleDouble files * FIX: dbd: Remove BerkeleyDB database environment after running `dbd`. This is crucial for the automatic BerkeleyDB database upgrade feature which is built into cnid_dbd and dbd. * FIX: Fix compilation error when AppleTalk support is disabled * FIX: Portability fixes * FIX: search of surrogate pair Changes in 2.2.1 ================ * NEW: afpd: disable continous service feature by default, new option -keepsessions to enable it * NEW: configure option "--enable-redhat-systemd" for Fedora15 and later. "--enable-redhat" is renamed "--enable-redhat-sysv". * UPD: afpd: Enhance ACL support detection for volumes: enable them per volume if 1) ACL support compiled in, 2) the volume supports ACLs, 3) the new volume option "noacls" is not set for the volume. The previous behaviour was to enable ACL support for a volume if 1) it was compiled in and 2) the volume supported ACLs. There was no way to disable ACLs for a volume. * UPD: afpd: add a configurable hold time option to FCE file modification event generation, default is 60 s, new option "fceholdfmod" to change it * UPD: afpd: add support for new NetBSD quota subsystem, Bug ID 3249879 * FIX: afpd: increase BerkeleyDB locks and lockobjs * FIX: afpd: create special folder as root * FIX: afpd: fix compilation error if --enable-ddp is used * FIX: afpd: More robust IPC reconnect error handling * FIX: afpd: ACL access checking * FIX: afpd: fix a possible race condition between SIGCHLD handler and new connection attempts * FIX: afpd: fix undefined behaviour when more then ~510 connetions where established * FIX: afpd: fix a crash when searching for a UUID that is not a special local UUID and LDAP support is not compiled in * FIX: afpd: .volinfo file not created on first volume access if user in rolist * FIX: afpd: possible crash at startup when registering with Avahi when Avahi is not running * FIX: afpd: return correct user/group type when mapping UUIDs to names * FIX: afpd: for directories add DARWIN_ACE_DELETE ACE if DARWIN_ACE_ADD_SUBDIRECTORY is set * FIX: afpd: afpd crashed when it failed to register with Avahi because eg user service registration is disabled in the Avahi config * FIX: dbd: function checking and removing malformed ad:ea header files failed to chdir back to the original working directory * FIX: cnid_dbd: increase BerkeleyDB locks and lockobjs * FIX: cnid_dbd: implement -d option, deletes CNID db * FIX: dbd: better detection of local (or SMB/NFS) modifications on AFP volumes * FIX: suse: initscript return better status * FIX: Sourcecode distribution: add missing headers * FIX: Solaris 10: missing dirfd replacement function * FIX: case-conversion of surrogate pair * FIX: Compilation error on GNU/kFreeBSD, fixes Bug ID 3392794 and Debian #630349 * FIX: Fix Debian Bug#637025 * FIX: Multiple *BSD compilation compatibility fixes, Bug ID 3380785 * FIX: precompose_w() failed if tail character is decomposed surrogate pair Changes in 2.2.0 ============== * NEW: afpd: new volume option "nonetids" * NEW: afpd: ACL access check caching * NEW: afpd: FCE event notifications * NEW: afpd: new option "-mimicmodel" for specifying Bonjour model registration * UPD: Support for Berkeley DB 5.1 * UPD: case-conversion is based on Unicode 6.0.0 * UPD: cnid_metad: allow up to 4096 volumes * UPD: afpd: only forward SIGTERM and SIGUSR1 from parent to childs * UPD: afpd: use internal function instead of popening du -sh in order to calculate the used size of a volume for option "volsizelimit" * UPD: afpd: Add negative UUID caching, enhance local UUID handling * FIX: afpd: configuration reload with SIGHUP * FIX: afpd: crashes in the dircache * FIX: afpd: Correct afp logout vs dsi eof behaviour * FIX: afpd: new catsearch was broken * FIX: afpd: only use volume UUIDs in master afpd * FIX: dbd: Multiple fixes, reliable locking * FIX: ad file suite: fix an error that resulted in CNID database inconsistencies Changes in 2.2beta4 =================== * NEW: afpd: new afpd.conf options "tcprcvbuf" and "tcpsndbuf" to customize the corresponding TCP socket options. * NEW: afpd: new afpd.conf option "nozeroconf" which disabled automatic Zeroconf service registration. * FIX: afpd: generate mersenne primes for DHX2 UAM once at startup, not for every login * FIX: afpd: DSI streaming deadlock * FIX: afpd: extended sleep * FIX: afpd: directory cache * FIX: Support for platforms that do not have the *at functions * UPD: afpd: put POSIX write lock on volume files while reading them Changes in 2.2beta3 =================== * FIX: afpd: fix option volsizelimit to return a usefull value for the volume free space using `du -sh` with popen * FIX: afpd: fix idle connection disconnects * FIX: afpd: don't disconnect sessions for clients if boottimes don't match * FIX: afpd: better handling of very long filenames that contain many multibyte UTF-8 glyphs Changes in 2.2beta2 ==================== * NEW: afpd: AFP 3.3 * UPD: afpd: AFP 3.x can't be disabled Changes in 2.2beta1 ==================== * FIX: composition of Surrogate Pair * UPD: gentoo,suse,cobalt,tru64: inistscript name is "netatalk", not "atalk" * UPD: gentoo: rc-update install don't hook in the Makefile Changes in 2.2alpha5 ==================== * UPD: afpd: new option "searchdb" which enables fast catalog searches using the CNID db. * UPD: Case-insensitive fast search with the CNID db * UPD: cnid_dbd: afpd now passes the volume path, not the db path when connecting for a volume. cnid_dbd will read the ".AppleDesktop/.volinfo" file of the volume in order to figure out the CNID db path and the volume charset encoding. Changes in 2.2alpha4 ==================== * NEW: Enhanced CNID "dbd" database for fast name search support. Important: this makes cnidscheme "cdb" incompatible with "dbd". * NEW: afpd: support for fast catalog searches * NEW: ad utility: ad find * UPD: afpd: CNID database versioning check for "cdb" scheme * UPD: cnid_dbd: CNID database versioning and upgrading. Additional CNID database index for fast name searches. Changes in 2.2alpha3 ==================== * FIX: afpd: various fixes * FIX: Any daemon did not run if atalkd doesn't exist (redhat/debian) Changes in 2.2alpha2 ==================== * FIX: afpd: fix compilation error when ACL support is not available * FIX: Ensure Appletalk manpages and config files are distributed Changes in 2.2alpha1 ==================== * NEW: ad utility: ad cp * NEW: ad utility: ad rm * NEW: ad utility: ad mv * NEW: afpd: dynamic directoy and CNID cache (new config option -dircachesize) * NEW: afpd: POSIX 1e ACL support * NEW: afpd: automagic Zeroconf registration with avahi, registering both the service _afpovertcp._tcp and TimeMachine volumes with _adisk._tcp. * UPD: afpd: ACLs usable (though not visible on the client side) without common directory service, by mapping ACLs to UARight * UPD: afpd: performance improvements for ACL access calculations * UPD: AppleTalk is disabled by default at configuration time. If needed use configure switch --enable-ddp. * FIX: afpd: Solaris 10 compatibilty fix: don't use SO_SNDTIMEO/SO_RCVTIMEO, use non-blocking IO and select instead. * FIX: cnid_dbd: Solaris 10 compatibilty fix: don't use SO_SNDTIMEO/SO_RCVTIMEO, use non-blocking IO and select instead. * REM: afile/achfile/apple_cp/apple_mv/apple_rm: use ad Changes in 2.1.6 ================ * FIX: afpd: Fix for LDAP user cache corruption * FIX: afpd: Fix for not shown ACLs for when filesyem uid or gid couldn't be resolved because (eg deleted users/groups) * FIX: gentoo: cannot set $CNID_CONFIG * FIX: ubuntu: servername was empty * FIX: Solaris: configure script failed to enable DDP module * FIX: AppleDouble buffer overrun by extremely long filename * UPD: afpd: return version info with machine type in DSIGetStatus * UPD: dbd: use on-disk temporary rebuild db instead of in-memory db * UPD: suse: initscript update Changes in 2.1.5 ================ * UPD: afpd: support newlines in -loginmesg with \n escaping syntax * UPD: afpd: support for changed chmod semantics on ZFS with ACLs in onnv145+ * FIX: afpd: fix leaking ressource when moving objects on the server * FIX: afpd: backport Solaris 10 compatibilty fix from 2.2: don't use SO_SNDTIMEO/SO_RCVTIMEO, use non-blocking IO and select instead. * FIX: afpd: misaligned memory access on Sparc in ad_setattr, fixes bug 3110004. * FIX: cnid_dbd: backport Solaris 10 compatibilty fix from 2.2: don't use SO_SNDTIMEO/SO_RCVTIMEO, use non-blocking IO and select instead. Changes in 2.1.4 ================ * FIX: afpd: Downstream fix for FreeBSD PR 148022 * FIX: afpd: Fixes for bugs 3074077 and 3074078 * FIX: afpd: Better handling of symlinks in combination with ACLs and EAs. Fixes bug 3074076. * FIX: dbd: Adding a file with the CNID from it's adouble file did not work in case that CNID was already occupied in the database * FIX: macusers: add support for Solaris * NEW: cnid_metad: use a PID lockfile * NEW: afpd: prevent log flooding * UPD: dbd: ignore ".zfs" snapshot directories * UPD: dbd: support interrupting -re mode Changes in 2.1.3 ================ * FIX: afpd: fix a serious error in networking IO code * FIX: afpd: Solaris 10 compatibilty fix: don't use SO_SNDTIMEO, use non-blocking IO and select instead for writing/sending data. * UPD: Support for BerkeleyDB 5.0. Changes in 2.1.2 ================ * FIX: afpd: fix for possible crash in case more then one server is configured in afpd.conf. * FIX: afpd: ExtendedAttributes in FreeBSD * FIX: afpd: sharing home folders corrupted the per volume umask. * UPD: afpd: umask for home folders is no longer taken from startup umask. * UPD: afpd: dont and permissions with parent folder when creating new directories on "upriv" volumes. * UPD: afpd: use 'afpserver@fqdn' instead of 'afpserver/fqdn@realm'. Prevents a crash in older GNU GSSAPI libs on eg. CentOS 5.x. Changes in 2.1.1 ================ * UPD: fallback to a temporary in memory tdb CNID database if the volume database can't be opened now works with the default backend "dbd" too. * FIX: afpd: afp_ldap.conf was missing from tarball. This only effected [Open]Solaris. * FIX: afpd: Check if options->server is set in set_signature, preventing SIGSEGV. * FIX: afpd: server signature wasn't initialized in some cases * FIX: DESTDIR support: DESTDIR was expanded twice * FIX: Fix for compilation error if header files of an older Netatalk version are installed. Changes in 2.1-release ====================== * NEW: afpd: new volume option "volsizelimit" for limitting reported volume size. Useful for limitting TM backup size. * UPD: dbd: -c option for rebuilding volumes which prevents the creation of .AppleDouble stuff, only removes orphaned files. Changes in 2.1-beta2 ==================== * NEW: afpd: static generated AFP signature stored in afp_signature.conf, cf man 5 afp_signature.conf * NEW: afpd: clustering support: new per volume option "cnidserver". * UPD: afpd: set volume defaults options "upriv" and "usedots" in the volume config file AppleVolumes.default. This will only affect new installations, but not upgrades. * FIX: afpd: prevent security attack guessing valid server accounts. afpd now returns error -5023 for unknown users, as does AppleFileServer. Changes in 2.1-beta1 ==================== * NEW: afpd: AFP 3.2 support * NEW: afpd: Extended Attributes support using native attributes or using files inside .AppleDouble directories. * NEW: afpd: ACL support with ZFS * NEW: cnid_metad: options -l and -f to configure logging * NEW: IPv6 support * NEW: AppleDouble compatible UNIX files utility suite `ad ...`. With 2.1 only `ad ls`. * NEW: CNID database maintanance utility dbd * NEW: support BerkeleyDB upgrade. Starting with the next release after 2.1 in case of BerkeleyDB library updates, Netatalk will be able to upgrade the CNID databases. * NEW: afpd: store and read CNIDs to/from AppleDouble files by default. This is used as a cache and as a backup in case the database is deleted or corrupted. It can be disabled with a new volume option "nocnidcache". * NEW: afpd: sending SIGINT to a child afpd process enables debug logging to /tmp/afpd.PID.XXXXXX. * NEW: configure args to download and install a "private" Webmin instance including only basic Webmin modules plus our netatalk.wbm. * NEW: fallback to a temporary in memory tdb CNID database if the volume database can't be opened. * NEW: support for Unicode characters in the range above U+010000 using internal surrogate pairs * NEW: apple_dump: utility to dump AppleSingle and AppleDouble files * NEW: afpldaptest: utility to check afp_ldap.conf. * UPD: atalkd and papd are now disabled by default. AppleTalk is legacy. * UPD: slp advertisement is now disabled by default. server option -slp SRVLOC is legacy. * UPD: cdb/dbd CNID backend requires BerkeleyDB >= 4.6 * UPD: afpd: default CNID backend is "dbd" * UPD: afpd: try to install PAM config that pulls in system|common auth * UPD: afpd: symlink handling: never followed server side, client resolves them, so it's safe to use them now. * UPD: afpd: Comment out all extension->type/creator mappings in AppleVolumes.system. They're unmaintained, possibly wrong and do not fit for OS X. * FIX: rewritten logger * FIX: afpd: UNIX permissions handling * FIX: cnid_dbd: always use BerkeleyDB transactions * FIX: initscripts installation now correctly uses autoconf paths, ie they're installed to --sysconfdir. * FIX: UTF-8 volume name length * FIX: atalkd: workaround for broken Linux 2.6 AT kernel module: Linux 2.6 sends broadcast queries to the first available socket which is in our case the last configured one. atalkd now tries to find the right one. Note: now a misconfigured or plugged router can broadcast a wrong route ! * REM: afpd: removed CNID backends "db3", "hash" and "mtab" * REM: cnid_maint: use dbd * REM: cleanappledouble.pl: use dbd * REM: nu: use `macusers` instead Changes in 2.0.5 ================ * NEW: afpd: Time Machine support with new volume option "tm". * FIX: papd: Remove variable expansion for BSD printers. Fixes CVE-2008-5718. * FIX: afpd: .AppleDxxx folders were user accessible if option 'usedots' was set * FIX: afpd: vetoed files/dirs where still accessible * FIX: afpd: cnid_resolve: don't return '..' as a valid name. * FIX: uniconv: -d option wasn't working Changes in 2.0.4 ================ * REM: remove timeout * NEW: afpd: DHX2 uams using GNU libgcrypt. * NEW: afpd: volume options 'illegalseq', 'perm' and 'invisibledots' 'ilegalseq' encode illegal sequence in filename asis, ex "\217-", which is not a valid SHIFT-JIS char, is encoded as U\217 -. 'perm' value OR with the client requested permissions. (help with OSX 10.5 strange permissions). Make dot files visible by default with 'usedots', use 'invisibledots' for keeping the old behavior, ie for OS9 (OSX hide dot files on its own). * NEW: afpd: volume options allow_hosts/denied hosts * NEW: afpd: volume options dperm/fperm default directory and file permissions or with server requests. * NEW: afpd: afpd.conf, allow line continuation with \ * NEW: afpd: AppleVolumes.default allow line continuation with \ * NEW: afpd: Mac greek encoding. * NEW: afpd: CJK encoding. * UPD: afpd: Default UAMs: DHX + DHX2 * FIX: afpd: return the right error in createfile and copyfile if the disk is full. * FIX: afpd: resolveid return the same error code than OSX if it's a directory * FIX: afpd: server name check, test for the whole loopback subnet not only 127.0.0.1. * UPD: afpd: limit comments size to 128 bytes, (workaround for Adobe CS2 bug). * UPD: afpd: no more daemon icon. * UPD: usedots, return an invalide name only for .Applexxx files used by netatalk not all files starting with .apple. * UPD: cnid: increase the number of cnid_dbd slots to 512. * FIX: cnid: dbd detach the daemon from the control terminal. * UPD: cnid: never ending Berkeley API changes... * UPD: cnid: dbd add a timeout when reading data from afpd client. * UPD: cnid: Don't wait five second after the first error when speaking to the dbd backend. * FIX: papd: vars use % not $ * FIX: papd: quote chars in popen variables expansion. security fix. * FIX: papd: papd -d didn't write to stderr. * FIX: papd: ps comments don't always use () * FIX: many compilation errors (solaris, AFS, Tru64, xfs quota...). Changes in 2.0.3 ================ * NEW: afpd: add a cachecnid option that controls if afpd should use the IDs stored in the AD2 files as cache. Defaults to off. * UPD: afpd: deal with more than 32 groups. * FIX: afpd: several catsearch fixes, based on patch from TSUBAKIMOTO Hiroya. * FIX: afpd: fix a race when a client very quickly reconnects and tries to kill its old session. * FIX: afpd: OSX style symlink caused problems with Panther clients. * FIX: afpd: old files with default type didn't show the right icon in finder, from Shlomi Yaakobovich, slightly modified. * FIX: cnid_check: disable cnid_check if CNID db was configured with transactions and really bail out after the first error. * FIX: admin-group configure option was broken. * FIX: several problems with IDs cached in AD2 files. * FIX: Ignore BIDI in UTF8 hints from OSX. * FIX: Lots of gcc warning fixes. * FIX: small configure script changes. Changes in 2.0.2 ================ * NEW: cnid: Add an indexes check and rebuild, optional for dbd (parameter check default no), standalone program cnid_index for cdb. * UPD: Enhanced afpd's -v command line switch and added -V for more verbose information * UPD: uams_gss: build the principal used by uams_gss.so from afpd's configuration, don't use GSS_C_NT_HOSTBASED_SERVICE * UPD: cnid_dbd: add process id in syslog and small clean up * REM: remove netatalkshorternamelinks.pl cf. SF bug [ 1061396 ] netatalkshorternamelinks.pl broken * FIX: afpd: check for DenyRead on FPCopyFile * FIX: afpd: add missing flush for AD2 Metadata on FPCopyFile, SF bug [ 1055691 ] Word 98 OS 9 Saving an existing file * FIX: afpd: Deal with AFP3 connection and type 2 (non-UTF8) names. reported by Gair Heaton, HI RESOLUTION SYSTEMS * FIX: afpd: Broken 'crlf' option * FIX: afpd: fix SF bug [ 1079622 ] afpd/dhx memory bug, by Ralf Schuchardt * FIX: afpd: Return an error if we cannot get the db stamp in afp_openvol. * FIX: afpd: Fix slp registration with Solaris9 slpd, from hat at fa2.so-net.ne.jp Changes in 2.0.1 ================ * NEW: --enable-debian configure option. Will install /etc/init.d/atalk to get not in conflict with standard debian /etc/init.d/netatalk. Reads netatalk.conf from $ETCDIR and not from /etc/default/ * UPD: Disable logger code by default. Log to syslog instead * UPD: changed netatalk.conf default settings to prevent problems with AppleTalk zone names containing spaces * FIX: insecure tempfile handling bug in etc2ps.sh, found by Trustix, CAN-2004-0974. * REM: remove add_netatalk_printer and netatalk.template from stable branch until fixed. (possible symlink vulnerabilities) * FIX: afpd: set hasBeenInited in default finder info. This bug caused endless finder refreshes with OS9 finder if the noadouble option was used. From TSUBAKIMOTO Hiroya. * FIX: afpd: fix a bug in default CREATOR/TYPE handling. Due to this bug the type/creator mappings in AppleVolumes.system were ignored, causing problems i.e. with OS9 clients. * FIX: AppleVolumes.system: By default don't define a CREATOR/TYPE for a file of unknown type. * FIX: fix two Tru64 UNIX compilation errors, from Burkhard Schmidt bs AT cpfs.mpg.de * FIX: afpd: FPMapId wasn't using UTF8 for groups if requested by client. Changes in 2.0.0 ================ * UPD: afpd: add an error message if -ipaddr parameter cannot be parsed * UPD: updated documentation * FIX: afpd: fix a file descriptor and memory leak with OSX ._ resource fork * FIX: afpd: Prevent overwriting a file by renaming a file in the same directory to the same name. Won't work with OSX, the dest file gets deleted by OSX first. * FIX: sometimes '0' was used instead of 0 for creator/type * FIX: removed setpgrp check from configure, we don't use it anymore and it doesn't work with cross compile. * FIX: fix for Solaris "make maintainer-clean", from Alexander Barton * FIX: fix username matching bug in afppasswd. from kanai at nadmin dot org * FIX: reworked username check a little. Depending on the UAM, the wrong username _could_ have been selected. Changes in 2.0-rc2 ================== * UPD: use 0 0 for default creator/type rather than UNIX TEXT, from Shlomi Yaakobovich. * UPD: updated documentation * UPD: change machine type from Macintosh to Netatalk in status reply * FIX: afpd: CopyFile only create a resource fork for destination if source has one. * FIX: afpd: mangling: for utf8 --> max filename length is 255 bytes, else 31. * FIX: cnid_dbd: fix a signed/unsigned, 16/32 bits mismatch. from Burkhard Schmidt, bs at cpfs.mpg.de. * FIX: afpd: After ad_setid don't flush resource fork if it has not been modified. * FIX: NEWS: Fixed ancient NEWS entries. Removed umlauts * FIX: fix macname cache, SF bug 1021642 * FIX: revert Makefile change from 2.0-rc1. We have to include BDB_CFLAGS after CFLAGS Changes in 2.0-rc1 ================== * NEW: new manual page for asip-status.pl * UPD: updated documentation * UPD: uams: link uam_dhx_passwd.so to lcrypt before lcrypto. might help with MD5 passwords * UPD: Improved BerkeleyDB detection * UPD: sys/solaris/Makefile.in: enable 'make check', from Alexander Barton * UPD: tcp wrappers detection should work on OpenBSD as well now * UPD: macbin: increase the maximum size of macbinary forks, as suggested by Sourceforge bug ID 829221 * UPD: ASP: rework getstatus. use several ASP packets if the client allows it, otherwise just send as much as we can * FIX: FreeBSD 5 build, from Alex Barton (alex at barton.de) * FIX: OSX 10.3 build * FIX: papd: workaround a problem with PJL before Postscript * FIX: afpd: make sure we only disconnect on old session if the users match * FIX: apfd: Quark6 mangled long filenames should work better now * FIX: enhance ADv1 to ADv2 conversion. Fixed a SIGSEGV reported by Mark Baker * FIX: better detection of invalid resource forks * FIX: fix some linking problems on OpenBSD * FIX: afpd: catsearch.c, filedir.c: fix bogus casts, from Olaf Hering (olh at suse.de) * FIX: afpd: don't try to create special folders and .volinfo on read-only volumes * FIX: iconv/unicode enhancements. fixed a sigsegv on conversion error * FIX: configure.in: fix a typo, reported by Joerg Rossdeutscher * FIX: uniconv: enhanced uniconv behaviour * FIX: fixed some Solaris compilation problems * FIX: papd/Makefile.am: add a missing $DESTDIR, from Vlad Agranovsky * FIX: afpd: quota.c: remove a c99 declaration, from Yann Rouillard * FIX: configure.in: Solaris/gcc 3.0 fix, from Yann Rouillard * FIX: afpd: fix a SIGSEGV when sharing home dirs without any options in AppleVolumes. * FIX: numerous small bugfixes Changes in 2.0-beta2 ==================== * NEW: atalkd, papd and npb tools now support nbpnames with extended characters * NEW: integrated CUPS support for papd * NEW: optionally advertise SSH tunneling capabilties * NEW: automatic logfile removal for cnid_metad * NEW: asip-status.pl has been added to netatalk * UPD: updated documentation * UPD: we now require Berkeley DB >= 4.1 * UPD: 64bit Linux fixes from Stew Benedict, Mandrakesoft * UPD: remove --enable-sendfile * UPD: more verbose error messages * FIX: better handling for resource forks without read access * FIX: Tru64 build, by Burkhard Schmidt * FIX: MIT Kerberos detection * FIX: varios *BSD compile problems * FIX: compile problem with libiconv, reported by Joe Marcus Clarke * FIX: adv1tov2: make it work with the new structure * FIX: afpd: filenames longer than 127 bytes were not enumerated correctly, reported by Thies C. Arntzen * FIX: afpd: return IP before FQDN in status reply. * FIX: afpd: Mac chooser could crash on a codepage conversion error * FIX: afpd: KerberosV auth with Panther clients, make long AD tickets work, reported by Andrew Smith * FIX: atalkd: could send invalid NBPLKUP replies, e.g with more than 15 printers. Reported by Almacha * FIX: papd: fix papd.conf parsing problems with consecutive ':' and missing newline. Reported by Craig White. * FIX: megatron: make megatron work with UTF-8 volumes * FIX: timeout: running timeout with commands which accept arguments, from Yuval Yeret. * FIX: uniconv: fix a SEGFAULT, reported by Matthew Geier * FIX: pam detection: PAM_C/LDFLAGS were always empty, from Alexander Barton * FIX: numerous small bugfixes. Changes in 2.0-beta1 ==================== * NEW: OSX style adouble scheme * NEW: japanese SHIFT_JIS codepage (iconv supplied) * NEW: Solaris kernel module build integrated with configure * NEW: Gentoo start scripts * NEW: cnid_dbd doesn't use transactions by default * FIX: afpd: the volume casefold option was broken * FIX: afpd: update AD2 headers and keep owner on file exchange * FIX: Solaris 9 and FreeBSD 4.9/5.2 compilation * FIX: free space reported with groups quotas on Linux * FIX: OS9/OS X didn't update free space * FIX: finder crash if folder opened got deleted by another process * FIX: randnum UAM wasn't AFP3 ready * FIX: numerous small bugfixes. Changes in 2.0-alpha2 ===================== * NEW: uniconv tool for converting volume encoding. * NEW: afpd: Make sure getstatus doesn't return loopback address as server IP. * NEW: afpd: Specify USEDOTS with MSWINDOWS implicitely. * NEW: afpd: SRVLOC register with IP address instead of hostname by default, if -fqdn is specified register with FQDN. Added extended character support for SLP, non ASCII characters are escaped Added ZONE to registration. * NEW: atalkd: Make atalkd set interfaces to ALLMULTI on linux by default. * NEW: cnid_metad: Use DB_PRIVATE attribute for dbd backend without transaction. * FIX: afpd: Partial workaround for an OSX client deadlock. * FIX: afpd: Reenumerate folder if db is out of sync in resolveID. * FIX: afpd: Don't modify modification date in copyfile. * FIX: afpd: Variable $v substitution: always use name defined in config files. * FIX: libatalk: Speed optimisation for byte locking was broken on resource fork. * FIX: Solaris 9 compilation. * FIX: Tru64 compilation fixes. * FIX: AFS compilation fixes. * FIX: strncpy bugfix. * FIX: configure, man pages update and small bugfixes. Changes in 2.0-alpha1 ===================== * NEW: afpd: We now support AFP 3.x, which features long filenames and large file support * NEW: CNID handling completely reworked. We now use per Volume configurable CNID backends. * NEW: Two new daemons, cnid_metad and cnid_dbd to implement the dbd CNID backend. Using Berkeley DB transactions with the CNID database should be safe now. * NEW: The on disk format of the CNID database has changed. We now support 8 byte device and inode numbers and an additinal type field that should make detection of file/directory changes outside of afpd more robust. Changed from HASH to BTREE access which speeds things up in certain cases and reduces database file size. * NEW: Long file name mangling is now implemented using the CNID ID, so no database is required to map names to mangled names. This is the same method Mac OS X uses. * NEW: New format (version 2) for Metadata in AppleDouble files. We record device and inode of the underlying file as well as the CNID. This can be used for recovery and speeds up access to the CNID. * NEW: The old NLS codepage system has been removed. It was replaced by an iconv based conversion system, which provides much more flexibility. * NEW: You can safely use extended characters in volume names and for SIGUSR2 messaging. * NEW: The default volume encoding is UTF-8. * NEW: All documentation is now generated using DocBook. New or completely reworked sections about installing, setting up and upgrading Netatalk replace various README files in the doc directory. * FIX: Protect afpd better against unexpected signals during updates of the CNID database with the cdb backend. This makes database corruption less likely. * FIX: All manpages have been reviewed and should now be up to date. * FIX: Tons of bug fixes since 1.6.4. Please consults the CVS change log for details. Changes in 1.6.4 ================ * NEW: afpd: Using the mswindows option now implicitly specifies usedots. [Sam Noble] * UPD: afpd.8: Updated the option documentation. [Thomas Kaiser, Sebastian Rittau] * FIX: configure: Removed broken --with-flock-locks option. [Bjoern Fernhomberg] * FIX: libatalk: Do not log network probe (OSX 10.3). [Didier Gautheron] * FIX: libatalk: Deadlock in signal handlers. [Didier] * FIX: libatalk: Compilation with Linux kernel 2.6 fixed. [Sebastian, Bjoern] * FIX: afpd: Solaris compile issues. [Bjoern] * FIX: afpd: If connection broke in dsi_tickle the child did never die. [Bjoern] * FIX: afpd: Catsearch, fixes a possible segmentation fault. [Bjoern] * FIX: afpd: Compilation issues. [Olaf Hering, Sebastian] * FIX: cnid: Fix compile problems on Tru64. [Burkhard Schmidt] * FIX: megatron: Fixed an uninitialized variable. [Olaf] * FIX: installation: Don't overwrite PAM file if --enable-overwrite configure option is not set. [Sam, Ryan Cleary] * FIX: installation: Fixed BSD installation. [Toru TAKAMIZU] * FIX: docs: Removed ssl-dir/ssl-dirs confusion from doc/INSTALL. [Bjoern] Changes in 1.6.3 ================ * UPD: afpd: Infrastructural support for an upcoming Kerberos 5 UAM. [Sam Noble] * UPD: uams_dhx_passwd: Better random seed in Tru64. [Burkhard Schmidt] * FIX: afpd: Bug in AFP connection negotiation stage. [Sam] * FIX: afpd: Catsearch, when Mac and unix name differ, search on attributes. * FIX: afpd: Files could be opened for writing on read-only filesystems. * FIX: afpd: Debugging using SIGUSR1 was broken. [Stefan Muenkner] * FIX: afpd: Segfault after login. [Robby Griffin, Sean Bolton] * FIX: psf: Correct path to etc2ps.sh. * FIX: shell_utils: Don't distribute generated files. * FIX: aecho: -A option didn't work. [Chris Shiels] * FIX: configure: Berkeley DB path detection could be wrong. [Stefan] * FIX: Automake build fixes. Changes in 1.6.2 ================ * FIX: atalkd: Fixes for reading long configuration file lines. [Dan Wilga] * FIX: afpd: CNID id allocation in a multiuser environment. * FIX: papd: Fix PSSP support when PAM is enabled. * FIX: macusers: Can now cope with IP addresses as well as host names. * FIX: etc2ps.sh: Install correctly. Changes in 1.6.1 ================ * UPD: Improve --enable-fhs. [Olaf Hering] * UPD: Add BDB 4.1.x support. * UPD: Add more documentation on CNID, as well as list which versions of Berkeley DB are supported. * FIX: Codepage file maccode.koi8-r is now correctly cleaned. * FIX: Fix init script location on SuSE. [Olaf] * FIX: Build fixes. [Olaf, Steven N. Hirsch] * FIX: Various bugs when a user doesn't have access permission to a folder. (Fixes an OSX kernel panic.) * FIX: CNID, folders' DID handling with concurrent access or symlinks. (Fixes an endless loop in afpd.) Changes in 1.6.0 ================ * FIX: pap looks at the STDOUT file descriptor to see if it's connected to a tty, instead of STDIN. Changes in 1.6pre2 ================== * UPD: Removed --with-catsearch option from configure and enable FPCatSearch by default. * UPD: The dbpath argument does now support variable substitution. * FIX: Build fix for non-GNU-C compilers in libatalk/util/logger.c. * FIX: Two directories with the same name but different case confused the Mac Finder. * FIX: The ROOT_PARENT directory could get invalidated. Changes in 1.6pre1 ==================== * NEW: Long file name mangling support. * NEW: Improved log file support. * NEW: Server-side find capability ("FPCatSearch") * NEW: Concurrent datastore (CDB) is now the default CNID datastore. This should be heavily tested in a multiuser environment. * NEW: Variable substitution support has been added for the dbpath AppleVolume option. * UPD: CNID DID handling is now enabled by default. * FIX: Various bug and build fixes as well as code cleanups. Changes in 1.5.5 ================ * NEW: Allow afpd debugging to be enabled by sending the afpd process a SIGUSR1. * NEW: Allow SLP to be disabled per afpd process by adding a new -noslp flag to afpd.conf. * FIX: Use server name (if not NULL) for the SLP URL. * FIX: papd: buffer overflow during config file read (Olaf Hering) Changes in 1.5.4 ================ * FIX: File open read only and then read write (aka pb with Illustrator). * FIX: Problems with unexpected EOF when reading files on a ddp connection Photoshop, old finder. * FIX: --with-nls-dir option does now work Changes in 1.5.3 ================ * UPD: Extend the --disable-shell-check functionality to ignore users with _no_ shell. Also, send a log message if a user is refused login based on the fact that they have no shell. * UPD: Autoconf updates. * UPD: Tru64 afpd authentication updates. * UPD: As always: lots of minor code cleanups. * FIX: Problems with Photoshop trying to open image files has been corrected. * FIX: Preserve special permission bits when creating or modifying directories. * FIX: afp_deleteid() now deletes the specified file and not the parent directory. * FIX: papd does now announce that it supports binary data to its clients. * FIX: NetBSD ELF support. * FIX: acleandir.rc is now installed in the bin directory. * FIX: megatron does now compile even if compiled with -DDEBUG. * FIX: Clean up some syslog messages. Changes in 1.5.2 ================ * NEW: NetBSD support contributed by David Rankin and NetBSD contributors. This includes a new configure option --enable-netbsd. * NEW: Add the -client_polling afpd.conf flag to allow for clients to poll the server every 10 seconds for open window updates. Currently this is the only way to get asynchronous directory updates. * UPD: Use separate macro for AFS configure check. * UPD: Some Perl scripts are now (partially) auto-generated. This improves out-of-the-box usage of Netatalk. * UPD: Solaris Kernel Makefile is now auto-generated. This fixes some path issues, but isn't perfect, yet. Added some Solaris compatibility fixes to the Kernel sources, too. * UPD: CNID DB code sync'd with the current CVS version. NOTE: Using this code requires you to delete _all_ existing .AppleDB directories in order to avoid database corruption! * FIX: The file AppleVolumes.system contained wrong line breaks so that not all file types were properly recognized. * FIX: AFS compilation would fail due to a misnamed variable. * FIX: SLP configure check was wrong so SLP did not compile. * FIX: Fix the way quotas are handled under certain situations. * FIX: Do not enable debugging code if debugging option is not set. * FIX: Some problems with wrongly assigned DIDs were fixed. * FIX: Various bug fixes and code cleanups. Changes in 1.5.1 ================ * NEW: Added a program called cnid_didname_verify that can be used to verify the consistency of the CNID database. * NEW: New afpd option: -timeout. Warning: This still doesn't do what it's supposed to! * UPD: Code cleanups and compatibility fixes to macusers. * UPD: AppleVolumes.system was cleaned up. * FIX: Really fix Tru64 compilation (see last entry). * FIX: Hand correct error value back to AFP client when deleting files or directories fails. * FIX: Leading or trailing spaces are now forbidden on volumes that have the AFPVOL_MSWINDOWS flag set. * FIX: Minor code cleanups and warning fixes. * FIX: Make quota support work on FreeBSD. Changes in 1.5.0 ================ * FIX: Compilation on Tru64 systems was broken, since libtool's acinclude.m4 file on the packagers system did not contain the necessary patch. * FIX: On some systems, atalkd refuses to start, since it couldn't detect any interfaces. This was caused by an overzealous validity check. Changes in 1.5rc2 ================= * FIX: contrib/shell_utils/lp2pap.sh was erased when "make clean" was called. Now we distribute lp2pap.sh.tmpl instead, and lp2pap.sh is automatically generated during package build. * FIX: Some platforms (notably Tru64) don't have the snprintf() call, which was used in etc/afp/afp_config.c. This call was replaced by sprintf() and prior bounds checking. Changes from the 1.4b1 release: =============================== * Fixed the maximum free/total volume size in afpd. * Made ~ the default volume in afpd. * Fixed pid file handling and changed setpgrp() to setpgid() in afpd, papd, and atalkd. * Added code to afpd to set the Unix file time stamps with utime(). * Fixed a bug in papd's printcap code which limited it to 15 or so printers. * Fixed papd's handling of piped printers. * Fixed papd's handling of bad job names. * Fixed atalkd to send NBP LKUP packets from NBP port. * Added "sync;sync;sync" to Solaris kinstall to help with streams file corruption. * Added nlocalrts to streams ddp.conf. Thanks Thomas Tornblom. * Fixed signed extension infinite loop in Solaris module. * Moved all the config files to .../config. Changes from the 1.3.3 release: =============================== * Added code from Sun Microsystems, Inc (OPCOM) for Solaris support. See COPYRIGHT. * Added support for FreeBSD, mostly changes by Mark Dawson and Julian Elischer. * All sorts of other stuff. Changes from the 1.3.1 release: =============================== * Added options to psf's filter names to support accounting on HPs. !!! NOTE: The location of the filters has changed, see the man page for where. * Added code from Alan Cox to support Linux. * Rewrote papd. Now handles dropped connections better. Configuration has been modernized. !!! NOTE: The format of the configuration file has changed, but NOT THE NAME. * Added Kerberos support to papd. * atalkd now removes routes on a SIGTERM. Still can't just restart it, but it's closer. * Changed atalkd and the kernel driver to remove a hack added to support sending to 0.255. Now the kernel will allow multiple open sockets with the same port, so long as the addess associated with the port is different. atalkd now opens a socket for each port on each interface. * atalkd now rewrites its configuration file. If no configuration file is given, one will be generated. Permissions on the new configuration file will be inherited from the old one. If there is no old one, permissions default to 644. Won't rewrite the file if the owner doesn't have write permission. * Removed support for the "AFS Kerberos UAM", in favor of the "AuthMan UAM". Kerberos support should now be much more straight-forward. * Fixed a bug in afpd which would cause incorrect group calculations on ultrix machines. * Fixed a bug in afpd which causes SimpleText and some other applications to silently fail to write. There's also a bug in MacOS, but we can't fix that. * Fixed a bad interaction with afpd and AFS which would cause file writes to not propogate between AFS clients. * !!! CHANGED the name(s) of afpd's config files. The new files are AppleVolumes.system and AppleVolumes.default. If AppleVolumes.system exists, it is always read, AppleVolumes.default is only read if the user has no AppleVolumes file. Included a flag "-u" to indicate which file has precedence. "-u" user wins, otherwise ".system" wins. * Rewrote the AppleVolumes parsing code. Now works. * Added a filename extension mapping to afpd. User always takes precedence, regardless of the "-u" flag. Code to change the type of all Unix files contributed by Kee Hinckley . * afpd now supports both UFS and AFS volumes simultaneously. It also uses access() to attempt to calculate reasonable Mac permissions for AFS directories. * Changed reporting of file times. Files that are written from Unix now update the Mac's idea of the files modification time. Unix mtime is now reported instead of ctime. * Added support for a new UAM to afpd. This requires that client Macs have MacTCP and AuthMan installed. Should make running afpd for AFS easier. * Removed code so that otherwise valid volumes for which the mounting user has no permission will appear in the volume selection dialog on the Mac gray-ed out. * Added code from Chris Metcalf of MIT to the AppleDouble library which improves permission inheritance. * Added code from G. Paul Ziemba of Alantec, Inc to better report errors in psf. Also changed psf to use syslog for errors that users aren't interested in. * Added information to psf's man page to better explain the interaction between psf, pap, and lpd. * Make psf/pap/psa do accounting when it's turnes on in /etc/printcap. * Changed pap's error message when there is no printer specified on the command line and no .paprc is found. Also heavily modified pap's man page to reflect changes in the "new" version of pap, including moving it from section 8 to section 1. * Fixed a byte-order bug in pap's sequence numbers. Doubt if pap has ever worked right on little endian machines! * Added a flag to pap to optionally close before receiving EOF from the printer. Off by default. psf calls pap with this option on. * Added timeouts to the nbp library calls. This means that processes won't hang when atalkd dies during boot, thus hanging your machine. Changes from the 1.3 release: ============================= * Fixed a bug in afpd which would cause APPL mappings to contain both mac and unix path names. The fixed code will handle the old (corrupted) database. * Fixed a *very* serious bug which would cause files to be corrupted when copying to afpd. * Fixed a bug in afpd which would cause replies to icon writes to contain the written icon. * Filled in the function code switch in afpd. Previously, a hacker could probably have used afpd to get unauthorized access to a machine running afpd. * Fixed a bug in the asp portion of libatalk.a which could cause the malloc()/free() database to be corrupted. * Fixed a bug in atalkd's zip query code. With this bug, only the first N % 255 nets get queried. However, since nets bigger than 255 are usually pretty unstable, the unqueried for nets will eventually get done, when N drops by one. * Suppressed a spurious error ("route: No such process") in atalkd. Changes from the 1.2.1 release: =============================== * atalkd is completely rewritten for phase 2 support. atalkd.conf from previous version will not work! * afpd now has better AFS support. In particular, the configuration for AFS was made much easier; a number of Kerberos-related byte-ordering and time problems were found; clear-text passwords were added (thanks to geeb@umich.edu). * afpd now handles Unix permissions much better (thanks to metcalf@mit.edu). * There are many, many more changes, but most are small bug fixes. Changes from the 1.2 release: ============================= * The Sun support now uses loadable kernel modules (a la VDDRV) instead of binary patches. As such, it should work on any sunos greater than 4.1, and is confirmed to work under 4.1.1 and 4.1.2. * The DEC support no longer requires source. It also runs under ultrix 4.1 and 4.2. It still requires patching your kernel, but the patches are limited to those files available to binary-only sites -- primarily hooks for things like netatalk. * The etc.rc script now uses changes made to nbprgstr (see below). * aecho now takes machine names on the command line. * nbplkup now takes a command line argument specifying the number of responses to accept. It also takes its defaults from the NBPLKUP environment variable. * nbprgstr may be used to register a name at any requested port. * afpd now logs if an illegal shell is used during login, instead of silently denying service. * A bug in afpd which caused position information for the directory children of the root of a volume to be ignored has been fixed. * Several typos in afpd which would cause include files necessary to ultrix to be skipped have been fixed. * atalkd will no long propagate routes to networks whose zone it doesn't know. * atalkd no longer dumps core if it receives a ZIP GetMyZone request from a network whose zone it doesn't know. (Since this currently can only happen from off net, it's not precisely a legal request.) * pap and papd (optionally) no longer check the connection id in PAP DATA responses. Both also maintain the function code in non-first-packet PAP DATA responses. These changes are work-arounds to deal with certain AppleTalk printer cards, notably the BridgePort LocalTalk card for HP LJIIISIs. * pap no longer sends an EOF response to each PAP SENDDATA request, only the first. * A bug in papd which would cause it to return a random value when printing the procset to a piped printer has been fixed. * A bug relating to NBP on reverse-endian machines has been fixed. * atp_rsel() from libatalk now returns a correct value even if it hasn't recieved anything yet. * atalk_addr() from libatalk no longer accepts addresses in octal format, since AppleTalk addresses can have leading zeros. Also it checks that the separator character is a '.'. * Pseudo man pages for nbplkup, nbprgstr, and nbpunrgstr, have been added. * The example in the psf(8) man page is now correct. * The man pages for changed commands have been updated. * The README files for various machine have been updated appropriately. netatalk-2.2.2/config.h.in0000644000175200017500000005764711671657261012325 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if the admin group should be enabled */ #undef ADMIN_GRP /* Define if AFS should be used */ #undef AFS /* Does extattr API work */ #undef BROKEN_EXTATTR /* BSD compatiblity macro */ #undef BSD4_4 /* Define if CNID Concurrent BDB backend should be compiled. */ #undef CNID_BACKEND_CDB /* Define if CNID Database Daemon backend should be compiled. */ #undef CNID_BACKEND_DBD /* Define if CNID LAST scheme backend should be compiled. */ #undef CNID_BACKEND_LAST /* Define if CNID TDB scheme backend should be compiled. */ #undef CNID_BACKEND_TDB /* CUPS API Version */ #undef CUPS_API_VERSION /* Required BDB version, major */ #undef DB_MAJOR_REQ /* Required BDB version, minor */ #undef DB_MINOR_REQ /* Required BDB version, patch */ #undef DB_PATCH_REQ /* Define if verbose debugging information should be included */ #undef DEBUG /* Define if debugging information should be included */ #undef DEBUG1 /* Define if you want to disable SIGALRM timers and DSI tickles */ #undef DEBUGGING /* Default CNID scheme to be used */ #undef DEFAULT_CNID_SCHEME /* Define if system (fcntl) locking should be disabled */ #undef DISABLE_LOCKING /* Define if shell check should be disabled */ #undef DISABLE_SHELLCHECK /* Define to enable spooldir support */ #undef DISABLE_SPOOL /* BSD compatibility macro */ #undef DLSYM_PREPEND_UNDERSCORE /* Define if you want to use the experimental dropkludge support */ #undef DROPKLUDGE /* Available Extended Attributes modules */ #undef EA_MODULES /* Define if you want compatibily with the FHS */ #undef FHS_COMPATIBILITY /* Define if you want forcing of uid/gid per volume */ #undef FORCE_UIDGID /* Define if OS is FreeBSD */ #undef FREEBSD /* Define to the type of elements in the array set by `getgroups'. Usually this is either `int' or `gid_t'. */ #undef GETGROUPS_T /* Define if dbtob takes two arguments */ #undef HAVE_2ARG_DBTOB /* Define if the data type long has 32 bit */ #undef HAVE_32BIT_LONGS /* Define if the data type long has 64 bit */ #undef HAVE_64BIT_LONGS /* Define to 1 if you have the `access' function. */ #undef HAVE_ACCESS /* Whether ACLs support is available */ #undef HAVE_ACLS /* Whether acl_from_mode() is available */ #undef HAVE_ACL_FROM_MODE /* Whether acl_get_perm_np() is available */ #undef HAVE_ACL_GET_PERM_NP /* Define to 1 if you have the header file. */ #undef HAVE_ACL_LIBACL_H /* Define to 1 if you have the `add_proplist_entry' function. */ #undef HAVE_ADD_PROPLIST_ENTRY /* Whether AIX ACLs are available */ #undef HAVE_AIX_ACLS /* set if struct at_addr is called atalk_addr */ #undef HAVE_ATALK_ADDR /* whether at funcs are available */ #undef HAVE_ATFUNCS /* Define to 1 if you have the `attropen' function. */ #undef HAVE_ATTROPEN /* Define to 1 if you have the `attr_get' function. */ #undef HAVE_ATTR_GET /* Define to 1 if you have the `attr_getf' function. */ #undef HAVE_ATTR_GETF /* Define to 1 if you have the `attr_list' function. */ #undef HAVE_ATTR_LIST /* Define to 1 if you have the `attr_listf' function. */ #undef HAVE_ATTR_LISTF /* Define to 1 if you have the `attr_remove' function. */ #undef HAVE_ATTR_REMOVE /* Define to 1 if you have the `attr_removef' function. */ #undef HAVE_ATTR_REMOVEF /* Define to 1 if you have the `attr_set' function. */ #undef HAVE_ATTR_SET /* Define to 1 if you have the `attr_setf' function. */ #undef HAVE_ATTR_SETF /* Define to 1 if you have the header file. */ #undef HAVE_ATTR_XATTR_H /* Use Avahi/DNS-SD registration */ #undef HAVE_AVAHI /* Uses Avahis threaded poll implementation */ #undef HAVE_AVAHI_THREADED_POLL /* Define to 1 if you have the `backtrace_symbols' function. */ #undef HAVE_BACKTRACE_SYMBOLS /* Define if dbtob is broken */ #undef HAVE_BROKEN_DBTOB /* Define to 1 if you have the `chmod' function. */ #undef HAVE_CHMOD /* Define to 1 if you have the `chown' function. */ #undef HAVE_CHOWN /* Define to 1 if you have the `chroot' function. */ #undef HAVE_CHROOT /* Define to 1 if you have the header file. */ #undef HAVE_CRYPT_H /* Define to enable CUPS Support */ #undef HAVE_CUPS /* Define if errno declaration exists */ #undef HAVE_DECL_ERRNO /* Define if sys_errlist declaration exists */ #undef HAVE_DECL_SYS_ERRLIST /* Define if sys_nerr declaration exists */ #undef HAVE_DECL_SYS_NERR /* Define to 1 if you have the `delproplist' function. */ #undef HAVE_DELPROPLIST /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the `dirfd' function. */ #undef HAVE_DIRFD /* Define to 1 if you have the `dlclose' function. */ #undef HAVE_DLCLOSE /* Define if you have the GNU dld library. */ #undef HAVE_DLD /* Define to 1 if you have the `dlerror' function. */ #undef HAVE_DLERROR /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `dlopen' function. */ #undef HAVE_DLOPEN /* Define to 1 if you have the `dlsym' function. */ #undef HAVE_DLSYM /* Define if you have the _dyld_func_lookup function. */ #undef HAVE_DYLD /* Define if errno declaration exists */ #undef HAVE_ERRNO /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the `extattr_delete_fd' function. */ #undef HAVE_EXTATTR_DELETE_FD /* Define to 1 if you have the `extattr_delete_file' function. */ #undef HAVE_EXTATTR_DELETE_FILE /* Define to 1 if you have the `extattr_delete_link' function. */ #undef HAVE_EXTATTR_DELETE_LINK /* Define to 1 if you have the `extattr_get_fd' function. */ #undef HAVE_EXTATTR_GET_FD /* Define to 1 if you have the `extattr_get_file' function. */ #undef HAVE_EXTATTR_GET_FILE /* Define to 1 if you have the `extattr_get_link' function. */ #undef HAVE_EXTATTR_GET_LINK /* Define to 1 if you have the `extattr_list_fd' function. */ #undef HAVE_EXTATTR_LIST_FD /* Define to 1 if you have the `extattr_list_file' function. */ #undef HAVE_EXTATTR_LIST_FILE /* Define to 1 if you have the `extattr_list_link' function. */ #undef HAVE_EXTATTR_LIST_LINK /* Define to 1 if you have the `extattr_set_fd' function. */ #undef HAVE_EXTATTR_SET_FD /* Define to 1 if you have the `extattr_set_file' function. */ #undef HAVE_EXTATTR_SET_FILE /* Define to 1 if you have the `extattr_set_link' function. */ #undef HAVE_EXTATTR_SET_LINK /* Define to 1 if you have the `fchmod' function. */ #undef HAVE_FCHMOD /* Define to 1 if you have the `fchown' function. */ #undef HAVE_FCHOWN /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fdelproplist' function. */ #undef HAVE_FDELPROPLIST /* Define to 1 if you have the `fgetea' function. */ #undef HAVE_FGETEA /* Define to 1 if you have the `fgetproplist' function. */ #undef HAVE_FGETPROPLIST /* Define to 1 if you have the `fgetxattr' function. */ #undef HAVE_FGETXATTR /* Define to 1 if you have the `flistea' function. */ #undef HAVE_FLISTEA /* Define to 1 if you have the `flistxattr' function. */ #undef HAVE_FLISTXATTR /* Define to 1 if you have the `fremoveea' function. */ #undef HAVE_FREMOVEEA /* Define to 1 if you have the `fremovexattr' function. */ #undef HAVE_FREMOVEXATTR /* Define to 1 if you have the `fsetea' function. */ #undef HAVE_FSETEA /* Define to 1 if you have the `fsetproplist' function. */ #undef HAVE_FSETPROPLIST /* Define to 1 if you have the `fsetxattr' function. */ #undef HAVE_FSETXATTR /* Define to 1 if you have the `fstatat' function. */ #undef HAVE_FSTATAT /* Define if memcpy is buggy */ #undef HAVE_GCC_MEMCPY_BUG /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `getea' function. */ #undef HAVE_GETEA /* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if you have the `getproplist' function. */ #undef HAVE_GETPROPLIST /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the `getusershell' function. */ #undef HAVE_GETUSERSHELL /* Define to 1 if you have the `getxattr' function. */ #undef HAVE_GETXATTR /* Define to 1 if you have the `get_proplist_entry' function. */ #undef HAVE_GET_PROPLIST_ENTRY /* Whether to enable GSSAPI support */ #undef HAVE_GSSAPI /* Define to 1 if you have the header file. */ #undef HAVE_GSSAPI_GSSAPI_GENERIC_H /* Define to 1 if you have the header file. */ #undef HAVE_GSSAPI_GSSAPI_H /* Define to 1 if you have the header file. */ #undef HAVE_GSSAPI_GSSAPI_KRB5_H /* Define to 1 if you have the header file. */ #undef HAVE_GSSAPI_H /* Wheter GSS_C_NT_HOSTBASED_SERVICE is in gssapi.h */ #undef HAVE_GSS_C_NT_HOSTBASED_SERVICE /* Whether HPUX ACLs are available */ #undef HAVE_HPUX_ACLS /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Whether IRIX ACLs are available */ #undef HAVE_IRIX_ACLS /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H /* LARGEFILE support */ #undef HAVE_LARGEFILE_SUPPORT /* Whether LDAP is available */ #undef HAVE_LDAP /* Define to 1 if you have the `lgetea' function. */ #undef HAVE_LGETEA /* Define to 1 if you have the `lgetxattr' function. */ #undef HAVE_LGETXATTR /* Define to 1 if you have the `crypt' library (-lcrypt). */ #undef HAVE_LIBCRYPT /* Define to 1 if you have the `crypto' library (-lcrypto). */ #undef HAVE_LIBCRYPTO /* Define to 1 if you have the `des' library (-ldes). */ #undef HAVE_LIBDES /* Define if you have the libdl library or equivalent. */ #undef HAVE_LIBDL /* Define if the DHX2 modules should be built with libgcrypt */ #undef HAVE_LIBGCRYPT /* Define to 1 if you have the `gss' library (-lgss). */ #undef HAVE_LIBGSS /* Define to 1 if you have the `gssapi' library (-lgssapi). */ #undef HAVE_LIBGSSAPI /* Define to 1 if you have the `gssapi_krb5' library (-lgssapi_krb5). */ #undef HAVE_LIBGSSAPI_KRB5 /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* define if you have libquota */ #undef HAVE_LIBQUOTA /* Define to 1 if you have the `security' library (-lsecurity). */ #undef HAVE_LIBSECURITY /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the `link' function. */ #undef HAVE_LINK /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_DQBLK_XFS_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_XFS_FS_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_XQM_H /* Define to 1 if you have the `listea' function. */ #undef HAVE_LISTEA /* Define to 1 if you have the `listxattr' function. */ #undef HAVE_LISTXATTR /* Define to 1 if you have the `llistea' function. */ #undef HAVE_LLISTEA /* Define to 1 if you have the `llistxattr' function. */ #undef HAVE_LLISTXATTR /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define if long double is a valid data type */ #undef HAVE_LONG_DOUBLE /* Define if long long is a valid data type */ #undef HAVE_LONG_LONG /* Define to 1 if you have the `lremoveea' function. */ #undef HAVE_LREMOVEEA /* Define to 1 if you have the `lremovexattr' function. */ #undef HAVE_LREMOVEXATTR /* Define to 1 if you have the `lsetea' function. */ #undef HAVE_LSETEA /* Define to 1 if you have the `lsetxattr' function. */ #undef HAVE_LSETXATTR /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have the `mknod' function. */ #undef HAVE_MKNOD /* Define to 1 if you have the `mknod64' function. */ #undef HAVE_MKNOD64 /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the header file. */ #undef HAVE_MNTENT_H /* Define to 1 if you have the header file. */ #undef HAVE_MOUNT_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the `nl_langinfo' function. */ #undef HAVE_NL_LANGINFO /* Whether no ACLs support is available */ #undef HAVE_NO_ACLS /* Define to 1 if you have the `openat' function. */ #undef HAVE_OPENAT /* Define to 1 if you have the header file. */ #undef HAVE_PAM_PAM_APPL_H /* Whether POSIX ACLs are available */ #undef HAVE_POSIX_ACLS /* Define to 1 if you have the `pread' function. */ #undef HAVE_PREAD /* Define to 1 if you have the `pselect' function. */ #undef HAVE_PSELECT /* Define to 1 if you have the `pwrite' function. */ #undef HAVE_PWRITE /* Define if quad_t is a valid data type */ #undef HAVE_QUAD_T /* Define to 1 if you have the `removeea' function. */ #undef HAVE_REMOVEEA /* Define to 1 if you have the `removexattr' function. */ #undef HAVE_REMOVEXATTR /* Define to 1 if you have the `renameat' function. */ #undef HAVE_RENAMEAT /* Define to 1 if you have the `rmdir' function. */ #undef HAVE_RMDIR /* Define to 1 if you have the header file. */ #undef HAVE_RPCSVC_RQUOTA_H /* Define to 1 if you have the header file. */ #undef HAVE_RPC_PMAP_PROT_H /* Define to 1 if you have the header file. */ #undef HAVE_RPC_RPC_H /* Define to 1 if you have the header file. */ #undef HAVE_SECURITY_PAM_APPL_H /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `setea' function. */ #undef HAVE_SETEA /* Define to 1 if you have the `setlinebuf' function. */ #undef HAVE_SETLINEBUF /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the `setproplist' function. */ #undef HAVE_SETPROPLIST /* Define to 1 if you have the `setxattr' function. */ #undef HAVE_SETXATTR /* Define to 1 if you have the header file. */ #undef HAVE_SGTTY_H /* Define if you have the shl_load function. */ #undef HAVE_SHL_LOAD /* Define to 1 if you have the `sizeof_proplist_entry' function. */ #undef HAVE_SIZEOF_PROPLIST_ENTRY /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Whether solaris ACLs are available */ #undef HAVE_SOLARIS_ACLS /* Define to 1 if you have the header file. */ #undef HAVE_STATFS_H /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasestr' function. */ #undef HAVE_STRCASESTR /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if you have the `strnlen' function. */ #undef HAVE_STRNLEN /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if `st_rdev' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_RDEV /* Define to 1 if `tm_gmtoff' is member of `struct tm'. */ #undef HAVE_STRUCT_TM_TM_GMTOFF /* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use `HAVE_STRUCT_STAT_ST_RDEV' instead. */ #undef HAVE_ST_RDEV /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_ATTRIBUTES_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_EA_H /* Define if sys_errlist declaration exists */ #undef HAVE_SYS_ERRLIST /* Define to 1 if you have the header file. */ #undef HAVE_SYS_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_EXTATTR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MNTTAB_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MOUNT_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define if sys_nerr declaration exists */ #undef HAVE_SYS_NERR /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STATVFS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_VFS_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_XATTR_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* define for timeout_id_t */ #undef HAVE_TIMEOUT_ID_T /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* Whether Tru64 ACLs are available */ #undef HAVE_TRU64_ACLS /* Whether UCS-2-INTERNAL is supported */ #undef HAVE_UCS2INTERNAL /* Define to 1 if you have the header file. */ #undef HAVE_UFS_QUOTA_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Whether UnixWare ACLs are available */ #undef HAVE_UNIXWARE_ACLS /* Define to 1 if you have the `unlinkat' function. */ #undef HAVE_UNLINKAT /* Whether to use native iconv */ #undef HAVE_USABLE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H /* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */ #undef HAVE_UTIME_NULL /* Define to 1 if you have the header file. */ #undef HAVE_VARARGS_H /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if you have the `wait3' system call. Deprecated, you should no longer depend upon `wait3'. */ #undef HAVE_WAIT3 /* Define to 1 if you have the `waitpid' function. */ #undef HAVE_WAITPID /* Define to 1 if you have the header file. */ #undef HAVE_XFS_LIBXFS_H /* Define to 1 if you have the header file. */ #undef HAVE_XFS_XFS_FS_H /* Define to 1 if you have the header file. */ #undef HAVE_XFS_XQM_H /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* Define if compiling for MacOS X Server */ #undef MACOSX_SERVER /* Define to 1 if `major', `minor', and `makedev' are declared in . */ #undef MAJOR_IN_MKDEV /* Define to 1 if `major', `minor', and `makedev' are declared in . */ #undef MAJOR_IN_SYSMACROS /* Disable assertions */ #undef NDEBUG /* Define if dlsym() requires a leading underscore in symbol names. */ #undef NEED_USCORE /* Define if OS is NetBSD */ #undef NETBSD /* Define if DDP should be disabled */ #undef NO_DDP /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Define if Quota support should be disabled */ #undef NO_QUOTA_SUPPORT /* Define if the gmtoff member of struct tm is not available */ #undef NO_STRUCT_TM_GMTOFF /* Define if the OpenSSL DHX modules should be built */ #undef OPENSSL_DHX /* errno returned by open with O_NOFOLLOW */ #undef OPEN_NOFOLLOW_ERRNO /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Whether the realpath function allows NULL */ #undef REALPATH_TAKES_NULL /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define if the sendfile() function uses BSD semantics */ #undef SENDFILE_FLAVOR_BSD /* Whether linux sendfile() API is available */ #undef SENDFILE_FLAVOR_LINUX /* Solaris sendfile() */ #undef SENDFILE_FLAVOR_SOLARIS /* Define if shadow passwords should be used */ #undef SHADOWPW /* Solaris compatibility macro */ #undef SOLARIS /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define if TCP wrappers should be used */ #undef TCPWRAP /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Define on Tru64 platforms */ #undef TRU64 /* Define if the DHX UAM modules should be compiled */ #undef UAM_DHX /* Define if the DHX2 UAM modules should be compiled */ #undef UAM_DHX2 /* Define if the Kerberos 4 UAM module should be compiled */ #undef UAM_KRB4 /* Define if the PGP UAM module should be compiled */ #undef UAM_PGP /* Define if cracklib should be used */ #undef USE_CRACKLIB /* Define to use old rquota */ #undef USE_OLD_RQUOTA /* Define to enable PAM support */ #undef USE_PAM /* Define to enable SLP support */ #undef USE_SRVLOC /* Define to enable Zeroconf support */ #undef USE_ZEROCONF /* Version number of package */ #undef VERSION /* Whether sendfile() should be used */ #undef WITH_SENDFILE /* xattr functions have additional options */ #undef XATTR_ADD_OPT /* AT file source */ #undef _ATFILE_SOURCE /* _FILE_OFFSET_BITS (for LARGEFILE support) */ #undef _FILE_OFFSET_BITS /* Whether to use GNU libc extensions */ #undef _GNU_SOURCE /* Compatibility macro */ #undef _ISOC9X_SOURCE /* _LARGE_FILES (for LARGEFILE support) */ #undef _LARGE_FILES /* Define if the *passwd UAMs should be used */ #undef _OSF_SOURCE /* path to cracklib dictionary */ #undef _PATH_CRACKLIB /* Solaris compilation environment */ #undef _XOPEN_SOURCE /* Define for Berkeley DB 4 */ #undef _XOPEN_SOURCE_EXTENDED /* Solaris compilation environment */ #undef __EXTENSIONS__ /* Solaris compatibility macro */ #undef __svr4__ /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `int' if does not define. */ #undef mode_t /* Define to `long int' if does not define. */ #undef off_t /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if doesn't define. */ #undef uid_t netatalk-2.2.2/services.atalk0000644000175200017500000000033411655731130013106 00000000000000rtmp 1/ddp # Routing Table Maintenance Protocol nbp 2/ddp # Name Binding Protocol echo 4/ddp # AppleTalk Echo Protocol zip 6/ddp # Zone Information Protocol afpovertcp 548/tcp # AFP over TCP afpovertcp 548/udp netatalk-2.2.2/aclocal.m40000644000175200017500000107210411671657201012116 00000000000000# generated automatically by aclocal 1.10.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(AC_AUTOCONF_VERSION, [2.61],, [m4_warning([this file was generated for autoconf 2.61. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 52 Debian 1.5.26-1ubuntu1 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac _LT_REQUIRED_DARWIN_CHECKS AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [AC_REQUIRE([LT_AC_PROG_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. AC_DEFUN([_LT_LINKER_BOILERPLATE], [AC_REQUIRE([LT_AC_PROG_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # -------------------------- # Check for some things on darwin AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. echo "int foo(void){return 1;}" > conftest.c $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib ${wl}-single_module conftest.c if test -f libconftest.dylib; then lt_cv_apple_cc_single_mod=yes rm -rf libconftest.dylib* fi rm conftest.c fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) case $host_os in rhapsody* | darwin1.[[0123]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil="~$DSYMUTIL \$lib || :" else _lt_dsymutil= fi ;; esac ]) # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # ------------------ AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # --------------------------------------------------------------------- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ---------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" m4_if($1,[],[ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`echo $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec], [lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"]) sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec], [lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"]) sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 DLLs AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- # set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognize shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognize a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # it is assumed to be `libltdl'. LIBLTDL will be prefixed with # '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' # (note the single quotes!). If your package is not flat and you're not # using automake, define top_builddir and top_srcdir appropriately in # the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # and an installed libltdl is not found, it is assumed to be `libltdl'. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and top_srcdir # appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # ------------------ AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # ------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" if test "$GXX" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP], [AC_REQUIRE([LT_AC_PROG_SED])dnl dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_AC_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac ])# AC_LIBTOOL_POSTDEP_PREDEP # AC_LIBTOOL_LANG_F77_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) AC_DEFUN([_LT_AC_LANG_F77_CONFIG], [AC_REQUIRE([AC_PROG_F77]) AC_LANG_PUSH(Fortran 77) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_AC_TAGVAR(GCC, $1)="$G77" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_F77_CONFIG # AC_LIBTOOL_LANG_GCJ_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], [AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_RESTORE CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_GCJ_CONFIG # AC_LIBTOOL_LANG_RC_CONFIG # ------------------------- # Ensure that the configuration vars for the Windows resource compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) AC_DEFUN([_LT_AC_LANG_RC_CONFIG], [AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes AC_LIBTOOL_CONFIG($1) AC_LANG_RESTORE CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_RC_CONFIG # AC_LIBTOOL_CONFIG([TAGNAME]) # ---------------------------- # If TAGNAME is not passed, then create an initial libtool script # with a default configuration from the untagged config vars. Otherwise # add code to config.status for appending the configuration named by # TAGNAME from the matching tagged config vars. AC_DEFUN([AC_LIBTOOL_CONFIG], [# The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ _LT_AC_TAGVAR(compiler, $1) \ _LT_AC_TAGVAR(CC, $1) \ _LT_AC_TAGVAR(LD, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ _LT_AC_TAGVAR(old_archive_cmds, $1) \ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ _LT_AC_TAGVAR(predep_objects, $1) \ _LT_AC_TAGVAR(postdep_objects, $1) \ _LT_AC_TAGVAR(predeps, $1) \ _LT_AC_TAGVAR(postdeps, $1) \ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \ _LT_AC_TAGVAR(archive_cmds, $1) \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ _LT_AC_TAGVAR(postinstall_cmds, $1) \ _LT_AC_TAGVAR(postuninstall_cmds, $1) \ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ _LT_AC_TAGVAR(allow_undefined_flag, $1) \ _LT_AC_TAGVAR(no_undefined_flag, $1) \ _LT_AC_TAGVAR(export_symbols_cmds, $1) \ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ _LT_AC_TAGVAR(hardcode_automatic, $1) \ _LT_AC_TAGVAR(module_cmds, $1) \ _LT_AC_TAGVAR(module_expsym_cmds, $1) \ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ _LT_AC_TAGVAR(fix_srcfile_path, $1) \ _LT_AC_TAGVAR(exclude_expsyms, $1) \ _LT_AC_TAGVAR(include_expsyms, $1); do case $var in _LT_AC_TAGVAR(old_archive_cmds, $1) | \ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ _LT_AC_TAGVAR(archive_cmds, $1) | \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ _LT_AC_TAGVAR(module_cmds, $1) | \ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\[$]0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` ;; esac ifelse([$1], [], [cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" AC_MSG_NOTICE([creating $ofile])], [cfgfile="$ofile"]) cat <<__EOF__ >> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([LT_AC_PROG_SED]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux* | k*bsd*-gnu) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac # # Check to make sure the static flag actually works. # wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) _LT_AC_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; interix[[3-9]]*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi _LT_AC_TAGVAR(link_all_deplibs, $1)=no else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # Cheap backport of AS_EXECUTABLE_P and required macros # from Autoconf 2.59; we should not use $as_executable_p directly. # _AS_TEST_PREPARE # ---------------- m4_ifndef([_AS_TEST_PREPARE], [m4_defun([_AS_TEST_PREPARE], [if test -x / >/dev/null 2>&1; then as_executable_p='test -x' else as_executable_p='test -f' fi ])])# _AS_TEST_PREPARE # AS_EXECUTABLE_P # --------------- # Check whether a file is executable. m4_ifndef([AS_EXECUTABLE_P], [m4_defun([AS_EXECUTABLE_P], [AS_REQUIRE([_AS_TEST_PREPARE])dnl $as_executable_p $1[]dnl ])])# AS_EXECUTABLE_P # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ]) # serial 9 AC_LIB_LTDL # AC_WITH_LTDL # ------------ # Clients of libltdl can use this macro to allow the installer to # choose between a shipped copy of the ltdl sources or a preinstalled # version of the library. AC_DEFUN([AC_WITH_LTDL], [AC_REQUIRE([AC_LIB_LTDL]) AC_SUBST([LIBLTDL]) AC_SUBST([INCLTDL]) # Unless the user asks us to check, assume no installed ltdl exists. use_installed_libltdl=no AC_ARG_WITH([included_ltdl], [ --with-included-ltdl use the GNU ltdl sources included here]) if test "x$with_included_ltdl" != xyes; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. AC_CHECK_HEADER([ltdl.h], [AC_CHECK_LIB([ltdl], [lt_dlcaller_register], [with_included_ltdl=no], [with_included_ltdl=yes]) ]) fi if test "x$enable_ltdl_install" != xyes; then # If the user did not specify an installable libltdl, then default # to a convenience lib. AC_LIBLTDL_CONVENIENCE fi if test "x$with_included_ltdl" = xno; then # If the included ltdl is not to be used. then Use the # preinstalled libltdl we found. AC_DEFINE([HAVE_LTDL], [1], [Define this if a modern libltdl is already installed]) LIBLTDL=-lltdl fi # Report our decision... AC_MSG_CHECKING([whether to use included libltdl]) AC_MSG_RESULT([$with_included_ltdl]) AC_CONFIG_SUBDIRS([libltdl]) ])# AC_WITH_LTDL # AC_LIB_LTDL # ----------- # Perform all the checks necessary for compilation of the ltdl objects # -- including compiler checks and header checks. AC_DEFUN([AC_LIB_LTDL], [AC_PREREQ(2.50) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_C_CONST]) AC_REQUIRE([AC_HEADER_STDC]) AC_REQUIRE([AC_HEADER_DIRENT]) AC_REQUIRE([_LT_AC_CHECK_DLFCN]) AC_REQUIRE([AC_LTDL_ENABLE_INSTALL]) AC_REQUIRE([AC_LTDL_SHLIBEXT]) AC_REQUIRE([AC_LTDL_SHLIBPATH]) AC_REQUIRE([AC_LTDL_SYSSEARCHPATH]) AC_REQUIRE([AC_LTDL_OBJDIR]) AC_REQUIRE([AC_LTDL_DLPREOPEN]) AC_REQUIRE([AC_LTDL_DLLIB]) AC_REQUIRE([AC_LTDL_SYMBOL_USCORE]) AC_REQUIRE([AC_LTDL_DLSYM_USCORE]) AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS]) AC_REQUIRE([AC_LTDL_FUNC_ARGZ]) AC_CHECK_HEADERS([assert.h ctype.h errno.h malloc.h memory.h stdlib.h \ stdio.h unistd.h]) AC_CHECK_HEADERS([dl.h sys/dl.h dld.h mach-o/dyld.h]) AC_CHECK_HEADERS([string.h strings.h], [break]) AC_CHECK_FUNCS([strchr index], [break]) AC_CHECK_FUNCS([strrchr rindex], [break]) AC_CHECK_FUNCS([memcpy bcopy], [break]) AC_CHECK_FUNCS([memmove strcmp]) AC_CHECK_FUNCS([closedir opendir readdir]) ])# AC_LIB_LTDL # AC_LTDL_ENABLE_INSTALL # ---------------------- AC_DEFUN([AC_LTDL_ENABLE_INSTALL], [AC_ARG_ENABLE([ltdl-install], [AC_HELP_STRING([--enable-ltdl-install], [install libltdl])]) AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno) AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno) ])# AC_LTDL_ENABLE_INSTALL # AC_LTDL_SYS_DLOPEN_DEPLIBS # -------------------------- AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether deplibs are loaded by dlopen], [libltdl_cv_sys_dlopen_deplibs], [# PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. libltdl_cv_sys_dlopen_deplibs=unknown case "$host_os" in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this `case' here to explicitly catch those versions. libltdl_cv_sys_dlopen_deplibs=unknown ;; aix[[4-9]]*) libltdl_cv_sys_dlopen_deplibs=yes ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat libltdl_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) libltdl_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu) # GNU and its variants, using gnu ld.so (Glibc) libltdl_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) libltdl_cv_sys_dlopen_deplibs=yes ;; interix*) libltdl_cv_sys_dlopen_deplibs=yes ;; irix[[12345]]*|irix6.[[01]]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. libltdl_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. libltdl_cv_sys_dlopen_deplibs=yes ;; netbsd* | netbsdelf*-gnu) libltdl_cv_sys_dlopen_deplibs=yes ;; openbsd*) libltdl_cv_sys_dlopen_deplibs=yes ;; osf[[1234]]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explictly say `no'. libltdl_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to `yes'. Without it, it would be `no'. libltdl_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say `yes'. libltdl_cv_sys_dlopen_deplibs=yes ;; solaris*) libltdl_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac ]) if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], [Define if the OS needs help to load dependent libraries for dlopen().]) fi ])# AC_LTDL_SYS_DLOPEN_DEPLIBS # AC_LTDL_SHLIBEXT # ---------------- AC_DEFUN([AC_LTDL_SHLIBEXT], [AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) AC_CACHE_CHECK([which extension is used for loadable modules], [libltdl_cv_shlibext], [ module=yes eval libltdl_cv_shlibext=$shrext_cmds ]) if test -n "$libltdl_cv_shlibext"; then AC_DEFINE_UNQUOTED([LTDL_SHLIB_EXT], ["$libltdl_cv_shlibext"], [Define to the extension used for shared libraries, say, ".so".]) fi ])# AC_LTDL_SHLIBEXT # AC_LTDL_SHLIBPATH # ----------------- AC_DEFUN([AC_LTDL_SHLIBPATH], [AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) AC_CACHE_CHECK([which variable specifies run-time library path], [libltdl_cv_shlibpath_var], [libltdl_cv_shlibpath_var="$shlibpath_var"]) if test -n "$libltdl_cv_shlibpath_var"; then AC_DEFINE_UNQUOTED([LTDL_SHLIBPATH_VAR], ["$libltdl_cv_shlibpath_var"], [Define to the name of the environment variable that determines the dynamic library search path.]) fi ])# AC_LTDL_SHLIBPATH # AC_LTDL_SYSSEARCHPATH # --------------------- AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) AC_CACHE_CHECK([for the default library search path], [libltdl_cv_sys_search_path], [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"]) if test -n "$libltdl_cv_sys_search_path"; then sys_search_path= for dir in $libltdl_cv_sys_search_path; do if test -z "$sys_search_path"; then sys_search_path="$dir" else sys_search_path="$sys_search_path$PATH_SEPARATOR$dir" fi done AC_DEFINE_UNQUOTED([LTDL_SYSSEARCHPATH], ["$sys_search_path"], [Define to the system default library search path.]) fi ])# AC_LTDL_SYSSEARCHPATH # AC_LTDL_OBJDIR # -------------- AC_DEFUN([AC_LTDL_OBJDIR], [AC_CACHE_CHECK([for objdir], [libltdl_cv_objdir], [libltdl_cv_objdir="$objdir" if test -n "$objdir"; then : else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then libltdl_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. libltdl_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi ]) AC_DEFINE_UNQUOTED([LTDL_OBJDIR], ["$libltdl_cv_objdir/"], [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# AC_LTDL_OBJDIR # AC_LTDL_DLPREOPEN # ----------------- AC_DEFUN([AC_LTDL_DLPREOPEN], [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], [libltdl_cv_preloaded_symbols], [if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi ]) if test x"$libltdl_cv_preloaded_symbols" = xyes; then AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1], [Define if libtool can extract symbol lists from object files.]) fi ])# AC_LTDL_DLPREOPEN # AC_LTDL_DLLIB # ------------- AC_DEFUN([AC_LTDL_DLLIB], [LIBADD_DL= AC_SUBST(LIBADD_DL) AC_LANG_PUSH([C]) AC_CHECK_FUNC([shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.])], [AC_CHECK_LIB([dld], [shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LIBADD_DL="$LIBADD_DL -ldld"], [AC_CHECK_LIB([dl], [dlopen], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes"], [AC_TRY_LINK([#if HAVE_DLFCN_H # include #endif ], [dlopen(0, 0);], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen="yes"], [AC_CHECK_LIB([svld], [dlopen], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes"], [AC_CHECK_LIB([dld], [dld_link], [AC_DEFINE([HAVE_DLD], [1], [Define if you have the GNU dld library.]) LIBADD_DL="$LIBADD_DL -ldld"], [AC_CHECK_FUNC([_dyld_func_lookup], [AC_DEFINE([HAVE_DYLD], [1], [Define if you have the _dyld_func_lookup function.])]) ]) ]) ]) ]) ]) ]) if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes then lt_save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DL" AC_CHECK_FUNCS([dlerror]) LIBS="$lt_save_LIBS" fi AC_LANG_POP ])# AC_LTDL_DLLIB # AC_LTDL_SYMBOL_USCORE # --------------------- # does the compiler prefix global symbols with an underscore? AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) AC_CACHE_CHECK([for _ prefix in compiled symbols], [ac_cv_sys_symbol_underscore], [ac_cv_sys_symbol_underscore=no cat > conftest.$ac_ext < $ac_nlist) && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then ac_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC fi else echo "configure: failed program was:" >&AC_FD_CC cat conftest.c >&AC_FD_CC fi rm -rf conftest* ]) ])# AC_LTDL_SYMBOL_USCORE # AC_LTDL_DLSYM_USCORE # -------------------- AC_DEFUN([AC_LTDL_DLSYM_USCORE], [AC_REQUIRE([AC_LTDL_SYMBOL_USCORE]) if test x"$ac_cv_sys_symbol_underscore" = xyes; then if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then AC_CACHE_CHECK([whether we have to add an underscore for dlsym], [libltdl_cv_need_uscore], [libltdl_cv_need_uscore=unknown save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DL" _LT_AC_TRY_DLOPEN_SELF( [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes], [], [libltdl_cv_need_uscore=cross]) LIBS="$save_LIBS" ]) fi fi if test x"$libltdl_cv_need_uscore" = xyes; then AC_DEFINE([NEED_USCORE], [1], [Define if dlsym() requires a leading underscore in symbol names.]) fi ])# AC_LTDL_DLSYM_USCORE # AC_LTDL_FUNC_ARGZ # ----------------- AC_DEFUN([AC_LTDL_FUNC_ARGZ], [AC_CHECK_HEADERS([argz.h]) AC_CHECK_TYPES([error_t], [], [AC_DEFINE([error_t], [int], [Define to a type to use for `error_t' if it is not otherwise available.])], [#if HAVE_ARGZ_H # include #endif]) AC_CHECK_FUNCS([argz_append argz_create_sep argz_insert argz_next argz_stringify]) ])# AC_LTDL_FUNC_ARGZ # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # # Similar to PKG_CHECK_MODULES, make sure that the first instance of # this or PKG_CHECK_MODULES is called, or make sure to call # PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_ifval([$2], [$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$PKG_CONFIG"; then if test -n "$$1"; then pkg_cv_[]$1="$$1" else PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) fi else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` else $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT ])], [AC_MSG_RESULT([no]) $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.10.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 13 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([macros/afs-check.m4]) m4_include([macros/cnid-backend.m4]) m4_include([macros/config-checks.m4]) m4_include([macros/cups.m4]) m4_include([macros/db3-check.m4]) m4_include([macros/grep-check.m4]) m4_include([macros/gssapi-check.m4]) m4_include([macros/iconv.m4]) m4_include([macros/largefile-check.m4]) m4_include([macros/libgcrypt.m4]) m4_include([macros/pam-check.m4]) m4_include([macros/perl-check.m4]) m4_include([macros/ps-check.m4]) m4_include([macros/quota-check.m4]) m4_include([macros/snprintf-check.m4]) m4_include([macros/srvloc.m4]) m4_include([macros/ssl-check.m4]) m4_include([macros/summary.m4]) m4_include([macros/tcp-wrappers.m4]) m4_include([macros/util.m4]) m4_include([macros/webmin.m4]) m4_include([macros/zeroconf.m4]) netatalk-2.2.2/config.sub0000755000175200017500000007772410707444443012256 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-06-28' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: netatalk-2.2.2/macros/0000777000175200017500000000000011704770433011621 500000000000000netatalk-2.2.2/macros/ssl-check.m40000644000175200017500000000447511655731130013661 00000000000000dnl $Id: ssl-check.m4,v 1.14 2008-11-22 12:07:26 didg Exp $ dnl Autoconf macro to check for SSL or OpenSSL AC_DEFUN([AC_CRYPT], [ saveLIBS=$LIBS LIBS="" CRYPT_LIBS="" AC_CHECK_HEADERS(crypt.h) AC_CHECK_LIB(crypt, main) CRYPT_LIBS=$LIBS LIBS=$saveLIBS AC_SUBST(CRYPT_LIBS) ]) AC_DEFUN([AC_PATH_SSL], [ AC_ARG_WITH(ssl-dir, [ --with-ssl-dir=PATH specify path to OpenSSL installation (must contain lib and include dirs)], [ if test "x$withval" = "xno"; then tryssl=no elif test "x$withval" = "xyes"; then tryssl=yes tryssldir= else dnl FIXME: should only try in $withval tryssl=yes tryssldir="$withval" fi ], [tryssl=yes] ) SSL_CFLAGS="" SSL_LIBS="" saved_LIBS=$LIBS saved_CFLAGS=$CFLAGS neta_cv_have_openssl=no dnl compile_ssl=no dnl make sure atalk_libname is defined beforehand [[ -n "$atalk_libname" ]] || AC_MSG_ERROR([internal error, atalk_libname undefined]) if test "$tryssl" = "yes"; then AC_MSG_CHECKING([for SSL]) for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/$atalk_libname/openssl /usr/local/ssl /usr/$atalk_libname/ssl /usr/local /usr/pkg /opt /opt/openssl /usr/local/ssl ; do if test -f "$ssldir/include/openssl/cast.h" ; then SSL_CFLAGS="$SSL_CFLAGS -I$ssldir/include -I$ssldir/include/openssl" SSL_LIBS="$SSL_LIBS -L$ssldir/$atalk_libname -L$ssldir -lcrypto" if test "x$need_dash_r" = "xyes"; then SSL_LIBS="$SSL_LIBS -R$ssldir/$atalk_libname -R$ssldir" fi AC_MSG_RESULT([$ssldir (enabling RANDNUM and DHX support)]) CFLAGS="$CFLAGS $SSL_CFLAGS" LIBS="$LIBS $SSL_LIBS" dnl FIXME: The following looks crude and probably doesn't work properly. dnl Check for the crypto library: AC_CHECK_LIB(crypto, main) dnl Check for "DES" library (for SSLeay, not openssl): AC_CHECK_LIB(des, main) AC_DEFINE(OPENSSL_DHX, 1, [Define if the OpenSSL DHX modules should be built]) AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled]) neta_cv_have_openssl=yes neta_cv_compile_dhx=yes CFLAGS=$saved_CFLAGS LIBS=$saved_LIBS break fi done if test "x$neta_cv_have_openssl" = "xno"; then AC_MSG_RESULT([no]) fi fi CFLAGS_REMOVE_USR_INCLUDE(SSL_CFLAGS) LIB_REMOVE_USR_LIB(SSL_LIBS) AC_SUBST(SSL_CFLAGS) AC_SUBST(SSL_LIBS) LIBS=$saved_LIBS ]) netatalk-2.2.2/macros/largefile-check.m40000644000175200017500000000512511655731130015003 00000000000000dnl ------------------------------------------------------------------- dnl This test for largefile support was written by Vadim Zeitlin for dnl wxWindows. dnl ------------------------------------------------------------------- dnl WX_SYS_LARGEFILE_TEST dnl dnl NB: original autoconf test was checking if compiler supported 6 bit off_t dnl arithmetic properly but this failed miserably with gcc under Linux dnl whereas the system still supports 64 bit files, so now simply check dnl that off_t is big enough define(WX_SYS_LARGEFILE_TEST, [typedef struct { unsigned int field: sizeof(off_t) == 8; } wxlf; ]) dnl WX_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR) define(WX_SYS_LARGEFILE_MACRO_VALUE, [ AC_CACHE_CHECK([for $1 value needed for large files], [$3], [ AC_TRY_COMPILE([#define $1 $2 #include ], WX_SYS_LARGEFILE_TEST, [$3=$2], [$3=no]) ] ) if test "$$3" != no; then wx_largefile=yes AC_DEFINE_UNQUOTED([$1], [$$3], [$1 (for LARGEFILE support)]) fi ]) dnl AC_SYS_LARGEFILE dnl ---------------- dnl By default, many hosts won't let programs access large files; dnl one must use special compiler options to get large-file access to work. dnl For more details about this brain damage please see: dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html AC_DEFUN([AC_SYS_LARGEFILE], [AC_ARG_ENABLE(largefile, [ --disable-largefile omit support for large files]) if test "$enable_largefile" != no; then dnl _FILE_OFFSET_BITS==64 is needed for Linux, Solaris, ... dnl _LARGE_FILES -- for AIX wx_largefile=no WX_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, ac_cv_sys_file_offset_bits) if test "x$wx_largefile" != "xyes"; then WX_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, ac_cv_sys_large_files) fi AC_CACHE_CHECK([for 64 bit off_t],netatalk_cv_SIZEOF_OFF_T,[ AC_TRY_RUN([#include #include #include main() { exit((sizeof(off_t) == 8) ? 0 : 1); }], netatalk_cv_SIZEOF_OFF_T=yes,netatalk_cv_SIZEOF_OFF_T=no,netatalk_cv_SIZEOF_OFF_T=cross)]) AC_MSG_CHECKING([if large file support is available]) if test "x$netatalk_cv_SIZEOF_OFF_T" != "xno"; then AC_DEFINE(HAVE_LARGEFILE_SUPPORT, [], [LARGEFILE support]) AC_MSG_RESULT([yes]) ifelse([$1], , :, [$1]) else AC_MSG_RESULT([no]) ifelse([$2], , :, [$2]) fi fi ]) dnl ----------end of largefile test------------------------------------ netatalk-2.2.2/macros/Makefile.am0000644000175200017500000000054711655731130013573 00000000000000EXTRA_DIST = \ afs-check.m4 \ cnid-backend.m4 \ config-checks.m4 \ cups.m4 \ db3-check.m4 \ grep-check.m4 \ gssapi-check.m4 \ iconv.m4 \ largefile-check.m4 \ libgcrypt.m4 \ pam-check.m4 \ perl-check.m4 \ ps-check.m4 \ quota-check.m4 \ snprintf-check.m4 \ srvloc.m4 \ ssl-check.m4 \ summary.m4 \ tcp-wrappers.m4 \ util.m4 netatalk-2.2.2/macros/Makefile.in0000644000175200017500000002673311703521730013606 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = macros DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ afs-check.m4 \ cnid-backend.m4 \ config-checks.m4 \ cups.m4 \ db3-check.m4 \ grep-check.m4 \ gssapi-check.m4 \ iconv.m4 \ largefile-check.m4 \ libgcrypt.m4 \ pam-check.m4 \ perl-check.m4 \ ps-check.m4 \ quota-check.m4 \ snprintf-check.m4 \ srvloc.m4 \ ssl-check.m4 \ summary.m4 \ tcp-wrappers.m4 \ util.m4 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign macros/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign macros/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/macros/tcp-wrappers.m40000644000175200017500000000226011655731130014422 00000000000000dnl $Id: tcp-wrappers.m4,v 1.4 2008-08-11 20:44:03 didg Exp $ AC_DEFUN([NETATALK_TCP_WRAPPERS], [ check=maybe AC_ARG_ENABLE(tcp-wrappers, [ --disable-tcp-wrappers disable TCP wrappers support], [ if test "x$enableval" = "xno"; then wrapcheck=no else wrapcheck=yes fi ] ) enable=no netatalk_cv_tcpwrap=no if test "x$wrapcheck" != "xno"; then saved_LIBS=$LIBS W_LIBS="-lwrap" LIBS="$LIBS $W_LIBS" AC_TRY_LINK([ int allow_severity = 0; int deny_severity = 0;] ,[hosts_access();] , netatalk_cv_tcpwrap=yes , [ LIBS=$saved_LIBS W_LIBS="-lwrap -lnsl" LIBS="$LIBS $W_LIBS" AC_TRY_LINK([ int allow_severity = 0; int deny_severity = 0;] ,[hosts_access();] , netatalk_cv_tcpwrap=yes , netatalk_cv_tcpwrap=no) ] , netatalk_cv_tcpwrap=cross) LIBS=$saved_LIBS fi AC_MSG_CHECKING([whether to enable the TCP wrappers]) if test "x$netatalk_cv_tcpwrap" = "xyes"; then AC_DEFINE(TCPWRAP, 1, [Define if TCP wrappers should be used]) WRAP_LIBS=$W_LIBS AC_MSG_RESULT([yes]) else if test "x$wrapcheck" = "xyes"; then AC_MSG_ERROR([libwrap not found]) else AC_MSG_RESULT([no]) fi fi AC_SUBST(WRAP_LIBS) ]) netatalk-2.2.2/macros/srvloc.m40000644000175200017500000000331011655731130013300 00000000000000dnl Check for optional server location protocol support (used by MacOS X) dnl $Id: srvloc.m4,v 1.10 2009-12-13 11:58:30 franklahm Exp $ AC_DEFUN([NETATALK_SRVLOC], [ SLP_LIBS="" SLP_CFLAGS="" found_slp=no srvlocdir="" AC_ARG_ENABLE(srvloc, [ --enable-srvloc[[=DIR]] enable Server Location Protocol (SLP) support], [srvloc=$enableval], [srvloc=no] ) dnl make sure atalk_libname is defined beforehand [[ -n "$atalk_libname" ]] || AC_MSG_ERROR([internal error, atalk_libname undefined]) if test "x$srvloc" != "xno"; then savedcppflags="$CPPFLAGS" savedldflags="$LDFLAGS" if test "x$srvloc" = "xyes" ; then srvlocdir="/usr" else srvlocdir="$srvloc" fi CPPFLAGS="$CPPFLAGS -I$srvlocdir/include" LDFLAGS="$LDFLAGS -L$srvlocdir/$atalk_libname" AC_MSG_CHECKING([for slp.h]) AC_TRY_CPP([#include ], [ AC_MSG_RESULT([yes]) found_slp=yes ], [ AC_MSG_RESULT([no]) ] ) if test "x$found_slp" = "xyes"; then AC_CHECK_LIB(slp, SLPOpen, [ SLP_LIBS="-L$srvlocdir/$atalk_libname -lslp" SLP_CFLAGS="-I$srvlocdir/include" ],[ AC_MSG_RESULT([no]) found_slp=no ]) fi CPPFLAGS="$savedcppflags" LDFLAGS="$savedldflags" fi netatalk_cv_srvloc=no AC_MSG_CHECKING([whether to enable srvloc (SLP) support]) if test "x$found_slp" = "xyes"; then AC_MSG_RESULT([yes]) AC_DEFINE(USE_SRVLOC, 1, [Define to enable SLP support]) netatalk_cv_srvloc=yes else AC_MSG_RESULT([no]) if test "x$srvloc" != "xno" -a "x$srvloc" != "xyes"; then AC_MSG_ERROR([SLP installation not found]) fi fi LIB_REMOVE_USR_LIB(SLP_LIBS) CFLAGS_REMOVE_USR_INCLUDE(SLP_CFLAGS) AC_SUBST(SLP_LIBS) AC_SUBST(SLP_CFLAGS) ]) netatalk-2.2.2/macros/snprintf-check.m40000644000175200017500000000635011655731130014715 00000000000000dnl Check for (v)snprintf functions AC_DEFUN([NETATALK_SNPRINTF_CHECK], [ AC_CHECK_FUNCS(snprintf vsnprintf) AC_CHECK_HEADERS(stdarg.h varargs.h) AC_CHECK_FUNCS(strerror) AC_CACHE_CHECK(for errno, ac_cv_errno, [ AC_TRY_LINK(,[extern int errno; return (errno);], ac_cv_errno=yes, ac_cv_errno=no) ]) if test "$ac_cv_errno" = yes; then AC_DEFINE(HAVE_ERRNO, 1, [Define if errno declaration exists]) AC_CACHE_CHECK(for errno declaration, ac_cv_decl_errno, [ AC_TRY_COMPILE([ #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_ERRNO_H #include #endif ],[return(sys_nerr);], ac_cv_decl_errno=yes, ac_cv_decl_errno=no) ]) if test "$ac_cv_decl_errno" = yes; then AC_DEFINE(HAVE_DECL_ERRNO, 1, [Define if errno declaration exists]) fi; fi AC_CACHE_CHECK(for sys_nerr, ac_cv_sys_nerr, [ AC_TRY_LINK(,[extern int sys_nerr; return (sys_nerr);], ac_cv_sys_nerr=yes, ac_cv_sys_nerr=no) ]) if test "$ac_cv_sys_nerr" = yes; then AC_DEFINE(HAVE_SYS_NERR, 1, [Define if sys_nerr declaration exists]) AC_CACHE_CHECK(for sys_nerr declaration, ac_cv_decl_sys_nerr, [ AC_TRY_COMPILE([ #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif],[return(sys_nerr);], ac_cv_decl_sys_nerr_def=yes, ac_cv_decl_sys_nerr_def=no) ]) if test "$ac_cv_decl_sys_nerr" = yes; then AC_DEFINE(HAVE_DECL_SYS_NERR, 1, [Define if sys_nerr declaration exists]) fi fi AC_CACHE_CHECK(for sys_errlist array, ac_cv_sys_errlist, [AC_TRY_LINK(,[extern char *sys_errlist[]; sys_errlist[0];], ac_cv_sys_errlist=yes, ac_cv_sys_errlist=no) ]) if test "$ac_cv_sys_errlist" = yes; then AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if sys_errlist declaration exists]) AC_CACHE_CHECK(for sys_errlist declaration, ac_cv_sys_errlist_def, [AC_TRY_COMPILE([ #include #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif],[char *s = sys_errlist[0]; return(*s);], ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no) ]) if test "$ac_cv_decl_sys_errlist" = yes; then AC_DEFINE(HAVE_DECL_SYS_ERRLIST, 1, [Define if sys_errlist declaration exists]) fi fi AC_CACHE_CHECK(for long long, ac_cv_long_long, [ AC_TRY_COMPILE([ #include #include ], [printf("%d",sizeof(long long));], ac_cv_long_long=yes, ac_cv_long_long=no) ]) if test $ac_cv_long_long = yes; then AC_DEFINE(HAVE_LONG_LONG, 1, [Define if long long is a valid data type]) fi AC_CACHE_CHECK(for long double, ac_cv_long_double, [ AC_TRY_COMPILE([ #include #include ], [printf("%d",sizeof(long double));], ac_cv_long_double=yes, ac_cv_long_double=no) ]) if test $ac_cv_long_double = yes; then AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if long double is a valid data type]) fi AC_CACHE_CHECK(for quad_t, ac_cv_quad_t, [ AC_TRY_COMPILE([ #include #include ], [printf("%d",sizeof(quad_t));], ac_cv_quad_t=yes, ac_cv_quad_t=no) ]) if test $ac_cv_quad_t = yes; then AC_DEFINE(HAVE_QUAD_T, 1, [Define if quad_t is a valid data type]) fi ]) netatalk-2.2.2/macros/cups.m40000644000175200017500000000443611655731130012754 00000000000000dnl $Id: cups.m4,v 1.3 2010-04-12 14:28:47 franklahm Exp $ dnl Autoconf macros to check for CUPS AC_DEFUN([NETATALK_AC_CUPS], [ dnl Don't use spool unless it's needed spool_required=no netatalk_cv_use_cups=no AC_ARG_ENABLE(cups, [ --enable-cups Turn on CUPS support (default=auto)]) if test x$enable_cups != xno; then AC_PATH_PROG(CUPS_CONFIG, cups-config) if test "x$CUPS_CONFIG" != x; then AC_DEFINE(HAVE_CUPS, 1, [Define to enable CUPS Support]) CUPS_CFLAGS="`$CUPS_CONFIG --cflags`" CUPS_LDFLAGS="`$CUPS_CONFIG --ldflags`" CUPS_LIBS="`$CUPS_CONFIG --libs`" CUPS_VERSION="`$CUPS_CONFIG --version`" AC_DEFINE_UNQUOTED(CUPS_API_VERSION, "`$CUPS_CONFIG --api-version`", [CUPS API Version]) AC_SUBST(CUPS_CFLAGS) AC_SUBST(CUPS_LDFLAGS) AC_SUBST(CUPS_LIBS) AC_MSG_CHECKING([CUPS version]) AC_MSG_RESULT([$CUPS_VERSION]) netatalk_cv_use_cups=yes if test x"$netatalk_cv_HAVE_USABLE_ICONV" = x"no" ; then AC_WARN([*** Warning: iconv not found on your system, using simple ascii mapping***]) fi spool_required="yes" elif test x"$enable_cups" = "xyes"; then AC_MSG_ERROR([*** CUPS not found. You might need to specify the path to cups-config ***]) fi fi AC_MSG_CHECKING([whether CUPS support can be enabled]) AC_MSG_RESULT([$netatalk_cv_use_cups]) AC_ARG_WITH(spooldir, [ --with-spooldir=PATH path for spooldir used for CUPS support (LOCALSTATEDIR/spool/netatalk)],[ if test "$withval" = "no"; then if test x"$spool_required" = x"yes"; then AC_MSG_ERROR([*** CUPS support requires a spooldir ***]) else AC_DEFINE(DISABLE_SPOOL, 1, [Define to enable spooldir support]) AC_MSG_RESULT([spool disabled]) fi elif test "$withval" != "yes"; then SPOOLDIR="$withval" AC_MSG_RESULT([spooldir set to $withval]) else SPOOLDIR="${localstatedir}/spool/netatalk" AC_MSG_RESULT([spool set to default]) fi ],[ SPOOLDIR="${localstatedir}/spool/netatalk" ]) AM_CONDITIONAL(USE_SPOOLDIR, test x"$spool_required" = x"yes") AC_SUBST(SPOOLDIR) ]) netatalk-2.2.2/macros/quota-check.m40000644000175200017500000000162111655731245014206 00000000000000dnl $Id: quota-check.m4,v 1.6 2005-07-20 23:58:21 didg Exp $ dnl Autoconf macro to check for quota support dnl FIXME: This is in now way complete. AC_DEFUN([AC_CHECK_QUOTA], [ AC_ARG_ENABLE(quota, [ --enable-quota Turn on quota support (default=auto)]) if test x$enable_quota != xno; then QUOTA_LIBS="" netatalk_cv_quotasupport="yes" AC_CHECK_LIB(rpcsvc, main, [QUOTA_LIBS="-lrpcsvc"]) AC_CHECK_HEADERS([rpc/rpc.h rpc/pmap_prot.h rpcsvc/rquota.h],[],[ QUOTA_LIBS="" netatalk_cv_quotasupport="no" AC_DEFINE(NO_QUOTA_SUPPORT, 1, [Define if quota support should not compiled]) ]) AC_CHECK_LIB(quota, getfsquota, [QUOTA_LIBS="-lquota -lprop -lrpcsvc" AC_DEFINE(HAVE_LIBQUOTA, 1, [define if you have libquota])], [], [-lprop -lrpcsvc]) else netatalk_cv_quotasupport="no" AC_DEFINE(NO_QUOTA_SUPPORT, 1, [Define if quota support should not compiled]) fi AC_SUBST(QUOTA_LIBS) ]) netatalk-2.2.2/macros/afs-check.m40000644000175200017500000000134211655731130013617 00000000000000dnl $Id: afs-check.m4,v 1.4 2005-08-11 20:15:35 didg Exp $ dnl Autoconf macro to check whether AFS support should be enabled AC_DEFUN([NETATALK_AFS_CHECK], [ AFS_LIBS= AFS_CFLAGS= netatalk_cv_afs=no AC_ARG_ENABLE(afs, [ --enable-afs enable AFS support], [ if test "x$enableval" = "xyes"; then AC_CHECK_LIB(afsauthent, pioctl, netatalk_cv_afs=yes, AC_MSG_ERROR([AFS installation not found]) ) AFS_LIBS=-lresolv -lafsrpc -lafsauthent AC_DEFINE(AFS, 1, [Define if AFS should be used]) fi ] ) AC_MSG_CHECKING([whether to enable AFS support]) if test x"$netatalk_cv_afs" = x"yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi AC_SUBST(AFS_LIBS) AC_SUBST(AFS_CFLAGS) ]) netatalk-2.2.2/macros/pam-check.m40000644000175200017500000000741211655731130013627 00000000000000dnl $Id: pam-check.m4,v 1.6 2010-01-11 13:06:02 franklahm Exp $ dnl PAM finding macro AC_DEFUN([AC_PATH_PAM], [ AC_ARG_WITH(pam, [ --with-pam[[=PATH]] specify path to PAM installation [[auto]]], [ require_pam="yes" if test "x$withval" = "xno"; then PAMDIR="NONE" require_pam="never" elif test "x$withval" = "xyes"; then PAMDIR="NONE" else PAMDIR="$withval" fi ], [PAMDIR="NONE";require_pam="no"] ) AC_MSG_CHECKING([for PAM installation directory]) if test "$host_os" != "solaris"; then if test "x$PAMDIR" = "xNONE" -a "x$require_pam" != "xnever"; then dnl Test for PAM pam_paths="/ /usr/ /usr/local/" for path in $pam_paths; do if test -d "${path}etc/pam.d"; then PAMDIR="$path" break fi done fi if test "x$PAMDIR" != "xNONE"; then AC_MSG_RESULT([yes (path: ${PAMDIR}etc/pam.d)]) else AC_MSG_RESULT([no]) fi else AC_MSG_RESULT([/etc/pam.conf (solaris)]) fi pam_found="no" if test "x$require_pam" != "xnever"; then savedCFLAGS="$CFLAGS" savedLDFLAGS="$LDFLAGS" savedLIBS="$LIBS" if test "x$PAMDIR" != "xNONE" -a "x$PAMDIR" != "x/"; then PAM_CFLAGS="-I${PAMDIR}include" PAM_LDFLAGS="-L${PAMDIR}lib" LDFLAGS="$LDFLAGS $PAM_LDFLAGS" CFLAGS="$CFLAGS $PAM_CFLAGS" fi AC_CHECK_HEADERS(security/pam_appl.h pam/pam_appl.h) if test x"$ac_cv_header_security_pam_appl_h" = x"no" -a x"$ac_cv_header_pam_pam_appl_h" = x"no"; then pam_found=no else AC_CHECK_LIB(pam, pam_set_item, [ PAM_LIBS="$PAM_LDFLAGS -lpam" pam_found="yes" ]) fi CFLAGS="$savedCFLAGS" LDFLAGS="$savedLDFLAGS" LIBS="$savedLIBS" fi netatalk_cv_install_pam=yes if test x"$pam_found" = "xyes" -a "x$PAMDIR" = "xNONE"; then AC_MSG_WARN([PAM support can be compiled, but the install location for the netatalk.pamd file could not be determined. Either install this file by hand or specify the install path.]) netatalk_cv_install_pam=no else dnl Check for some system|common auth file AC_MSG_CHECKING([for includable common PAM config]) pampath="${PAMDIR}etc/pam.d" dnl Debian/SuSE if test -f "$pampath/common-auth" ; then PAM_DIRECTIVE=include PAM_AUTH=common-auth PAM_ACCOUNT=common-account PAM_PASSWORD=common-password PAM_SESSION=common-session dnl RHEL/FC elif test -f "$pampath/system-auth" ; then PAM_DIRECTIVE=include PAM_AUTH=system-auth PAM_ACCOUNT=system-auth PAM_PASSWORD=system-auth PAM_SESSION=system-auth dnl FreeBSD elif test -f "$pampath/system" ; then PAM_DIRECTIVE=include PAM_AUTH=system PAM_ACCOUNT=system PAM_PASSWORD=system PAM_SESSION=system dnl Fallback else PAM_DIRECTIVE=required PAM_AUTH=pam_unix.so PAM_ACCOUNT=pam_unix.so PAM_PASSWORD="pam_unix.so use_authtok" PAM_SESSION=pam_unix.so fi if test "x$PAM_DIRECTIVE" != "xrequired" ; then AC_MSG_RESULT([yes ($PAM_DIRECTIVE $PAM_AUTH)]) else AC_MSG_RESULT([no (using defaut pam_unix.so)]) fi fi AC_MSG_CHECKING([whether to enable PAM support]) if test "x$pam_found" = "xno"; then netatalk_cv_install_pam=no if test "x$require_pam" = "xyes"; then AC_MSG_ERROR([PAM support missing]) else AC_MSG_RESULT([no]) fi ifelse([$2], , :, [$2]) else AC_MSG_RESULT([yes]) ifelse([$1], , :, [$1]) fi LIB_REMOVE_USR_LIB(PAM_LIBS) CFLAGS_REMOVE_USR_INCLUDE(PAM_CFLAGS) AC_SUBST(PAMDIR) AC_SUBST(PAM_CFLAGS) AC_SUBST(PAM_LIBS) AC_SUBST(PAM_DIRECTIVE) AC_SUBST(PAM_AUTH) AC_SUBST(PAM_ACCOUNT) AC_SUBST(PAM_PASSWORD) AC_SUBST(PAM_SESSION) ]) netatalk-2.2.2/macros/summary.m40000644000175200017500000001171511665651044013503 00000000000000dnl $Id: summary.m4,v 1.6 2009-10-02 09:32:41 franklahm Exp $ dnl Autoconf macros, display configure summary AC_DEFUN([AC_NETATALK_CONFIG_SUMMARY], [ AC_MSG_RESULT([Configure summary:]) AC_MSG_RESULT([ Install style:]) if test "x$sysv_style" != "x"; then AC_MSG_RESULT([ $sysv_style]) else AC_MSG_RESULT([ none]) fi AC_MSG_RESULT([ AFP:]) AC_MSG_RESULT([ Large file support (>2GB) for AFP3: $wx_largefile]) AC_MSG_RESULT([ Extended Attributes: $neta_cv_eas]) AC_MSG_RESULT([ CNID:]) AC_MSG_RESULT([ backends: $compiled_backends]) AC_MSG_RESULT([ UAMS:]) uams_using_options="" if test x"$netatalk_cv_use_pam" != x"no"; then uams_using_options="PAM" fi if test "x$netatalk_cv_use_shadowpw" = "xyes"; then uams_using_options="$uams_using_options SHADOW" fi if test "x$neta_cv_compile_dhx" = "xyes"; then AC_MSG_RESULT([ DHX ($uams_using_options)]) fi if test "x$neta_cv_compile_dhx2" = "xyes"; then AC_MSG_RESULT([ DHX2 ($uams_using_options)]) fi if test "x$neta_cv_have_openssl" = "xyes"; then AC_MSG_RESULT([ RANDNUM (afppasswd)]) fi if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then AC_MSG_RESULT([ Kerberos V]) fi if test x"$compile_kerberos" = x"yes"; then AC_MSG_RESULT([ Kerberos IV]) fi if test x"$compile_pgp" = x"yes"; then AC_MSG_RESULT([ PGP]) fi AC_MSG_RESULT([ clrtxt ($uams_using_options)]) AC_MSG_RESULT([ guest]) AC_MSG_RESULT([ Options:]) AC_MSG_RESULT([ DDP (AppleTalk) support: $netatalk_cv_ddp_enabled]) if test "x$netatalk_cv_ddp_enabled" = "xyes"; then AC_MSG_RESULT([ CUPS support: $netatalk_cv_use_cups]) AC_MSG_RESULT([ Apple 2 boot support: $compile_a2boot]) fi AC_MSG_RESULT([ SLP support: $netatalk_cv_srvloc]) AC_MSG_RESULT([ Zeroconf support: $netatalk_cv_zeroconf]) AC_MSG_RESULT([ tcp wrapper support: $netatalk_cv_tcpwrap]) dnl if test x"$netatalk_cv_linux_sendfile" != x; then dnl AC_MSG_RESULT([ Linux sendfile support: $netatalk_cv_linux_sendfile]) dnl fi AC_MSG_RESULT([ quota support: $netatalk_cv_quotasupport]) AC_MSG_RESULT([ admin group support: $netatalk_cv_admin_group]) AC_MSG_RESULT([ valid shell check: $netatalk_cv_use_shellcheck]) AC_MSG_RESULT([ cracklib support: $netatalk_cv_with_cracklib]) AC_MSG_RESULT([ dropbox kludge: $netatalk_cv_dropkludge]) AC_MSG_RESULT([ force volume uid/gid: $netatalk_cv_force_uidgid]) AC_MSG_RESULT([ ACL support: $with_acl_support]) AC_MSG_RESULT([ LDAP support: $with_ldap]) if test x"$use_pam_so" = x"yes" -a x"$netatalk_cv_install_pam" = x"no"; then AC_MSG_RESULT([]) AC_MSG_WARN([ PAM support was configured for your system, but the netatalk PAM configuration file]) AC_MSG_WARN([ cannot be installed. Please install the config/netatalk.pamd file manually.]) AC_MSG_WARN([ If you're running Solaris or BSD you'll have to edit /etc/pam.conf to get PAM working.]) AC_MSG_WARN([ You can also re-run configure and specify --without-pam to disable PAM support.]) fi ]) AC_DEFUN([AC_NETATALK_LIBS_SUMMARY], [ dnl ################################################# dnl # Display summary of libraries detected AC_MSG_RESULT([Using libraries:]) AC_MSG_RESULT([ LIBS = $LIBS]) AC_MSG_RESULT([ CFLAGS = $CFLAGS]) if test x"$neta_cv_have_openssl" = x"yes"; then AC_MSG_RESULT([ SSL:]) AC_MSG_RESULT([ LIBS = $SSL_LIBS]) AC_MSG_RESULT([ CFLAGS = $SSL_CFLAGS]) fi if test x"$neta_cv_have_libgcrypt" = x"yes"; then AC_MSG_RESULT([ LIBGCRYPT:]) AC_MSG_RESULT([ LIBS = $LIBGCRYPT_LIBS]) AC_MSG_RESULT([ CFLAGS = $LIBGCRYPT_CFLAGS]) fi if test x"$netatalk_cv_use_pam" = x"yes"; then AC_MSG_RESULT([ PAM:]) AC_MSG_RESULT([ LIBS = $PAM_LIBS]) AC_MSG_RESULT([ CFLAGS = $PAM_CFLAGS]) fi if test x"$netatalk_cv_use_pam" = x"yes"; then AC_MSG_RESULT([ WRAP:]) AC_MSG_RESULT([ LIBS = $WRAP_LIBS]) AC_MSG_RESULT([ CFLAGS = $WRAP_CFLAGS]) fi if test x"$bdb_required" = x"yes"; then AC_MSG_RESULT([ BDB:]) AC_MSG_RESULT([ LIBS = $BDB_LIBS]) AC_MSG_RESULT([ CFLAGS = $BDB_CFLAGS]) fi if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then AC_MSG_RESULT([ GSSAPI:]) AC_MSG_RESULT([ LIBS = $GSSAPI_LIBS]) AC_MSG_RESULT([ CFLAGS = $GSSAPI_CFLAGS]) fi if test x"$netatalk_cv_srvloc" = x"yes"; then AC_MSG_RESULT([ SRVLOC:]) AC_MSG_RESULT([ LIBS = $SLP_LIBS]) AC_MSG_RESULT([ CFLAGS = $SLP_CFLAGS]) fi if test x"$netatalk_cv_use_cups" = x"yes"; then AC_MSG_RESULT([ CUPS:]) AC_MSG_RESULT([ LIBS = $CUPS_LIBS]) AC_MSG_RESULT([ CFLAGS = $CUPS_CFLAGS]) fi ]) netatalk-2.2.2/macros/util.m40000644000175200017500000000103011655731130012742 00000000000000dnl Removes -I/usr/include/? from given variable AC_DEFUN([CFLAGS_REMOVE_USR_INCLUDE],[ ac_new_flags="" for i in [$]$1; do case [$]i in -I/usr/include|-I/usr/include/) ;; *) ac_new_flags="[$]ac_new_flags [$]i" ;; esac done $1=[$]ac_new_flags ]) dnl Removes -L/usr/lib/? from given variable AC_DEFUN([LIB_REMOVE_USR_LIB],[ ac_new_flags="" for i in [$]$1; do case [$]i in -L/usr/lib|-L/usr/lib/|-L/usr|-L/usr/) ;; *) ac_new_flags="[$]ac_new_flags [$]i" ;; esac done $1=[$]ac_new_flags ]) netatalk-2.2.2/macros/libgcrypt.m40000644000175200017500000001047311655731130013777 00000000000000dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS. dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed dnl with the API version to also check the API compatibility. Example: dnl a MINIMUN-VERSION of 1:1.2.5 won't pass the test unless the installed dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1. Using dnl this features allows to prevent build against newer versions of libgcrypt dnl with a changed API. dnl AC_DEFUN([AM_PATH_LIBGCRYPT], [ AC_ARG_WITH(libgcrypt-dir, AC_HELP_STRING([--with-libgcrypt-dir=PATH], [path where LIBGCRYPT is installed (optional). Must contain lib and include dirs.]), libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="") if test x$libgcrypt_config_prefix != x ; then if test x${LIBGCRYPT_CONFIG+set} != xset ; then LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config fi fi ok=no if test x$libgcrypt_config_prefix != xno ; then AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no) tmp=ifelse([$1], ,1:1.2.0,$1) if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` min_libgcrypt_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` else req_libgcrypt_api=0 min_libgcrypt_version="$tmp" fi AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version) if test "$LIBGCRYPT_CONFIG" != "no" ; then req_major=`echo $min_libgcrypt_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` req_minor=`echo $min_libgcrypt_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` req_micro=`echo $min_libgcrypt_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version` major=`echo $libgcrypt_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` minor=`echo $libgcrypt_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` micro=`echo $libgcrypt_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` if test "$major" -gt "$req_major"; then ok=yes else if test "$major" -eq "$req_major"; then if test "$minor" -gt "$req_minor"; then ok=yes else if test "$minor" -eq "$req_minor"; then if test "$micro" -ge "$req_micro"; then ok=yes fi fi fi fi fi fi if test $ok = yes; then AC_MSG_RESULT([yes ($libgcrypt_config_version)]) else AC_MSG_RESULT(no) fi fi if test $ok = yes; then # If we have a recent libgcrypt, we should also check that the # API is compatible if test "$req_libgcrypt_api" -gt 0 ; then tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then AC_MSG_CHECKING([libgcrypt API version]) if test "$req_libgcrypt_api" -eq "$tmp" ; then AC_MSG_RESULT([okay]) else ok=no AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp]) fi fi fi fi if test $ok = yes; then # Opensolaris 11/08 provided libgcrypt doesn't have CAST5, # so we better check the general case AC_MSG_CHECKING([libgcrypt hast CAST5 API]) cast=`$LIBGCRYPT_CONFIG --algorithms 2>/dev/null | grep cast5 | sed 's/\(.*\)\(cast5\)\(.*\)/\2/'` if test x$cast = xcast5 ; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) echo "*** Detected libgcryt without CAST5 ***" echo "*** Please install/build another one and point to it with ***" echo "*** --with-libgcrypt-dir= ***" ok=no fi fi if test $ok = yes; then LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` ifelse([$2], , :, [$2]) else LIBGCRYPT_CFLAGS="" LIBGCRYPT_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(LIBGCRYPT_CFLAGS) AC_SUBST(LIBGCRYPT_LIBS) ])netatalk-2.2.2/macros/zeroconf.m40000644000175200017500000000400311655731130013615 00000000000000dnl Check for optional Zeroconf support AC_DEFUN([NETATALK_ZEROCONF], [ ZEROCONF_LIBS="" ZEROCONF_CFLAGS="" found_zeroconf=no zeroconf_dir="" AC_ARG_ENABLE(zeroconf, [ --enable-zeroconf[[=DIR]] enable Zeroconf support [[auto]]], [zeroconf=$enableval], [zeroconf=try] ) dnl make sure atalk_libname is defined beforehand [[ -n "$atalk_libname" ]] || AC_MSG_ERROR([internal error, atalk_libname undefined]) if test "x$zeroconf" != "xno"; then savedcppflags="$CPPFLAGS" savedldflags="$LDFLAGS" if test "x$zeroconf" = "xyes" -o "x$zeroconf" = "xtry"; then zeroconf_dir="/usr" else zeroconf_dir="$zeroconf" fi # mDNS support using Avahi AC_CHECK_HEADER( avahi-client/client.h, AC_CHECK_LIB( avahi-client, avahi_client_new, AC_DEFINE(USE_ZEROCONF, 1, [Use DNS-SD registration])) ) case "$ac_cv_lib_avahi_client_avahi_client_new" in yes) PKG_CHECK_MODULES(AVAHI, [ avahi-client >= 0.6 ]) PKG_CHECK_MODULES(AVAHI_TPOLL, [ avahi-client >= 0.6.4 ], [AC_DEFINE(HAVE_AVAHI_THREADED_POLL, 1, [Uses Avahis threaded poll implementation])], [AC_MSG_WARN(This Avahi implementation is not supporting threaded poll objects. Maybe this is not what you want.)]) ZEROCONF_LIBS="$AVAHI_LIBS" ZEROCONF_CFLAGS="$AVAHI_CFLAGS" AC_DEFINE(HAVE_AVAHI, 1, [Use Avahi/DNS-SD registration]) found_zeroconf=yes ;; esac CPPFLAGS="$savedcppflags" LDFLAGS="$savedldflags" fi netatalk_cv_zeroconf=no AC_MSG_CHECKING([whether to enable Zerconf support]) if test "x$found_zeroconf" = "xyes"; then AC_MSG_RESULT([yes]) AC_DEFINE(USE_ZEROCONF, 1, [Define to enable Zeroconf support]) netatalk_cv_zeroconf=yes else AC_MSG_RESULT([no]) if test "x$zeroconf" != "xno" -a "x$zeroconf" != "xtry"; then AC_MSG_ERROR([Zeroconf installation not found]) fi fi LIB_REMOVE_USR_LIB(ZEROCONF_LIBS) CFLAGS_REMOVE_USR_INCLUDE(ZEROCONF_CFLAGS) AC_SUBST(ZEROCONF_LIBS) AC_SUBST(ZEROCONF_CFLAGS) ]) netatalk-2.2.2/macros/ps-check.m40000644000175200017500000000046111655731130013471 00000000000000dnl Autoconf macro to check for the existence of ps dnl $Id: ps-check.m4,v 1.2 2002-02-14 18:02:04 jmarcus Exp $ AC_DEFUN([AC_PROG_PS], [ AC_REQUIRE([AC_EXEEXT])dnl test x$PS = x && AC_PATH_PROG(PS, ps$EXEEXT, ps$EXEEXT) test x$PS = x && AC_MSG_ERROR([no acceptable ps found in \$PATH]) ]) AC_SUBST(PS) netatalk-2.2.2/macros/perl-check.m40000644000175200017500000000051411655731130014010 00000000000000dnl Autoconf macro to check for the existence of Perl dnl $Id: perl-check.m4,v 1.4 2002-03-12 11:03:49 srittau Exp $ AC_DEFUN([AC_PROG_PERL], [ AC_REQUIRE([AC_EXEEXT])dnl test "x$PERL" = x && AC_PATH_PROG(PERL, perl$EXEEXT, perl$EXEEXT) test "x$PERL" = x && AC_MSG_ERROR([no acceptable Perl found in \$PATH]) ]) AC_SUBST(PERL) netatalk-2.2.2/macros/config-checks.m40000644000175200017500000000154411655731130014502 00000000000000dnl $Id: config-checks.m4,v 1.6 2005-04-28 20:50:05 bfernhomberg Exp $ dnl Autoconf macro to set the configuration directories. AC_DEFUN([NETATALK_CONFIG_DIRS], [ PKGCONFDIR="${sysconfdir}/netatalk" AC_ARG_WITH(pkgconfdir, [ --with-pkgconfdir=DIR package specific configuration in DIR [[SYSCONF/netatalk]]], [ if test "x$withval" != "x"; then PKGCONFDIR="$withval" fi ] ) SERVERTEXT="${PKGCONFDIR}/msg" AC_ARG_WITH(message-dir, [ --with-message-dir=PATH path to server message files [[PKGCONF/msg]]], [ if test x"$withval" = x"no"; then AC_MSG_WARN([*** message-dir is mandatory and cannot be disabled, using default ***]) elif test "x$withval" != "x" && test x"$withval" != x"yes"; then SERVERTEXT="$withval" fi ] ) AC_SUBST(PKGCONFDIR) AC_SUBST(SERVERTEXT) ]) netatalk-2.2.2/macros/db3-check.m40000644000175200017500000002047611655731130013527 00000000000000dnl $Id: db3-check.m4,v 1.23 2010-04-12 14:28:48 franklahm Exp $ dnl Autoconf macros to check for the Berkeley DB library dnl -- check header for minimum version and return version in dnl -- $atalk_cv_bdb_MAJOR and $atalk_cv_bdb_MINOR AC_DEFUN([NETATALK_BDB_HEADER],[ dnl check for header version AC_MSG_CHECKING([$1/db.h version >= ${DB_MAJOR_REQ}.${DB_MINOR_REQ}.${DB_PATCH_REQ}]) atalk_cv_bdb_MAJOR=`grep DB_VERSION_MAJOR "$1/db.h" | cut -f 3` atalk_cv_bdb_MINOR=`grep DB_VERSION_MINOR "$1/db.h" | cut -f 3` if test $atalk_cv_bdb_MAJOR -gt $DB_MAJOR_REQ ; then AC_MSG_RESULT([yes]) atalk_cv_bdbheader=yes elif test $DB_MAJOR_REQ -gt $atalk_cv_bdb_MAJOR ; then AC_MSG_RESULT([no]) atalk_cv_bdbheader=no elif test $DB_MINOR_REQ -gt $atalk_cv_bdb_MINOR ; then AC_MSG_RESULT([no]) atalk_cv_bdbheader=no else AC_MSG_RESULT([yes]) atalk_cv_bdbheader=yes fi ]) dnl -- Try to link and run with lib with version taken from dnl -- $atalk_cv_bdb_MAJOR and $atalk_cv_bdb_MINOR AC_DEFUN([NETATALK_BDB_TRY_LINK],[ atalk_cv_bdb_version=no maj=$atalk_cv_bdb_MAJOR min=$atalk_cv_bdb_MINOR atalk_cv_bdb_try_libs="db$maj$min db$maj.$min db-$maj$min db-$maj.$min db$maj-$maj.$min db" for lib in $atalk_cv_bdb_try_libs ; do LIBS="-l$lib $savedlibs" AC_MSG_CHECKING([Berkeley DB library (-l$lib)]) AC_TRY_RUN([ #include #include int main(void) { int major, minor, patch; char *version_str; version_str = db_version(&major, &minor, &patch); if ((major*100 + minor*10 + patch) < (DB_MAJOR_REQ*100 + DB_MINOR_REQ*10 + DB_PATCH_REQ)) { printf("linking wrong library version (%d.%d.%d), ",major, minor, patch); return (2); } if ( major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR || patch != DB_VERSION_PATCH) { printf("header/library version mismatch (%d.%d.%d/%d.%d.%d), ", DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, major, minor, patch); return (3); } printf("%d.%d.%d ... ",major, minor, patch); return (0); } ],[ AC_MSG_RESULT(yes) atalk_cv_bdb_version="yes" atalk_cv_lib_db="-l$lib" break ],[ AC_MSG_RESULT(no) ],[ bdblibs=`ls $bdblibdir/lib$lib.* 2>/dev/null` for bdblib in $bdblibs ; do echo "Testing for lib file $bdblib" >&AS_MESSAGE_LOG_FD if test -f "$bdblib" ; then AC_MSG_RESULT([yes (cross-compiling)]) atalk_cv_bdb_version="yes" atalk_cv_lib_db="-l$lib" break fi done if test "x$atalk_cv_bdb_version" = "xyes" ; then break fi AC_MSG_RESULT([no (cross-compiling)]) ]) done LIBS="$savedlibs" ]) dnl -- This is called from configure AC_DEFUN([AC_PATH_BDB],[ trybdbdir="" dobdbsearch=yes bdb_search_dirs="/usr/local /usr" search_subdirs="/ /db5 /db5.1 /db51 /db5.0 /db50 /db4.8 /db48 /db4.7 /db47 /db4.6 /db46 /db4" bdbfound=no savedcflags="$CFLAGS" savedldflags="$LDFLAGS" savedcppflags="$CPPFLAGS" savedlibs="$LIBS" saved_shlibpath_var=$shlibpath_var dnl required BDB version: 4.6, because of cursor API change DB_MAJOR_REQ=4 DB_MINOR_REQ=6 DB_PATCH_REQ=0 dnl make sure atalk_libname is defined beforehand [[ -n "$atalk_libname" ]] || AC_MSG_ERROR([internal error, atalk_libname undefined]) saved_atalk_libname=$atalk_libname dnl define the required BDB version AC_DEFINE_UNQUOTED(DB_MAJOR_REQ, ${DB_MAJOR_REQ}, [Required BDB version, major]) AC_DEFINE_UNQUOTED(DB_MINOR_REQ, ${DB_MINOR_REQ}, [Required BDB version, minor]) AC_DEFINE_UNQUOTED(DB_PATCH_REQ, ${DB_PATCH_REQ}, [Required BDB version, patch]) AC_ARG_WITH(bdb, [ --with-bdb=PATH specify path to Berkeley DB installation[[auto]]], if test "x$withval" = "xno"; then dobdbsearch=no elif test "x$withval" = "xyes"; then dobdbsearch=yes else bdb_search_dirs="$withval" fi ) if test "x$dobdbsearch" = "xyes"; then for bdbdir in $bdb_search_dirs; do if test $bdbfound = "yes"; then break; fi for subdir in ${search_subdirs}; do AC_MSG_CHECKING([for Berkeley DB headers in ${bdbdir}/include${subdir}]) dnl -- First check the mere existence of the header if test -f "${bdbdir}/include${subdir}/db.h" ; then AC_MSG_RESULT([yes]) dnl -- Check if it meets minimun requirement, also return the version NETATALK_BDB_HEADER([${bdbdir}/include${subdir}]) if test ${atalk_cv_bdbheader} != "no"; then bdblibdir="${bdbdir}/${atalk_libname}" bdbbindir="${bdbdir}/bin" CPPFLAGS="-I${bdbdir}/include${subdir} $CPPFLAGS" LDFLAGS="-L$bdblibdir $LDFLAGS" dnl -- Uses version set by NETATALK_BDB_HEADER to try to run dnl -- a conftest that checks that header/lib version match dnl -- $shlibpath_var is set by LIBTOOL, its value is dnl -- LD_LIBRARY_PATH on many platforms. This will be fairly dnl -- portable hopefully. Reference: dnl -- http://lists.gnu.org/archive/html/autoconf/2009-03/msg00040.html eval export $shlibpath_var=$bdblibdir NETATALK_BDB_TRY_LINK eval export $shlibpath_var=$saved_shlibpath_var if test x"${atalk_cv_bdb_version}" = x"yes"; then BDB_CFLAGS="-I${bdbdir}/include${subdir}" BDB_LIBS="-L${bdblibdir} ${atalk_cv_lib_db}" BDB_BIN="$bdbbindir" BDB_PATH="$bdbdir" bdbfound=yes break; fi dnl -- Search lib in "lib" too, as $atalk_libname might be set dnl -- to "lib64" or "lib/64" which would not be found above dnl -- if 64bit lib were installed in a dir named "lib" if test x"$atalk_libname" != x"lib" ; then bdblibdir="${bdbdir}/lib" bdbbindir="${bdbdir}/bin" CPPFLAGS="-I${bdbdir}/include${subdir} $CPPFLAGS" LDFLAGS="-L$bdblibdir $LDFLAGS" eval export $shlibpath_var=$bdblibdir NETATALK_BDB_TRY_LINK eval export $shlibpath_var=$saved_shlibpath_var if test x"${atalk_cv_bdb_version}" = x"yes"; then BDB_CFLAGS="-I${bdbdir}/include${subdir}" BDB_LIBS="-L${bdblibdir} ${atalk_cv_lib_db}" BDB_BIN="$bdbbindir" BDB_PATH="$bdbdir" bdbfound=yes break; fi fi fi CFLAGS="$savedcflags" LDFLAGS="$savedldflags" CPPFLAGS="$savedcppflags" LIBS="$savedlibs" else AC_MSG_RESULT([no]) fi done done fi CFLAGS="$savedcflags" LDFLAGS="$savedldflags" CPPFLAGS="$savedcppflags" LIBS="$savedlibs" atalk_libname=$saved_atalk_libname if test "x$bdbfound" = "xyes"; then ifelse([$1], , :, [$1]) else ifelse([$2], , :, [$2]) fi CFLAGS_REMOVE_USR_INCLUDE(BDB_CFLAGS) LIB_REMOVE_USR_LIB(BDB_LIBS) AC_SUBST(BDB_CFLAGS) AC_SUBST(BDB_LIBS) AC_SUBST(BDB_BIN) AC_SUBST(BDB_PATH) ]) netatalk-2.2.2/macros/iconv.m40000644000175200017500000000657611655731245013136 00000000000000AC_DEFUN([AC_CHECK_ICONV], [ dnl ################################################# dnl # check for libiconv support saved_CPPFLAGS="$CPPFLAGS" savedcflags="$CFLAGS" savedldflags="$LDFLAGS" ICONV_CFLAGS="" ICONV_LIBS="" AC_ARG_WITH(libiconv, [ --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib and BASEDIR/include [[default=auto]]], [ case "$withval" in no) ;; yes) ;; *) ICONV_CFLAGS="-I$withval/include" ICONV_LIBS="-L$withval/$atalk_libname" ;; esac ], withval="no" ) CFLAGS="$ICONV_CFLAGS $CFLAGS" LDFLAGS="$LDFLAGS $ICONV_LIBS -liconv" AC_CACHE_CHECK([for libiconv],netatalk_cv_iconv,[ AC_TRY_LINK([ #include #include ],[ iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ], netatalk_cv_iconv=yes, netatalk_cv_iconv=no, netatalk_cv_iconv=cross)]) if test x"$netatalk_cv_iconv" = x"yes"; then ICONV_LIBS="$ICONV_LIBS -liconv" else dnl # unset C-/LDFLAGS so we can detect glibc iconv, if available CFLAGS="$savedcflags" LDFLAGS="$savedldflags" ICONV_LIBS="" ICONV_CFLAGS="" if test x"$withval" != x"no"; then AC_MSG_ERROR([libiconv not found]) fi fi CFLAGS_REMOVE_USR_INCLUDE(ICONV_CFLAGS) LIB_REMOVE_USR_LIB(ICONV_LIBS) AC_SUBST(ICONV_CFLAGS) AC_SUBST(ICONV_LIBS) dnl ############ dnl # check for iconv usability AC_CACHE_CHECK([for working iconv],netatalk_cv_HAVE_USABLE_ICONV,[ AC_TRY_RUN([\ #include main() { iconv_t cd = iconv_open("ASCII", "UTF-8"); if (cd == 0 || cd == (iconv_t)-1) return -1; return 0; } ], netatalk_cv_HAVE_USABLE_ICONV=yes,netatalk_cv_HAVE_USABLE_ICONV=no,netatalk_cv_HAVE_USABLE_ICONV=cross)]) if test x"$netatalk_cv_HAVE_USABLE_ICONV" = x"yes"; then AC_DEFINE(HAVE_USABLE_ICONV,1,[Whether to use native iconv]) fi dnl ########### dnl # check if iconv needs const if test x"$netatalk_cv_HAVE_USABLE_ICONV" = x"yes"; then AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([\ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi dnl ########### dnl # check if (lib)iconv supports UCS-2-INTERNAL if test x"$netatalk_cv_HAVE_USABLE_ICONV" = x"yes"; then AC_CACHE_CHECK([whether iconv supports UCS-2-INTERNAL],netatalk_cv_HAVE_UCS2INTERNAL,[ AC_TRY_RUN([\ #include int main() { iconv_t cd = iconv_open("ASCII", "UCS-2-INTERNAL"); if (cd == 0 || cd == (iconv_t)-1) return -1; return 0; } ], netatalk_cv_HAVE_UCS2INTERNAL=yes,netatalk_cv_HAVE_UCS2INTERNAL=no,netatalk_cv_HAVEUCS2INTERNAL=cross)]) if test x"$netatalk_cv_HAVE_UCS2INTERNAL" = x"yes"; then AC_DEFINE(HAVE_UCS2INTERNAL,1,[Whether UCS-2-INTERNAL is supported]) fi fi CFLAGS="$savedcflags" LDFLAGS="$savedldflags" CPPFLAGS="$saved_CPPFLAGS" ]) netatalk-2.2.2/macros/cnid-backend.m40000644000175200017500000001146011655731130014277 00000000000000AC_DEFUN([AC_NETATALK_CNID], [ dnl Don't use BDB unless it's needed bdb_required=no compiled_backends="" dnl Determine whether or not to use Database Daemon CNID backend AC_MSG_CHECKING([whether or not to use Database Daemon CNID backend]) AC_ARG_WITH(cnid-dbd-backend, [ --with-cnid-dbd-backend build CNID with Database Daemon Data Store [[yes]]], [ if test x"$withval" = x"no"; then use_dbd_backend=no AC_MSG_RESULT([no]) else use_dbd_backend=yes AC_MSG_RESULT([yes]) fi ],[ use_dbd_backend=yes AC_MSG_RESULT([yes]) ]) if test $use_dbd_backend = yes; then compiled_backends="$compiled_backends dbd" AC_DEFINE(CNID_BACKEND_DBD, 1, [Define if CNID Database Daemon backend should be compiled.]) if test x"$DEFAULT_CNID_SCHEME" = x; then DEFAULT_CNID_SCHEME=dbd fi bdb_required=yes fi AM_CONDITIONAL(BUILD_DBD_DAEMON, test x"$use_dbd_backend" = x"yes") dnl Determine whether or not to use BDB Concurrent Data Store AC_MSG_CHECKING([whether or not to use BDB Concurrent Data Store]) AC_ARG_WITH(cnid-cdb-backend, [ --with-cnid-cdb-backend build CNID with Concurrent BDB Data Store [[no]]],[ if test x"$withval" = x"no"; then use_cdb_backend=no else use_cdb_backend=yes fi ],[ use_cdb_backend=no ]) if test $use_cdb_backend = yes; then AC_MSG_RESULT([yes]) AC_DEFINE(CNID_BACKEND_CDB, 1, [Define if CNID Concurrent BDB backend should be compiled.]) if test x"$DEFAULT_CNID_SCHEME" = x; then DEFAULT_CNID_SCHEME=cdb fi bdb_required=yes compiled_backends="$compiled_backends cdb" else AC_MSG_RESULT([no]) fi AM_CONDITIONAL(USE_CDB_BACKEND, test x"$use_cdb_backend" = x"yes") dnl Determine whether or not to use LAST DID scheme AC_MSG_CHECKING([whether or not to use LAST DID scheme]) AC_ARG_WITH(cnid-last-backend, [ --with-cnid-last-backend build LAST CNID scheme [[yes]]], [ if test x"$withval" = x"no"; then use_last_backend=no else use_last_backend=yes fi ],[ use_last_backend=yes ]) if test $use_last_backend = yes; then AC_MSG_RESULT([yes]) AC_DEFINE(CNID_BACKEND_LAST, 1, [Define if CNID LAST scheme backend should be compiled.]) if test x"$DEFAULT_CNID_SCHEME" = x; then DEFAULT_CNID_SCHEME=last fi compiled_backends="$compiled_backends last" else AC_MSG_RESULT([no]) fi AM_CONDITIONAL(USE_LAST_BACKEND, test x"$use_last_backend" = x"yes") dnl Determine whether or not to use TDB DID scheme AC_MSG_CHECKING([whether or not to use TDB DID scheme]) AC_ARG_WITH(cnid-tdb-backend, [ --with-cnid-tdb-backend build TDB CNID scheme [[yes]]], [ if test x"$withval" = x"no"; then use_tdb_backend=no else use_tdb_backend=yes fi ],[ use_tdb_backend=yes ]) if test $use_tdb_backend = yes; then AC_MSG_RESULT([yes]) AC_DEFINE(CNID_BACKEND_TDB, 1, [Define if CNID TDB scheme backend should be compiled.]) if test x"$DEFAULT_CNID_SCHEME" = x; then DEFAULT_CNID_SCHEME=tdb fi compiled_backends="$compiled_backends tdb" else AC_MSG_RESULT([no]) fi AM_CONDITIONAL(USE_TDB_BACKEND, test x"$use_tdb_backend" = x"yes") dnl Set default DID scheme AC_MSG_CHECKING([default DID scheme]) AC_ARG_WITH(cnid-default-backend, [ --with-cnid-default-backend=val set default DID scheme [[dbd]]], [ if test x"$withval" = x; then AC_MSG_RESULT([ignored]) else DEFAULT_CNID_SCHEME=$withval AC_MSG_RESULT($DEFAULT_CNID_SCHEME) fi ],[ AC_MSG_RESULT($DEFAULT_CNID_SCHEME) ]) if test x"$DEFAULT_CNID_SCHEME" = x; then AC_MSG_ERROR([No DID schemes compiled in ]) fi AC_MSG_CHECKING([whether default CNID scheme has been activated]) found_scheme=no for scheme in $compiled_backends ; do if test x"$scheme" = x"$DEFAULT_CNID_SCHEME"; then found_scheme=yes fi done if test x"$found_scheme" = x"no"; then AC_MSG_RESULT([no]) AC_MSG_ERROR([Specified default CNID scheme $DEFAULT_CNID_SCHEME was not selected for compilation]) else AC_MSG_RESULT([yes]) fi AC_DEFINE_UNQUOTED(DEFAULT_CNID_SCHEME, "$DEFAULT_CNID_SCHEME", [Default CNID scheme to be used]) AC_SUBST(DEFAULT_CNID_SCHEME) AC_SUBST(compiled_backends) if test "x$bdb_required" = "xyes"; then ifelse([$1], , :, [$1]) else ifelse([$2], , :, [$2]) fi ]) netatalk-2.2.2/macros/gssapi-check.m40000644000175200017500000001131111655731245014340 00000000000000dnl $Id: gssapi-check.m4,v 1.3 2005-04-28 20:50:05 bfernhomberg Exp $ dnl Autoconf macro to check for kerberos AC_DEFUN([NETATALK_GSSAPI_CHECK], [ FOUND_GSSAPI=no GSSAPI_LIBS="" GSSAPI_CFLAGS="" AC_ARG_WITH(gssapi, [ --with-gssapi[[=PATH]] path to GSSAPI for Kerberos V UAM [[auto]]], [compilegssapi=$withval], [compilegssapi=auto] ) if test x"$compilegssapi" != x"no"; then if test "x$compilegssapi" != "xyes" -a "x$compilegssapi" != "xauto"; then GSSAPI_CFLAGS="-I$withval/include" GSSAPI_CPPFLAGS="-I$withval/include" GSSAPI_LDFLAGS="-L$withval/${atalk_libname}" FOUND_GSSAPI=yes AC_MSG_CHECKING([checking for GSSAPI support in]) AC_MSG_RESULT([$compilegssapi]) fi # Do no harm to the values of CFLAGS and LIBS while testing for # Kerberos support. ac_save_CFLAGS=$CFLAGS ac_save_CPPFLAGS=$CPPFLAGS ac_save_LDFLAGS=$LDFLAGS ac_save_LIBS=$LIBS if test x$FOUND_GSSAPI = x"no"; then ################################################# # check for krb5-config from recent MIT and Heimdal kerberos 5 AC_PATH_PROG(KRB5_CONFIG, krb5-config) AC_MSG_CHECKING(for working krb5-config) if test -x "$KRB5_CONFIG"; then ac_save_CFLAGS=$CFLAGS CFLAGS="";export CFLAGS ac_save_LDFLAGS=$LDFLAGS LDFLAGS="";export LDFLAGS GSSAPI_LIBS="`$KRB5_CONFIG --libs gssapi`" GSSAPI_CFLAGS="`$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`" GSSAPI_CPPFLAGS="`$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`" CFLAGS=$ac_save_CFLAGS;export CFLAGS LDFLAGS=$ac_save_LDFLAGS;export LDFLAGS FOUND_GSSAPI=yes AC_MSG_RESULT(yes) else AC_MSG_RESULT(no. Fallback to previous krb5 detection strategy) fi fi if test x$FOUND_GSSAPI = x"no"; then ################################################# # see if this box has the SuSE location for the heimdal krb implementation AC_MSG_CHECKING(for /usr/include/heimdal) if test -d /usr/include/heimdal; then if test -f /usr/lib/heimdal/lib/libkrb5.a; then GSSAPI_CFLAGS="-I/usr/include/heimdal" GSSAPI_CPPFLAGS="-I/usr/include/heimdal" GSSAPI_LDFLAGS="-L/usr/lib/heimdal/lib" AC_MSG_RESULT(yes) FOUND_GSSAPI=yes else GSSAPI_CFLAGS="-I/usr/include/heimdal" GSSAPI_CPPFLAGS="-I/usr/include/heimdal" AC_MSG_RESULT(yes) FOUND_GSSAPI=yes fi else AC_MSG_RESULT(no) fi fi if test x$FOUND_GSSAPI = x"no"; then ################################################# # see if this box has the RedHat location for kerberos AC_MSG_CHECKING(for /usr/kerberos) if test -d /usr/kerberos -a -f /usr/kerberos/lib/libkrb5.a; then GSSAPI_LDFLAGS="-L/usr/kerberos/lib" GSSAPI_CFLAGS="-I/usr/kerberos/include" GSSAPI_CPPFLAGS="-I/usr/kerberos/include" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi fi CFLAGS="$CFLAGS $GSSAPI_CFLAGS" CPPFLAGS="$CPPFLAGS $GSSAPI_CPPFLAGS" LDFLAGS="$LDFLAGS $GSSAPI_LDFLAGS" LIBS="$LIBS $GSSAPI_LIBS" # check for gssapi headers gss_headers_found=no AC_CHECK_HEADERS(gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h gssapi/gssapi_krb5.h,[gss_headers_found=yes],[],[]) if test x"$gss_headers_found" = x"no"; then AC_MSG_ERROR([GSSAPI installation not found, headers missing]) fi # check for libs AC_CHECK_LIB(gssapi, gss_display_status) AC_CHECK_LIB(gssapi_krb5, gss_display_status) AC_CHECK_LIB(gss, gss_display_status) # check for functions AC_CHECK_FUNC(gss_acquire_cred,[],[AC_MSG_ERROR([GSSAPI: required function gss_acquire_cred missing])]) # Heimdal/MIT compatibility fix if test "$ac_cv_header_gssapi_h" = "yes"; then AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,1,[Wheter GSS_C_NT_HOSTBASED_SERVICE is in gssapi.h])) else AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,1,[Wheter GSS_C_NT_HOSTBASED_SERVICE is in gssapi.h])) fi AC_MSG_CHECKING(whether GSSAPI support is used) if test x"$ac_cv_func_gss_acquire_cred" = x"yes"; then AC_DEFINE(HAVE_GSSAPI,1,[Whether to enable GSSAPI support]) AC_MSG_RESULT([yes]) GSSAPI_LIBS="$LDFLAGS $LIBS" else AC_MSG_RESULT([no]) if test x"$compilegssapi" = x"yes"; then AC_MSG_ERROR([GSSAPI installation not found]) fi GSSAPI_LIBS="" fi LIBS="$ac_save_LIBS" CFLAGS="$ac_save_CFLAGS" LDFLAGS="$ac_save_LDFLAGS" CPPFLAGS="$ac_save_CPPFLAGS" fi if test x"$ac_cv_func_gss_acquire_cred" = x"yes"; then ifelse([$1], , :, [$1]) else ifelse([$2], , :, [$2]) fi AC_SUBST(GSSAPI_LIBS) AC_SUBST(GSSAPI_CFLAGS) ]) netatalk-2.2.2/macros/grep-check.m40000644000175200017500000000050511655731130014003 00000000000000dnl Autoconf macro to check for the existence of grep dnl $Id: grep-check.m4,v 1.2 2002-02-14 18:02:04 jmarcus Exp $ AC_DEFUN([AC_PROG_GREP], [ AC_REQUIRE([AC_EXEEXT])dnl test x$GREP = x && AC_PATH_PROG(GREP, grep$EXEEXT, grep$EXEEXT) test x$GREP = x && AC_MSG_ERROR([no acceptable grep found in \$PATH]) ]) AC_SUBST(GREP) netatalk-2.2.2/macros/webmin.m40000644000175200017500000000513011655731130013253 00000000000000dnl $Id: webmin.m4,v 1.1 2009-10-22 08:36:30 franklahm Exp $ dnl Autoconf macro to install webmin + netatalk webmin module AC_DEFUN([NETATALK_WEBMIN],[ AC_ARG_WITH(webmin, [ --with-webmin=PATH path where webmin is installed [[$PKGCONFDIR/webmin]]], if test "x$withval" = "xyes"; then webminpath="$PKGCONFDIR" elif test "x$withval" = "xno"; then webminpath="" else webminpath="$withval" fi ) AC_ARG_WITH(webminuser, [ --with-webminuser=NAME name for the webmin admin user], if test "x$withval" = "xyes"; then webminuser="" elif test "x$withval" = "xno"; then webminuser="" else webminuser="$withval" fi ) AC_ARG_WITH(webminversion, [ --with-webminversion=VERSION Webmin version to fetch from sf.net [[1.490]]], if test "x$withval" = "xyes"; then webminversion="1.490" elif test "x$withval" = "xno"; then webminversions="1.490" else webminversion="$withval" fi ) AC_ARG_WITH(webminpass, [ --with-webminpass=PASSWORD password for the webmin admin user], if test "x$withval" = "xyes"; then webminpass="" elif test "x$withval" = "xno"; then webminpass="" else webminpass="$withval" fi ) AC_ARG_WITH(webminport, [ --with-webminport=PORT TCP port for webmin], if test "x$withval" = "xyes"; then webminport="" elif test "x$withval" = "xno"; then webminport="" else webminport="$withval" fi ) AC_MSG_CHECKING([if webmin administration shall be installed]) if test "x$webminpath" != "x" && test "x$webminuser" != "x" && test "x$webminpass" != "x" && test "x$webminport" != "x" && test "x$webminversion" != "x"; then AC_MSG_RESULT([yes]) AC_MSG_CHECKING([if neccessary Perl module 'Net::SSLeay' is installed]) $ac_cv_path_PERL -e 'use Net::SSLeay' >/dev/null 2>/dev/null if test "$?" != "0" ; then AC_MSG_RESULT([no]) webminpath="" else AC_MSG_RESULT([yes]) AC_MSG_NOTICE([Installing Webmin in "$webminpath/webmin"]) fi else AC_MSG_RESULT([no]) fi AC_SUBST(WEBMIN_PATH, $webminpath) AC_SUBST(WEBMIN_VERSION, $webminversion) AC_SUBST(WEBMIN_USER, $webminuser) AC_SUBST(WEBMIN_PASS, $webminpass) AC_SUBST(WEBMIN_PORT, $webminport) ])netatalk-2.2.2/missing0000755000175200017500000002557711661232404011661 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: netatalk-2.2.2/libatalk/0000777000175200017500000000000011704770423012117 500000000000000netatalk-2.2.2/libatalk/dummy.c0000644000175200017500000000000011655731127013323 00000000000000netatalk-2.2.2/libatalk/Makefile.am0000644000175200017500000000156611655731245014103 00000000000000 # Makefile.am for libatalk/ SUBDIRS = acl adouble bstring compat cnid dsi tdb util unicode vfs lib_LTLIBRARIES = libatalk.la libatalk_la_SOURCES = dummy.c libatalk_la_LIBADD = \ acl/libacl.la \ adouble/libadouble.la \ bstring/libbstring.la \ compat/libcompat.la \ dsi/libdsi.la \ util/libutil.la \ tdb/libtdb.la \ unicode/libunicode.la \ vfs/libvfs.la libatalk_la_DEPENDENCIES = \ acl/libacl.la \ adouble/libadouble.la \ bstring/libbstring.la \ compat/libcompat.la \ dsi/libdsi.la \ util/libutil.la \ tdb/libtdb.la \ unicode/libunicode.la \ vfs/libvfs.la libatalk_la_LDFLAGS = -static if USE_APPLETALK SUBDIRS += asp atp nbp netddp libatalk_la_LIBADD += \ asp/libasp.la \ atp/libatp.la \ nbp/libnbp.la \ netddp/libnetddp.la libatalk_la_DEPENDENCIES += \ asp/libasp.la \ atp/libatp.la \ nbp/libnbp.la \ netddp/libnetddp.la endif netatalk-2.2.2/libatalk/Makefile.in0000644000175200017500000005360611703521726014111 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @USE_APPLETALK_TRUE@am__append_1 = asp atp nbp netddp @USE_APPLETALK_TRUE@am__append_2 = \ @USE_APPLETALK_TRUE@ asp/libasp.la \ @USE_APPLETALK_TRUE@ atp/libatp.la \ @USE_APPLETALK_TRUE@ nbp/libnbp.la \ @USE_APPLETALK_TRUE@ netddp/libnetddp.la @USE_APPLETALK_TRUE@am__append_3 = \ @USE_APPLETALK_TRUE@ asp/libasp.la \ @USE_APPLETALK_TRUE@ atp/libatp.la \ @USE_APPLETALK_TRUE@ nbp/libnbp.la \ @USE_APPLETALK_TRUE@ netddp/libnetddp.la subdir = libatalk DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) am_libatalk_la_OBJECTS = dummy.lo libatalk_la_OBJECTS = $(am_libatalk_la_OBJECTS) libatalk_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libatalk_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libatalk_la_SOURCES) DIST_SOURCES = $(libatalk_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = acl adouble bstring compat cnid dsi tdb util unicode \ vfs asp atp nbp netddp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = acl adouble bstring compat cnid dsi tdb util unicode vfs \ $(am__append_1) lib_LTLIBRARIES = libatalk.la libatalk_la_SOURCES = dummy.c libatalk_la_LIBADD = acl/libacl.la adouble/libadouble.la \ bstring/libbstring.la compat/libcompat.la dsi/libdsi.la \ util/libutil.la tdb/libtdb.la unicode/libunicode.la \ vfs/libvfs.la $(am__append_2) libatalk_la_DEPENDENCIES = acl/libacl.la adouble/libadouble.la \ bstring/libbstring.la compat/libcompat.la dsi/libdsi.la \ util/libutil.la tdb/libtdb.la unicode/libunicode.la \ vfs/libvfs.la $(am__append_3) libatalk_la_LDFLAGS = -static all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libatalk.la: $(libatalk_la_OBJECTS) $(libatalk_la_DEPENDENCIES) $(libatalk_la_LINK) -rpath $(libdir) $(libatalk_la_OBJECTS) $(libatalk_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-libLTLIBRARIES install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags ctags-recursive \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/compat/0000777000175200017500000000000011704770416013404 500000000000000netatalk-2.2.2/libatalk/compat/Makefile.am0000644000175200017500000000035011655731245015354 00000000000000# Makefile.am for libatalk/compat/ noinst_LTLIBRARIES = libcompat.la libcompat_la_SOURCES = \ misc.c \ mktemp.c \ getusershell.c \ strcasecmp.c \ strstr.c \ strdup.c \ inet_aton.c \ rquota_xdr.c \ pselect.c \ snprintf.c netatalk-2.2.2/libatalk/compat/Makefile.in0000644000175200017500000004062611703521727015373 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/compat/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = libatalk/compat DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcompat_la_LIBADD = am_libcompat_la_OBJECTS = misc.lo mktemp.lo getusershell.lo \ strcasecmp.lo strstr.lo strdup.lo inet_aton.lo rquota_xdr.lo \ pselect.lo snprintf.lo libcompat_la_OBJECTS = $(am_libcompat_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcompat_la_SOURCES) DIST_SOURCES = $(libcompat_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libcompat.la libcompat_la_SOURCES = \ misc.c \ mktemp.c \ getusershell.c \ strcasecmp.c \ strstr.c \ strdup.c \ inet_aton.c \ rquota_xdr.c \ pselect.c \ snprintf.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/compat/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/compat/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libcompat.la: $(libcompat_la_OBJECTS) $(libcompat_la_DEPENDENCIES) $(LINK) $(libcompat_la_OBJECTS) $(libcompat_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getusershell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_aton.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktemp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pselect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rquota_xdr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strcasecmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strstr.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/compat/pselect.c0000644000175200017500000000551611655731127015133 00000000000000/* * Copyright 2000 Massachusetts Institute of Technology * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that both the above copyright notice and this * permission notice appear in all copies, that both the above * copyright notice and this permission notice appear in all * supporting documentation, and that the name of M.I.T. not be used * in advertising or publicity pertaining to distribution of the * software without specific, written prior permission. M.I.T. makes * no representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. * * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT * SHALL M.I.T. 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. */ /* $FreeBSD: src/lib/libc/gen/pselect.c,v 1.6 2002/10/12 16:13:37 mike Exp $ */ /* modified for OpenBSD by Masahito Yamaga (2010-02-02) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #if !defined(HAVE_PSELECT) || defined(__OpenBSD__) #include #include #include #include /* * Emulate the POSIX 1003.1g-2000 `pselect' interface. This is the * same as the traditional BSD `select' function, except that it uses * a timespec rather than a timeval, doesn't modify the timeout argument, * and allows the user to specify a signal mask to apply during the select. */ int pselect(int count, fd_set * restrict rfds, fd_set * restrict wfds, fd_set * restrict efds, const struct timespec * restrict timo, const sigset_t * restrict mask) { sigset_t omask; struct timeval tvtimo, *tvp; int rv, sverrno; if (timo) { TIMESPEC_TO_TIMEVAL(&tvtimo, timo); tvp = &tvtimo; } else tvp = 0; if (mask != 0) { rv = pthread_sigmask(SIG_SETMASK, mask, &omask); if (rv != 0) return rv; } rv = select(count, rfds, wfds, efds, tvp); if (mask != 0) { sverrno = errno; pthread_sigmask(SIG_SETMASK, &omask, (sigset_t *)0); errno = sverrno; } return rv; } #endif /* not HAVE_PSELECT || __OpenBSD__ */ netatalk-2.2.2/libatalk/compat/strcasecmp.c0000644000175200017500000001015611655731127015634 00000000000000/* * $Id: strcasecmp.c,v 1.4 2003-02-17 01:51:08 srittau Exp $ * * Copyright (c) 1987 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that: (1) source distributions retain this entire copyright * notice and comment, and (2) distributions including binaries display * the following acknowledgement: ``This product includes software * developed by the University of California, Berkeley and its contributors'' * in the documentation or other materials provided with the distribution * and in all advertising materials mentioning features or use of this * software. 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ # if defined( ibm032 ) #include #include #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)strcasecmp.c 5.9 (Berkeley) 6/1/90"; #endif /* LIBC_SCCS and not lint */ /* * This array is designed for mapping upper and lower case letter * together for a case independent comparison. The mappings are * based upon ascii character sequences. */ static u_char charmap[] = { '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307', '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317', '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377', }; int strcasecmp(s1, s2) char *s1, *s2; { register u_char *cm = charmap, *us1 = (u_char *)s1, *us2 = (u_char *)s2; while (cm[*us1] == cm[*us2++]) if (*us1++ == '\0') return (0); return (cm[*us1] - cm[*--us2]); } int strncasecmp(s1, s2, n) char *s1, *s2; register size_t n; { if (n != 0) { register u_char *cm = charmap, *us1 = (u_char *)s1, *us2 = (u_char *)s2; do { if (cm[*us1] != cm[*us2++]) return (cm[*us1] - cm[*--us2]); if (*us1++ == '\0') break; } while (--n != 0); } return (0); } # endif /* ibm032 */ netatalk-2.2.2/libatalk/compat/strstr.c0000644000175200017500000000522011655731127015025 00000000000000/* * $Id: strstr.c,v 1.4 2003-02-17 01:51:08 srittau Exp $ * * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strstr.c 5.2 (Berkeley) 1/26/91"; #endif /* LIBC_SCCS and not lint */ # if defined(ibm032) || (defined(sun) && defined(i386)) #ifdef sun #define const #endif /* sun */ #include #include /* * Find the first occurrence of find in s. */ char * strstr(s, find) register const char *s, *find; { register char c, sc; register size_t len; if ((c = *find++) != 0) { len = strlen(find); do { do { if ((sc = *s++) == 0) return (0); } while (sc != c); } while (strncmp(s, find, len) != 0); s--; } return ((char *)s); } # endif /* ibm03 sun i386 */ netatalk-2.2.2/libatalk/compat/strdup.c0000644000175200017500000000056211655731127015011 00000000000000/* * $Id: strdup.c,v 1.4 2003-02-17 01:51:08 srittau Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #ifdef ultrix char *strdup(const char *string) { char *new; if (new = (char *) malloc(strlen(string) + 1)) strcpy(new, string); return new; } #endif /* ultrix */ netatalk-2.2.2/libatalk/compat/getusershell.c0000644000175200017500000000622611655731127016201 00000000000000/* * $Id: getusershell.c,v 1.4 2003-02-17 01:51:08 srittau Exp $ * * Copyright (c) 1985 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that: (1) source distributions retain this entire copyright * notice and comment, and (2) distributions including binaries display * the following acknowledgement: ``This product includes software * developed by the University of California, Berkeley and its contributors'' * in the documentation or other materials provided with the distribution * and in all advertising materials mentioning features or use of this * software. 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getusershell.c 5.6 (Berkeley) 6/1/90"; #endif /* LIBC_SCCS and not lint */ #if defined(ultrix) || defined(_IBMR2) || defined(NEED_GETUSERSHELL) #include #include #include #include #include #define SHELLS "/etc/shells" /* * Do not add local shells here. They should be added in /etc/shells */ static char *okshells[] = { "/bin/sh", "/bin/csh", #ifdef _IBMR2 "/bin/ksh", #endif /* _IBMR2 */ 0 }; static char **shells, *strings; static char **curshell = NULL; extern char **initshells(); /* * Get a list of shells from SHELLS, if it exists. */ char * getusershell() { char *ret; if (curshell == NULL) curshell = initshells(); ret = *curshell; if (ret != NULL) curshell++; return (ret); } endusershell() { if (shells != NULL) free((char *)shells); shells = NULL; if (strings != NULL) free(strings); strings = NULL; curshell = NULL; } setusershell() { curshell = initshells(); } static char ** initshells() { register char **sp, *cp; register FILE *fp; struct stat statb; extern char *malloc(), *calloc(); if (shells != NULL) free((char *)shells); shells = NULL; if (strings != NULL) free(strings); strings = NULL; if ((fp = fopen(SHELLS, "r")) == (FILE *)0) return(okshells); if (fstat(fileno(fp), &statb) == -1) { (void)fclose(fp); return(okshells); } if ((strings = malloc((unsigned)statb.st_size)) == NULL) { (void)fclose(fp); return(okshells); } shells = (char **)calloc((unsigned)statb.st_size / 3, sizeof (char *)); if (shells == NULL) { (void)fclose(fp); free(strings); strings = NULL; return(okshells); } sp = shells; cp = strings; while (fgets(cp, MAXPATHLEN + 1, fp) != NULL) { while (*cp != '#' && *cp != '/' && *cp != '\0') cp++; if (*cp == '#' || *cp == '\0') continue; *sp++ = cp; while (!isspace(*cp) && *cp != '#' && *cp != '\0') cp++; *cp++ = '\0'; } *sp = (char *)0; (void)fclose(fp); return (shells); } # endif /* ultrix */ netatalk-2.2.2/libatalk/compat/snprintf.c0000644000175200017500000010637511655731127015344 00000000000000/************************************************************************** * Copyright 1994-2000 Patrick Powell, San Diego, CA * * Modified for Netatalk 2002/02/12 Burkhard Schmidt **************************************************************************/ /* Overview: plp_snprintf( char *buffer, int len, const char *format,...) plp_unsafe_snprintf( char *buffer, int len, const char *format,...) its horribly unsafe companion that does NOT protect you from the printing of evil control characters, but may be necessary See the man page documentation below This version of snprintf was developed originally for printing on a motley collection of specialized hardware that had NO IO library. Due to contractual restrictions, a clean room implementation of the printf() code had to be developed. The method chosen for printf was to be as paranoid as possible, as these platforms had NO memory protection, and very small address spaces. This made it possible to try to print very long strings, i.e. - all of memory, very easily. To guard against this, all printing was done via a buffer, generous enough to hold strings, but small enough to protect against overruns, etc. Strangely enough, this proved to be of immense importance when SPRINTFing to a buffer on a stack... The rest, of course, is well known, as buffer overruns in the stack are a common way to do horrible things to operating systems, security, etc etc. This version of snprintf is VERY limited by modern standards. Revision History: First Released Version - 1994. This version had NO comments. First Released Version - 1994. This version had NO comments. Second Major Released Version - Tue May 23 10:43:44 PDT 2000 Configuration and other items changed. Read this doc. Treat this as a new version. COPYRIGHT AND TERMS OF USE: You may use, copy, distribute, or otherwise incorporate this software and documentation into any product or other item, provided that the copyright in the documentation and source code as well as the source code generated constant strings in the object, executable or other code remain in place and are present in executable modules or objects. You may modify this code as appropriate to your usage; however the modified version must be identified by changing the various source and object code identification strings as is appropriately noted in the source code. The next include line is expected to work in conjunction with the GNU CONFIGURE utility. You should define the following macros appropriately: HAVE_STDARG_H - if the include file is available HAVE_VARARG_H - if the include file is available HAVE_STRERROR - if the strerror() routine is available. If it is not available, then examine the lines containing the tests below. You may need to fiddle with HAVE_SYS_NERR HAVE_SYS_ERRLIST HAVE_DECL_SYS_ERRLIST HAVE_SYS_NERR HAVE_DECL_SYS_NERR HAVE_QUAD_T - if the quad_t type is defined HAVE_LONG_LONG - if the long long type is defined HAVE_LONG_DOUBLE - if the long double type is defined If you are using the GNU configure (autoconf) facility, add the following line to the configure.in file, to force checking for the quad_t and long long data types: AC_CHECK_FUNCS(strerror); AC_CACHE_CHECK(for errno, ac_cv_errno, [ AC_TRY_LINK(,[extern int errno; return (errno);], ac_cv_errno=yes, ac_cv_errno=no) ]) if test "$ac_cv_errno" = yes; then AC_DEFINE(HAVE_ERRNO) AC_CACHE_CHECK(for errno declaration, ac_cv_decl_errno, [ AC_TRY_COMPILE([ #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_ERRNO_H #include ],[return(sys_nerr);], ac_cv_decl_errno=yes, ac_cv_decl_errno=no) ]) if test "$ac_cv_decl_errno" = yes; then AC_DEFINE(HAVE_DECL_ERRNO) fi; fi AC_CACHE_CHECK(for sys_nerr, ac_cv_sys_nerr, [ AC_TRY_LINK(,[extern int sys_nerr; return (sys_nerr);], ac_cv_sys_nerr=yes, ac_cv_sys_nerr=no) ]) if test "$ac_cv_sys_nerr" = yes; then AC_DEFINE(HAVE_SYS_NERR) AC_CACHE_CHECK(for sys_nerr declaration, ac_cv_decl_sys_nerr, [ AC_TRY_COMPILE([ #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif],[return(sys_nerr);], ac_cv_decl_sys_nerr_def=yes, ac_cv_decl_sys_nerr_def=no) ]) if test "$ac_cv_decl_sys_nerr" = yes; then AC_DEFINE(HAVE_DECL_SYS_NERR) fi fi AC_CACHE_CHECK(for sys_errlist array, ac_cv_sys_errlist, [AC_TRY_LINK(,[extern char *sys_errlist[]; sys_errlist[0];], ac_cv_sys_errlist=yes, ac_cv_sys_errlist=no) ]) if test "$ac_cv_sys_errlist" = yes; then AC_DEFINE(HAVE_SYS_ERRLIST) AC_CACHE_CHECK(for sys_errlist declaration, ac_cv_sys_errlist_def, [AC_TRY_COMPILE([ #include #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif],[char *s = sys_errlist[0]; return(*s);], ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no) ]) if test "$ac_cv_decl_sys_errlist" = yes; then AC_DEFINE(HAVE_DECL_SYS_ERRLIST) fi fi AC_CACHE_CHECK(checking for long long, ac_cv_long_long, [ AC_TRY_COMPILE([ #include #include ], [printf("%d",sizeof(long long));], ac_cv_long_long=yes, ac_cv_long_long=no) ]) if test $ac_cv_long_long = yes; then AC_DEFINE(HAVE_LONG_LONG) fi AC_CACHE_CHECK(checking for long double, ac_cv_long_double, [ AC_TRY_COMPILE([ #include #include ], [printf("%d",sizeof(long double));], ac_cv_long_double=yes, ac_cv_long_double=no) ]) if test $ac_cv_long_double = yes; then AC_DEFINE(HAVE_LONG_DOUBLE) fi AC_CACHE_CHECK(checking for quad_t, ac_cv_quad_t, [ AC_TRY_COMPILE([ #include #include ], [printf("%d",sizeof(quad_t));], ac_cv_quad_t=yes, ac_cv_quad_t=no) ]) if test $ac_cv_quad_t = yes; then AC_DEFINE(HAVE_QUAD_T) fi NAME plp_snprintf, plp_vsnprintf - formatted output conversion SYNOPSIS #include #include int plp_snprintf(const char *format, size_t size, va_list ap); int plp_unsafe_snprintf(const char *format, size_t size, va_list ap); AKA snprintf and unsafe_snprintf in the documentation below int vsnprintf(char *str, size_t size, const char *format, va_list ap); int unsafe_vsnprintf(char *str, size_t size, const char *format, va_list ap); AKA vsnprintf and unsafe_vsnprintf in the documentation below (Multithreaded Safe) DESCRIPTION The printf() family of functions produces output according to a format as described below. Snprintf(), and vsnprintf() write to the character string str. These functions write the output under the control of a format string that specifies how subsequent arguments (or arguments accessed via the variable-length argument facilities of stdarg(3)) are converted for output. These functions return the number of characters printed (not including the trailing `\0' used to end output to strings). Snprintf() and vsnprintf() will write at most size-1 of the characters printed into the output string (the size'th character then gets the terminating `\0'); if the return value is greater than or equal to the size argument, the string was too short and some of the printed characters were discarded. The size or str may be given as zero to find out how many characters are needed; in this case, the str argument is ignored. By default, the snprintf function will not format control characters (except new line and tab) in strings. This is a safety feature that has proven to be extremely critical when using snprintf for secure applications and when debugging. If you MUST have control characters formatted or printed, then use the unsafe_snprintf() and unsafe_vsnprintf() and on your own head be the consequences. You have been warned. There is one exception to the comments above, and that is the "%c" (character) format. It brutally assumes that the user will have performed the necessary 'isprint()' or other checks and uses the integer value as a character. The format string is composed of zero or more directives: ordinary characters (not %), which are copied unchanged to the output stream; and conversion specifications, each of which results in fetching zero or more subsequent arguments. Each conversion specification is introduced by the character %. The arguments must correspond properly (after type promotion) with the conversion specifier. After the %, the following appear in sequence: o Zero or more of the following flags: - A zero `0' character specifying zero padding. For all conversions except n, the converted value is padded on the left with zeros rather than blanks. If a precision is given with a numeric conversion (d, i, o, u, i, x, and X), the `0' flag is ignored. - A negative field width flag `-' indicates the converted value is to be left adjusted on the field boundary. Except for n conversions, the converted value is padded on the right with blanks, rather than on the left with blanks or zeros. A `-' overrides a `0' if both are given. - A space, specifying that a blank should be left before a positive number produced by a signed conversion (d, e, E, f, g, G, or i). - A `+' character specifying that a sign always be placed before a number produced by a signed conversion. A `+' overrides a space if both are used. o An optional decimal digit string specifying a minimum field width. If the converted value has fewer characters than the field width, it will be padded with spaces on the left (or right, if the left-adjustment flag has been given) to fill out the field width. o An optional precision, in the form of a period `.' followed by an optional digit string. If the digit string is omitted, the precision is taken as zero. This gives the minimum number of digits to appear for d, i, o, u, x, and X conversions, the number of digits to appear after the decimal-point for e, E, and f conversions, the maximum number of significant digits for g and G conversions, or the maximum number of characters to be printed from a string for s conversions. o The optional character h, specifying that a following d, i, o, u, x, or X conversion corresponds to a short int or unsigned short int argument, or that a following n conversion corresponds to a pointer to a short int argument. o The optional character l (ell) specifying that a following d, i, o, u, x, or X conversion applies to a pointer to a long int or unsigned long int argument, or that a following n conversion corresponds to a pointer to a long int argument. o The optional character q, specifying that a following d, i, o, u, x, or X conversion corresponds to a quad_t or u_quad_t argument, or that a following n conversion corresponds to a quad_t argument. This value is always printed in HEX notation. Tough. quad_t's are an OS system implementation, and should not be allowed. o The character L specifying that a following e, E, f, g, or G conversion corresponds to a long double argument. o A character that specifies the type of conversion to be applied. A field width or precision, or both, may be indicated by an asterisk `*' instead of a digit string. In this case, an int argument supplies the field width or precision. A negative field width is treated as a left adjustment flag followed by a positive field width; a negative precision is treated as though it were missing. The conversion specifiers and their meanings are: diouxX The int (or appropriate variant) argument is converted to signed decimal (d and i), unsigned octal (o), unsigned decimal (u), or unsigned hexadecimal (x and X) notation. The letters abcdef are used for x conversions; the letters ABCDEF are used for X conversions. The precision, if any, gives the minimum number of digits that must appear; if the converted value requires fewer digits, it is padded on the left with zeros. eE The double argument is rounded and converted in the style [-]d.ddde+-dd where there is one digit before the decimal-point character and the number of digits after it is equal to the precision; if the precision is missing, it is taken as 6; if the precision is zero, no decimal-point character appears. An E conversion uses the letter E (rather than e) to introduce the exponent. The exponent always contains at least two digits; if the value is zero, the exponent is 00. f The double argument is rounded and converted to decimal notation in the style [-]ddd.ddd, where the number of digits after the decimal-point character is equal to the precision specification. If the precision is missing, it is taken as 6; if the precision is explicitly zero, no decimal-point character appears. If a decimal point appears, at least one digit appears before it. g The double argument is converted in style f or e (or E for G conversions). The precision specifies the number of significant digits. If the precision is missing, 6 digits are given; if the precision is zero, it is treated as 1. Style e is used if the exponent from its conversion is less than -4 or greater than or equal to the precision. Trailing zeros are removed from the fractional part of the result; a decimal point appears only if it is followed by at least one digit. c The int argument is converted to an unsigned char, and the resulting character is written. s The ``char *'' argument is expected to be a pointer to an array of character type (pointer to a string). Characters from the array are written up to (but not including) a terminating NUL character; if a precision is specified, no more than the number specified are written. If a precision is given, no null character need be present; if the precision is not specified, or is greater than the size of the array, the array must contain a terminating NUL character. % A `%' is written. No argument is converted. The complete conversion specification is `%%'. In no case does a non-existent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field is expanded to contain the conversion result. EXAMPLES To print a date and time in the form `Sunday, July 3, 10:02', where weekday and month are pointers to strings: #include fprintf(stdout, "%s, %s %d, %.2d:%.2d\n", weekday, month, day, hour, min); To print pi to five decimal places: #include #include fprintf(stdout, "pi = %.5f\n", 4 * atan(1.0)); To allocate a 128 byte string and print into it: #include #include #include char *newfmt(const char *fmt, ...) { char *p; va_list ap; if ((p = malloc(128)) == NULL) return (NULL); va_start(ap, fmt); (void) vsnprintf(p, 128, fmt, ap); va_end(ap); return (p); } SEE ALSO printf(1), scanf(3) STANDARDS Turkey C Standardization and wimpy POSIX folks did not define snprintf or vsnprintf(). BUGS The conversion formats %D, %O, and %U are not standard and are provided only for backward compatibility. The effect of padding the %p format with zeros (either by the `0' flag or by specifying a precision), and the benign effect (i.e., none) of the `#' flag on %n and %p conversions, as well as other nonsensical combinations such as %Ld, are not standard; such combinations should be avoided. The typedef names quad_t and u_quad_t are infelicitous. */ #include "config.h" #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) #include #include #include #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif #include /* * For testing, define these values */ #if 0 #define HAVE_STDARG_H 1 #define TEST 1 #define HAVE_QUAD_T 1 #endif /**** ENDINCLUDE ****/ /************************************************* * KEEP THIS STRING - MODIFY AT THE END WITH YOUR REVISIONS * i.e. - the LOCAL REVISIONS part is for your use *************************************************/ static char *const _id = "plp_snprintf V98.12.21 Copyright Patrick Powell 1988-2000 " "$Id: snprintf.c,v 1.2 2008-11-14 10:29:08 didg Exp $" " LOCAL REVISIONS: Modified for Netatalk 2002/02/12 Burkhard Schmidt"; /* varargs declarations: */ # undef HAVE_STDARGS /* let's hope that works everywhere (mj) */ # undef VA_LOCAL_DECL # undef VA_START # undef VA_SHIFT # undef VA_END #if defined(HAVE_STDARG_H) # include # define HAVE_STDARGS /* let's hope that works everywhere (mj) */ # define VA_LOCAL_DECL va_list ap; # define VA_START(f) va_start(ap, f) # define VA_SHIFT(v,t) ; /* no-op for ANSI */ # define VA_END va_end(ap) #else # if defined(HAVE_VARARGS_H) # include # undef HAVE_STDARGS # define VA_LOCAL_DECL va_list ap; # define VA_START(f) va_start(ap) /* f is ignored! */ # define VA_SHIFT(v,t) v = va_arg(ap,t) # define VA_END va_end(ap) # else XX ** NO VARARGS ** XX # endif #endif union value { #if defined(HAVE_QUAD_T) quad_t qvalue; #endif #if defined(HAVE_LONG_LONG) long long value; #else long value; #endif double dvalue; }; #undef CVAL #define CVAL(s) (*((unsigned char *)s)) extern int errno; static char * plp_Errormsg ( int err, char *buffer ); static void dopr( int visible_control, char **buffer, int *left, const char *format, va_list args ); static void fmtstr( int visible_control, char **buffer, int *left, char *value, int ljust, int len, int zpad, int precision ); static void fmtnum( char **buffer, int *left, union value *value, int base, int dosign, int ljust, int len, int zpad, int precision ); #if defined(HAVE_QUAD_T) static void fmtquad( char **buffer, int *left, union value *value, int base, int dosign, int ljust, int len, int zpad, int precision ); #endif static void fmtdouble( char **bufer, int *left, int fmt, double value, int ljust, int len, int zpad, int precision ); static void dostr( char **buffer, int *left, char *str ); static void dopr_outch( char **buffer, int *left, int c ); int plp_vsnprintf(char *str, size_t count, const char *fmt, va_list args) { int left; char *buffer; if( count < 0 ) count = 0; left = count; if( count == 0 ) str = 0; buffer = str; dopr( 1, &buffer, &left, fmt, args ); /* fprintf(stderr,"str 0x%x, buffer 0x%x, count %d, left %d\n", (int)str, (int)buffer, count, left ); */ if( str && count > 0 ){ if( left > 0 ){ str[count-left] = 0; } else { str[count-1] = 0; } } return(count - left); } int plp_unsafe_vsnprintf(char *str, size_t count, const char *fmt, va_list args) { int left; char *buffer; if( count < 0 ) count = 0; left = count; if( count == 0 ) str = 0; buffer = str; dopr( 0, &buffer, &left, fmt, args ); /* fprintf(stderr,"str 0x%x, buffer 0x%x, count %d, left %d\n", (int)str, (int)buffer, count, left ); */ if( str && count > 0 ){ if( left > 0 ){ str[count-left] = 0; } else { str[count-1] = 0; } } return(count - left); } /* VARARGS3 */ #ifdef HAVE_STDARGS int plp_snprintf (char *str,size_t count,const char *fmt,...) #else int plp_snprintf (va_alist) va_dcl #endif { #ifndef HAVE_STDARGS char *str; size_t count; char *fmt; #endif int n = 0; VA_LOCAL_DECL VA_START (fmt); VA_SHIFT (str, char *); VA_SHIFT (count, size_t ); VA_SHIFT (fmt, char *); n = plp_vsnprintf ( str, count, fmt, ap); VA_END; return( n ); } /* VARARGS3 */ #ifdef HAVE_STDARGS int plp_unsafe_snprintf (char *str,size_t count,const char *fmt,...) #else int plp_unsafe_snprintf (va_alist) va_dcl #endif { #ifndef HAVE_STDARGS char *str; size_t count; char *fmt; #endif int n = 0; VA_LOCAL_DECL VA_START (fmt); VA_SHIFT (str, char *); VA_SHIFT (count, size_t ); VA_SHIFT (fmt, char *); n = plp_unsafe_vsnprintf ( str, count, fmt, ap); VA_END; return( n ); } static void dopr( int visible_control, char **buffer, int *left, const char *format, va_list args ) { int ch; union value value; int longflag = 0; int quadflag = 0; char *strvalue; int ljust; int len; int zpad; int precision; int set_precision; double dval; int err = errno; int base = 0; int signed_val = 0; while( (ch = *format++) ){ switch( ch ){ case '%': longflag = quadflag = ljust = len = zpad = base = signed_val = 0; precision = -1; set_precision = 0; nextch: ch = *format++; switch( ch ){ case 0: dostr( buffer, left, "**end of format**" ); return; case '-': ljust = 1; goto nextch; case '.': set_precision = 1; precision = 0; goto nextch; case '*': len = va_arg( args, int ); goto nextch; case '0': /* set zero padding if len not set */ if(len==0 && set_precision == 0 ) zpad = '0'; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if( set_precision ){ precision = precision*10 + ch - '0'; } else { len = len*10 + ch - '0'; } goto nextch; case 'l': ++longflag; goto nextch; case 'q': #if !defined( HAVE_QUAD_T ) dostr( buffer, left, "*no quad_t support *"); return; #endif quadflag = 1; goto nextch; case 'u': case 'U': if( base == 0 ){ base = 10; signed_val = 0; } case 'o': case 'O': if( base == 0 ){ base = 8; signed_val = 0; } case 'd': case 'D': if( base == 0 ){ base = 10; signed_val = 1; } case 'x': if( base == 0 ){ base = 16; signed_val = 0; } case 'X': if( base == 0 ){ base = -16; signed_val = 0; } #if defined( HAVE_QUAD_T ) if( quadflag ){ value.qvalue = va_arg( args, quad_t ); fmtquad( buffer, left, &value,base,signed_val, ljust, len, zpad, precision ); break; } else #endif if( longflag > 1 ){ #if defined(HAVE_LONG_LONG) if( signed_val ){ value.value = va_arg( args, long long ); } else { value.value = va_arg( args, unsigned long long ); } #else if( signed_val ){ value.value = va_arg( args, long ); } else { value.value = va_arg( args, unsigned long ); } #endif } else if( longflag ){ if( signed_val ){ value.value = va_arg( args, long ); } else { value.value = va_arg( args, unsigned long ); } } else { if( signed_val ){ value.value = va_arg( args, int ); } else { value.value = va_arg( args, unsigned int ); } } fmtnum( buffer, left, &value,base,signed_val, ljust, len, zpad, precision ); break; case 's': strvalue = va_arg( args, char *); fmtstr( visible_control, buffer, left, strvalue,ljust,len, zpad, precision ); break; case 'c': ch = va_arg( args, int ); { char b[2]; b[0] = ch; b[1] = 0; fmtstr( 0, buffer, left, b,ljust,len, zpad, precision ); } break; case 'f': case 'g': case 'e': dval = va_arg( args, double ); fmtdouble( buffer, left, ch, dval,ljust,len, zpad, precision ); break; case 'm': { char shortbuffer[32]; fmtstr( visible_control, buffer, left, plp_Errormsg(err, shortbuffer),ljust,len, zpad, precision ); } break; case '%': dopr_outch( buffer, left, ch ); continue; default: dostr( buffer, left, "???????" ); } longflag = 0; break; default: dopr_outch( buffer, left, ch ); break; } } } /* * Format '%[-]len[.precision]s' * - = left justify (ljust) * len = minimum length * precision = numbers of chars in string to use */ static void fmtstr( int visible_control, char **buffer, int *left, char *value, int ljust, int len, int zpad, int precision ) { int padlen, strlenv, i, c; /* amount to pad */ if( value == 0 ){ value = ""; } /* cheap strlen so you do not have library call */ for( strlenv = i = 0; (c=CVAL(value+i)); ++i ){ if( visible_control && iscntrl( c ) && c != '\t' && c != '\n' ){ ++strlenv; } ++strlenv; } if( precision > 0 && strlenv > precision ){ strlenv = precision; } padlen = len - strlenv; if( padlen < 0 ) padlen = 0; if( ljust ) padlen = -padlen; while( padlen > 0 ) { dopr_outch( buffer, left, ' ' ); --padlen; } /* output characters */ for( i = 0; i < strlenv && (c = CVAL(value+i)); ++i ){ if( visible_control && iscntrl( c ) && c != '\t' && c != '\n' ){ dopr_outch(buffer, left, '^'); c = ('@' | (c & 0x1F)); } dopr_outch(buffer, left, c); } while( padlen < 0 ) { dopr_outch( buffer, left, ' ' ); ++padlen; } } static void fmtnum( char **buffer, int *left, union value *value, int base, int dosign, int ljust, int len, int zpad, int precision ) { int signvalue = 0; #if defined(HAVE_LONG_LONG) unsigned long long uvalue; #else unsigned long uvalue; #endif char convert[sizeof( union value) * 8 + 16]; int place = 0; int padlen = 0; /* amount to pad */ int caps = 0; /* fprintf(stderr,"value 0x%x, base %d, dosign %d, ljust %d, len %d, zpad %d\n", value, base, dosign, ljust, len, zpad );/ **/ uvalue = value->value; if( dosign ){ if( value->value < 0 ) { signvalue = '-'; uvalue = -value->value; } } if( base < 0 ){ caps = 1; base = -base; } do{ convert[place++] = (caps? "0123456789ABCDEF":"0123456789abcdef") [uvalue % (unsigned)base ]; uvalue = (uvalue / (unsigned)base ); }while(uvalue); convert[place] = 0; padlen = len - place; if( padlen < 0 ) padlen = 0; if( ljust ) padlen = -padlen; /* fprintf( stderr, "str '%s', place %d, sign %c, padlen %d\n", convert,place,signvalue,padlen); / **/ if( zpad && padlen > 0 ){ if( signvalue ){ dopr_outch( buffer, left, signvalue ); --padlen; signvalue = 0; } while( padlen > 0 ){ dopr_outch( buffer, left, zpad ); --padlen; } } while( padlen > 0 ) { dopr_outch( buffer, left, ' ' ); --padlen; } if( signvalue ) dopr_outch( buffer, left, signvalue ); while( place > 0 ) dopr_outch( buffer, left, convert[--place] ); while( padlen < 0 ){ dopr_outch( buffer, left, ' ' ); ++padlen; } } #if defined(HAVE_QUAD_T) static void fmtquad( char **buffer, int *left, union value *value, int base, int dosign, int ljust, int len, int zpad, int precision ) { int signvalue = 0; int place = 0; int padlen = 0; /* amount to pad */ int caps = 0; int i, c; union { quad_t qvalue; unsigned char qconvert[sizeof(quad_t)]; } vvalue; char convert[2*sizeof(quad_t)+1]; /* fprintf(stderr,"value 0x%x, base %d, dosign %d, ljust %d, len %d, zpad %d\n", value, base, dosign, ljust, len, zpad );/ **/ vvalue.qvalue = value->qvalue; if( base < 0 ){ caps = 1; } for( i = 0; i < sizeof(quad_t); ++i ){ c = vvalue.qconvert[i]; convert[2*i] = (caps? "0123456789ABCDEF":"0123456789abcdef")[ (c >> 4) & 0xF]; convert[2*i+1] = (caps? "0123456789ABCDEF":"0123456789abcdef")[ c & 0xF]; } convert[2*i] = 0; place = strlen(convert); padlen = len - place; if( padlen < 0 ) padlen = 0; if( ljust ) padlen = -padlen; /* fprintf( stderr, "str '%s', place %d, sign %c, padlen %d\n", convert,place,signvalue,padlen); / **/ if( zpad && padlen > 0 ){ if( signvalue ){ dopr_outch( buffer, left, signvalue ); --padlen; signvalue = 0; } while( padlen > 0 ){ dopr_outch( buffer, left, zpad ); --padlen; } } while( padlen > 0 ) { dopr_outch( buffer, left, ' ' ); --padlen; } if( signvalue ) dopr_outch( buffer, left, signvalue ); while( place > 0 ) dopr_outch( buffer, left, convert[--place] ); while( padlen < 0 ){ dopr_outch( buffer, left, ' ' ); ++padlen; } } #endif static void mystrcat(char *dest, char *src ) { if( dest && src ){ dest += strlen(dest); strcpy(dest,src); } } static void fmtdouble( char **buffer, int *left, int fmt, double value, int ljust, int len, int zpad, int precision ) { char convert[sizeof( union value) * 8 + 16]; char formatstr[128]; /* fprintf(stderr,"len %d, precision %d\n", len, precision ); */ if( len > (sizeof(convert) - 20) ){ len = sizeof(convert) - 20; } if( precision >= 0 && precision > sizeof(convert) - 20 ){ precision = sizeof(convert) - 20; } if( precision >= 0 && precision > len ) precision = len; strcpy( formatstr, "%" ); if( ljust ) mystrcat(formatstr, "-" ); if( zpad ) mystrcat(formatstr, "0" ); if( len ){ sprintf( formatstr+strlen(formatstr), "%d", len ); } if( precision >= 0 ){ sprintf( formatstr+strlen(formatstr), ".%d", precision ); } sprintf( formatstr+strlen(formatstr), "%c", fmt ); /* this is easier than trying to do the portable dtostr */ /* fprintf(stderr,"format string '%s'\n", formatstr); */ sprintf( convert, formatstr, value ); dostr( buffer, left, convert ); } static void dostr( char **buffer, int *left, char *str ) { if(str)while(*str) dopr_outch( buffer, left, *str++ ); } static void dopr_outch( char **buffer, int *left, int c ) { if( *left > 0 ){ *(*buffer)++ = c; } *left -= 1; } /**************************************************************************** * static char *plp_errormsg( int err ) * returns a printable form of the * errormessage corresponding to the valie of err. * This is the poor man's version of sperror(), not available on all systems * Patrick Powell Tue Apr 11 08:05:05 PDT 1995 ****************************************************************************/ /****************************************************************************/ #if !defined(HAVE_STRERROR) # undef num_errors # if defined(HAVE_SYS_ERRLIST) # if !defined(HAVE_DECL_SYS_ERRLIST) extern const char *const sys_errlist[]; # endif # if defined(HAVE_SYS_NERR) # if !defined(HAVE_DECL_SYS_NERR) extern int sys_nerr; # endif # define num_errors (sys_nerr) # endif # endif # if !defined(num_errors) # define num_errors (-1) /* always use "errno=%d" */ # endif #endif static char * plp_Errormsg ( int err, char *buffer /* int maxlen = 32 */) { char *cp; #if defined(HAVE_STRERROR) cp = (void *)strerror(err); #else # if defined(HAVE_SYS_ERRLIST) if (err >= 0 && err < num_errors) { cp = (void *)sys_errlist[err]; } else # endif { (void) sprintf (buffer, "errno=%d", err); cp = buffer; } #endif return (cp); } #if defined(TEST) #include int main( void ) { char buffer[128]; char *t; char *test1 = "01234"; int n; errno = 1; buffer[0] = 0; n = plp_snprintf( buffer, 0, (t="test")); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t="errno '%s'")); printf( "[%d] %s = '%s'\n", n, t, buffer, strerror(errno) ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%s"), test1 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%12s"), test1 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%-12s"), test1 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%12.2s"), test1 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%-12.2s"), test1 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%g"), 1.25 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%g"), 1.2345 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%12g"), 1.25 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%12.1g"), 1.25 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%12.2g"), 1.25 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%12.3g"), 1.25 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%0*d"), 6, 1 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); #if defined(HAVE_LONG_LONG) n = plp_snprintf( buffer, sizeof(buffer), (t = "%llx"), 1, 2, 3, 4 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%llx"), (long long)1, (long long)2 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%qx"), 1, 2, 3, 4 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%qx"), (quad_t)1, (quad_t)2 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); #endif n = plp_snprintf( buffer, sizeof(buffer), (t = "0%x, 0%x"), (char *)(0x01234567), (char *)0, 0, 0, 0); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "0%x, 0%x"), (char *)(0x01234567), (char *)0x89ABCDEF, 0, 0, 0); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "0%x, 0%x"), t, 0, 0, 0, 0); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%f"), 1.25 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%f"), 1.2345 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%12f"), 1.25 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%12.2f"), 1.25 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%f"), 1.0 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%.0f"), 1.0 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%0.0f"), 1.0 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%1.0f"), 1.0 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%1.5f"), 1.0 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); n = plp_snprintf( buffer, sizeof(buffer), (t = "%5.5f"), 1.0 ); printf( "[%d] %s = '%s'\n", n, t, buffer ); return(0); } #endif #endif /* !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) */ #ifndef HAVE_VSNPRINTF int vsnprintf(char *str, size_t count, const char *fmt, va_list args) { int n; n = plp_vsnprintf(str, count, fmt, args); return(n); } #endif /* ! HAVE_VSNPRINTF */ #ifndef HAVE_SNPRINTF #ifdef HAVE_STDARGS int snprintf (char *str,size_t count,const char *fmt,...) #else int snprintf (va_alist) va_dcl #endif { #ifndef HAVE_STDARGS char *str; size_t count; char *fmt; #endif int n = 0; VA_LOCAL_DECL VA_START (fmt); VA_SHIFT (str, char *); VA_SHIFT (count, size_t ); VA_SHIFT (fmt, char *); n = plp_vsnprintf ( str, count, fmt, ap); VA_END; return( n ); } #endif /* ! HAVE_VNSPRINTF */ netatalk-2.2.2/libatalk/compat/mktemp.c0000644000175200017500000000532111655731127014763 00000000000000/* * $Id: mktemp.c,v 1.4 2003-02-17 01:51:08 srittau Exp $ * * Copyright (c) 1987 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that: (1) source distributions retain this entire copyright * notice and comment, and (2) distributions including binaries display * the following acknowledgement: ``This product includes software * developed by the University of California, Berkeley and its contributors'' * in the documentation or other materials provided with the distribution * and in all advertising materials mentioning features or use of this * software. 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)mktemp.c 5.9 (Berkeley) 6/1/90"; #endif /* LIBC_SCCS and not lint */ # ifdef ultrix #include #include #include #include #include #include mkstemp(path) char *path; { int fd; return (_gettemp(path, &fd) ? fd : -1); } char * mktemp(path) char *path; { return(_gettemp(path, (int *)NULL) ? path : (char *)NULL); } static _gettemp(path, doopen) char *path; register int *doopen; { extern int errno; register char *start, *trv; struct stat sbuf; u_int pid; pid = getpid(); for (trv = path; *trv; ++trv); /* extra X's get set to 0's */ while (*--trv == 'X') { *trv = (pid % 10) + '0'; pid /= 10; } /* * check the target directory; if you have six X's and it * doesn't exist this runs for a *very* long time. */ for (start = trv + 1;; --trv) { if (trv <= path) break; if (*trv == '/') { *trv = '\0'; if (stat(path, &sbuf)) return(0); if (!S_ISDIR(sbuf.st_mode)) { errno = ENOTDIR; return(0); } *trv = '/'; break; } } for (;;) { if (doopen) { if ((*doopen = open(path, O_CREAT|O_EXCL|O_RDWR, 0600)) >= 0) return(1); if (errno != EEXIST) return(0); } else if (stat(path, &sbuf)) return(errno == ENOENT ? 1 : 0); /* tricky little algorithm for backward compatibility */ for (trv = start;;) { if (!*trv) return(0); if (*trv == 'z') *trv++ = 'a'; else { if (isdigit(*trv)) *trv = 'a'; else ++*trv; break; } } } /*NOTREACHED*/ } # endif /* ultrix */ netatalk-2.2.2/libatalk/compat/misc.c0000644000175200017500000000027111667370360014421 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #if !defined HAVE_DIRFD && defined SOLARIS #include int dirfd(DIR *dir) { return dir->d_fd; } #endif netatalk-2.2.2/libatalk/compat/rquota_xdr.c0000644000175200017500000000422211667370360015656 00000000000000/* * $Id: rquota_xdr.c,v 1.4 2003-02-17 01:51:08 srittau Exp $ * * taken from the quota-1.55 used on linux. here's the bsd copyright: * * Copyright (c) 1980, 1990 Regents of the University of California. All * rights reserved. * * This code is derived from software contributed to Berkeley by Robert Elz at * The University of Melbourne. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include /* to get __GNU_LIBRARY__ */ /* list of machines that don't have these functions: solaris linux libc5 */ #if defined(NEED_RQUOTA) || defined(SOLARIS) || (defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ < 6) #include #include bool_t xdr_getquota_args(xdrs, objp) XDR *xdrs; getquota_args *objp; { if (!xdr_string(xdrs, &objp->gqa_pathp, RQ_PATHLEN)) { return (FALSE); } if (!xdr_int(xdrs, &objp->gqa_uid)) { return (FALSE); } return (TRUE); } bool_t xdr_rquota(xdrs, objp) XDR *xdrs; rquota *objp; { if (!xdr_int(xdrs, &objp->rq_bsize)) { return (FALSE); } if (!xdr_bool(xdrs, &objp->rq_active)) { return (FALSE); } if (!xdr_u_int(xdrs, &objp->rq_bhardlimit)) { return (FALSE); } if (!xdr_u_int(xdrs, &objp->rq_bsoftlimit)) { return (FALSE); } if (!xdr_u_int(xdrs, &objp->rq_curblocks)) { return (FALSE); } if (!xdr_u_int(xdrs, &objp->rq_fhardlimit)) { return (FALSE); } if (!xdr_u_int(xdrs, &objp->rq_fsoftlimit)) { return (FALSE); } if (!xdr_u_int(xdrs, &objp->rq_curfiles)) { return (FALSE); } if (!xdr_u_int(xdrs, &objp->rq_btimeleft)) { return (FALSE); } if (!xdr_u_int(xdrs, &objp->rq_ftimeleft)) { return (FALSE); } return (TRUE); } bool_t xdr_gqr_status(xdrs, objp) XDR *xdrs; gqr_status *objp; { if (!xdr_enum(xdrs, (enum_t *)objp)) { return (FALSE); } return (TRUE); } bool_t xdr_getquota_rslt(xdrs, objp) XDR *xdrs; getquota_rslt *objp; { if (!xdr_gqr_status(xdrs, &objp->status)) { return (FALSE); } switch (objp->status) { case Q_OK: if (!xdr_rquota(xdrs, &objp->getquota_rslt_u.gqr_rquota)) { return (FALSE); } break; case Q_NOQUOTA: break; case Q_EPERM: break; default: return (FALSE); } return (TRUE); } #endif netatalk-2.2.2/libatalk/compat/inet_aton.c0000644000175200017500000000104511655731127015445 00000000000000/* * $Id: inet_aton.c,v 1.4 2003-02-17 01:51:08 srittau Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #if defined(ultrix) || (defined(sun) && defined(__svr4__)) #ifndef INADDR_NONE #define INADDR_NONE ((unsigned) 0xffffffff) #endif /* ! INADDR_NONE */ int inet_aton(const char *name, struct in_addr *addr) { if ((addr->s_addr = inet_addr(name)) == htonl(INADDR_NONE)) return 0; return 1; } #endif /* ultrix || ( sun && __svr4__ ) */ netatalk-2.2.2/libatalk/nbp/0000777000175200017500000000000011704770423012676 500000000000000netatalk-2.2.2/libatalk/nbp/nbp_unrgstr.c0000644000175200017500000000613411655731127015330 00000000000000/* * $Id: nbp_unrgstr.c,v 1.6 2009-10-14 02:24:05 didg Exp $ * * Copyright (c) 1990,1997 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_NETDB_H #include #endif /* HAVE_NETDB_H */ #include "nbp_conf.h" /* FIXME/SOCKLEN_T: socklen_t is a unix98 feature. */ #ifndef SOCKLEN_T #define SOCKLEN_T unsigned int #endif /* ! SOCKLEN_T */ int nbp_unrgstr(const char *obj,const char *type,const char *zone, const struct at_addr *addr) { struct sockaddr_at to; struct nbphdr nh; struct timeval timeout; fd_set readfd; struct servent *se; char *data; int s, cc; SOCKLEN_T namelen; memset(&to, 0, sizeof(to)); if ((s = netddp_open(&to, NULL)) < 0) return -1; data = nbp_send; *data++ = DDPTYPE_NBP; nh.nh_op = NBPOP_UNRGSTR; nh.nh_cnt = 1; nh.nh_id = ++nbp_id; memcpy( data, &nh, SZ_NBPHDR ); data += SZ_NBPHDR; memset(data, 0, SZ_NBPTUPLE); data += SZ_NBPTUPLE; if ( obj ) { if (( cc = strlen( obj )) > NBPSTRLEN ) return( -1 ); *data++ = cc; memcpy( data, obj, cc ); data += cc; } else { *data++ = 0; } if ( type ) { if (( cc = strlen( type )) > NBPSTRLEN ) return( -1 ); *data++ = cc; memcpy( data, type, cc ); data += cc; } else { *data++ = 0; } if ( zone ) { if (( cc = strlen( zone )) > NBPSTRLEN ) return( -1 ); *data++ = cc; memcpy( data, zone, cc ); data += cc; } else { *data++ = 0; } memset( &to, 0, sizeof( struct sockaddr_at )); to.sat_family = AF_APPLETALK; if (addr) memcpy(&to.sat_addr, addr, sizeof(struct at_addr)); #ifdef BSD4_4 to.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ if ( nbp_port == 0 ) { if (( se = getservbyname( "nbp", "ddp" )) == NULL ) { nbp_port = 2; } else { nbp_port = ntohs( se->s_port ); } } to.sat_port = nbp_port; if ( netddp_sendto( s, nbp_send, data - nbp_send, 0, (struct sockaddr *)&to, sizeof( struct sockaddr_at )) < 0 ) { goto unregister_err; } FD_ZERO( &readfd ); FD_SET( s, &readfd ); timeout.tv_sec = 2; timeout.tv_usec = 0; if (( cc = select( s + 1, &readfd, NULL, NULL, &timeout )) < 0 ) { goto unregister_err; } if ( cc == 0 ) { errno = ETIMEDOUT; goto unregister_err; } namelen = sizeof( struct sockaddr_at ); if (( cc = netddp_recvfrom( s, nbp_recv, sizeof( nbp_recv ), 0, (struct sockaddr *)&to, &namelen )) < 0 ) { goto unregister_err; } netddp_close( s ); data = nbp_recv; if ( *data++ != DDPTYPE_NBP ) { return( -1 ); } memcpy( &nh, data, SZ_NBPHDR ); if ( nh.nh_op != NBPOP_OK ) { return( -1 ); } return( 0 ); unregister_err: netddp_close(s); return -1; } netatalk-2.2.2/libatalk/nbp/nbp_lkup.c0000644000175200017500000001155111655731127014576 00000000000000/* * $Id: nbp_lkup.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1997 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_NETDB_H #include #endif /* HAVE_NETDB_H */ #include "nbp_conf.h" /* FIXME/SOCKLEN_T: socklen_t is a unix98 feature. */ #ifndef SOCKLEN_T #define SOCKLEN_T unsigned int #endif /* ! SOCKLEN_T */ int nbp_lookup( const char *obj, const char *type, const char *zone, struct nbpnve *nn, int nncnt, const struct at_addr *ataddr) { struct sockaddr_at addr, from; struct timeval tv, tv_begin, tv_end; fd_set fds; struct nbpnve nve; struct nbphdr nh; struct nbptuple nt; struct servent *se; char *data = nbp_send; SOCKLEN_T namelen; int s, cnt, tries, sc, cc, i, c; memset(&addr, 0, sizeof(addr)); memset(&from, 0, sizeof(from)); if (ataddr) memcpy(&addr.sat_addr, ataddr, sizeof(struct at_addr)); if ((s = netddp_open(&addr, &from)) < 0) return -1; *data++ = DDPTYPE_NBP; #ifdef MACOSX_SERVER nh.nh_op = from.sat_addr.s_node ? NBPOP_BRRQ : NBPOP_LKUP; #else /* MACOSX_SERVER */ nh.nh_op = NBPOP_BRRQ; #endif /* MACOSX_SERVER */ nh.nh_cnt = 1; nh.nh_id = ++nbp_id; memcpy( data, &nh, SZ_NBPHDR ); data += SZ_NBPHDR; memset(&nt, 0, sizeof(nt)); nt.nt_net = addr.sat_addr.s_net; nt.nt_node = addr.sat_addr.s_node; nt.nt_port = addr.sat_port; memcpy( data, &nt, SZ_NBPTUPLE); data += SZ_NBPTUPLE; if ( obj ) { if (( cc = strlen( obj )) > NBPSTRLEN ) goto lookup_err; *data++ = cc; memcpy( data, obj, cc ); data += cc; } else { *data++ = 1; *data++ = '='; /* match anything */ } if ( type ) { if (( cc = strlen( type )) > NBPSTRLEN ) goto lookup_err; *data++ = cc; memcpy( data, type, cc ); data += cc; } else { *data++ = 1; *data++ = '='; /* match anything */ } if ( zone ) { if (( cc = strlen( zone )) > NBPSTRLEN ) goto lookup_err; *data++ = cc; memcpy( data, zone, cc ); data += cc; } else { *data++ = 1; *data++ = '*'; /* default zone */ } if ( nbp_port == 0 ) { if (( se = getservbyname( "nbp", "ddp" )) == NULL ) { nbp_port = 2; } else { nbp_port = ntohs( se->s_port ); } } #ifdef MACOSX_SERVER if (from.sat_addr.s_node) { memcpy(&addr.sat_addr, &from.sat_addr, sizeof(addr.sat_addr)); } else { addr.sat_addr.s_net = ATADDR_ANYNET; addr.sat_addr.s_node = ATADDR_BCAST; } #endif /* MACOSX_SERVER */ addr.sat_port = nbp_port; cnt = 0; tries = 3; sc = data - nbp_send; while ( tries > 0 ) { if ( netddp_sendto( s, nbp_send, sc, 0, (struct sockaddr *)&addr, sizeof( struct sockaddr_at )) < 0 ) { goto lookup_err; } tv.tv_sec = 2L; tv.tv_usec = 0; for (;;) { FD_ZERO( &fds ); FD_SET( s, &fds ); if ( gettimeofday( &tv_begin, NULL ) < 0 ) { goto lookup_err; } if (( c = select( s + 1, &fds, NULL, NULL, &tv )) < 0 ) { goto lookup_err; } if ( c == 0 || FD_ISSET( s, &fds ) == 0 ) { break; } if ( gettimeofday( &tv_end, NULL ) < 0 ) { goto lookup_err; } if ( tv_begin.tv_usec > tv_end.tv_sec ) { tv_end.tv_usec += 1000000; tv_end.tv_sec -= 1; } if (( tv.tv_usec -= ( tv_end.tv_usec - tv_begin.tv_usec )) < 0 ) { tv.tv_usec += 1000000; tv.tv_sec -= 1; } if (( tv.tv_sec -= ( tv_end.tv_sec - tv_begin.tv_sec )) < 0 ) { break; } namelen = sizeof( struct sockaddr_at ); if (( cc = netddp_recvfrom( s, nbp_recv, sizeof( nbp_recv ), 0, (struct sockaddr *)&from, &namelen )) < 0 ) { goto lookup_err; } data = nbp_recv; if ( *data++ != DDPTYPE_NBP ) { continue; } cc--; memcpy( &nh, data, SZ_NBPHDR ); data += SZ_NBPHDR; if ( nh.nh_op != NBPOP_LKUPREPLY ) { continue; } cc -= SZ_NBPHDR; while (( i = nbp_parse( data, &nve, cc )) >= 0 ) { data += cc - i; cc = i; /* * Check to see if nve is already in nn. If not, * put it in, and increment cnt. */ for ( i = 0; i < cnt; i++ ) { if ( nbp_match( &nve, &nn[ i ], NBPMATCH_NOZONE|NBPMATCH_NOGLOB )) { break; } } if ( i == cnt ) { nn[ cnt++ ] = nve; } if ( cnt == nncnt ) { tries = 0; break; } } if ( cnt == nncnt ) { tries = 0; break; } } tries--; } netddp_close(s); errno = 0; return( cnt ); lookup_err: netddp_close(s); return -1; } netatalk-2.2.2/libatalk/nbp/Makefile.am0000644000175200017500000000024211655731127014647 00000000000000# Makefile.am for libatalk/nbp/ noinst_LTLIBRARIES = libnbp.la libnbp_la_SOURCES = nbp_util.c nbp_lkup.c nbp_rgstr.c nbp_unrgstr.c noinst_HEADERS = nbp_conf.h netatalk-2.2.2/libatalk/nbp/Makefile.in0000644000175200017500000003755411703521727014675 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/nbp/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = libatalk/nbp DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libnbp_la_LIBADD = am_libnbp_la_OBJECTS = nbp_util.lo nbp_lkup.lo nbp_rgstr.lo \ nbp_unrgstr.lo libnbp_la_OBJECTS = $(am_libnbp_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libnbp_la_SOURCES) DIST_SOURCES = $(libnbp_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libnbp.la libnbp_la_SOURCES = nbp_util.c nbp_lkup.c nbp_rgstr.c nbp_unrgstr.c noinst_HEADERS = nbp_conf.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/nbp/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/nbp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libnbp.la: $(libnbp_la_OBJECTS) $(libnbp_la_DEPENDENCIES) $(LINK) $(libnbp_la_OBJECTS) $(libnbp_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbp_lkup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbp_rgstr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbp_unrgstr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbp_util.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/nbp/nbp_conf.h0000644000175200017500000000234611655731127014557 00000000000000/* * $Id: nbp_conf.h,v 1.3 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef NBP_CONF_H #define NBP_CONF_H 1 #include #include extern char nbp_send[ 1024 ]; extern char nbp_recv[ 1024 ]; extern u_char nbp_port; extern unsigned char nbp_id; int nbp_parse (char *, struct nbpnve *, int); int nbp_match (struct nbpnve *, struct nbpnve *, int); #endif /* NBP_CONF_H */ netatalk-2.2.2/libatalk/nbp/nbp_rgstr.c0000644000175200017500000000627611655731127014774 00000000000000/* * $Id: nbp_rgstr.c,v 1.6 2009-10-14 02:24:05 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_NETDB_H #include #endif /* HAVE_NETDB_H */ #include "nbp_conf.h" /* FIXME/SOCKLEN_T: socklen_t is a unix98 feature. */ #ifndef SOCKLEN_T #define SOCKLEN_T unsigned int #endif /* ! SOCKLEN_T */ int nbp_rgstr( struct sockaddr_at *sat, const char *obj, const char *type, const char *zone) { struct sockaddr_at to; struct nbpnve nn; struct nbphdr nh; struct nbptuple nt; struct timeval timeout; fd_set readfd; struct servent *se; char *data; int s, cc; SOCKLEN_T namelen; if ( nbp_lookup( obj, type, zone, &nn, 1, &sat->sat_addr ) > 0 ) { errno = EADDRINUSE; return( -1 ); } memset(&to, 0, sizeof(to)); if ((s = netddp_open(&to, NULL)) < 0) return -1; data = nbp_send; *data++ = DDPTYPE_NBP; nh.nh_op = NBPOP_RGSTR; nh.nh_cnt = 1; nh.nh_id = ++nbp_id; memcpy( data, &nh, SZ_NBPHDR ); data += SZ_NBPHDR; memset(&nt, 0, sizeof(nt)); nt.nt_net = sat->sat_addr.s_net; nt.nt_node = sat->sat_addr.s_node; nt.nt_port = sat->sat_port; memcpy( data, &nt, SZ_NBPTUPLE); data += SZ_NBPTUPLE; if ( obj ) { if (( cc = strlen( obj )) > NBPSTRLEN ) return( -1 ); *data++ = cc; memcpy( data, obj, cc ); data += cc; } else { *data++ = 0; } if ( type ) { if (( cc = strlen( type )) > NBPSTRLEN ) return( -1 ); *data++ = cc; memcpy( data, type, cc ); data += cc; } else { *data++ = 0; } if ( zone ) { if (( cc = strlen( zone )) > NBPSTRLEN ) return( -1 ); *data++ = cc; memcpy( data, zone, cc ); data += cc; } else { *data++ = 1; *data++ = '*'; /* default zone */ } if ( nbp_port == 0 ) { if (( se = getservbyname( "nbp", "ddp" )) == NULL ) { nbp_port = 2; } else { nbp_port = ntohs( se->s_port ); } } to.sat_port = nbp_port; if ( netddp_sendto( s, nbp_send, data - nbp_send, 0, (struct sockaddr *)&to, sizeof( struct sockaddr_at )) < 0 ) { goto register_err; } FD_ZERO( &readfd ); FD_SET( s, &readfd ); timeout.tv_sec = 2; timeout.tv_usec = 0; if (( cc = select( s + 1, &readfd, NULL, NULL, &timeout )) < 0 ) { goto register_err; } if ( cc == 0 ) { errno = ETIMEDOUT; goto register_err; } namelen = sizeof( struct sockaddr_at ); if (( cc = netddp_recvfrom( s, nbp_recv, sizeof( nbp_recv ), 0, (struct sockaddr *)&to, &namelen )) < 0 ) { goto register_err; } netddp_close( s ); data = nbp_recv; if ( *data++ != DDPTYPE_NBP ) { return( -1 ); } memcpy( &nh, data, SZ_NBPHDR ); if ( nh.nh_op != NBPOP_OK ) { return -1; } return( 0 ); register_err: netddp_close(s); return -1; } netatalk-2.2.2/libatalk/nbp/nbp_util.c0000644000175200017500000000635011655731127014601 00000000000000/* * $Id: nbp_util.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1997 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_NETDB_H #include #endif /* HAVE_NETDB_H */ #include "nbp_conf.h" char nbp_send[ 1024 ]; char nbp_recv[ 1024 ]; u_char nbp_port = 0; unsigned char nbp_id = 0; int nbp_parse(char *data, struct nbpnve *nn, int len) { struct nbptuple nt; memcpy( &nt, data, SZ_NBPTUPLE); data += SZ_NBPTUPLE; len -= SZ_NBPTUPLE; if ( len < 0 ) { return( -1 ); } #ifdef BSD4_4 nn->nn_sat.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ nn->nn_sat.sat_family = AF_APPLETALK; nn->nn_sat.sat_addr.s_net = nt.nt_net; nn->nn_sat.sat_addr.s_node = nt.nt_node; nn->nn_sat.sat_port = nt.nt_port; nn->nn_objlen = *data++; len -= nn->nn_objlen + 1; if ( len < 0 ) { return( -1 ); } if ( nn->nn_objlen > NBPSTRLEN ) { return( -1 ); } memcpy( nn->nn_obj, data, nn->nn_objlen ); data += nn->nn_objlen; nn->nn_typelen = *data++; len -= nn->nn_typelen + 1; if ( len < 0 ) { return( -1 ); } if ( nn->nn_typelen > NBPSTRLEN ) { return( 1 ); } memcpy( nn->nn_type, data, nn->nn_typelen ); data += nn->nn_typelen; nn->nn_zonelen = *data++; len -= nn->nn_zonelen + 1; if ( len < 0 ) { return( -1 ); } if ( nn->nn_zonelen > NBPSTRLEN ) { return( 1 ); } memcpy( nn->nn_zone, data, nn->nn_zonelen ); return( len ); } #define NBPM_OBJ (1<<1) #define NBPM_TYPE (1<<2) #define NBPM_ZONE (1<<3) int nbp_match(struct nbpnve *n1, struct nbpnve *n2, int flags) { int match = 0; if ( flags & NBPMATCH_NOZONE ) { match |= NBPM_ZONE; } if ( !( flags & NBPMATCH_NOGLOB )) { if ( n1->nn_objlen == 1 && n1->nn_obj[0] == '=' ) { match |= NBPM_OBJ; } if ( n1->nn_typelen == 1 && n1->nn_type[0] == '=' ) { match |= NBPM_TYPE; } } if ( !( match & NBPM_OBJ )) { if ( n1->nn_objlen != n2->nn_objlen || strndiacasecmp( n1->nn_obj, n2->nn_obj, n1->nn_objlen )) { return( 0 ); } } if ( !( match & NBPM_TYPE )) { if ( n1->nn_typelen != n2->nn_typelen || strndiacasecmp( n1->nn_type, n2->nn_type, n1->nn_typelen )) { return( 0 ); } } if ( !( match & NBPM_ZONE )) { if ( n1->nn_zonelen != n2->nn_zonelen || strndiacasecmp( n1->nn_zone, n2->nn_zone, n1->nn_zonelen )) { return( 0 ); } } return( 1 ); } int nbp_name(const char *name, char **objp,char **typep,char **zonep) { static char buf[ 32 + 1 + 32 + 1 + 32 + 1 ]; char *p; if ( name ) { if ( strlen( name ) + 1 > sizeof( buf )) { return( -1 ); } strcpy( buf, name ); if (( p = strrchr( buf, '@' )) != NULL ) { *p++ = '\0'; *zonep = p; } if (( p = strrchr( buf, ':' )) != NULL ) { *p++ = '\0'; *typep = p; } if ( *buf != '\0' ) { *objp = buf; } } return( 0 ); } netatalk-2.2.2/libatalk/acl/0000777000175200017500000000000011704770416012660 500000000000000netatalk-2.2.2/libatalk/acl/Makefile.am0000644000175200017500000000037511655731126014635 00000000000000# Makefile.am for libatalk/acl/ noinst_HEADERS = aclldap.h cache.h noinst_LTLIBRARIES = libacl.la libacl_la_SOURCES = cache.c unix.c uuid.c libacl_la_LDFLAGS = if HAVE_LDAP libacl_la_SOURCES += ldap.c ldap_config.c libacl_la_LDFLAGS += -lldap endif netatalk-2.2.2/libatalk/acl/Makefile.in0000644000175200017500000004050711703521726014644 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/acl/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @HAVE_LDAP_TRUE@am__append_1 = ldap.c ldap_config.c @HAVE_LDAP_TRUE@am__append_2 = -lldap subdir = libatalk/acl DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libacl_la_LIBADD = am__libacl_la_SOURCES_DIST = cache.c unix.c uuid.c ldap.c \ ldap_config.c @HAVE_LDAP_TRUE@am__objects_1 = ldap.lo ldap_config.lo am_libacl_la_OBJECTS = cache.lo unix.lo uuid.lo $(am__objects_1) libacl_la_OBJECTS = $(am_libacl_la_OBJECTS) libacl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libacl_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libacl_la_SOURCES) DIST_SOURCES = $(am__libacl_la_SOURCES_DIST) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = aclldap.h cache.h noinst_LTLIBRARIES = libacl.la libacl_la_SOURCES = cache.c unix.c uuid.c $(am__append_1) libacl_la_LDFLAGS = $(am__append_2) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/acl/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/acl/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libacl.la: $(libacl_la_OBJECTS) $(libacl_la_DEPENDENCIES) $(libacl_la_LINK) $(libacl_la_OBJECTS) $(libacl_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cache.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap_config.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uuid.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/acl/cache.h0000644000175200017500000000317411655731126014015 00000000000000/* $Id: cache.h,v 1.1 2009-02-02 11:55:01 franklahm Exp $ Copyright (c) 2008,2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef LDAPCACHE_H #define LDAPCACHE_H /* * We need to cache all LDAP querie results, they just take too long. * We do hashing with chaining. Two caches are needed: * 1) name -> uuid, indexed by a hash(f(): hashstring) of the name * 2) uuid -> name, indexed by a hash of the uuid(f(): hashuuid) * Both hash funcs result in a value 0-255 with which we index a array. * We malloc and free all elements as needed. * The cache caches for CACHESECONDS. */ #define CACHESECONDS 600 /******************************************************** * Interface ********************************************************/ extern int search_cachebyname( const char *name, uuidtype_t *type, uuidp_t uuid); extern int add_cachebyname( const char *inname, const uuidp_t inuuid, const uuidtype_t type, const unsigned long uid); extern int search_cachebyuuid( uuidp_t uuidp, char **name, uuidtype_t *type); extern int add_cachebyuuid( uuidp_t inuuid, const char *inname, uuidtype_t type, const unsigned long uid); #endif /* LDAPCACHE_H */ netatalk-2.2.2/libatalk/acl/aclldap.h0000644000175200017500000000173511655731126014353 00000000000000/* Copyright (c) 2008,2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef ACLLDAP_H #define ACLLDAP_H #include /* just for uuidtype_t*/ /******************************************************** * Interface ********************************************************/ extern int ldap_getuuidfromname( const char *name, uuidtype_t type, char **uuid_string); extern int ldap_getnamefromuuid( const char *uuidstr, char **name, uuidtype_t *type); #endif /* ACLLDAP_H */ netatalk-2.2.2/libatalk/acl/uuid.c0000644000175200017500000002137611655731245013721 00000000000000/* Copyright (c) 2008,2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include "aclldap.h" #include "cache.h" char *uuidtype[] = {"", "USER", "GROUP", "LOCAL"}; /******************************************************** * Public helper function ********************************************************/ static unsigned char local_group_uuid[] = {0xab, 0xcd, 0xef, 0xab, 0xcd, 0xef, 0xab, 0xcd, 0xef, 0xab, 0xcd, 0xef}; static unsigned char local_user_uuid[] = {0xff, 0xff, 0xee, 0xee, 0xdd, 0xdd, 0xcc, 0xcc, 0xbb, 0xbb, 0xaa, 0xaa}; void localuuid_from_id(unsigned char *buf, uuidtype_t type, unsigned int id) { uint32_t tmp; switch (type) { case UUID_GROUP: memcpy(buf, local_group_uuid, 12); break; case UUID_USER: default: memcpy(buf, local_user_uuid, 12); break; } tmp = htonl(id); memcpy(buf + 12, &tmp, 4); return; } /* * convert ascii string that can include dashes to binary uuid. * caller must provide a buffer. */ void uuid_string2bin( const char *uuidstring, uuidp_t uuid) { int nibble = 1; int i = 0; unsigned char c, val = 0; while (*uuidstring) { c = *uuidstring; if (c == '-') { uuidstring++; continue; } else if (c <= '9') /* 0-9 */ c -= '0'; else if (c <= 'F') /* A-F */ c -= 'A' - 10; else if (c <= 'f') /* a-f */ c-= 'a' - 10; if (nibble) val = c * 16; else uuid[i++] = val + c; nibble ^= 1; uuidstring++; } } /*! * Convert 16 byte binary uuid to neat ascii represantation including dashes. * * Returns pointer to static buffer. */ const char *uuid_bin2string(unsigned char *uuid) { static char uuidstring[UUID_STRINGSIZE + 1]; int i = 0; unsigned char c; while (i < UUID_STRINGSIZE) { c = *uuid; uuid++; sprintf(uuidstring + i, "%02X", c); i += 2; if (i==8 || i==13 || i==18 || i==23) uuidstring[i++] = '-'; } uuidstring[i] = 0; return uuidstring; } /******************************************************** * Interface ********************************************************/ /* * name: give me his name * type: and type (UUID_USER or UUID_GROUP) * uuid: pointer to uuid_t storage that the caller must provide * returns 0 on success !=0 on errror */ int getuuidfromname( const char *name, uuidtype_t type, uuidp_t uuid) { int ret = 0; uuidtype_t mytype = type; char nulluuid[16] = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0}; #ifdef HAVE_LDAP char *uuid_string = NULL; #endif ret = search_cachebyname(name, &mytype, uuid); if (ret == 0) { /* found in cache */ LOG(log_debug, logtype_afpd, "getuuidfromname{cache}: name: %s, type%s: %s -> UUID: %s", name, (mytype & UUID_ENOENT) == UUID_ENOENT ? "[negative]" : "", uuidtype[type & UUIDTYPESTR_MASK], uuid_bin2string(uuid)); if ((mytype & UUID_ENOENT) == UUID_ENOENT) return -1; } else { /* if not found in cache */ #ifdef HAVE_LDAP if ((ret = ldap_getuuidfromname( name, type, &uuid_string)) == 0) { uuid_string2bin( uuid_string, uuid); LOG(log_debug, logtype_afpd, "getuuidfromname{LDAP}: name: %s, type: %s -> UUID: %s", name, uuidtype[type & UUIDTYPESTR_MASK], uuid_bin2string(uuid)); } else { LOG(log_debug, logtype_afpd, "getuuidfromname(\"%s\",t:%u): no result from ldap search", name, type); } #endif if (ret != 0) { /* Build a local UUID */ if (type == UUID_USER) { struct passwd *pwd; if ((pwd = getpwnam(name)) == NULL) { LOG(log_error, logtype_afpd, "getuuidfromname(\"%s\",t:%u): unknown user", name, uuidtype[type & UUIDTYPESTR_MASK]); mytype |= UUID_ENOENT; memcpy(uuid, nulluuid, 16); } else { localuuid_from_id(uuid, UUID_USER, pwd->pw_uid); ret = 0; LOG(log_debug, logtype_afpd, "getuuidfromname{local}: name: %s, type: %s -> UUID: %s", name, uuidtype[type & UUIDTYPESTR_MASK], uuid_bin2string(uuid)); } } else { struct group *grp; if ((grp = getgrnam(name)) == NULL) { LOG(log_error, logtype_afpd, "getuuidfromname(\"%s\",t:%u): unknown user", name, uuidtype[type & UUIDTYPESTR_MASK]); mytype |= UUID_ENOENT; memcpy(uuid, nulluuid, 16); } else { localuuid_from_id(uuid, UUID_GROUP, grp->gr_gid); ret = 0; LOG(log_debug, logtype_afpd, "getuuidfromname{local}: name: %s, type: %s -> UUID: %s", name, uuidtype[type & UUIDTYPESTR_MASK], uuid_bin2string(uuid)); } } } add_cachebyname(name, uuid, mytype, 0); } cleanup: #ifdef HAVE_LDAP if (uuid_string) free(uuid_string); #endif return ret; } /* * uuidp: pointer to a uuid * name: returns allocated buffer from ldap_getnamefromuuid * type: returns USER, GROUP or LOCAL * return 0 on success !=0 on errror * * Caller must free name appropiately. */ int getnamefromuuid(const uuidp_t uuidp, char **name, uuidtype_t *type) { int ret; uid_t uid; gid_t gid; struct passwd *pwd; struct group *grp; if (search_cachebyuuid(uuidp, name, type) == 0) { /* found in cache */ LOG(log_debug, logtype_afpd, "getnamefromuuid{cache}: UUID: %s -> name: %s, type%s: %s", uuid_bin2string(uuidp), *name, (*type & UUID_ENOENT) == UUID_ENOENT ? "[negative]" : "", uuidtype[(*type) & UUIDTYPESTR_MASK]); if ((*type & UUID_ENOENT) == UUID_ENOENT) return -1; return 0; } /* not found in cache */ /* Check if UUID is a client local one */ if (memcmp(uuidp, local_user_uuid, 12) == 0) { *type = UUID_USER; uid = ntohl(*(uint32_t *)(uuidp + 12)); if ((pwd = getpwuid(uid)) == NULL) { /* not found, add negative entry to cache */ add_cachebyuuid(uuidp, "UUID_ENOENT", UUID_ENOENT, 0); ret = -1; } else { *name = strdup(pwd->pw_name); add_cachebyuuid(uuidp, *name, *type, 0); ret = 0; } LOG(log_debug, logtype_afpd, "getnamefromuuid{local}: UUID: %s -> name: %s, type:%s", uuid_bin2string(uuidp), *name, uuidtype[(*type) & UUIDTYPESTR_MASK]); return ret; } else if (memcmp(uuidp, local_group_uuid, 12) == 0) { *type = UUID_GROUP; gid = ntohl(*(uint32_t *)(uuidp + 12)); if ((grp = getgrgid(gid)) == NULL) { /* not found, add negative entry to cache */ add_cachebyuuid(uuidp, "UUID_ENOENT", UUID_ENOENT, 0); ret = -1; } else { *name = strdup(grp->gr_name); add_cachebyuuid(uuidp, *name, *type, 0); ret = 0; } return ret; } #ifdef HAVE_LDAP ret = ldap_getnamefromuuid(uuid_bin2string(uuidp), name, type); #else ret = -1; #endif if (ret != 0) { LOG(log_debug, logtype_afpd, "getnamefromuuid(%s): not found", uuid_bin2string(uuidp)); add_cachebyuuid(uuidp, "UUID_ENOENT", UUID_ENOENT, 0); return -1; } add_cachebyuuid(uuidp, *name, *type, 0); LOG(log_debug, logtype_afpd, "getnamefromuuid{LDAP}: UUID: %s -> name: %s, type:%s", uuid_bin2string(uuidp), *name, uuidtype[(*type) & UUIDTYPESTR_MASK]); return 0; } netatalk-2.2.2/libatalk/acl/unix.c0000644000175200017500000003276011655731245013735 00000000000000/* Copyright (c) 2010 Frank Lahm Copyright (c) 2011 Laura Mueller This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef HAVE_ACLS #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_SOLARIS_ACLS /* Get ACL. Allocates storage as needed. Caller must free. * Returns no of ACEs or -1 on error. */ int get_nfsv4_acl(const char *name, ace_t **retAces) { int ace_count = -1; ace_t *aces; struct stat st; *retAces = NULL; /* Only call acl() for regular files and directories, otherwise just return 0 */ if (lstat(name, &st) != 0) { LOG(log_warning, logtype_afpd, "get_nfsv4_acl(\"%s/%s\"): %s", getcwdpath(), name, strerror(errno)); return -1; } if (S_ISLNK(st.st_mode)) /* sorry, no ACLs for symlinks */ return 0; if ( ! (S_ISREG(st.st_mode) || S_ISDIR(st.st_mode))) { LOG(log_debug, logtype_afpd, "get_nfsv4_acl(\"%s/%s\"): special", getcwdpath(), name); return 0; } if ((ace_count = acl(name, ACE_GETACLCNT, 0, NULL)) == 0) { LOG(log_debug, logtype_afpd, "get_nfsv4_acl(\"%s/%s\"): 0 ACEs", getcwdpath(), name); return 0; } if (ace_count == -1) { LOG(log_debug, logtype_afpd, "get_nfsv4_acl: acl('%s/%s', ACE_GETACLCNT): ace_count %i, error: %s", getcwdpath(), name, ace_count, strerror(errno)); return -1; } aces = malloc(ace_count * sizeof(ace_t)); if (aces == NULL) { LOG(log_error, logtype_afpd, "get_nfsv4_acl: malloc error"); return -1; } if ( (acl(name, ACE_GETACL, ace_count, aces)) == -1 ) { LOG(log_error, logtype_afpd, "get_nfsv4_acl: acl(ACE_GETACL) error"); free(aces); return -1; } LOG(log_debug9, logtype_afpd, "get_nfsv4_acl: file: %s -> No. of ACEs: %d", name, ace_count); *retAces = aces; return ace_count; } /* Concatenate ACEs */ ace_t *concat_aces(ace_t *aces1, int ace1count, ace_t *aces2, int ace2count) { ace_t *new_aces; int i, j; /* malloc buffer for new ACL */ if ((new_aces = malloc((ace1count + ace2count) * sizeof(ace_t))) == NULL) { LOG(log_error, logtype_afpd, "combine_aces: malloc %s", strerror(errno)); return NULL; } /* Copy ACEs from buf1 */ for (i=0; i < ace1count; ) { memcpy(&new_aces[i], &aces1[i], sizeof(ace_t)); i++; } j = i; /* Copy ACEs from buf2 */ for (i=0; i < ace2count; ) { memcpy(&new_aces[j], &aces2[i], sizeof(ace_t)); i++; j++; } return new_aces; } /* Remove any trivial ACE "in-place". Returns no of non-trivial ACEs */ int strip_trivial_aces(ace_t **saces, int sacecount) { int i,j; int nontrivaces = 0; ace_t *aces = *saces; ace_t *new_aces; if (aces == NULL || sacecount <= 0) return 0; /* Count non-trivial ACEs */ for (i=0; i < sacecount; ) { if ( ! (aces[i].a_flags & (ACE_OWNER | ACE_GROUP | ACE_EVERYONE))) nontrivaces++; i++; } /* malloc buffer for new ACL */ if ((new_aces = malloc(nontrivaces * sizeof(ace_t))) == NULL) { LOG(log_error, logtype_afpd, "strip_trivial_aces: malloc %s", strerror(errno)); return -1; } /* Copy non-trivial ACEs */ for (i=0, j=0; i < sacecount; ) { if ( ! (aces[i].a_flags & (ACE_OWNER | ACE_GROUP | ACE_EVERYONE))) { memcpy(&new_aces[j], &aces[i], sizeof(ace_t)); j++; } i++; } free(aces); *saces = new_aces; LOG(log_debug7, logtype_afpd, "strip_trivial_aces: non-trivial ACEs: %d", nontrivaces); return nontrivaces; } /* Remove non-trivial ACEs "in-place". Returns no of trivial ACEs. */ int strip_nontrivial_aces(ace_t **saces, int sacecount) { int i,j; int trivaces = 0; ace_t *aces = *saces; ace_t *new_aces; /* Count trivial ACEs */ for (i=0; i < sacecount; ) { if ((aces[i].a_flags & (ACE_OWNER | ACE_GROUP | ACE_EVERYONE))) trivaces++; i++; } /* malloc buffer for new ACL */ if ((new_aces = malloc(trivaces * sizeof(ace_t))) == NULL) { LOG(log_error, logtype_afpd, "strip_nontrivial_aces: malloc %s", strerror(errno)); return -1; } /* Copy trivial ACEs */ for (i=0, j=0; i < sacecount; ) { if ((aces[i].a_flags & (ACE_OWNER | ACE_GROUP | ACE_EVERYONE))) { memcpy(&new_aces[j], &aces[i], sizeof(ace_t)); j++; } i++; } /* Free old ACEs */ free(aces); *saces = new_aces; LOG(log_debug7, logtype_afpd, "strip_nontrivial_aces: trivial ACEs: %d", trivaces); return trivaces; } /*! * Change mode of file preserving existing explicit ACEs * * nfsv4_chmod * (1) reads objects ACL (acl1), may return 0 or -1 NFSv4 ACEs on eg UFS fs * (2) removes all trivial ACEs from the ACL by calling strip_trivial_aces(), possibly * leaving 0 ACEs in the ACL if there were only trivial ACEs as mapped from the mode * (3) calls chmod() with mode, we're done if step (1) returned 0 for noaces * (4) reads the changed ACL (acl2) which * a) might still contain explicit ACEs (up to onnv132) * b) will have any explicit ACE removed (starting with onnv145/Openindiana) * (5) strip any explicit ACE from acl2 using strip_nontrivial_aces() * (6) merge acl2 and acl2 * (7) set the ACL merged ACL on the object */ int nfsv4_chmod(char *name, mode_t mode) { int ret = -1; int noaces, nnaces; ace_t *oacl = NULL, *nacl = NULL, *cacl = NULL; LOG(log_debug, logtype_afpd, "nfsv4_chmod(\"%s/%s\", %04o)", getcwdpath(), name, mode); if ((noaces = get_nfsv4_acl(name, &oacl)) < 1) /* (1) */ return chmod(name, mode); if ((noaces = strip_trivial_aces(&oacl, noaces)) == -1) /* (2) */ goto exit; if (chmod(name, mode) != 0) /* (3) */ goto exit; if ((nnaces = get_nfsv4_acl(name, &nacl)) == -1) /* (4) */ goto exit; if ((nnaces = strip_nontrivial_aces(&nacl, nnaces)) == -1) /* (5) */ goto exit; if ((cacl = concat_aces(oacl, noaces, nacl, nnaces)) == NULL) /* (6) */ goto exit; if ((ret = acl(name, ACE_SETACL, noaces + nnaces, cacl)) != 0) { LOG(log_error, logtype_afpd, "nfsv4_chmod: error setting acl: %s", strerror(errno)); goto exit; } exit: if (oacl) free(oacl); if (nacl) free(nacl); if (cacl) free(cacl); LOG(log_debug, logtype_afpd, "nfsv4_chmod(\"%s/%s\", %04o): result: %u", getcwdpath(), name, mode, ret); return ret; } #endif /* HAVE_SOLARIS_ACLS */ #ifdef HAVE_POSIX_ACLS /* This is a workaround for chmod() on filestystems supporting Posix 1003.1e draft 17 * compliant ACLs. For objects with extented ACLs, eg objects with an ACL_MASK entry, * chmod() manipulates ACL_MASK instead of ACL_GROUP_OBJ. As OS X isn't aware of * this behavior calling FPSetFileDirParms may lead to unpredictable results. For * more information see section 23.1.2 of Posix 1003.1e draft 17. * * posix_chmod() accepts the same arguments as chmod() and returns 0 in case of * success or -1 in case something went wrong. */ #define SEARCH_GROUP_OBJ 0x01 #define SEARCH_MASK 0x02 int posix_chmod(const char *name, mode_t mode) { int ret = 0; int entry_id = ACL_FIRST_ENTRY; acl_entry_t entry; acl_entry_t group_entry; acl_tag_t tag; acl_t acl; u_char not_found = (SEARCH_GROUP_OBJ|SEARCH_MASK); /* used as flags */ LOG(log_maxdebug, logtype_afpd, "posix_chmod: %s mode: 0x%08x", name, mode); /* Call chmod() first because there might be some special bits to be set which * aren't related to access control. */ ret = chmod(name, mode); if (ret) goto done; /* Check if the underlying filesystem supports ACLs. */ acl = acl_get_file(name, ACL_TYPE_ACCESS); if (acl) { /* There is no need to keep iterating once we have found ACL_GROUP_OBJ and ACL_MASK. */ while ((acl_get_entry(acl, entry_id, &entry) == 1) && not_found) { entry_id = ACL_NEXT_ENTRY; ret = acl_get_tag_type(entry, &tag); if (ret) { LOG(log_error, logtype_afpd, "posix_chmod: Failed to get tag type."); goto cleanup; } switch (tag) { case ACL_GROUP_OBJ: group_entry = entry; not_found &= ~SEARCH_GROUP_OBJ; break; case ACL_MASK: not_found &= ~SEARCH_MASK; break; default: break; } } if (!not_found) { /* The filesystem object has extented ACLs. We have to update ACL_GROUP_OBJ * with the group permissions. */ acl_permset_t permset; acl_perm_t perm = 0; ret = acl_get_permset(group_entry, &permset); if (ret) { LOG(log_error, logtype_afpd, "posix_chmod: Can't get permset."); goto cleanup; } ret = acl_clear_perms(permset); if (ret) goto cleanup; if (mode & S_IXGRP) perm |= ACL_EXECUTE; if (mode & S_IWGRP) perm |= ACL_WRITE; if (mode & S_IRGRP) perm |= ACL_READ; ret = acl_add_perm(permset, perm); if (ret) goto cleanup; ret = acl_set_permset(group_entry, permset); if (ret) { LOG(log_error, logtype_afpd, "posix_chmod: Can't set permset."); goto cleanup; } /* also update ACL_MASK */ ret = acl_calc_mask(&acl); if (ret) { LOG(log_error, logtype_afpd, "posix_chmod: acl_calc_mask failed."); goto cleanup; } ret = acl_set_file(name, ACL_TYPE_ACCESS, acl); } cleanup: acl_free(acl); } done: LOG(log_maxdebug, logtype_afpd, "posix_chmod: %d", ret); return ret; } /* * posix_fchmod() accepts the same arguments as fchmod() and returns 0 in case of * success or -1 in case something went wrong. */ int posix_fchmod(int fd, mode_t mode) { int ret = 0; int entry_id = ACL_FIRST_ENTRY; acl_entry_t entry; acl_entry_t group_entry; acl_tag_t tag; acl_t acl; u_char not_found = (SEARCH_GROUP_OBJ|SEARCH_MASK); /* used as flags */ /* Call chmod() first because there might be some special bits to be set which * aren't related to access control. */ ret = fchmod(fd, mode); if (ret) goto done; /* Check if the underlying filesystem supports ACLs. */ acl = acl_get_fd(fd); if (acl) { /* There is no need to keep iterating once we have found ACL_GROUP_OBJ and ACL_MASK. */ while ((acl_get_entry(acl, entry_id, &entry) == 1) && not_found) { entry_id = ACL_NEXT_ENTRY; ret = acl_get_tag_type(entry, &tag); if (ret) { LOG(log_error, logtype_afpd, "posix_fchmod: Failed to get tag type."); goto cleanup; } switch (tag) { case ACL_GROUP_OBJ: group_entry = entry; not_found &= ~SEARCH_GROUP_OBJ; break; case ACL_MASK: not_found &= ~SEARCH_MASK; break; default: break; } } if (!not_found) { /* The filesystem object has extented ACLs. We have to update ACL_GROUP_OBJ * with the group permissions. */ acl_permset_t permset; acl_perm_t perm = 0; ret = acl_get_permset(group_entry, &permset); if (ret) { LOG(log_error, logtype_afpd, "posix_fchmod: Can't get permset."); goto cleanup; } ret = acl_clear_perms(permset); if (ret) goto cleanup; if (mode & S_IXGRP) perm |= ACL_EXECUTE; if (mode & S_IWGRP) perm |= ACL_WRITE; if (mode & S_IRGRP) perm |= ACL_READ; ret = acl_add_perm(permset, perm); if (ret) goto cleanup; ret = acl_set_permset(group_entry, permset); if (ret) { LOG(log_error, logtype_afpd, "posix_fchmod: Can't set permset."); goto cleanup; } /* also update ACL_MASK */ ret = acl_calc_mask(&acl); if (ret) { LOG(log_error, logtype_afpd, "posix_fchmod: acl_calc_mask failed."); goto cleanup; } ret = acl_set_fd(fd, acl); } cleanup: acl_free(acl); } done: return ret; } #endif /* HAVE_POSIX_ACLS */ #endif /* HAVE_ACLS */ netatalk-2.2.2/libatalk/acl/cache.c0000644000175200017500000002434411655731126014012 00000000000000/* Copyright (c) 2008,2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include "cache.h" typedef struct cacheduser { unsigned long uid; /* for future use */ uuidtype_t type; uuidp_t uuid; char *name; time_t creationtime; struct cacheduser *prev; struct cacheduser *next; } cacheduser_t; cacheduser_t *namecache[256]; /* indexed by hash of name */ cacheduser_t *uuidcache[256]; /* indexed by hash of uuid */ /******************************************************** * helper function ********************************************************/ void uuidcache_dump(void) { int i; int ret = 0; cacheduser_t *entry; char timestr[200]; struct tm *tmp = NULL; for ( i=0 ; i<256; i++) { if ((entry = namecache[i]) != NULL) { do { tmp = localtime(&entry->creationtime); if (tmp == NULL) continue; if (strftime(timestr, 200, "%c", tmp) == 0) continue; LOG(log_debug, logtype_default, "namecache{%d}: name:%s, uuid:%s, type%s: %s, cached: %s", i, entry->name, uuid_bin2string(entry->uuid), (entry->type & UUID_ENOENT) == UUID_ENOENT ? "[negative]" : "", uuidtype[entry->type & UUIDTYPESTR_MASK], timestr); } while ((entry = entry->next) != NULL); } } for ( i=0; i<256; i++) { if ((entry = uuidcache[i]) != NULL) { do { tmp = localtime(&entry->creationtime); if (tmp == NULL) continue; if (strftime(timestr, 200, "%c", tmp) == 0) continue; LOG(log_debug, logtype_default, "uuidcache{%d}: uuid:%s, name:%s, type%s: %s, cached: %s", i, uuid_bin2string(entry->uuid), entry->name, (entry->type & UUID_ENOENT) == UUID_ENOENT ? "[negative]" : "", uuidtype[entry->type & UUIDTYPESTR_MASK], timestr); } while ((entry = entry->next) != NULL); } } } /* hash string it into unsigned char */ static unsigned char hashstring(unsigned char *str) { unsigned long hash = 5381; unsigned char index; int c; while ((c = *str++) != 0) hash = ((hash << 5) + hash) ^ c; /* (hash * 33) ^ c */ index = 85 ^ (hash & 0xff); while ((hash = hash >> 8) != 0) index ^= (hash & 0xff); return index; } /* hash atalk_uuid_t into unsigned char */ static unsigned char hashuuid(uuidp_t uuid) { unsigned char index = 83; int i; for (i=0; i<16; i++) { index ^= uuid[i]; index += uuid[i]; } return index; } /******************************************************** * Interface ********************************************************/ int add_cachebyname( const char *inname, const uuidp_t inuuid, const uuidtype_t type, const unsigned long uid _U_) { int ret = 0; char *name = NULL; uuidp_t uuid = NULL; cacheduser_t *cacheduser = NULL; unsigned char hash; /* allocate mem and copy values */ name = malloc(strlen(inname)+1); if (!name) { LOG(log_error, logtype_default, "add_cachebyname: mallor error"); ret = -1; goto cleanup; } uuid = malloc(UUID_BINSIZE); if (!uuid) { LOG(log_error, logtype_default, "add_cachebyname: mallor error"); ret = -1; goto cleanup; } cacheduser = malloc(sizeof(cacheduser_t)); if (!cacheduser) { LOG(log_error, logtype_default, "add_cachebyname: mallor error"); ret = -1; goto cleanup; } strcpy(name, inname); memcpy(uuid, inuuid, UUID_BINSIZE); /* fill in the cacheduser */ cacheduser->name = name; cacheduser->uuid = uuid; cacheduser->type = type; cacheduser->creationtime = time(NULL); cacheduser->prev = NULL; cacheduser->next = NULL; /* get hash */ hash = hashstring((unsigned char *)name); /* insert cache entry into cache array at head of queue */ if (namecache[hash] == NULL) { /* this queue is empty */ namecache[hash] = cacheduser; } else { cacheduser->next = namecache[hash]; namecache[hash]->prev = cacheduser; namecache[hash] = cacheduser; } cleanup: if (ret != 0) { if (name) free(name); if (uuid) free(uuid); if (cacheduser) free(cacheduser); } return ret; } /*! * Search cache by name and uuid type * * @args name (r) name to search * @args type (rw) type (user or group) of name, returns found type here which might * mark it as a negative entry * @args uuid (w) found uuid is returned here * @returns 0 on sucess, entry found * -1 no entry found */ int search_cachebyname(const char *name, uuidtype_t *type, uuidp_t uuid) { int ret; unsigned char hash; cacheduser_t *entry; time_t tim; hash = hashstring((unsigned char *)name); if (namecache[hash] == NULL) return -1; entry = namecache[hash]; while (entry) { ret = strcmp(entry->name, name); if (ret == 0 && *type == (entry->type & UUIDTYPESTR_MASK)) { /* found, now check if expired */ tim = time(NULL); if ((tim - entry->creationtime) > CACHESECONDS) { LOG(log_debug, logtype_default, "search_cachebyname: expired: name:\"%s\"", entry->name); /* remove item */ if (entry->prev) { /* 2nd to last in queue */ entry->prev->next = entry->next; if (entry->next) /* not the last element */ entry->next->prev = entry->prev; } else { /* queue head */ if ((namecache[hash] = entry->next) != NULL) namecache[hash]->prev = NULL; } free(entry->name); free(entry->uuid); free(entry); return -1; } else { memcpy(uuid, entry->uuid, UUID_BINSIZE); *type = entry->type; return 0; } } entry = entry->next; } return -1; } /* * Caller must free allocated name */ int search_cachebyuuid( uuidp_t uuidp, char **name, uuidtype_t *type) { int ret; unsigned char hash; cacheduser_t *entry; time_t tim; hash = hashuuid(uuidp); if (! uuidcache[hash]) return -1; entry = uuidcache[hash]; while (entry) { ret = memcmp(entry->uuid, uuidp, UUID_BINSIZE); if (ret == 0) { tim = time(NULL); if ((tim - entry->creationtime) > CACHESECONDS) { LOG(log_debug, logtype_default, "search_cachebyuuid: expired: name:\'%s\' in queue {%d}", entry->name, hash); if (entry->prev) { /* 2nd to last in queue */ entry->prev->next = entry->next; if (entry->next) /* not the last element */ entry->next->prev = entry->prev; } else { /* queue head */ if ((uuidcache[hash] = entry->next) != NULL) uuidcache[hash]->prev = NULL; } free(entry->name); free(entry->uuid); free(entry); return -1; } else { *name = malloc(strlen(entry->name)+1); strcpy(*name, entry->name); *type = entry->type; return 0; } } entry = entry->next; } return -1; } int add_cachebyuuid( uuidp_t inuuid, const char *inname, uuidtype_t type, const unsigned long uid _U_) { int ret = 0; char *name = NULL; uuidp_t uuid = NULL; cacheduser_t *cacheduser = NULL; cacheduser_t *entry; unsigned char hash; /* allocate mem and copy values */ name = malloc(strlen(inname)+1); if (!name) { LOG(log_error, logtype_default, "add_cachebyuuid: mallor error"); ret = -1; goto cleanup; } uuid = malloc(UUID_BINSIZE); if (!uuid) { LOG(log_error, logtype_default, "add_cachebyuuid: mallor error"); ret = -1; goto cleanup; } cacheduser = malloc(sizeof(cacheduser_t)); if (!cacheduser) { LOG(log_error, logtype_default, "add_cachebyuuid: mallor error"); ret = -1; goto cleanup; } strcpy(name, inname); memcpy(uuid, inuuid, UUID_BINSIZE); /* fill in the cacheduser */ cacheduser->name = name; cacheduser->type = type; cacheduser->uuid = uuid; cacheduser->creationtime = time(NULL); cacheduser->prev = NULL; cacheduser->next = NULL; /* get hash */ hash = hashuuid(uuid); /* insert cache entry into cache array at head of queue */ if (uuidcache[hash] == NULL) { /* this queue is empty */ uuidcache[hash] = cacheduser; } else { cacheduser->next = uuidcache[hash]; uuidcache[hash]->prev = cacheduser; uuidcache[hash] = cacheduser; } cleanup: if (ret != 0) { if (name) free(name); if (uuid) free(uuid); if (cacheduser) free(cacheduser); } return ret; } netatalk-2.2.2/libatalk/acl/ldap_config.c0000644000175200017500000001071211655731126015206 00000000000000/* Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef HAVE_LDAP #include #include #include #include #include #include #include #include #define LINESIZE 1024 /* Parse one line. Return result in pref and val */ static int getpref(char *buf, char **R_pref, char **R_val) { char *p, *pref, *val; /* a little pre-processing to get rid of spaces and end-of-lines */ p = buf; while (p && isspace(*p)) p++; if (!p || (*p == '\0')) return -1; if ((val = strchr(p, '=')) == NULL) return -1; while ((*val == '=') || (*val == ' ')) val++; if ((val = strtok(val, " \n")) == NULL) return -1; if ((val = strdup(val)) == NULL) return -1; if ((pref = strtok(p, " =")) == NULL) return -1; *R_pref = pref; *R_val = val; return 0; } /* Parse the afp_ldap.conf file */ int acl_ldap_readconfig(char *name) { int i, j; FILE *f; char buf[LINESIZE]; char *pref, *val; f = fopen(name,"r"); if (!f) { perror("fopen"); return -1; } while (!feof(f)) { /* read a line from file */ if (!fgets(buf, LINESIZE, f) || buf[0] == '#') continue; /* parse and return pref and value */ if ((getpref(buf, &pref, &val)) != 0) continue; i = 0; /* now see if its a correct pref */ while(ldap_prefs[i].pref != NULL) { if ((strcmp(ldap_prefs[i].name, pref)) == 0) { /* ok, found a valid pref */ /* check if we have pre-defined values */ if (0 == ldap_prefs[i].intfromarray) { /* no, its just a string */ ldap_prefs[i].valid = 0; if (0 == ldap_prefs[i].strorint) /* store string as string */ *((char **)(ldap_prefs[i].pref)) = val; else /* store as int */ *((int *)(ldap_prefs[i].pref)) = atoi(val); } else { /* ok, we have string to int mapping for this pref eg. "none", "simple", "sasl" map to 0, 128, 129 */ j = 0; while(prefs_array[j].pref != NULL) { if (((strcmp(prefs_array[j].pref, pref)) == 0) && ((strcmp(prefs_array[j].valuestring, val)) == 0)) { ldap_prefs[i].valid = 0; *((int *)(ldap_prefs[i].pref)) = prefs_array[j].value; } j++; } /* while j*/ } /* if else 0 == ldap_prefs*/ break; } /* if strcmp */ i++; } /* while i */ if (ldap_prefs[i].pref == NULL) LOG(log_error, logtype_afpd,"afp_ldap.conf: Unknown option: \"%s\"", pref); } /* EOF */ /* check if the config is sane and complete */ i = 0; ldap_config_valid = 1; while(ldap_prefs[i].pref != NULL) { if ( ldap_prefs[i].valid != 0) { LOG(log_debug, logtype_afpd,"afp_ldap.conf: Missing option: \"%s\"", ldap_prefs[i].name); ldap_config_valid = 0; break; } i++; } if (ldap_config_valid) { if (ldap_auth_method == LDAP_AUTH_NONE) LOG(log_debug, logtype_afpd,"afp_ldap.conf: Using anonymous bind."); else if (ldap_auth_method == LDAP_AUTH_SIMPLE) LOG(log_debug, logtype_afpd,"afp_ldap.conf: Using simple bind."); else { ldap_config_valid = 0; LOG(log_error, logtype_afpd,"afp_ldap.conf: SASL not yet supported."); } } else LOG(log_info, logtype_afpd,"afp_ldap.conf: not used"); fclose(f); return 0; } #endif /* HAVE_LDAP */ netatalk-2.2.2/libatalk/acl/ldap.c0000644000175200017500000002643111655731126013666 00000000000000/* Copyright (c) 2008,2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef HAVE_LDAP #include #include #include #include #include #define LDAP_DEPRECATED 1 #include #include #include #include #include /* For struct ldap_pref */ typedef enum { KEEPALIVE = 1 } ldapcon_t; /******************************************************** * LDAP config stuff. Filled by libatalk/acl/ldap_config.c ********************************************************/ int ldap_config_valid; char *ldap_server; int ldap_auth_method; char *ldap_auth_dn; char *ldap_auth_pw; char *ldap_userbase; int ldap_userscope; char *ldap_groupbase; int ldap_groupscope; char *ldap_uuid_attr; char *ldap_name_attr; char *ldap_group_attr; char *ldap_uid_attr; struct ldap_pref ldap_prefs[] = { {&ldap_server, "ldap_server", 0, 0, -1}, {&ldap_auth_method,"ldap_auth_method", 1, 1, -1}, {&ldap_auth_dn, "ldap_auth_dn", 0, 0, 0}, {&ldap_auth_pw, "ldap_auth_pw", 0, 0, 0}, {&ldap_userbase, "ldap_userbase", 0, 0, -1}, {&ldap_userscope, "ldap_userscope", 1 ,1, -1}, {&ldap_groupbase, "ldap_groupbase", 0, 0, -1}, {&ldap_groupscope, "ldap_groupscope", 1 ,1, -1}, {&ldap_uuid_attr, "ldap_uuid_attr", 0, 0, -1}, {&ldap_name_attr, "ldap_name_attr", 0, 0, -1}, {&ldap_group_attr, "ldap_group_attr", 0, 0, -1}, {&ldap_uid_attr, "ldap_uid_attr", 0, 0, 0}, {NULL, NULL, 0, 0, -1} }; struct pref_array prefs_array[] = { {"ldap_auth_method", "none", LDAP_AUTH_NONE}, {"ldap_auth_method", "simple", LDAP_AUTH_SIMPLE}, {"ldap_auth_method", "sasl", LDAP_AUTH_SASL}, {"ldap_userscope", "base", LDAP_SCOPE_BASE}, {"ldap_userscope", "one", LDAP_SCOPE_ONELEVEL}, {"ldap_userscope", "sub", LDAP_SCOPE_SUBTREE}, {"ldap_groupscope", "base", LDAP_SCOPE_BASE}, {"ldap_groupscope", "one", LDAP_SCOPE_ONELEVEL}, {"ldap_groupscope", "sub", LDAP_SCOPE_SUBTREE}, {NULL, NULL, 0} }; /******************************************************** * Static helper function ********************************************************/ /* * ldap_getattr_fromfilter_withbase_scope(): * conflags: KEEPALIVE * scope: LDAP_SCOPE_BASE, LDAP_SCOPE_ONELEVEL, LDAP_SCOPE_SUBTREE * result: return unique search result here, allocated here, caller must free * * returns: -1 on error * 0 nothing found * 1 successfull search, result int 'result' * * All connection managment to the LDAP server is done here. Just set KEEPALIVE if you know * you will be dispatching more than one search in a row, then don't set it with the last search. * You MUST dispatch the queries timely, otherwise the LDAP handle might timeout. */ static int ldap_getattr_fromfilter_withbase_scope( const char *searchbase, const char *filter, char *attributes[], int scope, ldapcon_t conflags, char **result) { int ret; int ldaperr; int retrycount = 0; int desired_version = LDAP_VERSION3; static int ldapconnected = 0; static LDAP *ld = NULL; LDAPMessage* msg = NULL; LDAPMessage* entry = NULL; char **attribute_values = NULL; struct timeval timeout; LOG(log_maxdebug, logtype_afpd,"ldap: BEGIN"); timeout.tv_sec = 3; timeout.tv_usec = 0; /* init LDAP if necessary */ retry: ret = 0; if (ld == NULL) { LOG(log_maxdebug, logtype_default, "ldap: server: \"%s\"", ldap_server); if ((ld = ldap_init(ldap_server, LDAP_PORT)) == NULL ) { LOG(log_error, logtype_default, "ldap: ldap_init error: %s", strerror(errno)); return -1; } if (ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &desired_version) != 0) { /* LDAP_OPT_SUCCESS is not in the proposed standard, so we check for 0 http://tools.ietf.org/id/draft-ietf-ldapext-ldap-c-api-05.txt */ LOG(log_error, logtype_default, "ldap: ldap_set_option failed!"); free(ld); ld = NULL; return -1; } } /* connect */ if (!ldapconnected) { if (LDAP_AUTH_NONE == ldap_auth_method) { if (ldap_bind_s(ld, "", "", LDAP_AUTH_SIMPLE) != LDAP_SUCCESS ) { LOG(log_error, logtype_default, "ldap: ldap_bind failed, auth_method: \'%d\'", ldap_auth_method); free(ld); ld = NULL; return -1; } ldapconnected = 1; } else if (LDAP_AUTH_SIMPLE == ldap_auth_method) { if (ldap_bind_s(ld, ldap_auth_dn, ldap_auth_pw, ldap_auth_method) != LDAP_SUCCESS ) { LOG(log_error, logtype_default, "ldap: ldap_bind failed: ldap_auth_dn: \'%s\', ldap_auth_pw: \'%s\', ldap_auth_method: \'%d\'", ldap_auth_dn, ldap_auth_pw, ldap_auth_method); free(ld); ld = NULL; return -1; } ldapconnected = 1; } } LOG(log_maxdebug, logtype_afpd, "ldap: start search: base: %s, filter: %s, attr: %s", searchbase, filter, attributes[0]); /* start LDAP search */ ldaperr = ldap_search_st(ld, searchbase, scope, filter, attributes, 0, &timeout, &msg); LOG(log_maxdebug, logtype_default, "ldap: ldap_search_st returned: %s", ldap_err2string(ldaperr)); if (ldaperr != LDAP_SUCCESS) { LOG(log_error, logtype_default, "ldap: ldap_search_st failed: %s, retrycount: %i", ldap_err2string(ldaperr), retrycount); ret = -1; goto cleanup; } /* parse search result */ LOG(log_maxdebug, logtype_default, "ldap: got %d entries from ldap search", ldap_count_entries(ld, msg)); if ((ret = ldap_count_entries(ld, msg)) != 1) { ret = 0; goto cleanup; } entry = ldap_first_entry(ld, msg); if (entry == NULL) { LOG(log_error, logtype_default, "ldap: ldap_first_entry error"); ret = -1; goto cleanup; } attribute_values = ldap_get_values(ld, entry, attributes[0]); if (attribute_values == NULL) { LOG(log_error, logtype_default, "ldap: ldap_get_values error"); ret = -1; goto cleanup; } LOG(log_maxdebug, logtype_afpd,"ldap: search result: %s: %s", attributes[0], attribute_values[0]); /* allocate result */ *result = strdup(attribute_values[0]); if (*result == NULL) { LOG(log_error, logtype_default, "ldap: strdup error: %s",strerror(errno)); ret = -1; goto cleanup; } cleanup: if (attribute_values) ldap_value_free(attribute_values); /* FIXME: is there another way to free entry ? */ while (entry != NULL) entry = ldap_next_entry(ld, entry); if (msg) ldap_msgfree(msg); if (ldapconnected) { if ((ret == -1) || !(conflags & KEEPALIVE)) { LOG(log_maxdebug, logtype_default,"ldap: unbind"); if (ldap_unbind_s(ld) != 0) { LOG(log_error, logtype_default, "ldap: unbind: %s\n", ldap_err2string(ldaperr)); return -1; } ld = NULL; ldapconnected = 0; /* In case of error we try twice */ if (ret == -1) { retrycount++; if (retrycount < 2) goto retry; } } } return ret; } /******************************************************** * Interface ********************************************************/ /*! * Search UUID for name in LDAP * * Caller must free uuid_string when done with it * * @param name (r) name to search * @param type (r) type of USER or GROUP * @param uuid_string (w) result as pointer to allocated UUID-string * * @returns 0 on success, -1 on error or not found */ int ldap_getuuidfromname( const char *name, uuidtype_t type, char **uuid_string) { int ret; int len; char filter[256]; /* this should really be enough. we dont want to malloc everything! */ char *attributes[] = { ldap_uuid_attr, NULL}; char *ldap_attr; if (!ldap_config_valid) return -1; /* make filter */ if (type == UUID_GROUP) ldap_attr = ldap_group_attr; else /* type hopefully == UUID_USER */ ldap_attr = ldap_name_attr; len = snprintf( filter, 256, "%s=%s", ldap_attr, name); if (len >= 256 || len == -1) { LOG(log_error, logtype_default, "ldap_getnamefromuuid: filter error:%d, \"%s\"", len, filter); return -1; } if (type == UUID_GROUP) { ret = ldap_getattr_fromfilter_withbase_scope( ldap_groupbase, filter, attributes, ldap_groupscope, KEEPALIVE, uuid_string); } else { /* type hopefully == UUID_USER */ ret = ldap_getattr_fromfilter_withbase_scope( ldap_userbase, filter, attributes, ldap_userscope, KEEPALIVE, uuid_string); } if (ret != 1) return -1; return 0; } /* * LDAP search wrapper * returns allocated storage in name, caller must free it * returns 0 on success, -1 on error or not found * * @param uuidstr (r) uuid to search as ascii string * @param name (w) return pointer to name as allocated string * @param type (w) return type: USER or GROUP * * returns 0 on success, -1 on errror */ int ldap_getnamefromuuid( const char *uuidstr, char **name, uuidtype_t *type) { int ret; int len; char filter[256]; /* this should really be enough. we dont want to malloc everything! */ char *attributes[] = { NULL, NULL}; if (!ldap_config_valid) return -1; /* make filter */ len = snprintf( filter, 256, "%s=%s", ldap_uuid_attr, uuidstr); if (len >= 256 || len == -1) { LOG(log_error, logtype_default, "ldap_getnamefromuuid: filter overflow:%d, \"%s\"", len, filter); return -1; } /* search groups first. group acls are probably used more often */ attributes[0] = ldap_group_attr; ret = ldap_getattr_fromfilter_withbase_scope( ldap_groupbase, filter, attributes, ldap_groupscope, KEEPALIVE, name); if (ret == -1) return -1; if (ret == 1) { *type = UUID_GROUP; return 0; } attributes[0] = ldap_name_attr; ret = ldap_getattr_fromfilter_withbase_scope( ldap_userbase, filter, attributes, ldap_userscope, KEEPALIVE, name); if (ret == 1) { *type = UUID_USER; return 0; } return -1; } #endif /* HAVE_LDAP */ netatalk-2.2.2/libatalk/cnid/0000777000175200017500000000000011704770417013037 500000000000000netatalk-2.2.2/libatalk/cnid/Makefile.am0000644000175200017500000000063511655731127015013 00000000000000# Makefile.am for libatalk/cnid/ SUBDIRS = last cdb dbd tdb noinst_LTLIBRARIES = libcnid.la LIBCNID_DEPS = dbd/libcnid_dbd.la if USE_CDB_BACKEND LIBCNID_DEPS += cdb/libcnid_cdb.la endif if USE_LAST_BACKEND LIBCNID_DEPS += last/libcnid_last.la endif if USE_TDB_BACKEND LIBCNID_DEPS += tdb/libcnid_tdb.la endif libcnid_la_SOURCES = cnid.c cnid_init.c libcnid_la_LIBADD = $(LIBCNID_DEPS) EXTRA_DIST = README netatalk-2.2.2/libatalk/cnid/Makefile.in0000644000175200017500000004751311703521727015027 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/cnid/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @USE_CDB_BACKEND_TRUE@am__append_1 = cdb/libcnid_cdb.la @USE_LAST_BACKEND_TRUE@am__append_2 = last/libcnid_last.la @USE_TDB_BACKEND_TRUE@am__append_3 = tdb/libcnid_tdb.la subdir = libatalk/cnid DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcnid_la_DEPENDENCIES = $(LIBCNID_DEPS) am_libcnid_la_OBJECTS = cnid.lo cnid_init.lo libcnid_la_OBJECTS = $(am_libcnid_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcnid_la_SOURCES) DIST_SOURCES = $(libcnid_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = last cdb dbd tdb noinst_LTLIBRARIES = libcnid.la LIBCNID_DEPS = dbd/libcnid_dbd.la $(am__append_1) $(am__append_2) \ $(am__append_3) libcnid_la_SOURCES = cnid.c cnid_init.c libcnid_la_LIBADD = $(LIBCNID_DEPS) EXTRA_DIST = README all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/cnid/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/cnid/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libcnid.la: $(libcnid_la_OBJECTS) $(libcnid_la_DEPENDENCIES) $(LINK) $(libcnid_la_OBJECTS) $(libcnid_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnid_init.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/cnid/cnid.c0000644000175200017500000002166411655757757014066 00000000000000/* * Copyright (c) 2003 the Netatalk Team * Copyright (c) 2003 Rafal Lewczuk * * This program is free software; you can redistribute and/or modify * it under the terms of the GNU General Public License as published * by the Free Software Foundation version 2 of the License or later * version if explicitly stated by any of above copyright holders. * */ #define USE_LIST #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* List of all registered modules. */ static struct list_head modules = ATALK_LIST_HEAD_INIT(modules); static sigset_t sigblockset; static const struct itimerval none = {{0, 0}, {0, 0}}; /* Registers new CNID backend module. */ /* Once module has been registered, it cannot be unregistered. */ void cnid_register(struct _cnid_module *module) { struct list_head *ptr; /* Check if our module is already registered. */ list_for_each(ptr, &modules) if (0 == strcmp(list_entry(ptr, cnid_module, db_list)->name, module->name)) { LOG(log_error, logtype_afpd, "Module with name [%s] is already registered !", module->name); return; } LOG(log_info, logtype_afpd, "Registering CNID module [%s]", module->name); ptr = &(module->db_list); list_add_tail(ptr, &modules); } /* --------------- */ static int cnid_dir(const char *dir, mode_t mask) { struct stat st, st1; char tmp[MAXPATHLEN]; if (stat(dir, &st) < 0) { if (errno != ENOENT) return -1; if (ad_stat( dir, &st) < 0) return -1; LOG(log_info, logtype_cnid, "Setting uid/gid to %d/%d", st.st_uid, st.st_gid); if (setegid(st.st_gid) < 0 || seteuid(st.st_uid) < 0) { LOG(log_error, logtype_cnid, "uid/gid: %s", strerror(errno)); return -1; } if (mkdir(dir, 0777 & ~mask) < 0) return -1; } else { strlcpy(tmp, dir, sizeof(tmp)); strlcat(tmp, "/.AppleDB", sizeof(tmp)); if (stat(tmp, &st1) < 0) /* use .AppleDB owner, if folder already exists */ st1 = st; LOG(log_info, logtype_cnid, "Setting uid/gid to %d/%d", st1.st_uid, st1.st_gid); if (setegid(st1.st_gid) < 0 || seteuid(st1.st_uid) < 0) { LOG(log_error, logtype_cnid, "uid/gid: %s", strerror(errno)); return -1; } } return 0; } /* Opens CNID database using particular back-end */ struct _cnid_db *cnid_open(const char *volpath, mode_t mask, char *type, int flags, const char *cnidsrv, const char *cnidport) { struct _cnid_db *db; cnid_module *mod = NULL; struct list_head *ptr; uid_t uid = -1; gid_t gid = -1; list_for_each(ptr, &modules) { if (0 == strcmp(list_entry(ptr, cnid_module, db_list)->name, type)) { mod = list_entry(ptr, cnid_module, db_list); break; } } if (NULL == mod) { LOG(log_error, logtype_afpd, "Cannot find module named [%s] in registered module list!", type); return NULL; } if ((mod->flags & CNID_FLAG_SETUID) && !(flags & CNID_FLAG_MEMORY)) { uid = geteuid(); gid = getegid(); if (seteuid(0)) { LOG(log_error, logtype_afpd, "seteuid failed %s", strerror(errno)); return NULL; } if (cnid_dir(volpath, mask) < 0) { if ( setegid(gid) < 0 || seteuid(uid) < 0) { LOG(log_error, logtype_afpd, "can't seteuid back %s", strerror(errno)); exit(EXITERR_SYS); } return NULL; } } struct cnid_open_args args = {volpath, mask, flags, cnidsrv, cnidport}; db = mod->cnid_open(&args); if ((mod->flags & CNID_FLAG_SETUID) && !(flags & CNID_FLAG_MEMORY)) { seteuid(0); if ( setegid(gid) < 0 || seteuid(uid) < 0) { LOG(log_error, logtype_afpd, "can't seteuid back %s", strerror(errno)); exit(EXITERR_SYS); } } if (NULL == db) { LOG(log_error, logtype_afpd, "Cannot open CNID db at [%s].", volpath); return NULL; } /* FIXME should module know about it ? */ if ((flags & CNID_FLAG_NODEV)) { db->flags |= CNID_FLAG_NODEV; } db->flags |= mod->flags; if ((db->flags & CNID_FLAG_BLOCK)) { sigemptyset(&sigblockset); sigaddset(&sigblockset, SIGTERM); sigaddset(&sigblockset, SIGHUP); sigaddset(&sigblockset, SIGUSR1); sigaddset(&sigblockset, SIGUSR2); sigaddset(&sigblockset, SIGALRM); } return db; } /* ------------------- */ static void block_signal( u_int32_t flags) { if ((flags & CNID_FLAG_BLOCK)) { pthread_sigmask(SIG_BLOCK, &sigblockset, NULL); } } /* ------------------- */ static void unblock_signal(u_int32_t flags) { if ((flags & CNID_FLAG_BLOCK)) { pthread_sigmask(SIG_UNBLOCK, &sigblockset, NULL); } } /* ------------------- protect against bogus value from the DB. adddir really doesn't like 2 */ static cnid_t valide(cnid_t id) { if (id == CNID_INVALID) return id; if (id < CNID_START) { static int err = 0; if (!err) { err = 1; LOG(log_error, logtype_afpd, "Error: Invalid cnid, corrupted DB?"); } return CNID_INVALID; } return id; } /* Closes CNID database. Currently it's just a wrapper around db->cnid_close(). */ void cnid_close(struct _cnid_db *db) { u_int32_t flags; if (NULL == db) { LOG(log_error, logtype_afpd, "Error: cnid_close called with NULL argument !"); return; } /* cnid_close free db */ flags = db->flags; block_signal(flags); db->cnid_close(db); unblock_signal(flags); } /* --------------- */ cnid_t cnid_add(struct _cnid_db *cdb, const struct stat *st, const cnid_t did, const char *name, const size_t len, cnid_t hint) { cnid_t ret; if (len == 0) return CNID_INVALID; block_signal(cdb->flags); ret = valide(cdb->cnid_add(cdb, st, did, name, len, hint)); unblock_signal(cdb->flags); return ret; } /* --------------- */ int cnid_delete(struct _cnid_db *cdb, cnid_t id) { int ret; block_signal(cdb->flags); ret = cdb->cnid_delete(cdb, id); unblock_signal(cdb->flags); return ret; } /* --------------- */ cnid_t cnid_get(struct _cnid_db *cdb, const cnid_t did, char *name,const size_t len) { cnid_t ret; block_signal(cdb->flags); ret = valide(cdb->cnid_get(cdb, did, name, len)); unblock_signal(cdb->flags); return ret; } /* --------------- */ int cnid_getstamp(struct _cnid_db *cdb, void *buffer, const size_t len) { cnid_t ret; time_t t; if (!cdb->cnid_getstamp) { memset(buffer, 0, len); /* return the current time. it will invalide cache */ if (len < sizeof(time_t)) return -1; t = time(NULL); memcpy(buffer, &t, sizeof(time_t)); return 0; } block_signal(cdb->flags); ret = cdb->cnid_getstamp(cdb, buffer, len); unblock_signal(cdb->flags); return ret; } /* --------------- */ cnid_t cnid_lookup(struct _cnid_db *cdb, const struct stat *st, const cnid_t did, char *name, const size_t len) { cnid_t ret; block_signal(cdb->flags); ret = valide(cdb->cnid_lookup(cdb, st, did, name, len)); unblock_signal(cdb->flags); return ret; } /* --------------- */ int cnid_find(struct _cnid_db *cdb, const char *name, size_t namelen, void *buffer, size_t buflen) { int ret; if (cdb->cnid_find == NULL) { LOG(log_error, logtype_cnid, "cnid_find not supported by CNID backend"); return -1; } block_signal(cdb->flags); ret = cdb->cnid_find(cdb, name, namelen, buffer, buflen); unblock_signal(cdb->flags); return ret; } /* --------------- */ char *cnid_resolve(struct _cnid_db *cdb, cnid_t *id, void *buffer, size_t len) { char *ret; block_signal(cdb->flags); ret = cdb->cnid_resolve(cdb, id, buffer, len); unblock_signal(cdb->flags); if (ret && !strcmp(ret, "..")) { LOG(log_error, logtype_afpd, "cnid_resolve: name is '..', corrupted db? "); ret = NULL; } return ret; } /* --------------- */ int cnid_update (struct _cnid_db *cdb, const cnid_t id, const struct stat *st, const cnid_t did, char *name, const size_t len) { int ret; block_signal(cdb->flags); ret = cdb->cnid_update(cdb, id, st, did, name, len); unblock_signal(cdb->flags); return ret; } /* --------------- */ cnid_t cnid_rebuild_add(struct _cnid_db *cdb, const struct stat *st, const cnid_t did, char *name, const size_t len, cnid_t hint) { cnid_t ret; block_signal(cdb->flags); ret = cdb->cnid_rebuild_add(cdb, st, did, name, len, hint); unblock_signal(cdb->flags); return ret; } netatalk-2.2.2/libatalk/cnid/dbd/0000777000175200017500000000000011704770417013570 500000000000000netatalk-2.2.2/libatalk/cnid/dbd/cnid_dbd.h0000644000175200017500000000320211655731127015400 00000000000000/* * Copyright (C) Joerg Lenneis 2003 * Copyright (C) Frank Lahm 2010 * All Rights Reserved. See COPYING. */ #ifndef _ATALK_CNID_DBD__H #define _ATALK_CNID_DBD__H 1 #include #include #include #include #include #include extern struct _cnid_module cnid_dbd_module; extern struct _cnid_db *cnid_dbd_open (struct cnid_open_args *args); extern void cnid_dbd_close (struct _cnid_db *); extern cnid_t cnid_dbd_add (struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t, cnid_t); extern cnid_t cnid_dbd_get (struct _cnid_db *, const cnid_t, char *, const size_t); extern char *cnid_dbd_resolve (struct _cnid_db *, cnid_t *, void *, size_t ); extern int cnid_dbd_getstamp (struct _cnid_db *, void *, const size_t ); extern cnid_t cnid_dbd_lookup (struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t); extern int cnid_dbd_find (struct _cnid_db *cdb, char *name, size_t namelen, void *buffer, size_t buflen); extern int cnid_dbd_update (struct _cnid_db *, const cnid_t, const struct stat *, const cnid_t, char *, size_t); extern int cnid_dbd_delete (struct _cnid_db *, const cnid_t); extern cnid_t cnid_dbd_rebuild_add(struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t, cnid_t); /* FIXME: These functions could be static in cnid_dbd.c */ #endif /* include/atalk/cnid_dbd.h */ netatalk-2.2.2/libatalk/cnid/dbd/cnid_dbd.c0000644000175200017500000006637111655731127015413 00000000000000/* * Copyright (C) Joerg Lenneis 2003 * Copyright (C) Frank Lahm 2010 * All Rights Reserved. See COPYING. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef CNID_BACKEND_DBD #include #ifdef HAVE_SYS_STAT_H #include #endif /* HAVE_SYS_STAT_H */ #ifdef HAVE_SYS_UIO_H #include #endif /* HAVE_SYS_UIO_H */ #ifdef HAVE_STRINGS_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "cnid_dbd.h" #ifndef SOL_TCP #define SOL_TCP IPPROTO_TCP #endif /* ! SOL_TCP */ /* Wait MAX_DELAY seconds before a request to the CNID server times out */ #define MAX_DELAY 20 #define ONE_DELAY 5 static void RQST_RESET(struct cnid_dbd_rqst *r) { memset(r, 0, sizeof(struct cnid_dbd_rqst )); } static void delay(int sec) { struct timeval tv; tv.tv_usec = 0; tv.tv_sec = sec; select(0, NULL, NULL, NULL, &tv); } static int tsock_getfd(const char *host, const char *port) { int sock = -1; int attr; int err; struct addrinfo hints, *servinfo, *p; int optval; socklen_t optlen = sizeof(optval); /* Prepare hint for getaddrinfo */ memset(&hints, 0, sizeof hints); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_NUMERICSERV; if ((err = getaddrinfo(host, port, &hints, &servinfo)) != 0) { LOG(log_error, logtype_default, "tsock_getfd: getaddrinfo: CNID server %s:%s : %s\n", host, port, gai_strerror(err)); return -1; } /* loop through all the results and bind to the first we can */ for (p = servinfo; p != NULL; p = p->ai_next) { if ((sock = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) { LOG(log_info, logtype_default, "tsock_getfd: socket CNID server %s:: %s", host, strerror(errno)); continue; } attr = 1; if (setsockopt(sock, SOL_TCP, TCP_NODELAY, &attr, sizeof(attr)) == -1) { LOG(log_error, logtype_cnid, "getfd: set TCP_NODELAY CNID server %s: %s", host, strerror(errno)); close(sock); sock = -1; return -1; } if (setnonblock(sock, 1) != 0) { LOG(log_error, logtype_cnid, "getfd: setnonblock: %s", strerror(errno)); close(sock); sock = -1; return -1; } if (connect(sock, p->ai_addr, p->ai_addrlen) == -1) { if (errno == EINPROGRESS) { struct timeval tv; tv.tv_usec = 0; tv.tv_sec = 5; /* give it five seconds ... */ fd_set wfds; FD_ZERO(&wfds); FD_SET(sock, &wfds); if ((err = select(sock + 1, NULL, &wfds, NULL, &tv)) == 0) { /* timeout */ LOG(log_error, logtype_cnid, "getfd: select timed out for CNID server %s", host); close(sock); sock = -1; continue; } if (err == -1) { /* select failed */ LOG(log_error, logtype_cnid, "getfd: select failed for CNID server %s", host); close(sock); sock = -1; continue; } if ( ! FD_ISSET(sock, &wfds)) { /* give up */ LOG(log_error, logtype_cnid, "getfd: socket not ready connecting to %s", host); close(sock); sock = -1; continue; } if ((err = getsockopt(sock, SOL_SOCKET, SO_ERROR, &optval, &optlen)) != 0 || optval != 0) { if (err != 0) { /* somethings very wrong */ LOG(log_error, logtype_cnid, "getfd: getsockopt error with CNID server %s: %s", host, strerror(errno)); } else { errno = optval; LOG(log_error, logtype_cnid, "getfd: getsockopt says: %s", strerror(errno)); } close(sock); sock = -1; continue; } } else { LOG(log_error, logtype_cnid, "getfd: connect CNID server %s: %s", host, strerror(errno)); close(sock); sock = -1; continue; } } /* We've got a socket */ break; } freeaddrinfo(servinfo); if (p == NULL) { errno = optval; LOG(log_error, logtype_cnid, "tsock_getfd: no suitable network config from CNID server (%s:%s): %s", host, port, strerror(errno)); return -1; } return(sock); } /*! * Write "towrite" bytes using writev on non-blocking fd * * Every short write is considered an error, transmit can handle that. * * @param fd (r) socket fd which must be non-blocking * @param iov (r) iovec for writev * @param towrite (r) number of bytes in all iovec elements * @param vecs (r) number of iovecs in array * * @returns "towrite" bytes written or -1 on error */ static int write_vec(int fd, struct iovec *iov, ssize_t towrite, int vecs) { ssize_t len; int slept = 0; int sleepsecs; while (1) { if (((len = writev(fd, iov, vecs)) == -1 && errno == EINTR)) continue; if ((! slept) && len == -1 && errno == EAGAIN) { sleepsecs = 2; while ((sleepsecs = sleep(sleepsecs))); slept = 1; continue; } if (len == towrite) /* wrote everything out */ break; if (len == -1) LOG(log_error, logtype_cnid, "write_vec: %s", strerror(errno)); else LOG(log_error, logtype_cnid, "write_vec: short write: %d", len); return len; } LOG(log_maxdebug, logtype_cnid, "write_vec: wrote %d bytes", len); return len; } /* --------------------- */ static int init_tsock(CNID_private *db) { int fd; int len; struct iovec iov[2]; LOG(log_debug, logtype_cnid, "init_tsock: BEGIN. Opening volume '%s', CNID Server: %s/%s", db->db_dir, db->cnidserver, db->cnidport); if ((fd = tsock_getfd(db->cnidserver, db->cnidport)) < 0) return -1; len = strlen(db->db_dir); iov[0].iov_base = &len; iov[0].iov_len = sizeof(int); iov[1].iov_base = db->db_dir; iov[1].iov_len = len; if (write_vec(fd, iov, len + sizeof(int), 2) != len + sizeof(int)) { LOG(log_error, logtype_cnid, "init_tsock: Error/short write: %s", strerror(errno)); close(fd); return -1; } LOG(log_debug, logtype_cnid, "init_tsock: ok"); return fd; } /* --------------------- */ static int send_packet(CNID_private *db, struct cnid_dbd_rqst *rqst) { struct iovec iov[2]; size_t towrite; int vecs; iov[0].iov_base = rqst; iov[0].iov_len = sizeof(struct cnid_dbd_rqst); towrite = sizeof(struct cnid_dbd_rqst); vecs = 1; if (rqst->namelen) { iov[1].iov_base = rqst->name; iov[1].iov_len = rqst->namelen; towrite += rqst->namelen; vecs++; } if (write_vec(db->fd, iov, towrite, vecs) != towrite) { LOG(log_warning, logtype_cnid, "send_packet: Error writev rqst (db_dir %s): %s", db->db_dir, strerror(errno)); return -1; } LOG(log_maxdebug, logtype_cnid, "send_packet: {done}"); return 0; } /* ------------------- */ static void dbd_initstamp(struct cnid_dbd_rqst *rqst) { RQST_RESET(rqst); rqst->op = CNID_DBD_OP_GETSTAMP; } /* ------------------- */ static int dbd_reply_stamp(struct cnid_dbd_rply *rply) { switch (rply->result) { case CNID_DBD_RES_OK: break; case CNID_DBD_RES_NOTFOUND: return -1; case CNID_DBD_RES_ERR_DB: default: errno = CNID_ERR_DB; return -1; } return 0; } /* --------------------- * send a request and get reply * assume send is non blocking * if no answer after sometime (at least MAX_DELAY secondes) return an error */ static int dbd_rpc(CNID_private *db, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply) { ssize_t ret; char *nametmp; size_t len; if (send_packet(db, rqst) < 0) { return -1; } len = rply->namelen; nametmp = rply->name; ret = readt(db->fd, rply, sizeof(struct cnid_dbd_rply), 0, ONE_DELAY); if (ret != sizeof(struct cnid_dbd_rply)) { LOG(log_debug, logtype_cnid, "dbd_rpc: Error reading header from fd (db_dir %s): %s", db->db_dir, ret == -1 ? strerror(errno) : "closed"); rply->name = nametmp; return -1; } rply->name = nametmp; if (rply->namelen && rply->namelen > len) { LOG(log_error, logtype_cnid, "dbd_rpc: Error reading name (db_dir %s): %s name too long: %d. only wanted %d, garbage?", db->db_dir, rply->name, rply->namelen, len); return -1; } if (rply->namelen && (ret = readt(db->fd, rply->name, rply->namelen, 0, ONE_DELAY)) != (ssize_t)rply->namelen) { LOG(log_error, logtype_cnid, "dbd_rpc: Error reading name from fd (db_dir %s): %s", db->db_dir, ret == -1?strerror(errno):"closed"); return -1; } LOG(log_maxdebug, logtype_cnid, "dbd_rpc: {done}"); return 0; } /* -------------------- */ static int transmit(CNID_private *db, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply) { time_t orig, t; int clean = 1; /* no errors so far - to prevent sleep on first try */ if (db->changed) { /* volume and db don't have the same timestamp */ return -1; } while (1) { if (db->fd == -1) { struct cnid_dbd_rqst rqst_stamp; struct cnid_dbd_rply rply_stamp; char stamp[ADEDLEN_PRIVSYN]; LOG(log_maxdebug, logtype_cnid, "transmit: connecting to cnid_dbd ..."); if ((db->fd = init_tsock(db)) < 0) { goto transmit_fail; } dbd_initstamp(&rqst_stamp); memset(stamp, 0, ADEDLEN_PRIVSYN); rply_stamp.name = stamp; rply_stamp.namelen = ADEDLEN_PRIVSYN; if (dbd_rpc(db, &rqst_stamp, &rply_stamp) < 0) goto transmit_fail; if (dbd_reply_stamp(&rply_stamp ) < 0) goto transmit_fail; if (db->notfirst) { LOG(log_debug7, logtype_cnid, "transmit: reconnected to cnid_dbd, comparing database stamps..."); if (memcmp(stamp, db->stamp, ADEDLEN_PRIVSYN)) { LOG(log_error, logtype_cnid, "transmit: ... not the same db!"); db->changed = 1; return -1; } LOG(log_debug7, logtype_cnid, "transmit: ... OK."); } else { /* db->notfirst == 0 */ db->notfirst = 1; if (db->client_stamp) memcpy(db->client_stamp, stamp, ADEDLEN_PRIVSYN); memcpy(db->stamp, stamp, ADEDLEN_PRIVSYN); } LOG(log_debug, logtype_cnid, "transmit: attached to '%s', stamp: '%08lx'.", db->db_dir, *(uint64_t *)stamp); } if (!dbd_rpc(db, rqst, rply)) { LOG(log_maxdebug, logtype_cnid, "transmit: {done}"); return 0; } transmit_fail: if (db->fd != -1) { close(db->fd); db->fd = -1; /* FD not valid... will need to reconnect */ } if (errno == ECONNREFUSED) { /* errno carefully injected in tsock_getfd */ /* give up */ LOG(log_error, logtype_cnid, "transmit: connection refused (db_dir %s)", db->db_dir); return -1; } if (!clean) { /* don't sleep if just got disconnected by cnid server */ time(&t); if (t - orig > MAX_DELAY) { LOG(log_error, logtype_cnid, "transmit: Request to dbd daemon (db_dir %s) timed out.", db->db_dir); return -1; } /* sleep a little before retry */ delay(1); } else { clean = 0; /* false... next time sleep */ time(&orig); } } return -1; } /* ---------------------- */ static struct _cnid_db *cnid_dbd_new(const char *volpath) { struct _cnid_db *cdb; if ((cdb = (struct _cnid_db *)calloc(1, sizeof(struct _cnid_db))) == NULL) return NULL; if ((cdb->volpath = strdup(volpath)) == NULL) { free(cdb); return NULL; } cdb->flags = CNID_FLAG_PERSISTENT | CNID_FLAG_LAZY_INIT; cdb->cnid_add = cnid_dbd_add; cdb->cnid_delete = cnid_dbd_delete; cdb->cnid_get = cnid_dbd_get; cdb->cnid_lookup = cnid_dbd_lookup; cdb->cnid_find = cnid_dbd_find; cdb->cnid_nextid = NULL; cdb->cnid_resolve = cnid_dbd_resolve; cdb->cnid_getstamp = cnid_dbd_getstamp; cdb->cnid_update = cnid_dbd_update; cdb->cnid_rebuild_add = cnid_dbd_rebuild_add; cdb->cnid_close = cnid_dbd_close; return cdb; } /* ---------------------- */ struct _cnid_db *cnid_dbd_open(struct cnid_open_args *args) { CNID_private *db = NULL; struct _cnid_db *cdb = NULL; if (!args->dir) { return NULL; } if ((cdb = cnid_dbd_new(args->dir)) == NULL) { LOG(log_error, logtype_cnid, "cnid_open: Unable to allocate memory for database"); return NULL; } if ((db = (CNID_private *)calloc(1, sizeof(CNID_private))) == NULL) { LOG(log_error, logtype_cnid, "cnid_open: Unable to allocate memory for database"); goto cnid_dbd_open_fail; } cdb->_private = db; /* We keep a copy of the directory in the db structure so that we can transparently reconnect later. */ strcpy(db->db_dir, args->dir); db->magic = CNID_DB_MAGIC; db->fd = -1; db->cnidserver = strdup(args->cnidserver); db->cnidport = strdup(args->cnidport); LOG(log_debug, logtype_cnid, "cnid_dbd_open: Finished initializing cnid dbd module for volume '%s'", db->db_dir); return cdb; cnid_dbd_open_fail: if (cdb != NULL) { if (cdb->volpath != NULL) { free(cdb->volpath); } free(cdb); } if (db != NULL) free(db); return NULL; } /* ---------------------- */ void cnid_dbd_close(struct _cnid_db *cdb) { CNID_private *db; if (!cdb) { LOG(log_error, logtype_cnid, "cnid_close called with NULL argument !"); return; } if ((db = cdb->_private) != NULL) { LOG(log_debug, logtype_cnid, "closing database connection for volume '%s'", db->db_dir); if (db->fd >= 0) close(db->fd); free(db); } free(cdb->volpath); free(cdb); return; } /* ---------------------- */ cnid_t cnid_dbd_add(struct _cnid_db *cdb, const struct stat *st, const cnid_t did, char *name, const size_t len, cnid_t hint) { CNID_private *db; struct cnid_dbd_rqst rqst; struct cnid_dbd_rply rply; cnid_t id; if (!cdb || !(db = cdb->_private) || !st || !name) { LOG(log_error, logtype_cnid, "cnid_add: Parameter error"); errno = CNID_ERR_PARAM; return CNID_INVALID; } if (len > MAXPATHLEN) { LOG(log_error, logtype_cnid, "cnid_add: Path name is too long"); errno = CNID_ERR_PATH; return CNID_INVALID; } RQST_RESET(&rqst); rqst.op = CNID_DBD_OP_ADD; if (!(cdb->flags & CNID_FLAG_NODEV)) { rqst.dev = st->st_dev; } rqst.ino = st->st_ino; rqst.type = S_ISDIR(st->st_mode)?1:0; rqst.cnid = hint; rqst.did = did; rqst.name = name; rqst.namelen = len; LOG(log_debug, logtype_cnid, "cnid_dbd_add: CNID: %u, name: '%s', inode: 0x%llx, type: %d (0=file, 1=dir)", ntohl(did), name, (long long)st->st_ino, rqst.type); rply.namelen = 0; if (transmit(db, &rqst, &rply) < 0) { errno = CNID_ERR_DB; return CNID_INVALID; } switch(rply.result) { case CNID_DBD_RES_OK: id = rply.cnid; LOG(log_debug, logtype_cnid, "cnid_dbd_add: got CNID: %u", ntohl(id)); break; case CNID_DBD_RES_ERR_MAX: errno = CNID_ERR_MAX; id = CNID_INVALID; break; case CNID_DBD_RES_ERR_DB: case CNID_DBD_RES_ERR_DUPLCNID: errno = CNID_ERR_DB; id = CNID_INVALID; break; default: abort(); } return id; } /* ---------------------- */ cnid_t cnid_dbd_get(struct _cnid_db *cdb, const cnid_t did, char *name, const size_t len) { CNID_private *db; struct cnid_dbd_rqst rqst; struct cnid_dbd_rply rply; cnid_t id; if (!cdb || !(db = cdb->_private) || !name) { LOG(log_error, logtype_cnid, "cnid_dbd_get: Parameter error"); errno = CNID_ERR_PARAM; return CNID_INVALID; } if (len > MAXPATHLEN) { LOG(log_error, logtype_cnid, "cnid_dbd_get: Path name is too long"); errno = CNID_ERR_PATH; return CNID_INVALID; } LOG(log_debug, logtype_cnid, "cnid_dbd_get: DID: %u, name: '%s'", ntohl(did), name); RQST_RESET(&rqst); rqst.op = CNID_DBD_OP_GET; rqst.did = did; rqst.name = name; rqst.namelen = len; rply.namelen = 0; if (transmit(db, &rqst, &rply) < 0) { errno = CNID_ERR_DB; return CNID_INVALID; } switch(rply.result) { case CNID_DBD_RES_OK: id = rply.cnid; LOG(log_debug, logtype_cnid, "cnid_dbd_get: got CNID: %u", ntohl(id)); break; case CNID_DBD_RES_NOTFOUND: id = CNID_INVALID; break; case CNID_DBD_RES_ERR_DB: id = CNID_INVALID; errno = CNID_ERR_DB; break; default: abort(); } return id; } /* ---------------------- */ char *cnid_dbd_resolve(struct _cnid_db *cdb, cnid_t *id, void *buffer, size_t len) { CNID_private *db; struct cnid_dbd_rqst rqst; struct cnid_dbd_rply rply; char *name; if (!cdb || !(db = cdb->_private) || !id || !(*id)) { LOG(log_error, logtype_cnid, "cnid_resolve: Parameter error"); errno = CNID_ERR_PARAM; return NULL; } LOG(log_debug, logtype_cnid, "cnid_dbd_resolve: resolving CNID: %u", ntohl(*id)); /* TODO: We should maybe also check len. At the moment we rely on the caller to provide a buffer that is large enough for MAXPATHLEN plus CNID_HEADER_LEN plus 1 byte, which is large enough for the maximum that can come from the database. */ RQST_RESET(&rqst); rqst.op = CNID_DBD_OP_RESOLVE; rqst.cnid = *id; /* Pass buffer to transmit so it can stuff the reply data there */ rply.name = (char *)buffer; rply.namelen = len; if (transmit(db, &rqst, &rply) < 0) { errno = CNID_ERR_DB; *id = CNID_INVALID; return NULL; } switch (rply.result) { case CNID_DBD_RES_OK: *id = rply.did; name = rply.name + CNID_NAME_OFS; LOG(log_debug, logtype_cnid, "cnid_dbd_resolve: resolved did: %u, name: '%s'", ntohl(*id), name); break; case CNID_DBD_RES_NOTFOUND: *id = CNID_INVALID; name = NULL; break; case CNID_DBD_RES_ERR_DB: errno = CNID_ERR_DB; *id = CNID_INVALID; name = NULL; break; default: abort(); } return name; } /* ---------------------- */ int cnid_dbd_getstamp(struct _cnid_db *cdb, void *buffer, const size_t len) { CNID_private *db; if (!cdb || !(db = cdb->_private) || len != ADEDLEN_PRIVSYN) { LOG(log_error, logtype_cnid, "cnid_getstamp: Parameter error"); errno = CNID_ERR_PARAM; return -1; } db->client_stamp = buffer; db->stamp_size = len; memset(buffer,0, len); return 0; } /* ---------------------- */ cnid_t cnid_dbd_lookup(struct _cnid_db *cdb, const struct stat *st, const cnid_t did, char *name, const size_t len) { CNID_private *db; struct cnid_dbd_rqst rqst; struct cnid_dbd_rply rply; cnid_t id; if (!cdb || !(db = cdb->_private) || !st || !name) { LOG(log_error, logtype_cnid, "cnid_lookup: Parameter error"); errno = CNID_ERR_PARAM; return CNID_INVALID; } if (len > MAXPATHLEN) { LOG(log_error, logtype_cnid, "cnid_lookup: Path name is too long"); errno = CNID_ERR_PATH; return CNID_INVALID; } RQST_RESET(&rqst); rqst.op = CNID_DBD_OP_LOOKUP; if (!(cdb->flags & CNID_FLAG_NODEV)) { rqst.dev = st->st_dev; } rqst.ino = st->st_ino; rqst.type = S_ISDIR(st->st_mode)?1:0; rqst.did = did; rqst.name = name; rqst.namelen = len; LOG(log_debug, logtype_cnid, "cnid_dbd_lookup: CNID: %u, name: '%s', inode: 0x%llx, type: %d (0=file, 1=dir)", ntohl(did), name, (long long)st->st_ino, rqst.type); rply.namelen = 0; if (transmit(db, &rqst, &rply) < 0) { errno = CNID_ERR_DB; return CNID_INVALID; } switch (rply.result) { case CNID_DBD_RES_OK: id = rply.cnid; LOG(log_debug, logtype_cnid, "cnid_dbd_lookup: got CNID: %u", ntohl(id)); break; case CNID_DBD_RES_NOTFOUND: id = CNID_INVALID; break; case CNID_DBD_RES_ERR_DB: errno = CNID_ERR_DB; id = CNID_INVALID; break; default: abort(); } return id; } /* ---------------------- */ int cnid_dbd_find(struct _cnid_db *cdb, char *name, size_t namelen, void *buffer, size_t buflen) { CNID_private *db; struct cnid_dbd_rqst rqst; struct cnid_dbd_rply rply; int count; if (!cdb || !(db = cdb->_private) || !name) { LOG(log_error, logtype_cnid, "cnid_find: Parameter error"); errno = CNID_ERR_PARAM; return CNID_INVALID; } if (namelen > MAXPATHLEN) { LOG(log_error, logtype_cnid, "cnid_find: Path name is too long"); errno = CNID_ERR_PATH; return CNID_INVALID; } LOG(log_debug, logtype_cnid, "cnid_find(\"%s\")", name); RQST_RESET(&rqst); rqst.op = CNID_DBD_OP_SEARCH; rqst.name = name; rqst.namelen = namelen; rply.name = buffer; rply.namelen = buflen; if (transmit(db, &rqst, &rply) < 0) { errno = CNID_ERR_DB; return CNID_INVALID; } switch (rply.result) { case CNID_DBD_RES_OK: count = rply.namelen / sizeof(cnid_t); LOG(log_debug, logtype_cnid, "cnid_find: got %d matches", count); break; case CNID_DBD_RES_NOTFOUND: count = 0; break; case CNID_DBD_RES_ERR_DB: errno = CNID_ERR_DB; count = -1; break; default: abort(); } return count; } /* ---------------------- */ int cnid_dbd_update(struct _cnid_db *cdb, const cnid_t id, const struct stat *st, const cnid_t did, char *name, const size_t len) { CNID_private *db; struct cnid_dbd_rqst rqst; struct cnid_dbd_rply rply; if (!cdb || !(db = cdb->_private) || !id || !st || !name) { LOG(log_error, logtype_cnid, "cnid_update: Parameter error"); errno = CNID_ERR_PARAM; return -1; } if (len > MAXPATHLEN) { LOG(log_error, logtype_cnid, "cnid_update: Path name is too long"); errno = CNID_ERR_PATH; return -1; } RQST_RESET(&rqst); rqst.op = CNID_DBD_OP_UPDATE; rqst.cnid = id; if (!(cdb->flags & CNID_FLAG_NODEV)) { rqst.dev = st->st_dev; } rqst.ino = st->st_ino; rqst.type = S_ISDIR(st->st_mode)?1:0; rqst.did = did; rqst.name = name; rqst.namelen = len; LOG(log_debug, logtype_cnid, "cnid_dbd_update: CNID: %u, name: '%s', inode: 0x%llx, type: %d (0=file, 1=dir)", ntohl(id), name, (long long)st->st_ino, rqst.type); rply.namelen = 0; if (transmit(db, &rqst, &rply) < 0) { errno = CNID_ERR_DB; return -1; } switch (rply.result) { case CNID_DBD_RES_OK: LOG(log_debug, logtype_cnid, "cnid_dbd_update: updated"); case CNID_DBD_RES_NOTFOUND: return 0; case CNID_DBD_RES_ERR_DB: errno = CNID_ERR_DB; return -1; default: abort(); } } /* ---------------------- */ cnid_t cnid_dbd_rebuild_add(struct _cnid_db *cdb, const struct stat *st, const cnid_t did, char *name, const size_t len, cnid_t hint) { CNID_private *db; struct cnid_dbd_rqst rqst; struct cnid_dbd_rply rply; cnid_t id; if (!cdb || !(db = cdb->_private) || !st || !name || hint == CNID_INVALID) { LOG(log_error, logtype_cnid, "cnid_rebuild_add: Parameter error"); errno = CNID_ERR_PARAM; return CNID_INVALID; } if (len > MAXPATHLEN) { LOG(log_error, logtype_cnid, "cnid_rebuild_add: Path name is too long"); errno = CNID_ERR_PATH; return CNID_INVALID; } RQST_RESET(&rqst); rqst.op = CNID_DBD_OP_REBUILD_ADD; if (!(cdb->flags & CNID_FLAG_NODEV)) { rqst.dev = st->st_dev; } rqst.ino = st->st_ino; rqst.type = S_ISDIR(st->st_mode)?1:0; rqst.did = did; rqst.name = name; rqst.namelen = len; rqst.cnid = hint; LOG(log_debug, logtype_cnid, "cnid_dbd_rebuild_add: CNID: %u, name: '%s', inode: 0x%llx, type: %d (0=file, 1=dir), hint: %u", ntohl(did), name, (long long)st->st_ino, rqst.type, hint); if (transmit(db, &rqst, &rply) < 0) { errno = CNID_ERR_DB; return CNID_INVALID; } switch(rply.result) { case CNID_DBD_RES_OK: id = rply.cnid; LOG(log_debug, logtype_cnid, "cnid_dbd_rebuild_add: got CNID: %u", ntohl(id)); break; case CNID_DBD_RES_ERR_MAX: errno = CNID_ERR_MAX; id = CNID_INVALID; break; case CNID_DBD_RES_ERR_DB: case CNID_DBD_RES_ERR_DUPLCNID: errno = CNID_ERR_DB; id = CNID_INVALID; break; default: abort(); } return id; } /* ---------------------- */ int cnid_dbd_delete(struct _cnid_db *cdb, const cnid_t id) { CNID_private *db; struct cnid_dbd_rqst rqst; struct cnid_dbd_rply rply; if (!cdb || !(db = cdb->_private) || !id) { LOG(log_error, logtype_cnid, "cnid_delete: Parameter error"); errno = CNID_ERR_PARAM; return -1; } LOG(log_debug, logtype_cnid, "cnid_dbd_delete: delete CNID: %u", ntohl(id)); RQST_RESET(&rqst); rqst.op = CNID_DBD_OP_DELETE; rqst.cnid = id; rply.namelen = 0; if (transmit(db, &rqst, &rply) < 0) { errno = CNID_ERR_DB; return -1; } switch (rply.result) { case CNID_DBD_RES_OK: LOG(log_debug, logtype_cnid, "cnid_dbd_delete: deleted CNID: %u", ntohl(id)); case CNID_DBD_RES_NOTFOUND: return 0; case CNID_DBD_RES_ERR_DB: errno = CNID_ERR_DB; return -1; default: abort(); } } struct _cnid_module cnid_dbd_module = { "dbd", {NULL, NULL}, cnid_dbd_open, 0 }; #endif /* CNID_DBD */ netatalk-2.2.2/libatalk/cnid/dbd/Makefile.am0000644000175200017500000000016711655731127015544 00000000000000# Makefile.am for libatalk/cnid/ noinst_LTLIBRARIES = libcnid_dbd.la libcnid_dbd_la_SOURCES = cnid_dbd.c cnid_dbd.h netatalk-2.2.2/libatalk/cnid/dbd/Makefile.in0000644000175200017500000003710011703521727015547 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/cnid/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = libatalk/cnid/dbd DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcnid_dbd_la_LIBADD = am_libcnid_dbd_la_OBJECTS = cnid_dbd.lo libcnid_dbd_la_OBJECTS = $(am_libcnid_dbd_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcnid_dbd_la_SOURCES) DIST_SOURCES = $(libcnid_dbd_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libcnid_dbd.la libcnid_dbd_la_SOURCES = cnid_dbd.c cnid_dbd.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/cnid/dbd/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/cnid/dbd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libcnid_dbd.la: $(libcnid_dbd_la_OBJECTS) $(libcnid_dbd_la_DEPENDENCIES) $(LINK) $(libcnid_dbd_la_OBJECTS) $(libcnid_dbd_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnid_dbd.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/cnid/cnid_init.c0000644000175200017500000000353311655731127015063 00000000000000 /* * $Id: cnid_init.c,v 1.3 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 2003 the Netatalk Team * Copyright (c) 2003 Rafal Lewczuk * * This program is free software; you can redistribute and/or modify * it under the terms of the GNU General Public License as published * by the Free Software Foundation version 2 of the License or later * version if explicitly stated by any of above copyright holders. * */ /* * This file contains initialization stuff for CNID backends. * Currently it only employs static bindings. * No plans for dynamically loaded CNID backends here (temporary). * Maybe somewhere in the future. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #ifdef CNID_BACKEND_DB3 extern struct _cnid_module cnid_db3_module; #endif #ifdef CNID_BACKEND_HASH extern struct _cnid_module cnid_hash_module; #endif #ifdef CNID_BACKEND_LAST extern struct _cnid_module cnid_last_module; #endif #ifdef CNID_BACKEND_MTAB extern struct _cnid_module cnid_mtab_module; #endif #ifdef CNID_BACKEND_CDB extern struct _cnid_module cnid_cdb_module; #endif #ifdef CNID_BACKEND_DBD extern struct _cnid_module cnid_dbd_module; #endif #ifdef CNID_BACKEND_TDB extern struct _cnid_module cnid_tdb_module; #endif void cnid_init(void) { #ifdef CNID_BACKEND_DB3 cnid_register(&cnid_db3_module); #endif #ifdef CNID_BACKEND_HASH cnid_register(&cnid_hash_module); #endif #ifdef CNID_BACKEND_LAST cnid_register(&cnid_last_module); #endif #ifdef CNID_BACKEND_MTAB cnid_register(&cnid_mtab_module); #endif #ifdef CNID_BACKEND_CDB cnid_register(&cnid_cdb_module); #endif #ifdef CNID_BACKEND_DBD cnid_register(&cnid_dbd_module); #endif #ifdef CNID_BACKEND_TDB cnid_register(&cnid_tdb_module); #endif } netatalk-2.2.2/libatalk/cnid/cdb/0000777000175200017500000000000011704770417013567 500000000000000netatalk-2.2.2/libatalk/cnid/cdb/cnid_cdb_open.c0000644000175200017500000003074411655731127016425 00000000000000/* * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. * * CNID database support. * * here's the deal: * 1) afpd already caches did's. * 2) the database stores cnid's as both did/name and dev/ino pairs. * 3) RootInfo holds the value of the NextID. * 4) the cnid database gets called in the following manner -- * start a database: * cnid = cnid_open(root_dir); * * allocate a new id: * newid = cnid_add(cnid, dev, ino, parent did, * name, id); id is a hint for a specific id. pass 0 if you don't * care. if the id is already assigned, you won't get what you * requested. * * given an id, get a did/name and dev/ino pair. * name = cnid_get(cnid, &id); given an id, return the corresponding * info. * return code = cnid_delete(cnid, id); delete an entry. * * with AFP, CNIDs 0-2 have special meanings. here they are: * 0 -- invalid cnid * 1 -- parent of root directory (handled by afpd) * 2 -- root directory (handled by afpd) * * CNIDs 4-16 are reserved according to page 31 of the AFP 3.0 spec so, * CNID_START begins at 17. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef CNID_BACKEND_CDB #include #include "cnid_cdb_private.h" #ifndef MIN #define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif /* ! MIN */ #define DBHOME ".AppleDB" #define DBCNID "cnid2.db" #define DBDEVINO "devino.db" #define DBDIDNAME "didname.db" /* did/full name mapping */ #define DBLOCKFILE "cnid.lock" #define DBHOMELEN 8 #define DBLEN 10 #define DBOPTIONS (DB_CREATE | DB_INIT_CDB | DB_INIT_MPOOL) #define MAXITER 0xFFFF /* maximum number of simultaneously open CNID * databases. */ static char *old_dbfiles[] = {"cnid.db", NULL}; /* ----------------------- * bandaid for LanTest performance pb. for now not used, cf. ifdef 0 below */ static int my_yield(void) { struct timeval t; int ret; t.tv_sec = 0; t.tv_usec = 1000; ret = select(0, NULL, NULL, NULL, &t); return 0; } /* --------------- */ static int didname(DB *dbp _U_, const DBT *pkey _U_, const DBT *pdata, DBT *skey) { int len; memset(skey, 0, sizeof(DBT)); skey->data = (char *)pdata->data + CNID_DID_OFS; len = strlen((char *)skey->data + CNID_DID_LEN); skey->size = CNID_DID_LEN + len + 1; return (0); } /* --------------- */ static int devino(DB *dbp _U_, const DBT *pkey _U_, const DBT *pdata, DBT *skey) { memset(skey, 0, sizeof(DBT)); skey->data = (char *)pdata->data + CNID_DEVINO_OFS; skey->size = CNID_DEVINO_LEN; return (0); } /* --------------- */ static int my_associate (DB *p, DB *s, int (*callback)(DB *, const DBT *,const DBT *, DBT *), u_int32_t flags) { #if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1) return p->associate(p, NULL, s, callback, flags); #else #if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 0) return p->associate(p, s, callback, flags); #else return 0; /* FIXME */ #endif #endif } /* --------------- */ static int my_open(DB * p, const char *f, const char *d, DBTYPE t, u_int32_t flags, int mode) { #if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1) return p->open(p, NULL, f, d, t, flags, mode); #else return p->open(p, f, d, t, flags, mode); #endif } /* --------------- */ static struct _cnid_db *cnid_cdb_new(const char *volpath) { struct _cnid_db *cdb; int major, minor, patch; char *version_str; version_str = db_version(&major, &minor, &patch); /* check library match, ignore if only patch level changed */ if ( major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR) { LOG(log_error, logtype_cnid, "cnid_cdb_new: the Berkeley DB library version used does not match the version compiled with: (%u.%u)/(%u.%u)", DB_VERSION_MAJOR, DB_VERSION_MINOR, major, minor); return NULL; } if ((cdb = (struct _cnid_db *) calloc(1, sizeof(struct _cnid_db))) == NULL) return NULL; if ((cdb->volpath = strdup(volpath)) == NULL) { free(cdb); return NULL; } cdb->flags = CNID_FLAG_PERSISTENT; cdb->cnid_add = cnid_cdb_add; cdb->cnid_delete = cnid_cdb_delete; cdb->cnid_get = cnid_cdb_get; cdb->cnid_lookup = cnid_cdb_lookup; cdb->cnid_nextid = NULL; /*cnid_cdb_nextid;*/ cdb->cnid_resolve = cnid_cdb_resolve; cdb->cnid_update = cnid_cdb_update; cdb->cnid_close = cnid_cdb_close; cdb->cnid_getstamp = cnid_cdb_getstamp; cdb->cnid_rebuild_add = cnid_cdb_rebuild_add; return cdb; } /* --------------- */ static int upgrade_required(char *dbdir) { char path[MAXPATHLEN + 1]; int len, i; int found = 0; struct stat st; strcpy(path, dbdir); len = strlen(path); if (path[len - 1] != '/') { strcat(path, "/"); len++; } for (i = 0; old_dbfiles[i] != NULL; i++) { strcpy(path + len, old_dbfiles[i]); if ( !(stat(path, &st) < 0) ) { found++; continue; } if (errno != ENOENT) { LOG(log_error, logtype_default, "cnid_open: Checking %s gave %s", path, strerror(errno)); found++; } } return found; } /* --------------- */ struct _cnid_db *cnid_cdb_open(struct cnid_open_args *args) { struct stat st; char path[MAXPATHLEN + 1]; CNID_private *db; struct _cnid_db *cdb; int open_flag, len; static int first = 0; int rc; if (!args->dir || *args->dir == 0) { return NULL; } /* this checks .AppleDB. We need space for dir + '/' + DBHOMELEN + '/' + DBLEN */ if ((len = strlen(args->dir)) > (MAXPATHLEN - DBHOMELEN - DBLEN - 2)) { LOG(log_error, logtype_default, "cnid_open: Pathname too large: %s", args->dir); return NULL; } if ((cdb = cnid_cdb_new(args->dir)) == NULL) { LOG(log_error, logtype_default, "cnid_open: Unable to allocate memory for database"); return NULL; } if ((db = (CNID_private *) calloc(1, sizeof(CNID_private))) == NULL) { LOG(log_error, logtype_default, "cnid_open: Unable to allocate memory for database"); goto fail_cdb; } cdb->_private = (void *) db; db->magic = CNID_DB_MAGIC; strcpy(path, args->dir); if (path[len - 1] != '/') { strcat(path, "/"); len++; } strcpy(path + len, DBHOME); if ((stat(path, &st) < 0) && (ad_mkdir(path, 0777 & ~args->mask) < 0)) { LOG(log_error, logtype_default, "cnid_open: DBHOME mkdir failed for %s", path); goto fail_adouble; } if (upgrade_required(path)) { LOG(log_error, logtype_default, "cnid_open: Found version 1 of the CNID database. Please upgrade to version 2"); goto fail_adouble; } /* Print out the version of BDB we're linked against. */ if (!first) { first = 1; LOG(log_info, logtype_default, "CNID DB initialized using %s", db_version(NULL, NULL, NULL)); } open_flag = DB_CREATE; /* We need to be able to open the database environment with full * transaction, logging, and locking support if we ever hope to * be a true multi-acess file server. */ if ((rc = db_env_create(&db->dbenv, 0)) != 0) { LOG(log_error, logtype_default, "cnid_open: db_env_create: %s", db_strerror(rc)); goto fail_lock; } /* Open the database environment. */ if ((rc = db->dbenv->open(db->dbenv, path, DBOPTIONS, 0666 & ~args->mask)) != 0) { LOG(log_error, logtype_default, "cnid_open: dbenv->open (rw) of %s failed: %s", path, db_strerror(rc)); /* FIXME: This should probably go. Even if it worked, any use for a read-only DB? Didier? */ if (rc == DB_RUNRECOVERY) { /* This is the mother of all errors. We _must_ fail here. */ LOG(log_error, logtype_default, "cnid_open: CATASTROPHIC ERROR opening database environment %s. Run db_recovery -c immediately", path); goto fail_lock; } /* We can't get a full transactional environment, so multi-access * is out of the question. Let's assume a read-only environment, * and try to at least get a shared memory pool. */ if ((rc = db->dbenv->open(db->dbenv, path, DB_INIT_MPOOL, 0666 & ~args->mask)) != 0) { /* Nope, not a MPOOL, either. Last-ditch effort: we'll try to * open the environment with no flags. */ if ((rc = db->dbenv->open(db->dbenv, path, 0, 0666 & ~args->mask)) != 0) { LOG(log_error, logtype_default, "cnid_open: dbenv->open of %s failed: %s", path, db_strerror(rc)); goto fail_lock; } } db->flags |= CNIDFLAG_DB_RO; open_flag = DB_RDONLY; LOG(log_info, logtype_default, "cnid_open: Obtained read-only database environment %s", path); } /* ---------------------- */ /* Main CNID database. Use a hash for this one. */ if ((rc = db_create(&db->db_cnid, db->dbenv, 0)) != 0) { LOG(log_error, logtype_default, "cnid_open: Failed to create cnid database: %s", db_strerror(rc)); goto fail_appinit; } if ((rc = my_open(db->db_cnid, DBCNID, DBCNID, DB_BTREE, open_flag, 0666 & ~args->mask)) != 0) { LOG(log_error, logtype_default, "cnid_open: Failed to open dev/ino database: %s", db_strerror(rc)); goto fail_appinit; } /* ---------------------- */ /* did/name reverse mapping. We use a BTree for this one. */ if ((rc = db_create(&db->db_didname, db->dbenv, 0)) != 0) { LOG(log_error, logtype_default, "cnid_open: Failed to create did/name database: %s", db_strerror(rc)); goto fail_appinit; } if ((rc = my_open(db->db_didname, DBCNID, DBDIDNAME, DB_BTREE, open_flag, 0666 & ~args->mask))) { LOG(log_error, logtype_default, "cnid_open: Failed to open did/name database: %s", db_strerror(rc)); goto fail_appinit; } /* ---------------------- */ /* dev/ino reverse mapping. Use a hash for this one. */ if ((rc = db_create(&db->db_devino, db->dbenv, 0)) != 0) { LOG(log_error, logtype_default, "cnid_open: Failed to create dev/ino database: %s", db_strerror(rc)); goto fail_appinit; } if ((rc = my_open(db->db_devino, DBCNID, DBDEVINO, DB_BTREE, open_flag, 0666 & ~args->mask)) != 0) { LOG(log_error, logtype_default, "cnid_open: Failed to open devino database: %s", db_strerror(rc)); goto fail_appinit; } /* ---------------------- */ /* Associate the secondary with the primary. */ if ((rc = my_associate(db->db_cnid, db->db_didname, didname, 0)) != 0) { LOG(log_error, logtype_default, "cnid_open: Failed to associate didname database: %s", db_strerror(rc)); goto fail_appinit; } if ((rc = my_associate(db->db_cnid, db->db_devino, devino, 0)) != 0) { LOG(log_error, logtype_default, "cnid_open: Failed to associate devino database: %s", db_strerror(rc)); goto fail_appinit; } /* ---------------------- */ /* Check for version. "cdb" only supports CNID_VERSION_0, cf cnid_private.h */ DBT key, data; uint32_t version; memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); key.data = ROOTINFO_KEY; key.size = ROOTINFO_KEYLEN; if ((rc = db->db_cnid->get(db->db_cnid, NULL, &key, &data, 0)) == 0) { /* If not found, ignore it */ memcpy(&version, data.data + CNID_DID_OFS, sizeof(version)); version = ntohl(version); LOG(log_debug, logtype_default, "CNID db version %u", version); if (version != CNID_VERSION_0) { LOG(log_error, logtype_default, "Unsupported CNID db version %u, use CNID backend \"dbd\"", version); goto fail_appinit; } } db_env_set_func_yield(my_yield); return cdb; fail_appinit: if (db->db_didname) db->db_didname->close(db->db_didname, 0); if (db->db_devino) db->db_devino->close(db->db_devino, 0); if (db->db_cnid) db->db_cnid->close(db->db_cnid, 0); LOG(log_error, logtype_default, "cnid_open: Failed to setup CNID DB environment"); db->dbenv->close(db->dbenv, 0); fail_lock: fail_adouble: free(db); fail_cdb: if (cdb->volpath != NULL) free(cdb->volpath); free(cdb); return NULL; } struct _cnid_module cnid_cdb_module = { "cdb", {NULL, NULL}, cnid_cdb_open, CNID_FLAG_SETUID | CNID_FLAG_BLOCK }; #endif /* CNID_BACKEND_CDB */ netatalk-2.2.2/libatalk/cnid/cdb/Makefile.am0000644000175200017500000000103711655731127015540 00000000000000# Makefile.am for libatalk/cnid/ libcnid_cdb_la_SOURCES = cnid_cdb_add.c \ cnid_cdb_close.c \ cnid_cdb_delete.c \ cnid_cdb_get.c \ cnid_cdb_lookup.c \ cnid_cdb_open.c \ cnid_cdb_resolve.c \ cnid_cdb_update.c \ cnid_cdb_rebuild_add.c \ cnid_cdb.h libcnid_cdb_la_CFLAGS = @BDB_CFLAGS@ libcnid_cdb_la_LIBADD = @BDB_LIBS@ @PTHREAD_LIBS@ if USE_CDB_BACKEND noinst_LTLIBRARIES = libcnid_cdb.la endif noinst_HEADERS = cnid_cdb_meta.h cnid_cdb_private.h EXTRA_DIST = README cnid_cdb_meta.c cnid_cdb_nextid.c netatalk-2.2.2/libatalk/cnid/cdb/cnid_cdb_private.h0000644000175200017500000000714111655731127017136 00000000000000/* * $Id: cnid_cdb_private.h,v 1.7 2009-11-20 17:22:11 didg Exp $ */ #ifndef LIBATALK_CDB_PRIVATE_H #define LIBATALK_CDB_PRIVATE_H 1 #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #include #ifdef HAVE_SYS_TIME_H #include #endif /* HAVE_SYS_TIME_H */ #ifdef HAVE_TIME_H #include #endif #include #include #include #include #include #include #include #include "cnid_cdb.h" /* record structure cnid 4 dev 8 inode 8 type/last cnid 4 Not used did 4 name strlen(name) +1 primary key cnid secondary keys dev/inode did/name */ typedef struct cnid_record { /* helper for debug don't use */ unsigned int cnid; dev_t dev; ino_t inode; unsigned int type; unsigned int did; char name[50]; } cnid_record; typedef struct CNID_private { u_int32_t magic; DB *db_cnid; DB *db_didname; DB *db_devino; DB_ENV *dbenv; int lockfd, flags; char lock_file[MAXPATHLEN + 1]; } CNID_private; /* XXX stuff below is outdate */ /* on-disk data format (in network byte order where appropriate) -- * db_cnid: (key: cnid) * name size (in bytes) * dev 4 * ino 4 * did 4 * unix name strlen(name) + 1 * * db_didname: (key: did/unix name) * -- this also caches the bits of .AppleDouble used by FPGetFilDirParam * so that we don't have to open the header file. * NOTE: FPCatSearch has to search through all of the directories as * this stuff doesn't get entered until needed. * if the entire volume is in the database, though, we can use * cursor operations to make this faster. * * version number is stored with did/name key of 0/0 * * cnid 4 * modfiller 4 (dates only use 4 bytes right now, but we leave space * moddate 4 for 8. moddate is also used to keep this info * createfiller 4 up-to-date.) * createdate 4 * backfiller 4 * backupdate 4 * accfiller 4 (unused) * accdate 4 (unused) * AFP info 4 (stores a couple permission bits as well) * finder info 32 * prodos info 8 * rforkfiller 4 * rforklen 4 * macname 32 (nul-terminated) * shortname 12 (nul-terminated) * longname longnamelen (nul-terminated) * --------------- * 132 bytes + longnamelen * * db_devino: (key: dev/ino) * -- this is only used for consistency checks and isn't 1-1 * cnid 4 * * these correspond to the different path types. longname is for the * 255 unicode character names (path type == ?), macname is for the * 32-character names (path type == 2), and shortname is for the * 8+3-character names (path type == 1). * * db_longname: (key: did/longname) * name namelen = strlen(name) + 1 * * db_macname: (key: did/macname) * name namelen = strlen(name) + 1 * * db_shortname: (key: did/shortname) * name namelen = strlen(name) + 1 */ /* construct db_cnid data. NOTE: this is not re-entrant. */ extern unsigned char *make_cnid_data (u_int32_t flags, const struct stat *,const cnid_t , const char *, const size_t ); #endif /* atalk/cnid/cnid_private.h */ netatalk-2.2.2/libatalk/cnid/cdb/Makefile.in0000644000175200017500000006606011703521727015555 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/cnid/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = libatalk/cnid/cdb DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcnid_cdb_la_DEPENDENCIES = am_libcnid_cdb_la_OBJECTS = libcnid_cdb_la-cnid_cdb_add.lo \ libcnid_cdb_la-cnid_cdb_close.lo \ libcnid_cdb_la-cnid_cdb_delete.lo \ libcnid_cdb_la-cnid_cdb_get.lo \ libcnid_cdb_la-cnid_cdb_lookup.lo \ libcnid_cdb_la-cnid_cdb_open.lo \ libcnid_cdb_la-cnid_cdb_resolve.lo \ libcnid_cdb_la-cnid_cdb_update.lo \ libcnid_cdb_la-cnid_cdb_rebuild_add.lo libcnid_cdb_la_OBJECTS = $(am_libcnid_cdb_la_OBJECTS) libcnid_cdb_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libcnid_cdb_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ @USE_CDB_BACKEND_TRUE@am_libcnid_cdb_la_rpath = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcnid_cdb_la_SOURCES) DIST_SOURCES = $(libcnid_cdb_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ libcnid_cdb_la_SOURCES = cnid_cdb_add.c \ cnid_cdb_close.c \ cnid_cdb_delete.c \ cnid_cdb_get.c \ cnid_cdb_lookup.c \ cnid_cdb_open.c \ cnid_cdb_resolve.c \ cnid_cdb_update.c \ cnid_cdb_rebuild_add.c \ cnid_cdb.h libcnid_cdb_la_CFLAGS = @BDB_CFLAGS@ libcnid_cdb_la_LIBADD = @BDB_LIBS@ @PTHREAD_LIBS@ @USE_CDB_BACKEND_TRUE@noinst_LTLIBRARIES = libcnid_cdb.la noinst_HEADERS = cnid_cdb_meta.h cnid_cdb_private.h EXTRA_DIST = README cnid_cdb_meta.c cnid_cdb_nextid.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/cnid/cdb/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/cnid/cdb/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libcnid_cdb.la: $(libcnid_cdb_la_OBJECTS) $(libcnid_cdb_la_DEPENDENCIES) $(libcnid_cdb_la_LINK) $(am_libcnid_cdb_la_rpath) $(libcnid_cdb_la_OBJECTS) $(libcnid_cdb_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcnid_cdb_la-cnid_cdb_add.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcnid_cdb_la-cnid_cdb_close.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcnid_cdb_la-cnid_cdb_delete.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcnid_cdb_la-cnid_cdb_get.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcnid_cdb_la-cnid_cdb_lookup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcnid_cdb_la-cnid_cdb_open.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcnid_cdb_la-cnid_cdb_rebuild_add.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcnid_cdb_la-cnid_cdb_resolve.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcnid_cdb_la-cnid_cdb_update.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libcnid_cdb_la-cnid_cdb_add.lo: cnid_cdb_add.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -MT libcnid_cdb_la-cnid_cdb_add.lo -MD -MP -MF $(DEPDIR)/libcnid_cdb_la-cnid_cdb_add.Tpo -c -o libcnid_cdb_la-cnid_cdb_add.lo `test -f 'cnid_cdb_add.c' || echo '$(srcdir)/'`cnid_cdb_add.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcnid_cdb_la-cnid_cdb_add.Tpo $(DEPDIR)/libcnid_cdb_la-cnid_cdb_add.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cnid_cdb_add.c' object='libcnid_cdb_la-cnid_cdb_add.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -c -o libcnid_cdb_la-cnid_cdb_add.lo `test -f 'cnid_cdb_add.c' || echo '$(srcdir)/'`cnid_cdb_add.c libcnid_cdb_la-cnid_cdb_close.lo: cnid_cdb_close.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -MT libcnid_cdb_la-cnid_cdb_close.lo -MD -MP -MF $(DEPDIR)/libcnid_cdb_la-cnid_cdb_close.Tpo -c -o libcnid_cdb_la-cnid_cdb_close.lo `test -f 'cnid_cdb_close.c' || echo '$(srcdir)/'`cnid_cdb_close.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcnid_cdb_la-cnid_cdb_close.Tpo $(DEPDIR)/libcnid_cdb_la-cnid_cdb_close.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cnid_cdb_close.c' object='libcnid_cdb_la-cnid_cdb_close.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -c -o libcnid_cdb_la-cnid_cdb_close.lo `test -f 'cnid_cdb_close.c' || echo '$(srcdir)/'`cnid_cdb_close.c libcnid_cdb_la-cnid_cdb_delete.lo: cnid_cdb_delete.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -MT libcnid_cdb_la-cnid_cdb_delete.lo -MD -MP -MF $(DEPDIR)/libcnid_cdb_la-cnid_cdb_delete.Tpo -c -o libcnid_cdb_la-cnid_cdb_delete.lo `test -f 'cnid_cdb_delete.c' || echo '$(srcdir)/'`cnid_cdb_delete.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcnid_cdb_la-cnid_cdb_delete.Tpo $(DEPDIR)/libcnid_cdb_la-cnid_cdb_delete.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cnid_cdb_delete.c' object='libcnid_cdb_la-cnid_cdb_delete.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -c -o libcnid_cdb_la-cnid_cdb_delete.lo `test -f 'cnid_cdb_delete.c' || echo '$(srcdir)/'`cnid_cdb_delete.c libcnid_cdb_la-cnid_cdb_get.lo: cnid_cdb_get.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -MT libcnid_cdb_la-cnid_cdb_get.lo -MD -MP -MF $(DEPDIR)/libcnid_cdb_la-cnid_cdb_get.Tpo -c -o libcnid_cdb_la-cnid_cdb_get.lo `test -f 'cnid_cdb_get.c' || echo '$(srcdir)/'`cnid_cdb_get.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcnid_cdb_la-cnid_cdb_get.Tpo $(DEPDIR)/libcnid_cdb_la-cnid_cdb_get.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cnid_cdb_get.c' object='libcnid_cdb_la-cnid_cdb_get.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -c -o libcnid_cdb_la-cnid_cdb_get.lo `test -f 'cnid_cdb_get.c' || echo '$(srcdir)/'`cnid_cdb_get.c libcnid_cdb_la-cnid_cdb_lookup.lo: cnid_cdb_lookup.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -MT libcnid_cdb_la-cnid_cdb_lookup.lo -MD -MP -MF $(DEPDIR)/libcnid_cdb_la-cnid_cdb_lookup.Tpo -c -o libcnid_cdb_la-cnid_cdb_lookup.lo `test -f 'cnid_cdb_lookup.c' || echo '$(srcdir)/'`cnid_cdb_lookup.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcnid_cdb_la-cnid_cdb_lookup.Tpo $(DEPDIR)/libcnid_cdb_la-cnid_cdb_lookup.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cnid_cdb_lookup.c' object='libcnid_cdb_la-cnid_cdb_lookup.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -c -o libcnid_cdb_la-cnid_cdb_lookup.lo `test -f 'cnid_cdb_lookup.c' || echo '$(srcdir)/'`cnid_cdb_lookup.c libcnid_cdb_la-cnid_cdb_open.lo: cnid_cdb_open.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -MT libcnid_cdb_la-cnid_cdb_open.lo -MD -MP -MF $(DEPDIR)/libcnid_cdb_la-cnid_cdb_open.Tpo -c -o libcnid_cdb_la-cnid_cdb_open.lo `test -f 'cnid_cdb_open.c' || echo '$(srcdir)/'`cnid_cdb_open.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcnid_cdb_la-cnid_cdb_open.Tpo $(DEPDIR)/libcnid_cdb_la-cnid_cdb_open.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cnid_cdb_open.c' object='libcnid_cdb_la-cnid_cdb_open.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -c -o libcnid_cdb_la-cnid_cdb_open.lo `test -f 'cnid_cdb_open.c' || echo '$(srcdir)/'`cnid_cdb_open.c libcnid_cdb_la-cnid_cdb_resolve.lo: cnid_cdb_resolve.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -MT libcnid_cdb_la-cnid_cdb_resolve.lo -MD -MP -MF $(DEPDIR)/libcnid_cdb_la-cnid_cdb_resolve.Tpo -c -o libcnid_cdb_la-cnid_cdb_resolve.lo `test -f 'cnid_cdb_resolve.c' || echo '$(srcdir)/'`cnid_cdb_resolve.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcnid_cdb_la-cnid_cdb_resolve.Tpo $(DEPDIR)/libcnid_cdb_la-cnid_cdb_resolve.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cnid_cdb_resolve.c' object='libcnid_cdb_la-cnid_cdb_resolve.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -c -o libcnid_cdb_la-cnid_cdb_resolve.lo `test -f 'cnid_cdb_resolve.c' || echo '$(srcdir)/'`cnid_cdb_resolve.c libcnid_cdb_la-cnid_cdb_update.lo: cnid_cdb_update.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -MT libcnid_cdb_la-cnid_cdb_update.lo -MD -MP -MF $(DEPDIR)/libcnid_cdb_la-cnid_cdb_update.Tpo -c -o libcnid_cdb_la-cnid_cdb_update.lo `test -f 'cnid_cdb_update.c' || echo '$(srcdir)/'`cnid_cdb_update.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcnid_cdb_la-cnid_cdb_update.Tpo $(DEPDIR)/libcnid_cdb_la-cnid_cdb_update.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cnid_cdb_update.c' object='libcnid_cdb_la-cnid_cdb_update.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -c -o libcnid_cdb_la-cnid_cdb_update.lo `test -f 'cnid_cdb_update.c' || echo '$(srcdir)/'`cnid_cdb_update.c libcnid_cdb_la-cnid_cdb_rebuild_add.lo: cnid_cdb_rebuild_add.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -MT libcnid_cdb_la-cnid_cdb_rebuild_add.lo -MD -MP -MF $(DEPDIR)/libcnid_cdb_la-cnid_cdb_rebuild_add.Tpo -c -o libcnid_cdb_la-cnid_cdb_rebuild_add.lo `test -f 'cnid_cdb_rebuild_add.c' || echo '$(srcdir)/'`cnid_cdb_rebuild_add.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcnid_cdb_la-cnid_cdb_rebuild_add.Tpo $(DEPDIR)/libcnid_cdb_la-cnid_cdb_rebuild_add.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cnid_cdb_rebuild_add.c' object='libcnid_cdb_la-cnid_cdb_rebuild_add.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcnid_cdb_la_CFLAGS) $(CFLAGS) -c -o libcnid_cdb_la-cnid_cdb_rebuild_add.lo `test -f 'cnid_cdb_rebuild_add.c' || echo '$(srcdir)/'`cnid_cdb_rebuild_add.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/cnid/cdb/cnid_cdb_add.c0000644000175200017500000002154011655731127016206 00000000000000/* * $Id: cnid_cdb_add.c,v 1.8 2009-11-20 17:22:11 didg Exp $ * * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. * * cnid_add (db, dev, ino, did, name, hint): * add a name to the CNID database. we use both dev/ino and did/name * to keep track of things. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef CNID_BACKEND_CDB #include "cnid_cdb_private.h" extern int cnid_cdb_update(struct _cnid_db *cdb, const cnid_t id, const struct stat *st, const cnid_t did, char *name, const size_t len); #define tid NULL static void make_devino_data(unsigned char *buf, dev_t dev, ino_t ino) { buf[CNID_DEV_LEN - 1] = dev; dev >>= 8; buf[CNID_DEV_LEN - 2] = dev; dev >>= 8; buf[CNID_DEV_LEN - 3] = dev; dev >>= 8; buf[CNID_DEV_LEN - 4] = dev; dev >>= 8; buf[CNID_DEV_LEN - 5] = dev; dev >>= 8; buf[CNID_DEV_LEN - 6] = dev; dev >>= 8; buf[CNID_DEV_LEN - 7] = dev; dev >>= 8; buf[CNID_DEV_LEN - 8] = dev; buf[CNID_DEV_LEN + CNID_INO_LEN - 1] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 2] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 3] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 4] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 5] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 6] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 7] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 8] = ino; } unsigned char *make_cnid_data(u_int32_t flags, const struct stat *st, const cnid_t did, const char *name, const size_t len) { static unsigned char start[CNID_HEADER_LEN + MAXPATHLEN + 1]; unsigned char *buf = start +CNID_LEN; u_int32_t i; if (len > MAXPATHLEN) return NULL; make_devino_data(buf, !(flags & CNID_FLAG_NODEV)?st->st_dev:0, st->st_ino); buf += CNID_DEVINO_LEN; i = S_ISDIR(st->st_mode)?1:0; i = htonl(i); memcpy(buf, &i, sizeof(i)); buf += sizeof(i); /* did is already in network byte order */ memcpy(buf, &did, sizeof(did)); buf += sizeof(did); memcpy(buf, name, len); *(buf + len) = '\0'; return start; } /* --------------- */ static int db_stamp(void *buffer, size_t size) { time_t t; memset(buffer, 0, size); /* return the current time. */ if (size < sizeof(time_t)) return -1; t = time(NULL); memcpy(buffer,&t, sizeof(time_t)); return 0; } /* ----------------------------- */ static cnid_t get_cnid(CNID_private *db) { DBT rootinfo_key, rootinfo_data; DBC *cursor; int rc; int flag, setstamp=0; cnid_t hint,id; char buf[ROOTINFO_DATALEN]; char stamp[CNID_DEV_LEN]; if ((rc = db->db_cnid->cursor(db->db_cnid, NULL, &cursor, DB_WRITECURSOR) ) != 0) { LOG(log_error, logtype_default, "get_cnid: Unable to get a cursor: %s", db_strerror(rc)); return CNID_INVALID; } memset(&rootinfo_key, 0, sizeof(rootinfo_key)); memset(&rootinfo_data, 0, sizeof(rootinfo_data)); rootinfo_key.data = ROOTINFO_KEY; rootinfo_key.size = ROOTINFO_KEYLEN; switch (rc = cursor->c_get(cursor, &rootinfo_key, &rootinfo_data, DB_SET)) { case 0: memcpy(&hint, (char *)rootinfo_data.data +CNID_TYPE_OFS, sizeof(hint)); id = ntohl(hint); /* If we've hit the max CNID allowed, we return a fatal error. CNID * needs to be recycled before proceding. */ if (++id == CNID_INVALID) { LOG(log_error, logtype_default, "cnid_add: FATAL: CNID database has reached its limit."); errno = CNID_ERR_MAX; goto cleanup; } hint = htonl(id); flag = DB_CURRENT; break; case DB_NOTFOUND: hint = htonl(CNID_START); flag = DB_KEYFIRST; setstamp = 1; break; default: LOG(log_error, logtype_default, "cnid_add: Unable to lookup rootinfo: %s", db_strerror(rc)); errno = CNID_ERR_DB; goto cleanup; } memcpy(buf, ROOTINFO_DATA, ROOTINFO_DATALEN); rootinfo_data.data = buf; rootinfo_data.size = ROOTINFO_DATALEN; memcpy((char *)rootinfo_data.data +CNID_TYPE_OFS, &hint, sizeof(hint)); if (setstamp) { if (db_stamp(stamp, CNID_DEV_LEN) < 0) { goto cleanup; } memcpy((char *)rootinfo_data.data +CNID_DEV_OFS, stamp, sizeof(stamp)); } switch (rc = cursor->c_put(cursor, &rootinfo_key, &rootinfo_data, flag)) { case 0: break; default: LOG(log_error, logtype_default, "cnid_add: Unable to update rootinfo: %s", db_strerror(rc)); errno = CNID_ERR_DB; goto cleanup; } if ((rc = cursor->c_close(cursor)) != 0) { LOG(log_error, logtype_default, "get_cnid: Unable to close cursor: %s", db_strerror(rc)); errno = CNID_ERR_DB; return CNID_INVALID; } return hint; cleanup: if ((rc = cursor->c_close(cursor)) != 0) { LOG(log_error, logtype_default, "get_cnid: Unable to close cursor: %s", db_strerror(rc)); return CNID_INVALID; } return CNID_INVALID; } /* ------------------------ */ cnid_t cnid_cdb_add(struct _cnid_db *cdb, const struct stat *st, const cnid_t did, char *name, const size_t len, cnid_t hint) { CNID_private *db; DBT key, data; cnid_t id; int rc; if (!cdb || !(db = cdb->_private) || !st || !name) { errno = CNID_ERR_PARAM; return CNID_INVALID; } /* Do a lookup. */ id = cnid_cdb_lookup(cdb, st, did, name, len); /* ... Return id if it is valid, or if Rootinfo is read-only. */ if (id || (db->flags & CNIDFLAG_DB_RO)) { #ifdef DEBUG LOG(log_debug9, logtype_default, "cnid_add: Looked up did %u, name %s as %u", ntohl(did), name, ntohl(id)); #endif return id; } /* Initialize our DBT data structures. */ memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); if ((data.data = make_cnid_data(cdb->flags, st, did, name, len)) == NULL) { LOG(log_error, logtype_default, "cnid_add: Path name is too long"); errno = CNID_ERR_PATH; return CNID_INVALID; } data.size = CNID_HEADER_LEN + len + 1; if ((hint = get_cnid(db)) == 0) { errno = CNID_ERR_DB; return CNID_INVALID; } memcpy(data.data, &hint, sizeof(hint)); key.data = &hint; key.size = sizeof(hint); /* Now we need to add the CNID data to the databases. */ if ((rc = db->db_cnid->put(db->db_cnid, tid, &key, &data, DB_NOOVERWRITE))) { if (rc == EINVAL) { /* if we have a duplicate * on cnid it's a fatal error. * on dev:inode * - leftover should have been delete before. * - a second process already updated the db * - it's a new file eg our file is already deleted and replaced * on did:name leftover */ if (cnid_cdb_update(cdb, hint, st, did, name, len)) { errno = CNID_ERR_DB; return CNID_INVALID; } } else { LOG(log_error, logtype_default , "cnid_add: Failed to add CNID for %s to database using hint %u: %s", name, ntohl(hint), db_strerror(rc)); errno = CNID_ERR_DB; return CNID_INVALID; } } #ifdef DEBUG LOG(log_debug9, logtype_default, "cnid_add: Returned CNID for did %u, name %s as %u", ntohl(did), name, ntohl(hint)); #endif return hint; } /* cnid_cbd_getstamp */ /*-----------------------*/ int cnid_cdb_getstamp(struct _cnid_db *cdb, void *buffer, const size_t len) { DBT key, data; int rc; CNID_private *db; if (!cdb || !(db = cdb->_private) || !buffer || !len) { errno = CNID_ERR_PARAM; return -1; } memset(buffer, 0, len); memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); key.data = ROOTINFO_KEY; key.size = ROOTINFO_KEYLEN; if (0 != (rc = db->db_cnid->get(db->db_cnid, NULL, &key, &data, 0 )) ) { if (rc != DB_NOTFOUND) { LOG(log_error, logtype_default, "cnid_lookup: Unable to get database stamp: %s", db_strerror(rc)); errno = CNID_ERR_DB; return -1; } /* we waste a single ID here... */ get_cnid(db); memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); key.data = ROOTINFO_KEY; key.size = ROOTINFO_KEYLEN; if (0 != (rc = db->db_cnid->get(db->db_cnid, NULL, &key, &data, 0 )) ) { LOG(log_error, logtype_default, "cnid_getstamp: failed to get rootinfo: %s", db_strerror(rc)); errno = CNID_ERR_DB; return -1; } } memcpy(buffer, (char*)data.data + CNID_DEV_OFS, len); #ifdef DEBUG LOG(log_debug9, logtype_cnid, "cnid_getstamp: Returning stamp"); #endif return 0; } #endif /* CNID_BACKEND_CDB */ netatalk-2.2.2/libatalk/cnid/cdb/cnid_cdb_meta.h0000644000175200017500000000364611655731127016420 00000000000000/* * $Id: cnid_cdb_meta.h,v 1.2 2005-04-28 20:49:59 bfernhomberg Exp $ */ #define CNID_META_CNID_LEN 4 #define CNID_META_MDATE_LEN 4 /* space for 8 */ #define CNID_META_CDATE_LEN 4 /* space for 8 */ #define CNID_META_BDATE_LEN 4 /* ditto */ #define CNID_META_ADATE_LEN 4 /* ditto */ #define CNID_META_AFPI_LEN 4 /* plus permission bits */ #define CNID_META_FINDERI_LEN 32 #define CNID_META_PRODOSI_LEN 8 #define CNID_META_RFORKLEN_LEN 4 /* space for 8 */ #define CNID_META_MACNAME_LEN 32 /* maximum size */ #define CNID_META_SHORTNAME_LEN 12 /* max size (8.3) */ #define CNID_META_FILLER_LEN 4 #define CNID_META_CNID_OFF 0 #define CNID_META_MDATE_OFF (CNID_META_CNID_OFF + CNID_META_CNID_LEN + \ CNID_META_FILLER_LEN) #define CNID_META_CDATE_OFF (CNID_META_MDATE_OFF + CNID_META_MDATE_LEN + \ CNID_META_FILLER_LEN) #define CNID_META_BDATE_OFF (CNID_META_CDATE_OFF + CNID_META_CDATE_LEN + \ CNID_META_FILLER_LEN) #define CNID_META_ADATE_OFF (CNID_META_BDATE_OFF + CNID_META_BDATE_LEN + \ CNID_META_FILLER_LEN) #define CNID_META_AFPI_OFF (CNID_META_ADATE_OFF + CNID_META_ADATE_LEN) #define CNID_META_FINDERI_OFF (CNID_META_AFPI_OFF + CNID_META_AFPI_LEN) #define CNID_META_PRODOSI_OFF (CNID_META_FINDERI_OFF + CNID_META_FINDERI_LEN) #define CNID_META_RFORKLEN_OFF (CNID_META_PRODOSI_OFF + CNID_META_PRODOSI_LEN) #define CNID_META_MACNAME_OFF (CNID_META_RFORKLEN_OFF + \ CNID_META_RFORKLEN_LEN) #define CNID_META_SHORTNAME_OFF (CNID_META_MACNAME_OFF + #define cnid_meta_clear(a) #define cnid_meta_get(id) #define cnid_meta_cnid(a) #define cnid_meta_modifydate(a) #define cnid_meta_createdate(a) #define cnid_meta_backupdate(a) #define cnid_meta_accessdate(a) #define cnid_meta_afpi(a) #define cnid_meta_finderi(a) #define cnid_meta_prodosi(a) #define cnid_meta_rforklen(a) #define cnid_meta_macname(a) #define cnid_meta_shortname(a) #define cnid_meta_longname(a) netatalk-2.2.2/libatalk/cnid/cdb/cnid_cdb_nextid.c0000644000175200017500000000105711655731127016752 00000000000000/* * $Id: cnid_cdb_nextid.c,v 1.2 2005-04-28 20:49:59 bfernhomberg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef CNID_BACKEND_CDB #ifdef unused #include "cnid_cdb_private.h" /* return the next id. we use the fact that ad files are memory * mapped. */ cnid_t cnid_cdb_nextid(struct _cnid_db *cdb) { CNID_private *db; cnid_t id; if (!cdb || !(db = cdb->_private)) return 0; memcpy(&id, ad_entry(&db->rootinfo, ADEID_DID), sizeof(id)); return id; } #endif #endif /* CNID_BACKEND_CDB */ netatalk-2.2.2/libatalk/cnid/cdb/cnid_cdb_close.c0000644000175200017500000000147011655731127016563 00000000000000/* * $Id: cnid_cdb_close.c,v 1.2 2005-04-28 20:49:59 bfernhomberg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef CNID_BACKEND_CDB #include "cnid_cdb_private.h" void cnid_cdb_close(struct _cnid_db *cdb) { CNID_private *db; if (!cdb) { LOG(log_error, logtype_afpd, "cnid_close called with NULL argument !"); return; } if (!(db = cdb->_private)) { return; } db->db_didname->sync(db->db_didname, 0); db->db_devino->sync(db->db_devino, 0); db->db_cnid->sync(db->db_cnid, 0); db->db_didname->close(db->db_didname, 0); db->db_devino->close(db->db_devino, 0); db->db_cnid->close(db->db_cnid, 0); db->dbenv->close(db->dbenv, 0); free(db); free(cdb->volpath); free(cdb); } #endif /* CNID_BACKEND_CDB */ netatalk-2.2.2/libatalk/cnid/cdb/cnid_cdb_lookup.c0000644000175200017500000001007411655731127016767 00000000000000/* * $Id: cnid_cdb_lookup.c,v 1.6 2009-11-20 17:22:11 didg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef CNID_BACKEND_CDB #include "cnid_cdb_private.h" #define LOGFILEMAX 100 /* kbytes */ #define CHECKTIMEMAX 30 /* minutes */ /* This returns the CNID corresponding to a particular file. It will * also fix up the various databases if there's a problem. */ cnid_t cnid_cdb_lookup(struct _cnid_db *cdb, const struct stat *st, const cnid_t did, char *name, const size_t len) { unsigned char *buf; CNID_private *db; DBT key, devdata, diddata; char dev[CNID_DEV_LEN]; char ino[CNID_INO_LEN]; int devino = 1, didname = 1; u_int32_t type_devino = (unsigned)-1; u_int32_t type_didname = (unsigned)-1; u_int32_t type; int update = 0; cnid_t id_devino, id_didname,id = 0; int rc; if (!cdb || !(db = cdb->_private) || !st || !name) { return 0; } if ((buf = make_cnid_data(cdb->flags, st, did, name, len)) == NULL) { LOG(log_error, logtype_default, "cnid_lookup: Pathname is too long"); return 0; } memcpy(&type, buf +CNID_TYPE_OFS, sizeof(type)); type = ntohl(type); memset(&key, 0, sizeof(key)); memset(&diddata, 0, sizeof(diddata)); memset(&devdata, 0, sizeof(devdata)); /* Look for a CNID for our did/name */ key.data = buf +CNID_DEVINO_OFS; key.size = CNID_DEVINO_LEN; memcpy(dev, buf + CNID_DEV_OFS, CNID_DEV_LEN); memcpy(ino, buf + CNID_INO_OFS, CNID_INO_LEN); if (0 != (rc = db->db_didname->get(db->db_devino, NULL, &key, &devdata, 0 )) ) { if (rc != DB_NOTFOUND) { LOG(log_error, logtype_default, "cnid_lookup: Unable to get CNID did 0x%x, name %s: %s", did, name, db_strerror(rc)); return 0; } devino = 0; } else { memcpy(&id_devino, devdata.data, sizeof(cnid_t)); memcpy(&type_devino, (char *)devdata.data +CNID_TYPE_OFS, sizeof(type_devino)); type_devino = ntohl(type_devino); } buf = make_cnid_data(cdb->flags, st, did, name, len); key.data = buf +CNID_DID_OFS; key.size = CNID_DID_LEN + len + 1; if (0 != (rc = db->db_didname->get(db->db_didname, NULL, &key, &diddata, 0 ) ) ) { if (rc != DB_NOTFOUND) { LOG(log_error, logtype_default, "cnid_lookup: Unable to get CNID did 0x%x, name %s: %s", did, name, db_strerror(rc)); return 0; } didname = 0; } else { memcpy(&id_didname, diddata.data, sizeof(cnid_t)); memcpy(&type_didname, (char *)diddata.data +CNID_TYPE_OFS, sizeof(type_didname)); type_didname = ntohl(type_didname); } if (!devino && !didname) { return 0; } if (devino && didname && id_devino == id_didname && type_devino == type) { /* the same */ return id_didname; } if (didname) { id = id_didname; /* we have a did:name * if it's the same dev or not the same type * just delete it */ if (!memcmp(dev, (char *)diddata.data + CNID_DEV_OFS, CNID_DEV_LEN) || type_didname != type) { if (cnid_cdb_delete(cdb, id) < 0) { return 0; } } else { update = 1; } } if (devino) { id = id_devino; if (type_devino != type) { /* same dev:inode but not same type one is a folder the other * is a file,it's an inode reused, delete the record */ if (cnid_cdb_delete(cdb, id) < 0) { return 0; } } else { update = 1; } } if (!update) { return 0; } /* Fix up the database. assume it was a file move and rename */ cnid_cdb_update(cdb, id, st, did, name, len); #ifdef DEBUG LOG(log_debug9, logtype_default, "cnid_lookup: Looked up did %u, name %s, as %u (needed update)", ntohl(did), name, ntohl(id)); #endif return id; } #endif /* CNID_BACKEND_CDB */ netatalk-2.2.2/libatalk/cnid/cdb/cnid_cdb_resolve.c0000644000175200017500000000233711655731127017140 00000000000000/* * $Id: cnid_cdb_resolve.c,v 1.5 2009-10-29 13:38:16 didg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef CNID_BACKEND_CDB #include "cnid_cdb_private.h" /* Return the did/name pair corresponding to a CNID. */ char *cnid_cdb_resolve(struct _cnid_db *cdb, cnid_t *id, void *buffer, size_t len) { CNID_private *db; DBT key, data; int rc; if (!cdb || !(db = cdb->_private) || !id || !(*id)) { return NULL; } memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); data.data = buffer; data.ulen = len; data.flags = DB_DBT_USERMEM; key.data = id; key.size = sizeof(cnid_t); while ((rc = db->db_cnid->get(db->db_cnid, NULL, &key, &data, 0))) { if (rc != DB_NOTFOUND) { LOG(log_error, logtype_default, "cnid_resolve: Unable to get did/name: %s", db_strerror(rc)); } *id = 0; return NULL; } memcpy(id, (char *)data.data +CNID_DID_OFS, sizeof(cnid_t)); #ifdef DEBUG LOG(log_debug9, logtype_default, "cnid_resolve: Returning id = %u, did/name = %s", ntohl(*id), (char *)data.data + CNID_NAME_OFS); #endif return (char *)data.data + CNID_NAME_OFS; } #endif netatalk-2.2.2/libatalk/cnid/cdb/cnid_cdb_rebuild_add.c0000644000175200017500000000770011655731127017716 00000000000000/* * $Id: cnid_cdb_rebuild_add.c,v 1.6 2009-11-20 17:22:11 didg Exp $ * * All Rights Reserved. See COPYRIGHT. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef CNID_BACKEND_CDB #include "cnid_cdb_private.h" #define tid NULL #define DEBUG 1 #include "cnid_cdb.h" /* ----------------------------- */ static cnid_t set_max_cnid(CNID_private *db, cnid_t hint) { DBT rootinfo_key, rootinfo_data; int rc; char buf[ROOTINFO_DATALEN]; cnid_t id, id1; time_t t; memset(&rootinfo_key, 0, sizeof(rootinfo_key)); memset(&rootinfo_data, 0, sizeof(rootinfo_data)); rootinfo_key.data = ROOTINFO_KEY; rootinfo_key.size = ROOTINFO_KEYLEN; switch ((rc = db->db_cnid->get(db->db_cnid, tid, &rootinfo_key, &rootinfo_data, 0))) { case 0: memcpy(buf, (char *)rootinfo_data.data, ROOTINFO_DATALEN); break; case DB_NOTFOUND: /* FIXME: This duplicates stuff from cnid_cdb_add.c. We also implicitely assume that sizeof(time_t) <= CNID_DEV_LEN */ memcpy(buf, ROOTINFO_DATA, ROOTINFO_DATALEN); t = time(NULL); memset(buf + CNID_DEV_OFS, 0, CNID_DEV_LEN); memcpy(buf + CNID_DEV_OFS, &t, sizeof(time_t)); id = htonl(CNID_START); memcpy(buf + CNID_TYPE_OFS, &id, sizeof(id)); break; default: LOG(log_error, logtype_default, "set_max_cnid: Unable to read rootinfo: %s", db_strerror(rc)); errno = CNID_ERR_DB; goto cleanup; } memcpy(&id, buf + CNID_TYPE_OFS, sizeof(id)); id = ntohl(id); id1 = ntohl(hint); if (id1 > id) { memcpy(buf + CNID_TYPE_OFS, &hint, sizeof(hint)); rootinfo_data.data = buf; rootinfo_data.size = ROOTINFO_DATALEN; if ((rc = db->db_cnid->put(db->db_cnid, tid, &rootinfo_key, &rootinfo_data, 0))) { LOG(log_error, logtype_default, "set_max_cnid: Unable to write rootinfo: %s", db_strerror(rc)); errno = CNID_ERR_DB; goto cleanup; } } return hint; cleanup: return CNID_INVALID; } /* ------------------------ */ cnid_t cnid_cdb_rebuild_add(struct _cnid_db *cdb, const struct stat *st, const cnid_t did, char *name, const size_t len, cnid_t hint) { CNID_private *db; DBT key, data; int rc; if (!cdb || !(db = cdb->_private) || !st || !name || hint == CNID_INVALID || hint < CNID_START) { errno = CNID_ERR_PARAM; return CNID_INVALID; } #if 0 /* FIXME: Bjoern does a lookup. Should we not overwrite unconditionally? */ /* Do a lookup. */ id = cnid_cdb_lookup(cdb, st, did, name, len); /* ... Return id if it is valid, or if Rootinfo is read-only. */ if (id || (db->flags & CNIDFLAG_DB_RO)) { #ifdef DEBUG LOG(log_debug9, logtype_default, "cnid_add: Looked up did %u, name %s as %u", ntohl(did), name, ntohl(id)); #endif return id; } #endif /* Initialize our DBT data structures. */ memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); if ((data.data = make_cnid_data(cdb->flags, st, did, name, len)) == NULL) { LOG(log_error, logtype_default, "cnid_add: Path name is too long"); errno = CNID_ERR_PATH; return CNID_INVALID; } data.size = CNID_HEADER_LEN + len + 1; memcpy(data.data, &hint, sizeof(hint)); key.data = &hint; key.size = sizeof(hint); /* Now we need to add the CNID data to the databases. */ if ((rc = db->db_cnid->put(db->db_cnid, tid, &key, &data, 0))) { LOG(log_error, logtype_default , "cnid_add: Failed to add CNID for %s to database using hint %u: %s", name, ntohl(hint), db_strerror(rc)); errno = CNID_ERR_DB; goto cleanup; } if (set_max_cnid(db, hint) == CNID_INVALID) { errno = CNID_ERR_DB; goto cleanup; } #ifdef DEBUG LOG(log_debug9, logtype_default, "cnid_add: Returned CNID for did %u, name %s as %u", ntohl(did), name, ntohl(hint)); #endif return hint; cleanup: return CNID_INVALID; } #endif /* CNID_BACKEND_CDB */ netatalk-2.2.2/libatalk/cnid/cdb/cnid_cdb_meta.c0000644000175200017500000000032211655731127016377 00000000000000/* * $Id: cnid_cdb_meta.c,v 1.2 2005-04-28 20:49:59 bfernhomberg Exp $ * * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. * * deal with metadata * */ netatalk-2.2.2/libatalk/cnid/cdb/cnid_cdb_get.c0000644000175200017500000000252511655731127016237 00000000000000/* * $Id: cnid_cdb_get.c,v 1.5 2009-10-29 13:38:16 didg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef CNID_BACKEND_CDB #include "cnid_cdb_private.h" /* Return CNID for a given did/name. */ cnid_t cnid_cdb_get(struct _cnid_db *cdb, const cnid_t did, char *name, const size_t len) { char start[CNID_DID_LEN + MAXPATHLEN + 1], *buf; CNID_private *db; DBT key, data; cnid_t id; int rc; if (!cdb || !(db = cdb->_private) || (len > MAXPATHLEN)) { return 0; } memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); buf = start; memcpy(buf, &did, sizeof(did)); buf += sizeof(did); memcpy(buf, name, len); *(buf + len) = '\0'; /* Make it a C-string. */ key.data = start; key.size = CNID_DID_LEN + len + 1; while ((rc = db->db_didname->get(db->db_didname, NULL, &key, &data, 0))) { if (rc != DB_NOTFOUND) { LOG(log_error, logtype_default, "cnid_get: Unable to get CNID %u, name %s: %s", ntohl(did), name, db_strerror(rc)); } return 0; } memcpy(&id, data.data, sizeof(id)); #ifdef DEBUG LOG(log_debug9, logtype_default, "cnid_get: Returning CNID for %u, name %s as %u", ntohl(did), name, ntohl(id)); #endif return id; } #endif /* CNID_BACKEND_CDB */ netatalk-2.2.2/libatalk/cnid/cdb/README0000644000175200017500000000305711655731127014370 00000000000000the catalog database keeps track of three mappings: CNID -> dev/ino and did/name dev/ino -> CNID did/name -> CNID dev/ino is used to keep track of magically moved files. did/name is for quick lookups of CNIDs. NOTE: the database will append a nul byte to the end of name. in addition, name should be given as it appears on disk. this allows the creation of cnid updating/cleaning programs that don't have to deal with knowing what the particular codepage is. here's the ritual: 1) open a volume. call cnid_open. 2) every time you need a CNID, call cnid_add(). it will automatically look for an existing cnid and add a new one if one isn't already there. you can pass a hint if you want. the only use this has right now is to enable consistency between AFP and HFS. in the future, it would allow people to write conversion utilities that pre-instantiate a database without needing to re-assign CNIDs. 3) if you want to just look for a CNID without automatically adding one in, you have two choices: a) cnid_resolve takes a CNID, returns name, and over-writes the CNID given with the parent DID. this is good for FPResolveID. b) cnid_lookup returns a CNID corresponding to the dev/ino,did/name keys. it will auto-update the catalog database if there's a discrepancy. NOTE: cnid_add calls this before adding a new CNID. 4) when you delete a file or directory, you need to call cnid_delete with the CNID for that file/directory. 5) call cnid_close when closing the volume. netatalk-2.2.2/libatalk/cnid/cdb/cnid_cdb.h0000644000175200017500000000311311655731127015377 00000000000000/* * interface for database access to cnids. i do it this way to abstract * things a bit in case we want to change the underlying implementation. */ #ifndef _ATALK_CNID_CDB__H #define _ATALK_CNID_CDB__H 1 #include #include #include #include #include #include /* cnid_open.c */ extern struct _cnid_module cnid_cdb_module; extern struct _cnid_db *cnid_cdb_open (struct cnid_open_args *args); /* cnid_close.c */ extern void cnid_cdb_close (struct _cnid_db *); /* cnid_add.c */ extern cnid_t cnid_cdb_add (struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t, cnid_t); extern int cnid_cdb_getstamp (struct _cnid_db *, void *, const size_t ); /* cnid_get.c */ extern cnid_t cnid_cdb_get (struct _cnid_db *, const cnid_t, char *, const size_t); extern char *cnid_cdb_resolve (struct _cnid_db *, cnid_t *, void *, size_t ); extern cnid_t cnid_cdb_lookup (struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t); /* cnid_update.c */ extern int cnid_cdb_update (struct _cnid_db *, const cnid_t, const struct stat *, const cnid_t, char *, size_t); /* cnid_delete.c */ extern int cnid_cdb_delete (struct _cnid_db *, const cnid_t); /* cnid_nextid.c */ extern cnid_t cnid_cdb_nextid (struct _cnid_db *); extern int cnid_cdb_lock (void *); extern int cnid_cdb_unlock (void *); extern cnid_t cnid_cdb_rebuild_add (struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t, cnid_t); #endif /* include/atalk/cnid_cdb.h */ netatalk-2.2.2/libatalk/cnid/cdb/cnid_cdb_delete.c0000644000175200017500000000210111655731127016710 00000000000000/* * $Id: cnid_cdb_delete.c,v 1.4 2009-10-29 13:38:16 didg Exp $ * * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. * * cnid_delete: delete a CNID from the database */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef CNID_BACKEND_CDB #include "cnid_cdb_private.h" #define tid NULL int cnid_cdb_delete(struct _cnid_db *cdb, const cnid_t id) { CNID_private *db; DBT key; int rc; if (!cdb || !(db = cdb->_private) || !id || (db->flags & CNIDFLAG_DB_RO)) { return -1; } memset(&key, 0, sizeof(key)); /* Get from ain CNID database. */ key.data = (cnid_t *)&id; key.size = sizeof(id); if ((rc = db->db_cnid->del(db->db_cnid, tid, &key, 0))) { LOG(log_error, logtype_default, "cnid_delete: Unable to delete CNID %u: %s", ntohl(id), db_strerror(rc)); } else { #ifdef DEBUG LOG(log_debug9, logtype_default, "cnid_delete: Deleting CNID %u", ntohl(id)); #endif } return rc; } #endif /* CNID_BACKEND_CDB */ netatalk-2.2.2/libatalk/cnid/cdb/cnid_cdb_update.c0000644000175200017500000000633211655731127016742 00000000000000/* * $Id: cnid_cdb_update.c,v 1.4 2009-11-20 17:22:11 didg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef CNID_BACKEND_CDB #include "cnid_cdb_private.h" #define tid NULL /* cnid_update: takes the given cnid and updates the metadata. To * handle the did/name data, there are a bunch of functions to get * and set the various fields. */ int cnid_cdb_update(struct _cnid_db *cdb, const cnid_t id, const struct stat *st, const cnid_t did, char *name, const size_t len /*, const char *info, const int infolen*/) { unsigned char *buf; CNID_private *db; DBT key, pkey, data; int rc; int notfound = 0; char getbuf[CNID_HEADER_LEN + MAXPATHLEN +1]; if (!cdb || !(db = cdb->_private) || !id || !st || !name || (db->flags & CNIDFLAG_DB_RO)) { return -1; } memset(&key, 0, sizeof(key)); memset(&pkey, 0, sizeof(pkey)); memset(&data, 0, sizeof(data)); buf = make_cnid_data(cdb->flags, st, did, name, len); key.data = buf +CNID_DEVINO_OFS; key.size = CNID_DEVINO_LEN; data.data = getbuf; data.size = CNID_HEADER_LEN + MAXPATHLEN + 1; if (0 != (rc = db->db_devino->pget(db->db_devino, tid, &key, &pkey, &data, 0)) ) { #if DB_VERSION_MAJOR >= 4 if (rc != DB_NOTFOUND && rc != DB_SECONDARY_BAD) { #else if (rc != DB_NOTFOUND) { #endif LOG(log_error, logtype_default, "cnid_update: Unable to get devino CNID %u, name %s: %s", ntohl(did), name, db_strerror(rc)); goto fin; } notfound = 1; } else { if ((rc = db->db_cnid->del(db->db_cnid, tid, &pkey, 0))) { LOG(log_error, logtype_default, "cnid_update: Unable to delete CNID %u: %s", ntohl(id), db_strerror(rc)); } } memset(&pkey, 0, sizeof(pkey)); buf = make_cnid_data(cdb->flags, st, did, name, len); key.data = buf + CNID_DID_OFS; key.size = CNID_DID_LEN + len + 1; if (0 != (rc = db->db_didname->pget(db->db_didname, tid, &key, &pkey, &data, 0)) ) { #if DB_VERSION_MAJOR >= 4 if (rc != DB_NOTFOUND && rc != DB_SECONDARY_BAD) { #else if (rc != DB_NOTFOUND) { #endif LOG(log_error, logtype_default, "cnid_update: Unable to get didname CNID %u, name %s: %s", ntohl(did), name, db_strerror(rc)); goto fin; } notfound |= 2; } else { if ((rc = db->db_cnid->del(db->db_cnid, tid, &pkey, 0))) { LOG(log_error, logtype_default, "cnid_update: Unable to delete CNID %u: %s", ntohl(id), db_strerror(rc)); } } memset(&key, 0, sizeof(key)); key.data = (cnid_t *)&id; key.size = sizeof(id); memset(&data, 0, sizeof(data)); /* Make a new entry. */ buf = make_cnid_data(cdb->flags, st, did, name, len); data.data = buf; memcpy(data.data, &id, sizeof(id)); data.size = CNID_HEADER_LEN + len + 1; /* Update the old CNID with the new info. */ if ((rc = db->db_cnid->put(db->db_cnid, tid, &key, &data, 0))) { LOG(log_error, logtype_default, "cnid_update: (%d) Unable to update CNID %u:%s: %s", notfound, ntohl(id), name, db_strerror(rc)); goto fin; } return 0; fin: return -1; } #endif netatalk-2.2.2/libatalk/cnid/README0000644000175200017500000000336011655731127013635 00000000000000 CNID back-end refactoring This patch allows to compile all DID schemes into afpd binary and then select desired schemes at runtime, per volume. Changes: Libatalk/cnid directory as been restructured. Now it contains subdirectories representing particular back-end types and a simple cnid-object factory (cnid.c and cnid_init.c). All CNID functions have been grouped into a structure which contains function pointers and some data. Main afpd code uses them in a object manner rather than structural: it calls cnid functions through fields of cnid_db structure. Actually there are standard backends: transactional db3, cdb, last and mtab (I'm not sure how to call mtab - it does some magic with dev/inode numbers, but mtab has been removed some time ago). Changes in ./configure options: Options --with-did=xxx, --with-cdb have been removed. Instead, there are following options: --with-cnid-cdb-backend - compile DB3 Concurrent Datastore backend --with-cnid-db3-backend - compile DB3 transactional backend --with-cnid-last-backend - compile LAST backend --with-cnid-mtab-backend - compile MTAB backend --with-cnid-default-backend={cdb|db3|last|mtab} Some of the backend names should be (propably) changed (mtab? db3?). AppleVolumes.default file has a new option: -cnidscheme:{db3|cdb|last|mtab} Again, sorry for this weird naming. I didn't care about it while coding, some cleanups have to be done later. Was tested mainly against test-suite and against MacOS 9 client. Things to do: - some really reliable kind of backend should be developed - file-name mangling should be runtime option - naming- and code cleanups are still needed - optional dynamic CNID backend loading - lower priority, static linking option has still to be available netatalk-2.2.2/libatalk/cnid/last/0000777000175200017500000000000011704770417014002 500000000000000netatalk-2.2.2/libatalk/cnid/last/Makefile.am0000644000175200017500000000026011655731127015750 00000000000000# Makefile.am for libatalk/cnid/ if USE_LAST_BACKEND noinst_LTLIBRARIES = libcnid_last.la endif libcnid_last_la_SOURCES = cnid_last.c \ cnid_last.h EXTRA_DIST = README netatalk-2.2.2/libatalk/cnid/last/Makefile.in0000644000175200017500000003733311703521727015771 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/cnid/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = libatalk/cnid/last DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcnid_last_la_LIBADD = am_libcnid_last_la_OBJECTS = cnid_last.lo libcnid_last_la_OBJECTS = $(am_libcnid_last_la_OBJECTS) @USE_LAST_BACKEND_TRUE@am_libcnid_last_la_rpath = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcnid_last_la_SOURCES) DIST_SOURCES = $(libcnid_last_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @USE_LAST_BACKEND_TRUE@noinst_LTLIBRARIES = libcnid_last.la libcnid_last_la_SOURCES = cnid_last.c \ cnid_last.h EXTRA_DIST = README all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/cnid/last/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/cnid/last/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libcnid_last.la: $(libcnid_last_la_OBJECTS) $(libcnid_last_la_DEPENDENCIES) $(LINK) $(am_libcnid_last_la_rpath) $(libcnid_last_la_OBJECTS) $(libcnid_last_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnid_last.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/cnid/last/cnid_last.c0000644000175200017500000001165211655731127016027 00000000000000 /* * $Id: cnid_last.c,v 1.5 2010-03-31 09:47:32 franklahm Exp $ * * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef CNID_BACKEND_LAST #include #include "cnid_last.h" #include #include #include #include #include /* ------------------------ */ cnid_t cnid_last_add(struct _cnid_db *cdb, const struct stat *st, const cnid_t did _U_, char *name _U_, const size_t len _U_, cnid_t hint _U_) { /* FIXME: it relies on fact, that this is never called twice for the same file/dir. */ /* Propably we should look through DID tree. */ /* * First thing: DID and FNUMs are * in the same space for purposes of enumerate (and several * other wierd places). While we consider this Apple's bug, * this is the work-around: In order to maintain constant and * unique DIDs and FNUMs, we monotonically generate the DIDs * during the session, and derive the FNUMs from the filesystem. * Since the DIDs are small, we insure that the FNUMs are fairly * large by setting thier high bits to the device number. * * AFS already does something very similar to this for the * inode number, so we don't repeat the procedure. * * new algorithm: * due to complaints over did's being non-persistent, * here's the current hack to provide semi-persistent * did's: * 1) we reserve the first bit for file ids. * 2) the next 7 bits are for the device. * 3) the remaining 24 bits are for the inode. * * both the inode and device information are actually hashes * that are then truncated to the requisite bit length. * * it should be okay to use lstat to deal with symlinks. */ struct _cnid_last_private *priv; if (!cdb || !(cdb->_private)) return CNID_INVALID; priv = (struct _cnid_last_private *) (cdb->_private); if (S_ISDIR(st->st_mode)) return htonl(priv->last_did++); else return htonl((st->st_dev << 16) | (st->st_ino & 0x0000ffff)); } void cnid_last_close(struct _cnid_db *cdb) { free(cdb->volpath); free(cdb->_private); free(cdb); } int cnid_last_delete(struct _cnid_db *cdb _U_, const cnid_t id _U_) { return CNID_INVALID; } /* Return CNID for a given did/name. */ cnid_t cnid_last_get(struct _cnid_db *cdb _U_, const cnid_t did _U_, char *name _U_, const size_t len _U_) { /* FIXME: it relies on fact, that this is never called twice for the same file/dir. */ /* Propably we should look through DID tree. */ return CNID_INVALID; } /* */ cnid_t cnid_last_lookup(struct _cnid_db *cdb _U_, const struct stat *st _U_, const cnid_t did _U_, char *name _U_, const size_t len _U_) { /* FIXME: this function doesn't work in [last] scheme ! */ /* Should be never called or CNID should be somewhat refactored again. */ return CNID_INVALID; } static struct _cnid_db *cnid_last_new(const char *volpath) { struct _cnid_db *cdb; struct _cnid_last_private *priv; if ((cdb = (struct _cnid_db *) calloc(1, sizeof(struct _cnid_db))) == NULL) return NULL; if ((cdb->volpath = strdup(volpath)) == NULL) { free(cdb); return NULL; } if ((cdb->_private = calloc(1, sizeof(struct _cnid_last_private))) == NULL) { free(cdb->volpath); free(cdb); return NULL; } /* Set up private state */ priv = (struct _cnid_last_private *) (cdb->_private); priv->last_did = 17; /* Set up standard fields */ cdb->flags = 0; cdb->cnid_add = cnid_last_add; cdb->cnid_delete = cnid_last_delete; cdb->cnid_get = cnid_last_get; cdb->cnid_lookup = cnid_last_lookup; cdb->cnid_nextid = NULL; /* cnid_last_nextid; */ cdb->cnid_resolve = cnid_last_resolve; cdb->cnid_update = cnid_last_update; cdb->cnid_close = cnid_last_close; return cdb; } struct _cnid_db *cnid_last_open(struct cnid_open_args *args) { struct _cnid_db *cdb; if (!args->dir) { return NULL; } if ((cdb = cnid_last_new(args->dir)) == NULL) { LOG(log_error, logtype_default, "cnid_open: Unable to allocate memory for database"); return NULL; } return cdb; } struct _cnid_module cnid_last_module = { "last", {NULL, NULL}, cnid_last_open, 0 }; /* Return the did/name pair corresponding to a CNID. */ char *cnid_last_resolve(struct _cnid_db *cdb _U_, cnid_t * id _U_, void *buffer _U_, size_t len _U_) { /* FIXME: frankly, it does not work. As get, add and other functions. */ return NULL; } int cnid_last_update(struct _cnid_db *cdb _U_, const cnid_t id _U_, const struct stat *st _U_, const cnid_t did _U_, char *name _U_, const size_t len _U_) { return 0; } #endif /* CNID_BACKEND_LAST */ netatalk-2.2.2/libatalk/cnid/last/README0000644000175200017500000000024411655731127014576 00000000000000This is [last] DID scheme implementation. TODO: this scheme doesn't exactly mimic real, persistent CNID schemes, so things like name mangling won't work. netatalk-2.2.2/libatalk/cnid/last/cnid_last.h0000644000175200017500000000233011655731127016025 00000000000000 /* * interface for database access to cnids. i do it this way to abstract * things a bit in case we want to change the underlying implementation. */ #ifndef _ATALK_CNID_LAST__H #define _ATALK_CNID_LAST__H 1 #include #include #include #include #include #include struct _cnid_last_private { cnid_t last_did; }; extern struct _cnid_module cnid_last_module; extern struct _cnid_db *cnid_last_open (struct cnid_open_args *args); extern void cnid_last_close (struct _cnid_db *); extern cnid_t cnid_last_add (struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t, cnid_t); extern cnid_t cnid_last_get (struct _cnid_db *, const cnid_t, char *, const size_t); extern char *cnid_last_resolve (struct _cnid_db *, cnid_t *, void *, size_t); extern cnid_t cnid_last_lookup (struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t); extern int cnid_last_update (struct _cnid_db *, const cnid_t, const struct stat *, const cnid_t, char *, size_t); extern int cnid_last_delete (struct _cnid_db *, const cnid_t); #endif /* include/atalk/cnid_last.h */ netatalk-2.2.2/libatalk/cnid/tdb/0000777000175200017500000000000011704770417013610 500000000000000netatalk-2.2.2/libatalk/cnid/tdb/cnid_tdb_add.c0000644000175200017500000001355511655731127016257 00000000000000/* * $Id: cnid_tdb_add.c,v 1.4 2009-11-20 17:37:14 didg Exp $ * * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef CNID_BACKEND_TDB #include "cnid_tdb.h" #include #include #include #include #include #include static void make_devino_data(unsigned char *buf, dev_t dev, ino_t ino) { buf[CNID_DEV_LEN - 1] = dev; dev >>= 8; buf[CNID_DEV_LEN - 2] = dev; dev >>= 8; buf[CNID_DEV_LEN - 3] = dev; dev >>= 8; buf[CNID_DEV_LEN - 4] = dev; dev >>= 8; buf[CNID_DEV_LEN - 5] = dev; dev >>= 8; buf[CNID_DEV_LEN - 6] = dev; dev >>= 8; buf[CNID_DEV_LEN - 7] = dev; dev >>= 8; buf[CNID_DEV_LEN - 8] = dev; buf[CNID_DEV_LEN + CNID_INO_LEN - 1] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 2] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 3] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 4] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 5] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 6] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 7] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 8] = ino; } unsigned char *make_tdb_data(u_int32_t flags, const struct stat *st,const cnid_t did, const char *name, const size_t len) { static unsigned char start[CNID_HEADER_LEN + MAXPATHLEN + 1]; unsigned char *buf = start +CNID_LEN; u_int32_t i; if (len > MAXPATHLEN) return NULL; make_devino_data(buf, !(flags & CNID_FLAG_NODEV)?st->st_dev:0, st->st_ino); buf += CNID_DEVINO_LEN; i = S_ISDIR(st->st_mode)?1:0; i = htonl(i); memcpy(buf, &i, sizeof(i)); buf += sizeof(i); /* did is already in network byte order */ memcpy(buf, &did, sizeof(did)); buf += sizeof(did); memcpy(buf, name, len); *(buf + len) = '\0'; return start; } /* add an entry to the CNID databases. we do this as a transaction * to prevent messiness. * key: cnid * data: */ static int add_cnid (struct _cnid_tdb_private *db, TDB_DATA *key, TDB_DATA *data) { TDB_DATA altkey, altdata; memset(&altkey, 0, sizeof(altkey)); memset(&altdata, 0, sizeof(altdata)); /* main database */ if (tdb_store(db->tdb_cnid, *key, *data, TDB_REPLACE)) { goto abort; } /* dev/ino database */ altkey.dptr = data->dptr +CNID_DEVINO_OFS; altkey.dsize = CNID_DEVINO_LEN; altdata.dptr = key->dptr; altdata.dsize = key->dsize; if (tdb_store(db->tdb_devino, altkey, altdata, TDB_REPLACE)) { goto abort; } /* did/name database */ altkey.dptr = (char *) data->dptr +CNID_DID_OFS; altkey.dsize = data->dsize -CNID_DID_OFS; if (tdb_store(db->tdb_didname, altkey, altdata, TDB_REPLACE)) { goto abort; } return 0; abort: return -1; } /* ----------------------- */ static cnid_t get_cnid(struct _cnid_tdb_private *db) { TDB_DATA rootinfo_key, data; cnid_t hint,id; memset(&rootinfo_key, 0, sizeof(rootinfo_key)); memset(&data, 0, sizeof(data)); rootinfo_key.dptr = ROOTINFO_KEY; rootinfo_key.dsize = ROOTINFO_KEYLEN; tdb_chainlock(db->tdb_didname, rootinfo_key); data = tdb_fetch(db->tdb_didname, rootinfo_key); if (data.dptr) { memcpy(&hint, data.dptr, sizeof(cnid_t)); free(data.dptr); id = ntohl(hint); /* If we've hit the max CNID allowed, we return a fatal error. CNID * needs to be recycled before proceding. */ if (++id == CNID_INVALID) { LOG(log_error, logtype_default, "cnid_add: FATAL: CNID database has reached its limit."); errno = CNID_ERR_MAX; goto cleanup; } hint = htonl(id); } else { hint = htonl(CNID_START); } memset(&data, 0, sizeof(data)); data.dptr = (char *)&hint; data.dsize = sizeof(hint); if (tdb_store(db->tdb_didname, rootinfo_key, data, TDB_REPLACE)) { goto cleanup; } tdb_chainunlock(db->tdb_didname, rootinfo_key ); return hint; cleanup: tdb_chainunlock(db->tdb_didname, rootinfo_key); return CNID_INVALID; } /* ------------------------ */ cnid_t cnid_tdb_add(struct _cnid_db *cdb, const struct stat *st, const cnid_t did, char *name, const size_t len, cnid_t hint) { const struct stat *lstp; cnid_t id; struct _cnid_tdb_private *priv; TDB_DATA key, data; int rc; if (!cdb || !(priv = cdb->_private) || !st || !name) { errno = CNID_ERR_PARAM; return CNID_INVALID; } /* Do a lookup. */ id = cnid_tdb_lookup(cdb, st, did, name, len); /* ... Return id if it is valid, or if Rootinfo is read-only. */ if (id || (priv->flags & CNIDFLAG_DB_RO)) { return id; } #if 0 struct stat lst; lstp = lstat(name, &lst) < 0 ? st : &lst; #endif lstp = st; /* Initialize our DBT data structures. */ memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); key.dptr = (char *)&hint; key.dsize = sizeof(cnid_t); if ((data.dptr = make_tdb_data(cdb->flags, lstp, did, name, len)) == NULL) { LOG(log_error, logtype_default, "tdb_add: Path name is too long"); errno = CNID_ERR_PATH; return CNID_INVALID; } data.dsize = CNID_HEADER_LEN + len + 1; hint = get_cnid(priv); if (hint == 0) { errno = CNID_ERR_DB; return CNID_INVALID; } memcpy(data.dptr, &hint, sizeof(hint)); /* Now we need to add the CNID data to the databases. */ rc = add_cnid(priv, &key, &data); if (rc) { LOG(log_error, logtype_default, "tdb_add: Failed to add CNID for %s to database using hint %u", name, ntohl(hint)); errno = CNID_ERR_DB; return CNID_INVALID; } return hint; } #endif netatalk-2.2.2/libatalk/cnid/tdb/cnid_tdb_get.c0000644000175200017500000000171211655731127016276 00000000000000/* * $Id: cnid_tdb_get.c,v 1.4 2009-11-20 17:37:14 didg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef CNID_BACKEND_TDB #include "cnid_tdb.h" /* Return CNID for a given did/name. */ cnid_t cnid_tdb_get(struct _cnid_db *cdb, const cnid_t did, char *name, const size_t len) { char start[CNID_DID_LEN + MAXPATHLEN + 1], *buf; struct _cnid_tdb_private *db; TDB_DATA key, data; cnid_t id; if (!cdb || !(db = cdb->_private) || (len > MAXPATHLEN)) { return 0; } memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); buf = start; memcpy(buf, &did, sizeof(did)); buf += sizeof(did); memcpy(buf, name, len); *(buf + len) = '\0'; /* Make it a C-string. */ key.dptr = start; key.dsize = CNID_DID_LEN + len + 1; data = tdb_fetch(db->tdb_didname, key); if (!data.dptr) return 0; memcpy(&id, data.dptr, sizeof(id)); free(data.dptr); return id; } #endif netatalk-2.2.2/libatalk/cnid/tdb/Makefile.am0000644000175200017500000000054611655731127015565 00000000000000# Makefile.am for libatalk/cnid/ if USE_TDB_BACKEND noinst_LTLIBRARIES = libcnid_tdb.la endif libcnid_tdb_la_SOURCES = cnid_tdb_add.c \ cnid_tdb_close.c \ cnid_tdb_delete.c \ cnid_tdb_get.c \ cnid_tdb_lookup.c \ cnid_tdb_open.c \ cnid_tdb_resolve.c \ cnid_tdb_update.c \ cnid_tdb.h EXTRA_DIST = README cnid_tdb_nextid.c netatalk-2.2.2/libatalk/cnid/tdb/cnid_tdb_delete.c0000644000175200017500000000206411655731127016762 00000000000000/* * $Id: cnid_tdb_delete.c,v 1.4 2009-11-20 19:25:05 didg Exp $ * * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. * * cnid_delete: delete a CNID from the database */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef CNID_BACKEND_TDB #include "cnid_tdb.h" int cnid_tdb_delete(struct _cnid_db *cdb, const cnid_t id) { struct _cnid_tdb_private *db; TDB_DATA key, data; if (!cdb || !(db = cdb->_private) || !id) { return -1; } memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); key.dptr = (char *)&id; key.dsize = sizeof(cnid_t); data = tdb_fetch(db->tdb_cnid, key); if (!data.dptr) { return 0; } tdb_delete(db->tdb_cnid, key); key.dptr = data.dptr +CNID_DEVINO_OFS; key.dsize = CNID_DEVINO_LEN; tdb_delete(db->tdb_devino, key); key.dptr = (char *)data.dptr +CNID_DID_OFS; key.dsize = data.dsize -CNID_DID_OFS; tdb_delete(db->tdb_didname, key); free(data.dptr); return 0; } #endif netatalk-2.2.2/libatalk/cnid/tdb/Makefile.in0000644000175200017500000004106711703521727015576 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/cnid/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = libatalk/cnid/tdb DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcnid_tdb_la_LIBADD = am_libcnid_tdb_la_OBJECTS = cnid_tdb_add.lo cnid_tdb_close.lo \ cnid_tdb_delete.lo cnid_tdb_get.lo cnid_tdb_lookup.lo \ cnid_tdb_open.lo cnid_tdb_resolve.lo cnid_tdb_update.lo libcnid_tdb_la_OBJECTS = $(am_libcnid_tdb_la_OBJECTS) @USE_TDB_BACKEND_TRUE@am_libcnid_tdb_la_rpath = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcnid_tdb_la_SOURCES) DIST_SOURCES = $(libcnid_tdb_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @USE_TDB_BACKEND_TRUE@noinst_LTLIBRARIES = libcnid_tdb.la libcnid_tdb_la_SOURCES = cnid_tdb_add.c \ cnid_tdb_close.c \ cnid_tdb_delete.c \ cnid_tdb_get.c \ cnid_tdb_lookup.c \ cnid_tdb_open.c \ cnid_tdb_resolve.c \ cnid_tdb_update.c \ cnid_tdb.h EXTRA_DIST = README cnid_tdb_nextid.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/cnid/tdb/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/cnid/tdb/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libcnid_tdb.la: $(libcnid_tdb_la_OBJECTS) $(libcnid_tdb_la_DEPENDENCIES) $(LINK) $(am_libcnid_tdb_la_rpath) $(libcnid_tdb_la_OBJECTS) $(libcnid_tdb_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnid_tdb_add.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnid_tdb_close.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnid_tdb_delete.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnid_tdb_get.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnid_tdb_lookup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnid_tdb_open.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnid_tdb_resolve.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnid_tdb_update.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/cnid/tdb/cnid_tdb_resolve.c0000644000175200017500000000162611655731127017202 00000000000000/* * $Id: cnid_tdb_resolve.c,v 1.4 2009-11-22 14:14:05 franklahm Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef CNID_BACKEND_TDB #include "cnid_tdb.h" /* Return the did/name pair corresponding to a CNID. */ char *cnid_tdb_resolve(struct _cnid_db *cdb, cnid_t * id, void *buffer, size_t len) { struct _cnid_tdb_private *db; TDB_DATA key, data; if (!cdb || !(db = cdb->_private) || !id || !(*id)) { return NULL; } key.dptr = (char *)id; key.dsize = sizeof(cnid_t); data = tdb_fetch(db->tdb_cnid, key); if (data.dptr) { if (data.dsize < len && data.dsize > sizeof(cnid_t)) { memcpy(id, (char *)data.dptr + +CNID_DID_OFS, sizeof(cnid_t)); strcpy(buffer, (char *)data.dptr + CNID_NAME_OFS); free(data.dptr); return buffer; } free(data.dptr); } return NULL; } #endif netatalk-2.2.2/libatalk/cnid/tdb/cnid_tdb_lookup.c0000644000175200017500000001026311655731127017031 00000000000000/* * $Id: cnid_tdb_lookup.c,v 1.6 2009-11-21 11:12:49 didg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef CNID_BACKEND_TDB #include "cnid_tdb.h" #include cnid_t cnid_tdb_lookup(struct _cnid_db *cdb, const struct stat *st, const cnid_t did, char *name, const size_t len) { char *buf; struct _cnid_tdb_private *db; TDB_DATA key, devdata, diddata, cniddata; int devino = 1, didname = 1; char dev[CNID_DEV_LEN]; char ino[CNID_INO_LEN]; u_int32_t type_devino = (unsigned)-1; u_int32_t type_didname = (unsigned)-1; u_int32_t type; int update = 0; cnid_t id_devino = 0, id_didname = 0,id = 0; if (!cdb || !(db = cdb->_private) || !st || !name) { return 0; } if ((buf = make_tdb_data(cdb->flags, st, did, name, len)) == NULL) { LOG(log_error, logtype_default, "tdb_lookup: Pathname is too long"); return 0; } memcpy(&type, buf +CNID_TYPE_OFS, sizeof(type)); type = ntohl(type); memset(&key, 0, sizeof(key)); memset(&devdata, 0, sizeof(devdata)); memset(&diddata, 0, sizeof(diddata)); memset(&cniddata, 0, sizeof(cniddata)); /* Look for a CNID. We have two options: dev/ino or did/name. If we * only get a match in one of them, that means a file has moved. */ memcpy(dev, buf + CNID_DEV_OFS, CNID_DEV_LEN); memcpy(ino, buf + CNID_INO_OFS, CNID_INO_LEN); key.dptr = buf +CNID_DEVINO_OFS; key.dsize = CNID_DEVINO_LEN; cniddata = tdb_fetch(db->tdb_devino, key); if (!cniddata.dptr) { devino = 0; } else { key.dptr = cniddata.dptr; key.dsize = sizeof(id); devdata = tdb_fetch(db->tdb_cnid, key); free(cniddata.dptr); if (devdata.dptr) { memcpy(&id_devino, devdata.dptr, sizeof(cnid_t)); memcpy(&type_devino, (char *)devdata.dptr +CNID_TYPE_OFS, sizeof(type_devino)); type_devino = ntohl(type_devino); } else { devino = 0; } } /* did/name now */ key.dptr = buf + CNID_DID_OFS; key.dsize = CNID_DID_LEN + len + 1; cniddata = tdb_fetch(db->tdb_didname, key); if (!cniddata.dptr) { didname = 0; } else { key.dptr = cniddata.dptr; key.dsize = sizeof(id); diddata = tdb_fetch(db->tdb_cnid, key); free(cniddata.dptr); if (diddata.dptr) { memcpy(&id_didname, diddata.dptr, sizeof(cnid_t)); memcpy(&type_didname, (char *)diddata.dptr +CNID_TYPE_OFS, sizeof(type_didname)); type_didname = ntohl(type_didname); } else { didname = 0; } } /* Set id. Honor did/name over dev/ino as dev/ino isn't necessarily * 1-1. */ if (!devino && !didname) { free(devdata.dptr); free(diddata.dptr); return 0; } if (devino && didname && id_devino == id_didname && type_devino == type) { /* the same */ free(devdata.dptr); free(diddata.dptr); return id_didname; } if (didname) { id = id_didname; /* we have a did:name * if it's the same dev or not the same type * just delete it */ if (!memcmp(dev, (char *)diddata.dptr + CNID_DEV_OFS, CNID_DEV_LEN) || type_didname != type) { if (cnid_tdb_delete(cdb, id) < 0) { free(devdata.dptr); free(diddata.dptr); return 0; } } else { update = 1; } } if (devino) { id = id_devino; if (type_devino != type) { /* same dev:inode but not same type one is a folder the other * is a file,it's an inode reused, delete the record */ if (cnid_tdb_delete(cdb, id) < 0) { free(devdata.dptr); free(diddata.dptr); return 0; } } else { update = 1; } } free(devdata.dptr); free(diddata.dptr); if (!update) { return 0; } /* Fix up the database. */ cnid_tdb_update(cdb, id, st, did, name, len); return id; } #endif netatalk-2.2.2/libatalk/cnid/tdb/cnid_tdb_update.c0000644000175200017500000000617011655731127017004 00000000000000/* * $Id: cnid_tdb_update.c,v 1.6 2009-11-21 11:12:49 didg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef CNID_BACKEND_TDB #include "cnid_tdb.h" #include int cnid_tdb_update(struct _cnid_db *cdb, const cnid_t id, const struct stat *st, const cnid_t did, char *name, const size_t len /*, const char *info, const int infolen */ ) { struct _cnid_tdb_private *db; TDB_DATA key, data, altdata; if (!cdb || !(db = cdb->_private) || !id || !st || !name || (db->flags & CNIDFLAG_DB_RO)) { return -1; } memset(&key, 0, sizeof(key)); memset(&altdata, 0, sizeof(altdata)); /* Get the old info. search by dev/ino */ data.dptr = make_tdb_data(cdb->flags, st, did, name, len); data.dsize = CNID_HEADER_LEN + len + 1; key.dptr = data.dptr +CNID_DEVINO_OFS; key.dsize = CNID_DEVINO_LEN; altdata = tdb_fetch(db->tdb_devino, key); if (altdata.dptr) { tdb_delete(db->tdb_devino, key); key.dptr = altdata.dptr; key.dsize = sizeof(id); data = tdb_fetch(db->tdb_cnid, key); tdb_delete(db->tdb_cnid, key); free(altdata.dptr); if (data.dptr) { key.dptr = (char *)data.dptr +CNID_DID_OFS; key.dsize = data.dsize - CNID_DID_OFS; tdb_delete(db->tdb_didname, key); free(data.dptr); } } /* search by did/name */ data.dptr = make_tdb_data(cdb->flags, st, did, name, len); data.dsize = CNID_HEADER_LEN + len + 1; key.dptr = (char *)data.dptr +CNID_DID_OFS; key.dsize = data.dsize - CNID_DID_OFS; altdata = tdb_fetch(db->tdb_didname, key); if (altdata.dptr) { tdb_delete(db->tdb_didname, key); key.dptr = altdata.dptr; key.dsize = sizeof(id); data = tdb_fetch(db->tdb_cnid, key); tdb_delete(db->tdb_cnid, key); free(altdata.dptr); if (data.dptr) { key.dptr = data.dptr +CNID_DEVINO_OFS; key.dsize = CNID_DEVINO_LEN; tdb_delete(db->tdb_devino, key); free(data.dptr); } } /* Make a new entry. */ data.dptr = make_tdb_data(cdb->flags, st, did, name, len); data.dsize = CNID_HEADER_LEN + len + 1; memcpy(data.dptr, &id, sizeof(id)); /* Update the old CNID with the new info. */ key.dptr = (char *) &id; key.dsize = sizeof(id); if (tdb_store(db->tdb_cnid, key, data, TDB_REPLACE)) { goto update_err; } /* Put in a new dev/ino mapping. */ key.dptr = data.dptr +CNID_DEVINO_OFS; key.dsize = CNID_DEVINO_LEN; altdata.dptr = (char *) &id; altdata.dsize = sizeof(id); if (tdb_store(db->tdb_devino, key, altdata, TDB_REPLACE)) { goto update_err; } /* put in a new did/name mapping. */ key.dptr = (char *) data.dptr +CNID_DID_OFS; key.dsize = data.dsize -CNID_DID_OFS; if (tdb_store(db->tdb_didname, key, altdata, TDB_REPLACE)) { goto update_err; } return 0; update_err: LOG(log_error, logtype_default, "cnid_update: Unable to update CNID %u", ntohl(id)); return -1; } #endif netatalk-2.2.2/libatalk/cnid/tdb/cnid_tdb_close.c0000644000175200017500000000062111655731127016622 00000000000000/* * $Id: cnid_tdb_close.c,v 1.3 2009-11-21 13:38:11 didg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef CNID_BACKEND_TDB #include "cnid_tdb.h" void cnid_tdb_close(struct _cnid_db *cdb) { struct _cnid_tdb_private *db; free(cdb->volpath); db = (struct _cnid_tdb_private *)cdb->_private; tdb_close(db->tdb_cnid); free(cdb->_private); free(cdb); } #endif netatalk-2.2.2/libatalk/cnid/tdb/cnid_tdb_open.c0000644000175200017500000001046711655731127016467 00000000000000/* * $Id: cnid_tdb_open.c,v 1.8 2010-03-31 09:47:32 franklahm Exp $ * * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef CNID_BACKEND_TDB #include #include "cnid_tdb.h" #include #include #define DBHOME ".AppleDB" #define DBHOMELEN 9 /* strlen(DBHOME) +1 for / */ #define DBLEN 12 #define DBCNID "cnid2.tdb" #define DBVERSION_KEY "\0\0\0\0Version" #define DBVERSION_KEYLEN (sizeof(DBVERSION_KEY)) #define DBVERSION2 0x00000002U #define DBVERSION DBVERSION2 static struct _cnid_db *cnid_tdb_new(const char *volpath) { struct _cnid_db *cdb; struct _cnid_tdb_private *priv; if ((cdb = (struct _cnid_db *) calloc(1, sizeof(struct _cnid_db))) == NULL) return NULL; if ((cdb->volpath = strdup(volpath)) == NULL) { free(cdb); return NULL; } if ((cdb->_private = calloc(1, sizeof(struct _cnid_tdb_private))) == NULL) { free(cdb->volpath); free(cdb); return NULL; } /* Set up private state */ priv = (struct _cnid_tdb_private *) (cdb->_private); /* Set up standard fields */ cdb->flags = CNID_FLAG_PERSISTENT; cdb->cnid_add = cnid_tdb_add; cdb->cnid_delete = cnid_tdb_delete; cdb->cnid_get = cnid_tdb_get; cdb->cnid_lookup = cnid_tdb_lookup; cdb->cnid_nextid = NULL; /*cnid_tdb_nextid;*/ cdb->cnid_resolve = cnid_tdb_resolve; cdb->cnid_update = cnid_tdb_update; cdb->cnid_close = cnid_tdb_close; return cdb; } /* ---------------------------- */ struct _cnid_db *cnid_tdb_open(struct cnid_open_args *args) { struct stat st; struct _cnid_db *cdb; struct _cnid_tdb_private *db; size_t len; char path[MAXPATHLEN + 1]; TDB_DATA key, data; int hash_size = 131071; int tdb_flags = 0; if (!args->dir) { /* note: dir and path are not used for in memory db */ return NULL; } if ((len = strlen(args->dir)) > (MAXPATHLEN - DBLEN - 1)) { LOG(log_error, logtype_default, "tdb_open: Pathname too large: %s", args->dir); return NULL; } if ((cdb = cnid_tdb_new(args->dir)) == NULL) { LOG(log_error, logtype_default, "tdb_open: Unable to allocate memory for tdb"); return NULL; } strcpy(path, args->dir); if (path[len - 1] != '/') { strcat(path, "/"); len++; } strcpy(path + len, DBHOME); if (!(args->flags & CNID_FLAG_MEMORY)) { if ((stat(path, &st) < 0) && (ad_mkdir(path, 0777 & ~args->mask) < 0)) { LOG(log_error, logtype_default, "tdb_open: DBHOME mkdir failed for %s", path); goto fail; } } else { hash_size = 0; tdb_flags = TDB_INTERNAL; } strcat(path, "/"); db = (struct _cnid_tdb_private *)cdb->_private; path[len + DBHOMELEN] = '\0'; strcat(path, DBCNID); db->tdb_cnid = tdb_open(path, hash_size, tdb_flags , O_RDWR | O_CREAT, 0666 & ~args->mask); if (!db->tdb_cnid) { LOG(log_error, logtype_default, "tdb_open: unable to open tdb", path); goto fail; } /* ------------- */ db->tdb_didname = db->tdb_cnid; db->tdb_devino = db->tdb_cnid; /* Check for version. This way we can update the database if we need * to change the format in any way. */ memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); key.dptr = DBVERSION_KEY; key.dsize = DBVERSION_KEYLEN; data = tdb_fetch(db->tdb_didname, key); if (!data.dptr) { u_int32_t version = htonl(DBVERSION); data.dptr = (char *)&version; data.dsize = sizeof(version); if (tdb_store(db->tdb_didname, key, data, TDB_REPLACE)) { LOG(log_error, logtype_default, "tdb_open: Error putting new version"); goto fail; } } else { free(data.dptr); } return cdb; fail: free(cdb->_private); free(cdb->volpath); free(cdb); return NULL; } struct _cnid_module cnid_tdb_module = { "tdb", {NULL, NULL}, cnid_tdb_open, CNID_FLAG_SETUID | CNID_FLAG_BLOCK }; #endif netatalk-2.2.2/libatalk/cnid/tdb/cnid_tdb.h0000644000175200017500000000411711655731127015446 00000000000000/* * interface for database access to cnids. i do it this way to abstract * things a bit in case we want to change the underlying implementation. */ #ifndef _ATALK_CNID_TDB__H #define _ATALK_CNID_TDB__H 1 #include #include #include #include #include #include #include #include #define STANDALONE 1 #include #include #include #include #include #include #include #include #include #include #include #define TDB_ERROR_LINK 1 #define TDB_ERROR_DEV 2 #define TDB_ERROR_INODE 4 struct _cnid_tdb_private { dev_t st_dev; int st_set; int error; int flags; TDB_CONTEXT *tdb_cnid; TDB_CONTEXT *tdb_didname; TDB_CONTEXT *tdb_devino; }; /* cnid_open.c */ extern struct _cnid_module cnid_tdb_module; extern struct _cnid_db *cnid_tdb_open (struct cnid_open_args *args); /* cnid_close.c */ extern void cnid_tdb_close (struct _cnid_db *); /* cnid_add.c */ extern cnid_t cnid_tdb_add (struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t, cnid_t); /* cnid_get.c */ extern cnid_t cnid_tdb_get (struct _cnid_db *, const cnid_t, char *, const size_t); extern char *cnid_tdb_resolve (struct _cnid_db *, cnid_t *, void *, size_t); extern cnid_t cnid_tdb_lookup (struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t); /* cnid_update.c */ extern int cnid_tdb_update (struct _cnid_db *, const cnid_t, const struct stat *, const cnid_t, char *, size_t); /* cnid_delete.c */ extern int cnid_tdb_delete (struct _cnid_db *, const cnid_t); /* cnid_nextid.c */ extern cnid_t cnid_tdb_nextid (struct _cnid_db *); /* construct db_cnid data. NOTE: this is not re-entrant. */ extern unsigned char *make_tdb_data(u_int32_t flags, const struct stat *st, const cnid_t did, const char *name, const size_t len); #endif /* include/atalk/cnid_tdb.h */ netatalk-2.2.2/libatalk/cnid/tdb/README0000644000175200017500000000305711655731127014411 00000000000000the catalog database keeps track of three mappings: CNID -> dev/ino and did/name dev/ino -> CNID did/name -> CNID dev/ino is used to keep track of magically moved files. did/name is for quick lookups of CNIDs. NOTE: the database will append a nul byte to the end of name. in addition, name should be given as it appears on disk. this allows the creation of cnid updating/cleaning programs that don't have to deal with knowing what the particular codepage is. here's the ritual: 1) open a volume. call cnid_open. 2) every time you need a CNID, call cnid_add(). it will automatically look for an existing cnid and add a new one if one isn't already there. you can pass a hint if you want. the only use this has right now is to enable consistency between AFP and HFS. in the future, it would allow people to write conversion utilities that pre-instantiate a database without needing to re-assign CNIDs. 3) if you want to just look for a CNID without automatically adding one in, you have two choices: a) cnid_resolve takes a CNID, returns name, and over-writes the CNID given with the parent DID. this is good for FPResolveID. b) cnid_lookup returns a CNID corresponding to the dev/ino,did/name keys. it will auto-update the catalog database if there's a discrepancy. NOTE: cnid_add calls this before adding a new CNID. 4) when you delete a file or directory, you need to call cnid_delete with the CNID for that file/directory. 5) call cnid_close when closing the volume. netatalk-2.2.2/libatalk/cnid/tdb/cnid_tdb_nextid.c0000644000175200017500000000040411655731127017007 00000000000000/* * $Id: cnid_tdb_nextid.c,v 1.2 2005-04-28 20:50:02 bfernhomberg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef CNID_BACKEND_TDB #include "cnid_tdb.h" cnid_t cnid_tdb_nextid(struct _cnid_db *cdb) { return CNID_INVALID; } #endif netatalk-2.2.2/libatalk/netddp/0000777000175200017500000000000011704770423013375 500000000000000netatalk-2.2.2/libatalk/netddp/Makefile.am0000644000175200017500000000021611655731127015347 00000000000000# Makefile.am for libatalk/netddp/ noinst_LTLIBRARIES = libnetddp.la libnetddp_la_SOURCES = netddp_open.c netddp_sendto.c netddp_recvfrom.c netatalk-2.2.2/libatalk/netddp/Makefile.in0000644000175200017500000003740711703521727015371 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/netddp/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = libatalk/netddp DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libnetddp_la_LIBADD = am_libnetddp_la_OBJECTS = netddp_open.lo netddp_sendto.lo \ netddp_recvfrom.lo libnetddp_la_OBJECTS = $(am_libnetddp_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libnetddp_la_SOURCES) DIST_SOURCES = $(libnetddp_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libnetddp.la libnetddp_la_SOURCES = netddp_open.c netddp_sendto.c netddp_recvfrom.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/netddp/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/netddp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libnetddp.la: $(libnetddp_la_OBJECTS) $(libnetddp_la_DEPENDENCIES) $(LINK) $(libnetddp_la_OBJECTS) $(libnetddp_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netddp_open.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netddp_recvfrom.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netddp_sendto.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/netddp/netddp_open.c0000644000175200017500000000400611655731127015757 00000000000000/* * $Id: netddp_open.c,v 1.9 2005-04-28 20:50:02 bfernhomberg Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * * open a ddp socket and return the port and address assigned. return * various address info if requested as well. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #ifdef MACOSX_SERVER #include #include #endif /* MACOSX_SERVER */ #include #include int netddp_open(struct sockaddr_at *addr, struct sockaddr_at *bridge) { #ifdef NO_DDP return -1; #else /* !NO_DDP */ int s; #ifdef MACOSX_SERVER at_inet_t address, baddress; if ((s = ddp_open(addr ? &addr->sat_port : NULL)) < 0) return -1; if (!addr) return s; if (rtmp_netinfo(s, &address, &baddress) < 0) { ddp_close(s); return -1; } memcpy(&addr->sat_addr.s_net, &address.net, sizeof(addr->sat_addr.s_net)); addr->sat_addr.s_node = address.node; addr->sat_port = address.socket; if (bridge) { memcpy(&bridge->sat_addr.s_net, &baddress.net, sizeof(bridge->sat_addr.s_net)); bridge->sat_addr.s_node = baddress.node; bridge->sat_port = baddress.socket; } #else /* MACOSX_SERVER */ socklen_t len; if ((s = socket( AF_APPLETALK, SOCK_DGRAM, 0 )) < 0) return -1; if (!addr) return s; addr->sat_family = AF_APPLETALK; /* rest of address should be initialized by the caller */ if (bind(s, (struct sockaddr *) addr, sizeof( struct sockaddr_at )) < 0 ) { close(s); return -1; } /* get the real address from the kernel */ len = sizeof( struct sockaddr_at); if ( getsockname( s, (struct sockaddr *) addr, &len ) != 0 ) { close(s); return -1; } #endif /* MACOSX_SERVER */ return s; #endif /* NO_DDP */ } netatalk-2.2.2/libatalk/netddp/netddp_sendto.c0000644000175200017500000000321011655731127016306 00000000000000/* * $Id: netddp_sendto.c,v 1.7 2005-04-28 20:50:02 bfernhomberg Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * * send data. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifndef NO_DDP #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #include #ifdef MACOSX_SERVER #include #include #endif /* MACOSX_SERVER */ #include #include #include #include #ifndef MAX #define MAX(a, b) ((a) < (b) ? (b) : (a)) #endif /* ! MAX */ #ifdef MACOSX_SERVER int netddp_sendto(int fd, void *buf, size_t buflen, unsigned int dummy, const struct sockaddr *addr, unsigned int addrlen) { ssize_t i; struct ddpehdr ddphdr; const struct sockaddr_at *sat = (const struct sockaddr_at *) addr; struct iovec iov[2]; iov[0].iov_base = (void *) &ddphdr; iov[0].iov_len = sizeof(ddphdr); iov[1].iov_base = buf; iov[1].iov_len = buflen; if (!addr) return -1; memset(&ddphdr, 0, sizeof(ddphdr)); ddphdr.deh_len = htons(sizeof(ddphdr) + (u_int16_t) buflen); ddphdr.deh_dnet = sat->sat_addr.s_net; ddphdr.deh_dnode = sat->sat_addr.s_node; ddphdr.deh_dport = sat->sat_port; while ((i = writev(fd, iov, 2)) < 0) { if (errno != EINTR) return -1; } return MAX(0, i - sizeof(ddphdr)); } #endif /* os x server */ #endif /* no ddp */ netatalk-2.2.2/libatalk/netddp/netddp_recvfrom.c0000644000175200017500000000276711655731127016655 00000000000000/* * $Id: netddp_recvfrom.c,v 1.5 2003-02-17 02:02:25 srittau Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * * receive data. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifndef NO_DDP #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #include #ifdef MACOSX_SERVER #include #include #endif /* MACOSX_SERVER */ #include #include #include #include #ifndef MAX #define MAX(a, b) ((a) < (b) ? (b) : (a)) #endif /* ! MAX */ #ifdef MACOSX_SERVER int netddp_recvfrom(int fd, void *buf, int buflen, unsigned int dummy, struct sockaddr *addr, unsigned int *addrlen) { ssize_t i; struct ddpehdr ddphdr; struct sockaddr_at *sat = (struct sockaddr_at *) addr; struct iovec iov[2]; iov[0].iov_base = (void *) &ddphdr; iov[0].iov_len = sizeof(ddphdr); iov[1].iov_base = buf; iov[1].iov_len = buflen; while ((i = readv(fd, iov, 2)) < 0) { if (errno != EINTR) return -1; } if (addr) { sat->sat_addr.s_net = ddphdr.deh_snet; sat->sat_addr.s_node = ddphdr.deh_snode; sat->sat_port = ddphdr.deh_sport; } return MAX(0, i - sizeof(ddphdr)); } #endif /* os x server */ #endif /* no ddp */ netatalk-2.2.2/libatalk/dsi/0000777000175200017500000000000011704770421012674 500000000000000netatalk-2.2.2/libatalk/dsi/dsi_read.c0000644000175200017500000000354511664176240014541 00000000000000/* * $Id: dsi_read.c,v 1.7 2009-10-25 06:13:11 didg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #ifdef HAVE_SYS_FILIO_H #include #endif #include #include #include /* streaming i/o for afp_read. this is all from the perspective of the * client. it basically does the reverse of dsi_write. on first entry, * it will send off the header plus whatever is in its command * buffer. it returns the amount of stuff still to be read * (constrained by the buffer size). */ ssize_t dsi_readinit(DSI *dsi, void *buf, const size_t buflen, const size_t size, const int err) { LOG(log_maxdebug, logtype_dsi, "dsi_readinit: sending %zd bytes from buffer, total size: %zd", buflen, size); dsi->flags |= DSI_NOREPLY; /* we will handle our own replies */ dsi->header.dsi_flags = DSIFL_REPLY; dsi->header.dsi_len = htonl(size); dsi->header.dsi_code = htonl(err); dsi->in_write++; if (dsi_stream_send(dsi, buf, buflen)) { dsi->datasize = size - buflen; LOG(log_maxdebug, logtype_dsi, "dsi_readinit: remaining data for sendfile: %zd", dsi->datasize); return MIN(dsi->datasize, buflen); } return -1; /* error */ } void dsi_readdone(DSI *dsi) { dsi->in_write--; } /* send off the data */ ssize_t dsi_read(DSI *dsi, void *buf, const size_t buflen) { size_t len; len = dsi_stream_write(dsi, buf, buflen, 0); if (len == buflen) { dsi->datasize -= len; return MIN(dsi->datasize, buflen); } return -1; } netatalk-2.2.2/libatalk/dsi/Makefile.am0000644000175200017500000000052311655731127014651 00000000000000# Makefile.am for libatalk/dsi/ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys LIBS = @LIBS@ noinst_LTLIBRARIES = libdsi.la libdsi_la_SOURCES = dsi_attn.c dsi_close.c dsi_cmdreply.c dsi_getsess.c dsi_getstat.c dsi_init.c dsi_opensess.c dsi_read.c dsi_tcp.c dsi_tickle.c dsi_write.c dsi_stream.c noinst_HEADERS = dsi_private.h netatalk-2.2.2/libatalk/dsi/dsi_private.h0000644000175200017500000000117511655731127015303 00000000000000/* * $Id: dsi_private.h,v 1.4 2009-11-05 14:38:08 franklahm Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. */ #ifndef _DSI_PRIVATE_H #define _DSI_PRIVATE_H 1 /* this header handles interactions between protocol-specific code and * dsi initialization. only dsi_init.c and dsi_.c should * include it. */ #include #include #include extern int dsi_tcp_init (DSI *, const char * /*host*/, const char * /*address*/, const char * /*port*/, const int /*proxy*/); #endif /* _DSI_PRIVATE_H */ netatalk-2.2.2/libatalk/dsi/dsi_init.c0000644000175200017500000000234011655731127014562 00000000000000/* * $Id: dsi_init.c,v 1.10 2009-11-05 14:38:08 franklahm Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include "dsi_private.h" DSI *dsi_init(const dsi_proto protocol, const char *program, const char *hostname, const char *address, const char *port, const int proxy, const u_int32_t quantum) { DSI *dsi; if ((dsi = (DSI *) calloc(1, sizeof(DSI))) == NULL) { return( NULL ); } dsi->attn_quantum = DSI_DEFQUANT; /* default quantum size */ dsi->server_quantum = quantum; /* default server quantum */ dsi->program = program; switch (protocol) { /* currently the only transport protocol that exists for dsi */ case DSI_TCPIP: if (!dsi_tcp_init(dsi, hostname, address, port, proxy)) { free(dsi); dsi = NULL; } break; default: /* unknown protocol */ free(dsi); dsi = NULL; break; } return dsi; } void dsi_setstatus(DSI *dsi, char *status, const size_t slen) { dsi->status = status; dsi->statuslen = slen; } netatalk-2.2.2/libatalk/dsi/Makefile.in0000644000175200017500000004134011703521727014661 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/dsi/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = libatalk/dsi DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libdsi_la_LIBADD = am_libdsi_la_OBJECTS = dsi_attn.lo dsi_close.lo dsi_cmdreply.lo \ dsi_getsess.lo dsi_getstat.lo dsi_init.lo dsi_opensess.lo \ dsi_read.lo dsi_tcp.lo dsi_tickle.lo dsi_write.lo \ dsi_stream.lo libdsi_la_OBJECTS = $(am_libdsi_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdsi_la_SOURCES) DIST_SOURCES = $(libdsi_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys noinst_LTLIBRARIES = libdsi.la libdsi_la_SOURCES = dsi_attn.c dsi_close.c dsi_cmdreply.c dsi_getsess.c dsi_getstat.c dsi_init.c dsi_opensess.c dsi_read.c dsi_tcp.c dsi_tickle.c dsi_write.c dsi_stream.c noinst_HEADERS = dsi_private.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/dsi/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/dsi/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdsi.la: $(libdsi_la_OBJECTS) $(libdsi_la_DEPENDENCIES) $(LINK) $(libdsi_la_OBJECTS) $(libdsi_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsi_attn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsi_close.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsi_cmdreply.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsi_getsess.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsi_getstat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsi_init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsi_opensess.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsi_read.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsi_stream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsi_tcp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsi_tickle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsi_write.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/dsi/dsi_tcp.c0000644000175200017500000003033211655731127014407 00000000000000/* * $Id: dsi_tcp.c,v 1.25 2009-12-08 22:34:37 didg Exp $ * * Copyright (c) 1997, 1998 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. * * this provides both proto_open() and proto_close() to account for * protocol specific initialization and shutdown procedures. all the * read/write stuff is done in dsi_stream.c. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #define USE_TCP_NODELAY #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #ifdef HAVE_NETDB_H #include #endif /* HAVE_NETDB_H */ #include #include #include #ifdef HAVE_STDINT_H #include #endif /* HAVE_STDINT_H */ #include #ifdef TRU64 #include #include #endif /* TRU64 */ #include #include #include #include #include #include #ifdef __svr4__ #include #endif /* __svr4__ */ #ifdef TCPWRAP #include int allow_severity = log_info; int deny_severity = log_warning; #endif /* TCPWRAP */ #include #include #include #include #include "dsi_private.h" #define min(a,b) ((a) < (b) ? (a) : (b)) #ifndef DSI_TCPMAXPEND #define DSI_TCPMAXPEND 20 /* max # of pending connections */ #endif /* DSI_TCPMAXPEND */ #ifndef DSI_TCPTIMEOUT #define DSI_TCPTIMEOUT 120 /* timeout in seconds for connections */ #endif /* ! DSI_TCPTIMEOUT */ /* FIXME/SOCKLEN_T: socklen_t is a unix98 feature. */ #ifndef SOCKLEN_T #define SOCKLEN_T unsigned int #endif /* ! SOCKLEN_T */ static void dsi_tcp_close(DSI *dsi) { if (dsi->socket == -1) return; close(dsi->socket); dsi->socket = -1; } /* alarm handler for tcp_open */ static void timeout_handler(int sig _U_) { LOG(log_error, logtype_dsi, "dsi_tcp_open: connection timed out"); exit(EXITERR_CLNT); } static struct itimerval itimer; /* accept the socket and do a little sanity checking */ static int dsi_tcp_open(DSI *dsi) { pid_t pid; SOCKLEN_T len; len = sizeof(dsi->client); dsi->socket = accept(dsi->serversock, (struct sockaddr *) &dsi->client, &len); #ifdef TCPWRAP { struct request_info req; request_init(&req, RQ_DAEMON, dsi->program, RQ_FILE, dsi->socket, NULL); fromhost(&req); if (!hosts_access(&req)) { LOG(deny_severity, logtype_dsi, "refused connect from %s", eval_client(&req)); close(dsi->socket); errno = ECONNREFUSED; dsi->socket = -1; } } #endif /* TCPWRAP */ if (dsi->socket < 0) return -1; getitimer(ITIMER_PROF, &itimer); if (0 == (pid = fork()) ) { /* child */ static struct itimerval timer = {{0, 0}, {DSI_TCPTIMEOUT, 0}}; struct sigaction newact, oldact; u_int8_t block[DSI_BLOCKSIZ]; size_t stored; /* Immediateyl mark globally that we're a child now */ parent_or_child = 1; /* reset signals */ server_reset_signal(); #ifndef DEBUGGING /* install an alarm to deal with non-responsive connections */ newact.sa_handler = timeout_handler; sigemptyset(&newact.sa_mask); newact.sa_flags = 0; sigemptyset(&oldact.sa_mask); oldact.sa_flags = 0; setitimer(ITIMER_PROF, &itimer, NULL); if ((sigaction(SIGALRM, &newact, &oldact) < 0) || (setitimer(ITIMER_REAL, &timer, NULL) < 0)) { LOG(log_error, logtype_dsi, "dsi_tcp_open: %s", strerror(errno)); exit(EXITERR_SYS); } #endif /* read in commands. this is similar to dsi_receive except * for the fact that we do some sanity checking to prevent * delinquent connections from causing mischief. */ /* read in the first two bytes */ len = dsi_stream_read(dsi, block, 2); if (!len ) { /* connection already closed, don't log it (normal OSX 10.3 behaviour) */ exit(EXITERR_CLNT); } if (len < 2 || (block[0] > DSIFL_MAX) || (block[1] > DSIFUNC_MAX)) { LOG(log_error, logtype_dsi, "dsi_tcp_open: invalid header"); exit(EXITERR_CLNT); } /* read in the rest of the header */ stored = 2; while (stored < DSI_BLOCKSIZ) { len = dsi_stream_read(dsi, block + stored, sizeof(block) - stored); if (len > 0) stored += len; else { LOG(log_error, logtype_dsi, "dsi_tcp_open: stream_read: %s", strerror(errno)); exit(EXITERR_CLNT); } } dsi->header.dsi_flags = block[0]; dsi->header.dsi_command = block[1]; memcpy(&dsi->header.dsi_requestID, block + 2, sizeof(dsi->header.dsi_requestID)); memcpy(&dsi->header.dsi_code, block + 4, sizeof(dsi->header.dsi_code)); memcpy(&dsi->header.dsi_len, block + 8, sizeof(dsi->header.dsi_len)); memcpy(&dsi->header.dsi_reserved, block + 12, sizeof(dsi->header.dsi_reserved)); dsi->clientID = ntohs(dsi->header.dsi_requestID); /* make sure we don't over-write our buffers. */ dsi->cmdlen = min(ntohl(dsi->header.dsi_len), DSI_CMDSIZ); stored = 0; while (stored < dsi->cmdlen) { len = dsi_stream_read(dsi, dsi->commands + stored, dsi->cmdlen - stored); if (len > 0) stored += len; else { LOG(log_error, logtype_dsi, "dsi_tcp_open: stream_read: %s", strerror(errno)); exit(EXITERR_CLNT); } } /* stop timer and restore signal handler */ #ifndef DEBUGGING memset(&timer, 0, sizeof(timer)); setitimer(ITIMER_REAL, &timer, NULL); sigaction(SIGALRM, &oldact, NULL); #endif LOG(log_info, logtype_dsi, "AFP/TCP session from %s:%u", getip_string((struct sockaddr *)&dsi->client), getip_port((struct sockaddr *)&dsi->client)); } /* send back our pid */ return pid; } /* get it from the interface list */ #ifndef IFF_SLAVE #define IFF_SLAVE 0 #endif static void guess_interface(DSI *dsi, const char *hostname, const char *port) { int fd; char **start, **list; struct ifreq ifr; struct sockaddr_in *sa = (struct sockaddr_in *)&dsi->server; start = list = getifacelist(); if (!start) return; fd = socket(PF_INET, SOCK_STREAM, 0); while (list && *list) { strlcpy(ifr.ifr_name, *list, sizeof(ifr.ifr_name)); list++; if (ioctl(dsi->serversock, SIOCGIFFLAGS, &ifr) < 0) continue; if (ifr.ifr_flags & (IFF_LOOPBACK | IFF_POINTOPOINT | IFF_SLAVE)) continue; if (!(ifr.ifr_flags & (IFF_UP | IFF_RUNNING)) ) continue; if (ioctl(fd, SIOCGIFADDR, &ifr) < 0) continue; memset(&dsi->server, 0, sizeof(struct sockaddr_storage)); sa->sin_family = AF_INET; sa->sin_port = htons(atoi(port)); sa->sin_addr = ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr; LOG(log_info, logtype_dsi, "dsi_tcp: '%s:%s' on interface '%s' will be used instead.", getip_string((struct sockaddr *)&dsi->server), port, ifr.ifr_name); goto iflist_done; } LOG(log_info, logtype_dsi, "dsi_tcp (Chooser will not select afp/tcp) " "Check to make sure %s is in /etc/hosts and the correct domain is in " "/etc/resolv.conf: %s", hostname, strerror(errno)); iflist_done: close(fd); freeifacelist(start); } #ifndef AI_NUMERICSERV #define AI_NUMERICSERV 0 #endif /* this needs to accept passed in addresses */ int dsi_tcp_init(DSI *dsi, const char *hostname, const char *address, const char *port, const int proxy) { int ret; int flag; struct addrinfo hints, *servinfo, *p; dsi->protocol = DSI_TCPIP; /* Prepare hint for getaddrinfo */ memset(&hints, 0, sizeof hints); #if !defined(FREEBSD) hints.ai_family = AF_UNSPEC; #endif hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_NUMERICSERV; if ( ! address) { hints.ai_flags |= AI_PASSIVE; #if defined(FREEBSD) hints.ai_family = AF_INET6; #endif } else { hints.ai_flags |= AI_NUMERICHOST; #if defined(FREEBSD) hints.ai_family = AF_UNSPEC; #endif } if ((ret = getaddrinfo(address ? address : NULL, port ? port : "548", &hints, &servinfo)) != 0) { LOG(log_error, logtype_dsi, "dsi_tcp_init: getaddrinfo: %s\n", gai_strerror(ret)); return 0; } /* create a socket */ if (proxy) dsi->serversock = -1; else { /* loop through all the results and bind to the first we can */ for (p = servinfo; p != NULL; p = p->ai_next) { if ((dsi->serversock = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) { LOG(log_info, logtype_dsi, "dsi_tcp_init: socket: %s", strerror(errno)); continue; } /* * Set some socket options: * SO_REUSEADDR deals w/ quick close/opens * TCP_NODELAY diables Nagle */ #ifdef SO_REUSEADDR flag = 1; setsockopt(dsi->serversock, SOL_SOCKET, SO_REUSEADDR, &flag, sizeof(flag)); #endif #if defined(FREEBSD) && defined(IPV6_BINDV6ONLY) int on = 0; setsockopt(dsi->serversock, IPPROTO_IPV6, IPV6_BINDV6ONLY, (char *)&on, sizeof (on)); #endif #ifdef USE_TCP_NODELAY #ifndef SOL_TCP #define SOL_TCP IPPROTO_TCP #endif flag = 1; setsockopt(dsi->serversock, SOL_TCP, TCP_NODELAY, &flag, sizeof(flag)); #endif /* USE_TCP_NODELAY */ if (bind(dsi->serversock, p->ai_addr, p->ai_addrlen) == -1) { close(dsi->serversock); LOG(log_info, logtype_dsi, "dsi_tcp_init: bind: %s\n", strerror(errno)); continue; } if (listen(dsi->serversock, DSI_TCPMAXPEND) < 0) { close(dsi->serversock); LOG(log_info, logtype_dsi, "dsi_tcp_init: listen: %s\n", strerror(errno)); continue; } break; } if (p == NULL) { LOG(log_error, logtype_dsi, "dsi_tcp_init: no suitable network config for TCP socket"); freeaddrinfo(servinfo); return 0; } /* Copy struct sockaddr to struct sockaddr_storage */ memcpy(&dsi->server, p->ai_addr, p->ai_addrlen); freeaddrinfo(servinfo); } /* if (proxy) */ /* Point protocol specific functions to tcp versions */ dsi->proto_open = dsi_tcp_open; dsi->proto_close = dsi_tcp_close; /* get real address for GetStatus. */ if (address) { /* address is a parameter, use it 'as is' */ return 1; } /* Prepare hint for getaddrinfo */ memset(&hints, 0, sizeof hints); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; if ((ret = getaddrinfo(hostname, port ? port : "548", &hints, &servinfo)) != 0) { LOG(log_info, logtype_dsi, "dsi_tcp_init: getaddrinfo '%s': %s\n", hostname, gai_strerror(ret)); goto interfaces; } for (p = servinfo; p != NULL; p = p->ai_next) { if (p->ai_family == AF_INET) { // IPv4 struct sockaddr_in *ipv4 = (struct sockaddr_in *)p->ai_addr; if ( (ipv4->sin_addr.s_addr & htonl(0x7f000000)) != htonl(0x7f000000) ) break; } else { // IPv6 struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)p->ai_addr; unsigned char ipv6loopb[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}; if ((memcmp(ipv6->sin6_addr.s6_addr, ipv6loopb, 16)) != 0) break; } } if (p) { /* Store found address in dsi->server */ memcpy(&dsi->server, p->ai_addr, p->ai_addrlen); freeaddrinfo(servinfo); return 1; } LOG(log_info, logtype_dsi, "dsi_tcp: hostname '%s' resolves to loopback address", hostname); freeaddrinfo(servinfo); interfaces: guess_interface(dsi, hostname, port ? port : "548"); return 1; } netatalk-2.2.2/libatalk/dsi/dsi_stream.c0000644000175200017500000003632211665651044015121 00000000000000/* * Copyright (c) 1998 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. * * this file provides the following functions: * dsi_stream_write: just write a bunch of bytes. * dsi_stream_read: just read a bunch of bytes. * dsi_stream_send: send a DSI header + data. * dsi_stream_receive: read a DSI header + data. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include #include #include #include #include #define min(a,b) ((a) < (b) ? (a) : (b)) #ifndef MSG_MORE #define MSG_MORE 0x8000 #endif #ifndef MSG_DONTWAIT #define MSG_DONTWAIT 0x40 #endif /* * afpd is sleeping too much while trying to send something. * May be there's no reader or the reader is also sleeping in write, * look if there's some data for us to read, hopefully it will wake up * the reader so we can write again. * * @returns 0 when is possible to send again, -1 on error */ static int dsi_peek(DSI *dsi) { static int warned = 0; fd_set readfds, writefds; int len; int maxfd; int ret; LOG(log_debug, logtype_dsi, "dsi_peek"); maxfd = dsi->socket + 1; while (1) { FD_ZERO(&readfds); FD_ZERO(&writefds); if (dsi->eof < dsi->end) { /* space in read buffer */ FD_SET( dsi->socket, &readfds); } else { if (!warned) { warned = 1; LOG(log_note, logtype_dsi, "dsi_peek: readahead buffer is full, possibly increase -dsireadbuf option"); LOG(log_note, logtype_dsi, "dsi_peek: dsireadbuf: %d, DSI quantum: %d, effective buffer size: %d", dsi->dsireadbuf, dsi->server_quantum ? dsi->server_quantum : DSI_SERVQUANT_DEF, dsi->end - dsi->buffer); } } FD_SET( dsi->socket, &writefds); /* No timeout: if there's nothing to read nor nothing to write, * we've got nothing to do at all */ if ((ret = select( maxfd, &readfds, &writefds, NULL, NULL)) <= 0) { if (ret == -1 && errno == EINTR) /* we might have been interrupted by out timer, so restart select */ continue; /* give up */ LOG(log_error, logtype_dsi, "dsi_peek: unexpected select return: %d %s", ret, ret < 0 ? strerror(errno) : ""); return -1; } if (FD_ISSET(dsi->socket, &writefds)) { /* we can write again */ LOG(log_debug, logtype_dsi, "dsi_peek: can write again"); break; } /* Check if there's sth to read, hopefully reading that will unblock the client */ if (FD_ISSET(dsi->socket, &readfds)) { len = dsi->end - dsi->eof; /* it's ensured above that there's space */ if ((len = read(dsi->socket, dsi->eof, len)) <= 0) { if (len == 0) { LOG(log_error, logtype_dsi, "dsi_peek: EOF"); return -1; } LOG(log_error, logtype_dsi, "dsi_peek: read: %s", strerror(errno)); if (errno == EAGAIN) continue; return -1; } LOG(log_debug, logtype_dsi, "dsi_peek: read %d bytes", len); dsi->eof += len; } } return 0; } /* * Return all bytes up to count from dsi->buffer if there are any buffered there */ static size_t from_buf(DSI *dsi, u_int8_t *buf, size_t count) { size_t nbe = 0; if (dsi->buffer == NULL) /* afpd master has no DSI buffering */ return 0; LOG(log_maxdebug, logtype_dsi, "from_buf: %u bytes", count); nbe = dsi->eof - dsi->start; if (nbe > 0) { nbe = min((size_t)nbe, count); memcpy(buf, dsi->start, nbe); dsi->start += nbe; if (dsi->eof == dsi->start) dsi->start = dsi->eof = dsi->buffer; } LOG(log_debug, logtype_dsi, "from_buf(read: %u, unread:%u , space left: %u): returning %u", dsi->start - dsi->buffer, dsi->eof - dsi->start, dsi->end - dsi->eof, nbe); return nbe; } /* * Get bytes from buffer dsi->buffer or read from socket * * 1. Check if there are bytes in the the dsi->buffer buffer. * 2. Return bytes from (1) if yes. * Note: this may return fewer bytes then requested in count !! * 3. If the buffer was empty, read from the socket. */ static ssize_t buf_read(DSI *dsi, u_int8_t *buf, size_t count) { ssize_t len; LOG(log_maxdebug, logtype_dsi, "buf_read(%u bytes)", count); if (!count) return 0; len = from_buf(dsi, buf, count); /* 1. */ if (len) return len; /* 2. */ len = readt(dsi->socket, buf, count, 0, 1); /* 3. */ LOG(log_maxdebug, logtype_dsi, "buf_read(%u bytes): got: %d", count, len); return len; } /* * Get "length" bytes from buffer and/or socket. In order to avoid frequent small reads * this tries to read larger chunks (8192 bytes) into a buffer. */ static size_t dsi_buffered_stream_read(DSI *dsi, u_int8_t *data, const size_t length) { size_t len; size_t buflen; LOG(log_maxdebug, logtype_dsi, "dsi_buffered_stream_read: %u bytes", length); len = from_buf(dsi, data, length); /* read from buffer dsi->buffer */ dsi->read_count += len; if (len == length) { /* got enough bytes from there ? */ return len; /* yes */ } /* fill the buffer with 8192 bytes or until buffer is full */ buflen = min(8192, dsi->end - dsi->eof); if (buflen > 0) { ssize_t ret; ret = read(dsi->socket, dsi->eof, buflen); if (ret > 0) dsi->eof += ret; } /* now get the remaining data */ if ((buflen = dsi_stream_read(dsi, data + len, length - len)) != length - len) return 0; len += buflen; return len; } /* --------------------------------------- */ static void block_sig(DSI *dsi) { dsi->in_write++; } /* --------------------------------------- */ static void unblock_sig(DSI *dsi) { dsi->in_write--; } /********************************************************************************* * Public functions *********************************************************************************/ /*! * Communication error with the client, enter disconnected state * * 1. close the socket * 2. set the DSI_DISCONNECTED flag, remove possible sleep flags * * @returns 0 if successfully entered disconnected state * -1 if ppid is 1 which means afpd master died * or euid == 0 ie where still running as root (unauthenticated session) */ int dsi_disconnect(DSI *dsi) { LOG(log_note, logtype_dsi, "dsi_disconnect: entering disconnected state"); dsi->proto_close(dsi); /* 1 */ dsi->flags &= ~(DSI_SLEEPING | DSI_EXTSLEEP); /* 2 */ dsi->flags |= DSI_DISCONNECTED; if (geteuid() == 0) return -1; return 0; } /* ------------------------------ * write raw data. return actual bytes read. checks against EINTR * aren't necessary if all of the signals have SA_RESTART * specified. */ ssize_t dsi_stream_write(DSI *dsi, void *data, const size_t length, int mode) { size_t written; ssize_t len; unsigned int flags = 0; dsi->in_write++; written = 0; LOG(log_maxdebug, logtype_dsi, "dsi_stream_write(send: %zd bytes): START", length); if (dsi->flags & DSI_DISCONNECTED) return -1; while (written < length) { len = send(dsi->socket, (u_int8_t *) data + written, length - written, flags); if (len >= 0) { written += len; continue; } if (errno == EINTR) continue; if (errno == EAGAIN || errno == EWOULDBLOCK) { LOG(log_debug, logtype_dsi, "dsi_stream_write: send: %s", strerror(errno)); if (mode == DSI_NOWAIT && written == 0) { /* DSI_NOWAIT is used by attention give up in this case. */ written = -1; goto exit; } /* Try to read sth. in order to break up possible deadlock */ if (dsi_peek(dsi) != 0) { written = -1; goto exit; } /* Now try writing again */ continue; } LOG(log_error, logtype_dsi, "dsi_stream_write: %s", strerror(errno)); written = -1; goto exit; } dsi->write_count += written; LOG(log_maxdebug, logtype_dsi, "dsi_stream_write(send: %zd bytes): END", length); exit: dsi->in_write--; return written; } /* --------------------------------- */ #ifdef WITH_SENDFILE ssize_t dsi_stream_read_file(DSI *dsi, int fromfd, off_t offset, const size_t length) { int ret = 0; size_t written; ssize_t len; off_t pos = offset; LOG(log_maxdebug, logtype_dsi, "dsi_stream_read_file(send %zd bytes): START", length); if (dsi->flags & DSI_DISCONNECTED) return -1; dsi->in_write++; written = 0; while (written < length) { len = sys_sendfile(dsi->socket, fromfd, &pos, length - written); if (len < 0) { if (errno == EINTR) continue; if (errno == EINVAL || errno == ENOSYS) { ret = -1; goto exit; } if (errno == EAGAIN || errno == EWOULDBLOCK) { #if defined(SOLARIS) || defined(FREEBSD) if (pos > offset) { /* we actually have sent sth., adjust counters and keep trying */ len = pos - offset; written += len; offset = pos; } #endif if (dsi_peek(dsi)) { /* can't go back to blocking mode, exit, the next read will return with an error and afpd will die. */ break; } continue; } LOG(log_error, logtype_dsi, "dsi_stream_read_file: %s", strerror(errno)); break; } else if (!len) { /* afpd is going to exit */ ret = -1; goto exit; } else written += len; } dsi->write_count += written; exit: dsi->in_write--; LOG(log_maxdebug, logtype_dsi, "dsi_stream_read_file: sent: %zd", written); if (ret != 0) return -1; return written; } #endif /* * Essentially a loop around buf_read() to ensure "length" bytes are read * from dsi->buffer and/or the socket. * * @returns length on success, some value smaller then length indicates an error */ size_t dsi_stream_read(DSI *dsi, void *data, const size_t length) { size_t stored; ssize_t len; if (dsi->flags & DSI_DISCONNECTED) return 0; LOG(log_maxdebug, logtype_dsi, "dsi_stream_read(%u bytes)", length); stored = 0; while (stored < length) { len = buf_read(dsi, (u_int8_t *) data + stored, length - stored); if (len == -1 && (errno == EINTR || errno == EAGAIN)) { LOG(log_maxdebug, logtype_dsi, "dsi_stream_read: select read loop"); continue; } else if (len > 0) { stored += len; } else { /* eof or error */ /* don't log EOF error if it's just after connect (OSX 10.3 probe) */ #if 0 if (errno == ECONNRESET) dsi->flags |= DSI_GOT_ECONNRESET; #endif if (len || stored || dsi->read_count) { if (! (dsi->flags & DSI_DISCONNECTED)) { LOG(log_error, logtype_dsi, "dsi_stream_read: len:%d, %s", len, (len < 0) ? strerror(errno) : "unexpected EOF"); } return 0; } break; } } dsi->read_count += stored; LOG(log_maxdebug, logtype_dsi, "dsi_stream_read(%u bytes): got: %u", length, stored); return stored; } /* --------------------------------------- * write data. 0 on failure. this assumes that dsi_len will never * cause an overflow in the data buffer. */ int dsi_stream_send(DSI *dsi, void *buf, size_t length) { char block[DSI_BLOCKSIZ]; struct iovec iov[2]; size_t towrite; ssize_t len; LOG(log_maxdebug, logtype_dsi, "dsi_stream_send(%u bytes): START", length); if (dsi->flags & DSI_DISCONNECTED) return 0; block[0] = dsi->header.dsi_flags; block[1] = dsi->header.dsi_command; memcpy(block + 2, &dsi->header.dsi_requestID, sizeof(dsi->header.dsi_requestID)); memcpy(block + 4, &dsi->header.dsi_code, sizeof(dsi->header.dsi_code)); memcpy(block + 8, &dsi->header.dsi_len, sizeof(dsi->header.dsi_len)); memcpy(block + 12, &dsi->header.dsi_reserved, sizeof(dsi->header.dsi_reserved)); if (!length) { /* just write the header */ LOG(log_maxdebug, logtype_dsi, "dsi_stream_send(%u bytes): DSI header, no data", sizeof(block)); length = (dsi_stream_write(dsi, block, sizeof(block), 0) == sizeof(block)); return length; /* really 0 on failure, 1 on success */ } /* block signals */ block_sig(dsi); iov[0].iov_base = block; iov[0].iov_len = sizeof(block); iov[1].iov_base = buf; iov[1].iov_len = length; towrite = sizeof(block) + length; dsi->write_count += towrite; while (towrite > 0) { if (((len = writev(dsi->socket, iov, 2)) == -1 && errno == EINTR) || (len == 0)) continue; if ((size_t)len == towrite) /* wrote everything out */ break; else if (len < 0) { /* error */ if (errno == EAGAIN || errno == EWOULDBLOCK) { if (!dsi_peek(dsi)) { continue; } } LOG(log_error, logtype_dsi, "dsi_stream_send: %s", strerror(errno)); unblock_sig(dsi); return 0; } towrite -= len; if (towrite > length) { /* skip part of header */ iov[0].iov_base = (char *) iov[0].iov_base + len; iov[0].iov_len -= len; } else { /* skip to data */ if (iov[0].iov_len) { len -= iov[0].iov_len; iov[0].iov_len = 0; } iov[1].iov_base = (char *) iov[1].iov_base + len; iov[1].iov_len -= len; } } LOG(log_maxdebug, logtype_dsi, "dsi_stream_send(%u bytes): END", length); unblock_sig(dsi); return 1; } /*! * Read DSI command and data * * @param dsi (rw) DSI handle * * @return DSI function on success, 0 on failure */ int dsi_stream_receive(DSI *dsi) { char block[DSI_BLOCKSIZ]; LOG(log_maxdebug, logtype_dsi, "dsi_stream_receive: START"); if (dsi->flags & DSI_DISCONNECTED) return 0; /* read in the header */ if (dsi_buffered_stream_read(dsi, (u_int8_t *)block, sizeof(block)) != sizeof(block)) return 0; dsi->header.dsi_flags = block[0]; dsi->header.dsi_command = block[1]; if (dsi->header.dsi_command == 0) return 0; memcpy(&dsi->header.dsi_requestID, block + 2, sizeof(dsi->header.dsi_requestID)); memcpy(&dsi->header.dsi_code, block + 4, sizeof(dsi->header.dsi_code)); memcpy(&dsi->header.dsi_len, block + 8, sizeof(dsi->header.dsi_len)); memcpy(&dsi->header.dsi_reserved, block + 12, sizeof(dsi->header.dsi_reserved)); dsi->clientID = ntohs(dsi->header.dsi_requestID); /* make sure we don't over-write our buffers. */ dsi->cmdlen = min(ntohl(dsi->header.dsi_len), DSI_CMDSIZ); if (dsi_stream_read(dsi, dsi->commands, dsi->cmdlen) != dsi->cmdlen) return 0; LOG(log_debug, logtype_dsi, "dsi_stream_receive: DSI cmdlen: %zd", dsi->cmdlen); return block[1]; } netatalk-2.2.2/libatalk/dsi/dsi_getsess.c0000644000175200017500000000766211655731127015310 00000000000000/* * $Id: dsi_getsess.c,v 1.7 2005-04-28 20:50:02 bfernhomberg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include /* POSIX.1 sys/wait.h check */ #include #ifdef HAVE_SYS_WAIT_H #include #endif /* HAVE_SYS_WAIT_H */ #ifndef WEXITSTATUS #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif /* ! WEXITSTATUS */ #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif /* ! WIFEXITED */ #include #include #include #include #include /* hand off the command. return child connection to the main program */ afp_child_t *dsi_getsession(DSI *dsi, server_child *serv_children, int tickleval) { pid_t pid; unsigned int ipc_fds[2]; afp_child_t *child; if (socketpair(PF_UNIX, SOCK_STREAM, 0, ipc_fds) < 0) { LOG(log_error, logtype_dsi, "dsi_getsess: %s", strerror(errno)); exit( EXITERR_CLNT ); } if (setnonblock(ipc_fds[0], 1) != 0 || setnonblock(ipc_fds[1], 1) != 0) { LOG(log_error, logtype_dsi, "dsi_getsess: setnonblock: %s", strerror(errno)); exit(EXITERR_CLNT); } switch (pid = dsi->proto_open(dsi)) { /* in libatalk/dsi/dsi_tcp.c */ case -1: /* if we fail, just return. it might work later */ LOG(log_error, logtype_dsi, "dsi_getsess: %s", strerror(errno)); return NULL; case 0: /* child. mostly handled below. */ break; default: /* parent */ /* using SIGQUIT is hokey, but the child might not have * re-established its signal handler for SIGTERM yet. */ if ((child = server_child_add(serv_children, CHILD_DSIFORK, pid, ipc_fds)) == NULL) { LOG(log_error, logtype_dsi, "dsi_getsess: %s", strerror(errno)); dsi->header.dsi_flags = DSIFL_REPLY; dsi->header.dsi_code = DSIERR_SERVBUSY; dsi_send(dsi); dsi->header.dsi_code = DSIERR_OK; kill(pid, SIGQUIT); } dsi->proto_close(dsi); return child; } /* child: check number of open connections. this is one off the * actual count. */ if ((serv_children->count >= serv_children->nsessions) && (dsi->header.dsi_command == DSIFUNC_OPEN)) { LOG(log_info, logtype_dsi, "dsi_getsess: too many connections"); dsi->header.dsi_flags = DSIFL_REPLY; dsi->header.dsi_code = DSIERR_TOOMANY; dsi_send(dsi); exit(EXITERR_CLNT); } /* get rid of some stuff */ close(dsi->serversock); server_child_free(serv_children); switch (dsi->header.dsi_command) { case DSIFUNC_STAT: /* send off status and return */ { /* OpenTransport 1.1.2 bug workaround: * * OT code doesn't currently handle close sockets well. urk. * the workaround: wait for the client to close its * side. timeouts prevent indefinite resource use. */ static struct timeval timeout = {120, 0}; fd_set readfds; dsi_getstatus(dsi); FD_ZERO(&readfds); FD_SET(dsi->socket, &readfds); free(dsi); select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); exit(0); } break; case DSIFUNC_OPEN: /* setup session */ /* set up the tickle timer */ dsi->timer.it_interval.tv_sec = dsi->timer.it_value.tv_sec = tickleval; dsi->timer.it_interval.tv_usec = dsi->timer.it_value.tv_usec = 0; signal(SIGPIPE, SIG_IGN); /* we catch these ourselves */ dsi_opensession(dsi); if ((child = calloc(1, sizeof(afp_child_t))) == NULL) exit(EXITERR_SYS); child->ipc_fds[1] = ipc_fds[1]; return child; break; default: /* just close */ LOG(log_info, logtype_dsi, "DSIUnknown %d", dsi->header.dsi_command); dsi->proto_close(dsi); exit(EXITERR_CLNT); } } netatalk-2.2.2/libatalk/dsi/dsi_opensess.c0000644000175200017500000000461611655731127015466 00000000000000/* * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include static void dsi_init_buffer(DSI *dsi) { size_t quantum = dsi->server_quantum ? dsi->server_quantum : DSI_SERVQUANT_DEF; /* default is 12 * 300k = 3,6 MB (Apr 2011) */ if ((dsi->buffer = malloc(dsi->dsireadbuf * quantum)) == NULL) { LOG(log_error, logtype_dsi, "dsi_init_buffer: OOM"); AFP_PANIC("OOM in dsi_init_buffer"); } dsi->start = dsi->buffer; dsi->eof = dsi->buffer; dsi->end = dsi->buffer + (dsi->dsireadbuf * quantum); } /* OpenSession. set up the connection */ void dsi_opensession(DSI *dsi) { u_int32_t i = 0; /* this serves double duty. it must be 4-bytes long */ int offs; dsi_init_buffer(dsi); if (setnonblock(dsi->socket, 1) < 0) { LOG(log_error, logtype_dsi, "dsi_opensession: setnonblock: %s", strerror(errno)); AFP_PANIC("setnonblock error"); } /* parse options */ while (i < dsi->cmdlen) { switch (dsi->commands[i++]) { case DSIOPT_ATTNQUANT: memcpy(&dsi->attn_quantum, dsi->commands + i + 1, dsi->commands[i]); dsi->attn_quantum = ntohl(dsi->attn_quantum); case DSIOPT_SERVQUANT: /* just ignore these */ default: i += dsi->commands[i] + 1; /* forward past length tag + length */ break; } } /* let the client know the server quantum. we don't use the * max server quantum due to a bug in appleshare client 3.8.6. */ dsi->header.dsi_flags = DSIFL_REPLY; dsi->header.dsi_code = 0; /* dsi->header.dsi_command = DSIFUNC_OPEN;*/ dsi->cmdlen = 2 * (2 + sizeof(i)); /* length of data. dsi_send uses it. */ /* DSI Option Server Request Quantum */ dsi->commands[0] = DSIOPT_SERVQUANT; dsi->commands[1] = sizeof(i); i = htonl(( dsi->server_quantum < DSI_SERVQUANT_MIN || dsi->server_quantum > DSI_SERVQUANT_MAX ) ? DSI_SERVQUANT_DEF : dsi->server_quantum); memcpy(dsi->commands + 2, &i, sizeof(i)); /* AFP replaycache size option */ offs = 2 + sizeof(i); dsi->commands[offs] = DSIOPT_REPLCSIZE; dsi->commands[offs+1] = sizeof(i); i = htonl(REPLAYCACHE_SIZE); memcpy(dsi->commands + offs + 2, &i, sizeof(i)); dsi_send(dsi); } netatalk-2.2.2/libatalk/dsi/dsi_cmdreply.c0000644000175200017500000000167711665651044015452 00000000000000/* * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include /* this assumes that the reply follows right after the command, saving * on a couple assignments. specifically, command, requestID, and * reserved field are assumed to already be set. */ int dsi_cmdreply(DSI *dsi, const int err) { int ret; LOG(log_debug, logtype_dsi, "dsi_cmdreply(DSI ID: %u, len: %zd): START", dsi->clientID, dsi->datalen); dsi->header.dsi_flags = DSIFL_REPLY; dsi->header.dsi_len = htonl(dsi->datalen); dsi->header.dsi_code = htonl(err); ret = dsi_stream_send(dsi, dsi->data, dsi->datalen); LOG(log_debug, logtype_dsi, "dsi_cmdreply(DSI ID: %u, len: %zd): END", dsi->clientID, dsi->datalen); return ret; } netatalk-2.2.2/libatalk/dsi/dsi_getstat.c0000644000175200017500000000130511655731127015272 00000000000000/* * $Id: dsi_getstat.c,v 1.4 2005-09-07 15:27:29 didg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include /* return the status and then delete the connection. most of the * fields are already set. */ void dsi_getstatus(DSI *dsi) { dsi->header.dsi_flags = DSIFL_REPLY; /*dsi->header.dsi_command = DSIFUNC_STAT;*/ dsi->header.dsi_code = dsi->header.dsi_reserved = 0; memcpy(dsi->commands, dsi->status, dsi->statuslen); dsi->cmdlen = dsi->statuslen; dsi_send(dsi); } netatalk-2.2.2/libatalk/dsi/dsi_write.c0000644000175200017500000000416211655731127014755 00000000000000/* * $Id: dsi_write.c,v 1.5 2009-10-20 04:31:41 didg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. * * 7 Oct 1997 added checks for 0 data. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ /* this streams writes */ #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #include #include #ifndef MIN #define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif /* ! MIN */ /* initialize relevant things for dsi_write. this returns the amount * of data in the data buffer. the interface has been reworked to allow * for arbitrary buffers. */ size_t dsi_writeinit(DSI *dsi, void *buf, const size_t buflen _U_) { size_t len, header; /* figure out how much data we have. do a couple checks for 0 * data */ header = ntohl(dsi->header.dsi_code); dsi->datasize = header ? ntohl(dsi->header.dsi_len) - header : 0; if (dsi->datasize > 0) { len = MIN(sizeof(dsi->commands) - header, dsi->datasize); /* write last part of command buffer into buf */ memcpy(buf, dsi->commands + header, len); /* recalculate remaining data */ dsi->datasize -= len; } else len = 0; return len; } /* fill up buf and then return. this should be called repeatedly * until all the data has been read. i block alarm processing * during the transfer to avoid sending unnecessary tickles. */ size_t dsi_write(DSI *dsi, void *buf, const size_t buflen) { size_t length; if (((length = MIN(buflen, dsi->datasize)) > 0) && ((length = dsi_stream_read(dsi, buf, length)) > 0)) { dsi->datasize -= length; return length; } return 0; } /* flush any unread buffers. */ void dsi_writeflush(DSI *dsi) { size_t length; while (dsi->datasize > 0) { length = dsi_stream_read(dsi, dsi->data, MIN(sizeof(dsi->data), dsi->datasize)); if (length > 0) dsi->datasize -= length; else break; } } netatalk-2.2.2/libatalk/dsi/dsi_close.c0000644000175200017500000000143511655731127014730 00000000000000/* * $Id: dsi_close.c,v 1.4 2003-03-12 15:07:06 didg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include void dsi_close(DSI *dsi) { /* server generated. need to set all the fields. */ if (!(dsi->flags & DSI_SLEEPING) && !(dsi->flags & DSI_DISCONNECTED)) { dsi->header.dsi_flags = DSIFL_REQUEST; dsi->header.dsi_command = DSIFUNC_CLOSE; dsi->header.dsi_requestID = htons(dsi_serverID(dsi)); dsi->header.dsi_code = dsi->header.dsi_reserved = htonl(0); dsi->cmdlen = 0; dsi_send(dsi); dsi->proto_close(dsi); } free(dsi); } netatalk-2.2.2/libatalk/dsi/README0000644000175200017500000000356011655731127013501 00000000000000SIGNALS AND WRITES TO CLIENT: because AFP/TCP uses a streaming protocol, we need to make sure that writes to the client are atomic. notably, signal handlers which write data can't interrupt data currently being written. in addition, some functions get called from the signal handlers or can write partial packets. we need to SIG_BLOCK/SIG_SETMASK those functions instead of SIG_BLOCK/SIG_UNBLOCK'ing them. furthermore, certain functions which write to the client can get called at any time. to avoid corruption, we need to make sure that these functions DO NOT touch any common-use buffers. signals that send data to the client and should block other signals (afp_dsi.c): SIGALRM (tickle handler) SIGHUP (attention) SIGTERM (attention) functions which need SIG_BLOCK/SIG_SETMASK: dsi_send, dsi_attention functions which can use SIG_BLOCK/SIG_UNBLOCK: dsi_read functions which need their own buffers: dsi_attention, dsi_tickle PERFORMANCE TWEAKING: sending complete packets or the header and a partial packet to the client should always be handled by proto_send. for dsi_tcp.c, proto_send will coalesce the header and data by using writev. in addition, appleshare sessions often involve the sending and receiving of many small packets. as a consequence, i use TCP_NODELAY to speed up the turnaround time. because dsi_read can send incomplete packets, proto_send should not use the length parameter to specify the dsi_len field in the header. instead, anything that uses proto_send needs to specify dsi_len (in network byte order) before calling proto_send. the dsi_send() macro already does this. functions that need to specify .dsi_len: dsi_readinit, dsi_cmdreply mmap doesn't actually help things that much, so i don't use it. to reduce the amount of tickles generated on a slow link, i actually turn off SIGALRM for the duration of a "known" large file transfer (i.e., dsi_read/write). netatalk-2.2.2/libatalk/dsi/dsi_attn.c0000644000175200017500000000256211655731127014573 00000000000000/* * $Id: dsi_attn.c,v 1.8 2009-10-25 06:13:11 didg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #ifndef MIN #define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif /* MIN */ /* send an attention. this may get called at any time, so we can't use * DSI buffers to send one. return 0 on error */ int dsi_attention(DSI *dsi, AFPUserBytes flags) { /* header + AFPUserBytes */ char block[DSI_BLOCKSIZ + sizeof(AFPUserBytes)]; u_int32_t len, nlen; u_int16_t id; if (dsi->flags & DSI_SLEEPING) return 1; if (dsi->in_write) { return -1; } id = htons(dsi_serverID(dsi)); flags = htons(flags); len = MIN(sizeof(flags), dsi->attn_quantum); nlen = htonl(len); memset(block, 0, sizeof(block)); block[0] = DSIFL_REQUEST; /* sending a request */ block[1] = DSIFUNC_ATTN; /* it's an attention */ memcpy(block + 2, &id, sizeof(id)); /* code = 0 */ memcpy(block + 8, &nlen, sizeof(nlen)); memcpy(block + 16, &flags, sizeof(flags)); /* reserved = 0 */ /* send an attention */ return dsi_stream_write(dsi, block, DSI_BLOCKSIZ + len, DSI_NOWAIT); } netatalk-2.2.2/libatalk/dsi/dsi_tickle.c0000644000175200017500000000160311655731127015073 00000000000000/* * $Id: dsi_tickle.c,v 1.8 2009-10-25 06:13:11 didg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include /* server generated tickles. as this is only called by the tickle handler, * we don't need to block signals. */ int dsi_tickle(DSI *dsi) { char block[DSI_BLOCKSIZ]; u_int16_t id; if ((dsi->flags & DSI_SLEEPING) || dsi->in_write) return 1; id = htons(dsi_serverID(dsi)); memset(block, 0, sizeof(block)); block[0] = DSIFL_REQUEST; block[1] = DSIFUNC_TICKLE; memcpy(block + 2, &id, sizeof(id)); /* code = len = reserved = 0 */ return dsi_stream_write(dsi, block, DSI_BLOCKSIZ, DSI_NOWAIT); } netatalk-2.2.2/libatalk/adouble/0000777000175200017500000000000011704770416013534 500000000000000netatalk-2.2.2/libatalk/adouble/Makefile.am0000644000175200017500000000035511655731126015507 00000000000000# Makefile.am for libatalk/adouble/ noinst_LTLIBRARIES = libadouble.la libadouble_la_SOURCES = ad_open.c ad_flush.c ad_read.c ad_write.c ad_size.c \ ad_mmap.c ad_lock.c ad_date.c ad_attr.c ad_sendfile.c noinst_HEADERS = ad_private.h netatalk-2.2.2/libatalk/adouble/Makefile.in0000644000175200017500000004074111703521726015520 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/adouble/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = libatalk/adouble DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libadouble_la_LIBADD = am_libadouble_la_OBJECTS = ad_open.lo ad_flush.lo ad_read.lo \ ad_write.lo ad_size.lo ad_mmap.lo ad_lock.lo ad_date.lo \ ad_attr.lo ad_sendfile.lo libadouble_la_OBJECTS = $(am_libadouble_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libadouble_la_SOURCES) DIST_SOURCES = $(libadouble_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libadouble.la libadouble_la_SOURCES = ad_open.c ad_flush.c ad_read.c ad_write.c ad_size.c \ ad_mmap.c ad_lock.c ad_date.c ad_attr.c ad_sendfile.c noinst_HEADERS = ad_private.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/adouble/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/adouble/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libadouble.la: $(libadouble_la_OBJECTS) $(libadouble_la_DEPENDENCIES) $(LINK) $(libadouble_la_OBJECTS) $(libadouble_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_attr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_date.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_flush.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_lock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_mmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_open.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_read.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_sendfile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_size.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_write.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/adouble/ad_sendfile.c0000644000175200017500000000613011667143376016060 00000000000000/* * $Id: ad_sendfile.c,v 1.11 2010-01-21 14:14:49 didg Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. * * NOTE: the following uses the fact that sendfile() only exists on * machines with SA_RESTART behaviour. this is all very machine specific. * * sendfile chainsaw from samba. Unix SMB/Netbios implementation. Version 2.2.x / 3.0.x sendfile implementations. Copyright (C) Jeremy Allison 2002. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef WITH_SENDFILE #include #include #include #include #include #include #include "ad_private.h" #if defined(SENDFILE_FLAVOR_LINUX) #include ssize_t sys_sendfile(int tofd, int fromfd, off_t *offset, size_t count) { return sendfile(tofd, fromfd, offset, count); } #elif defined(SENDFILE_FLAVOR_SOLARIS) #include ssize_t sys_sendfile(int tofd, int fromfd, off_t *offset, size_t count) { return sendfile(tofd, fromfd, offset, count); } #elif defined(SENDFILE_FLAVOR_BSD ) #include #include #include ssize_t sys_sendfile(int tofd, int fromfd, off_t *offset, size_t count) { return sendfile(fromfd, tofd, *offset, count, NULL, offset, 0); } #else ssize_t sys_sendfile(int out_fd, int in_fd, off_t *_offset, size_t count) { /* No sendfile syscall. */ errno = ENOSYS; return -1; } #endif /* ------------------------------- */ int ad_readfile_init(const struct adouble *ad, const int eid, off_t *off, const int end) { int fd; if (end) *off = ad_size(ad, eid) - *off; if (eid == ADEID_DFORK) { fd = ad_data_fileno(ad); } else { *off += ad_getentryoff(ad, eid); fd = ad_reso_fileno(ad); } return fd; } /* ------------------------ */ #if 0 #ifdef HAVE_SENDFILE_WRITE /* read from a socket and write to an adouble file */ ssize_t ad_writefile(struct adouble *ad, const int eid, const int sock, off_t off, const int end, const size_t len) { #ifdef __linux__ ssize_t cc; int fd; fd = ad_sendfile_init(ad, eid, &off, end); if ((cc = sys_sendfile(fd, sock, &off, len)) < 0) return -1; if ((eid != ADEID_DFORK) && (off > ad_getentrylen(ad, eid))) ad_setentrylen(ad, eid, off); return cc; #endif /* __linux__ */ } #endif /* HAVE_SENDFILE_WRITE */ #endif /* 0 */ #endif netatalk-2.2.2/libatalk/adouble/ad_lock.c0000644000175200017500000004163311700307473015212 00000000000000/* * Copyright (c) 1998,1999 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT for more information. * * Byte-range locks. This uses either whole-file flocks to fake byte * locks or fcntl-based actual byte locks. Because fcntl locks are * process-oriented, we need to keep around a list of file descriptors * that refer to the same file. Currently, this doesn't serialize access * to the locks. as a result, there's the potential for race conditions. * * TODO: fix the race when reading/writing. * keep a pool of both locks and reference counters around so that * we can save on mallocs. we should also use a tree to keep things * sorted. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include "ad_private.h" /* translate between ADLOCK styles and specific locking mechanisms */ #define XLATE_FLOCK(type) ((type) == ADLOCK_RD ? LOCK_SH : \ ((type) == ADLOCK_WR ? LOCK_EX : \ ((type) == ADLOCK_CLR ? LOCK_UN : -1))) #ifdef DISABLE_LOCKING #define fcntl(a, b, c ) (0) #endif /* ----------------------- */ static int set_lock(int fd, int cmd, struct flock *lock) { if (fd == -2) { /* We assign fd = -2 for symlinks -> do nothing */ if (cmd == F_GETLK) lock->l_type = F_UNLCK; return 0; } return fcntl(fd, cmd, lock); } /* ----------------------- */ static int XLATE_FCNTL_LOCK(int type) { switch(type) { case ADLOCK_RD: return F_RDLCK; case ADLOCK_WR: return F_WRLCK; case ADLOCK_CLR: return F_UNLCK; } return -1; } /* ----------------------- */ static int OVERLAP(off_t a, off_t alen, off_t b, off_t blen) { return (!alen && a <= b) || (!blen && b <= a) || ( (a + alen > b) && (b + blen > a) ); } /* allocation for lock regions. we allocate aggressively and shrink * only in large chunks. */ #define ARRAY_BLOCK_SIZE 10 #define ARRAY_FREE_DELTA 100 /* remove a lock and compact space if necessary */ static void adf_freelock(struct ad_fd *ad, const int i) { adf_lock_t *lock = ad->adf_lock + i; if (--(*lock->refcount) < 1) { free(lock->refcount); if (!ad->adf_excl) { lock->lock.l_type = F_UNLCK; set_lock(ad->adf_fd, F_SETLK, &lock->lock); /* unlock */ } } ad->adf_lockcount--; /* move another lock into the empty space */ if (i < ad->adf_lockcount) { memcpy(lock, lock + ad->adf_lockcount - i, sizeof(adf_lock_t)); } /* free extra cruft if we go past a boundary. we always want to * keep at least some stuff around for allocations. this wastes * a bit of space to save time on reallocations. */ if ((ad->adf_lockmax > ARRAY_FREE_DELTA) && (ad->adf_lockcount + ARRAY_FREE_DELTA < ad->adf_lockmax)) { struct adf_lock_t *tmp; tmp = (struct adf_lock_t *) realloc(ad->adf_lock, sizeof(adf_lock_t)* (ad->adf_lockcount + ARRAY_FREE_DELTA)); if (tmp) { ad->adf_lock = tmp; ad->adf_lockmax = ad->adf_lockcount + ARRAY_FREE_DELTA; } } } /* this needs to deal with the following cases: * 1) fork is the only user of the lock * 2) fork shares a read lock with another open fork * * i converted to using arrays of locks. everytime a lock * gets removed, we shift all of the locks down. */ static void adf_unlock(struct ad_fd *ad, const int fork) { adf_lock_t *lock = ad->adf_lock; int i; for (i = 0; i < ad->adf_lockcount; i++) { if (lock[i].user == fork) { /* we're really going to delete this lock. note: read locks are the only ones that allow refcounts > 1 */ adf_freelock(ad, i); i--; /* we shifted things down, so we need to backtrack */ /* unlikely but realloc may have change adf_lock */ lock = ad->adf_lock; } } } /* relock any byte lock that overlaps off/len. unlock everything * else. */ static void adf_relockrange(struct ad_fd *ad, int fd, const off_t off, const off_t len) { adf_lock_t *lock = ad->adf_lock; int i; if (!ad->adf_excl) for (i = 0; i < ad->adf_lockcount; i++) { if (OVERLAP(off, len, lock[i].lock.l_start, lock[i].lock.l_len)) set_lock(fd, F_SETLK, &lock[i].lock); } } /* find a byte lock that overlaps off/len for a particular open fork */ static int adf_findlock(struct ad_fd *ad, const int fork, const int type, const off_t off, const off_t len) { adf_lock_t *lock = ad->adf_lock; int i; for (i = 0; i < ad->adf_lockcount; i++) { if ((((type & ADLOCK_RD) && (lock[i].lock.l_type == F_RDLCK)) || ((type & ADLOCK_WR) && (lock[i].lock.l_type == F_WRLCK))) && (lock[i].user == fork) && OVERLAP(off, len, lock[i].lock.l_start, lock[i].lock.l_len)) { return i; } } return -1; } /* search other fork lock lists */ static int adf_findxlock(struct ad_fd *ad, const int fork, const int type, const off_t off, const off_t len) { adf_lock_t *lock = ad->adf_lock; int i; for (i = 0; i < ad->adf_lockcount; i++) { if ((((type & ADLOCK_RD) && (lock[i].lock.l_type == F_RDLCK)) || ((type & ADLOCK_WR) && (lock[i].lock.l_type == F_WRLCK))) && (lock[i].user != fork) && OVERLAP(off, len, lock[i].lock.l_start, lock[i].lock.l_len)) return i; } return -1; } /* okay, this needs to do the following: * 1) check current list of locks. error on conflict. * 2) apply the lock. error on conflict with another process. * 3) update the list of locks this file has. * * NOTE: this treats synchronization locks a little differently. we * do the following things for those: * 1) if the header file exists, all the locks go in the beginning * of that. * 2) if the header file doesn't exist, we stick the locks * in the locations specified by AD_FILELOCK_RD/WR. */ #define LOCK_DATA_WR (0) #define LOCK_DATA_RD (1) #define LOCK_RSRC_WR (2) #define LOCK_RSRC_RD (3) #define LOCK_RSRC_DRD (4) #define LOCK_RSRC_DWR (5) #define LOCK_DATA_DRD (6) #define LOCK_DATA_DWR (7) #define LOCK_RSRC_NONE (8) #define LOCK_DATA_NONE (9) /* -------------- translate a data fork lock to an offset */ static off_t df2off(off_t off) { off_t start = off; if (off == AD_FILELOCK_OPEN_WR) start = LOCK_DATA_WR; else if (off == AD_FILELOCK_OPEN_RD) start = LOCK_DATA_RD; else if (off == AD_FILELOCK_DENY_RD) start = LOCK_DATA_DRD; else if (off == AD_FILELOCK_DENY_WR) start = LOCK_DATA_DWR; else if (off == AD_FILELOCK_OPEN_NONE) start = LOCK_DATA_NONE; return start; } /* -------------- translate a resource fork lock to an offset */ static off_t hf2off(off_t off) { off_t start = off; if (off == AD_FILELOCK_OPEN_WR) start = LOCK_RSRC_WR; else if (off == AD_FILELOCK_OPEN_RD) start = LOCK_RSRC_RD; else if (off == AD_FILELOCK_DENY_RD) start = LOCK_RSRC_DRD; else if (off == AD_FILELOCK_DENY_WR) start = LOCK_RSRC_DWR; else if (off == AD_FILELOCK_OPEN_NONE) start = LOCK_RSRC_NONE; return start; } /* ------------------ */ int ad_fcntl_lock(struct adouble *ad, const u_int32_t eid, const int locktype, const off_t off, const off_t len, const int fork) { struct flock lock; struct ad_fd *adf; adf_lock_t *adflock; int oldlock; int i; int type; lock.l_start = off; type = locktype; if (eid == ADEID_DFORK) { adf = &ad->ad_data_fork; if ((type & ADLOCK_FILELOCK)) { if (ad_meta_fileno(ad) != -1) { /* META */ adf = ad->ad_md; lock.l_start = df2off(off); } } } else { /* rfork */ if (ad_meta_fileno(ad) == -1 || ad_reso_fileno(ad) == -1) { /* there's no meta data. return a lock error * otherwise if a second process is able to create it * locks are a mess. */ errno = EACCES; return -1; } if (type & ADLOCK_FILELOCK) { adf = ad->ad_md; /* either resource or meta data (set in ad_open) */ lock.l_start = hf2off(off); } else { /* we really want the resource fork it's a byte lock */ adf = &ad->ad_resource_fork; lock.l_start += ad_getentryoff(ad, eid); } } /* NOTE: we can't write lock a read-only file. on those, we just * make sure that we have a read lock set. that way, we at least prevent * someone else from really setting a deny read/write on the file. */ if (!(adf->adf_flags & O_RDWR) && (type & ADLOCK_WR)) { type = (type & ~ADLOCK_WR) | ADLOCK_RD; } lock.l_type = XLATE_FCNTL_LOCK(type & ADLOCK_MASK); lock.l_whence = SEEK_SET; lock.l_len = len; /* byte_lock(len=-1) lock whole file */ if (len == BYTELOCK_MAX) { lock.l_len -= lock.l_start; /* otherwise EOVERFLOW error */ } /* see if it's locked by another fork. * NOTE: this guarantees that any existing locks must be at most * read locks. we use ADLOCK_WR/RD because F_RD/WRLCK aren't * guaranteed to be ORable. */ if (adf_findxlock(adf, fork, ADLOCK_WR | ((type & ADLOCK_WR) ? ADLOCK_RD : 0), lock.l_start, lock.l_len) > -1) { errno = EACCES; return -1; } /* look for any existing lock that we may have */ i = adf_findlock(adf, fork, ADLOCK_RD | ADLOCK_WR, lock.l_start, lock.l_len); adflock = (i < 0) ? NULL : adf->adf_lock + i; /* here's what we check for: 1) we're trying to re-lock a lock, but we didn't specify an update. 2) we're trying to free only part of a lock. 3) we're trying to free a non-existent lock. */ if ( (!adflock && (lock.l_type == F_UNLCK)) || (adflock && !(type & ADLOCK_UPGRADE) && ((lock.l_type != F_UNLCK) || (adflock->lock.l_start != lock.l_start) || (adflock->lock.l_len != lock.l_len) )) ) { errno = EINVAL; return -1; } /* now, update our list of locks */ /* clear the lock */ if (lock.l_type == F_UNLCK) { adf_freelock(adf, i); return 0; } /* attempt to lock the file. */ if (!adf->adf_excl && set_lock(adf->adf_fd, F_SETLK, &lock) < 0) return -1; /* we upgraded this lock. */ if (adflock && (type & ADLOCK_UPGRADE)) { memcpy(&adflock->lock, &lock, sizeof(lock)); return 0; } /* it wasn't an upgrade */ oldlock = -1; if (lock.l_type == F_RDLCK) { oldlock = adf_findxlock(adf, fork, ADLOCK_RD, lock.l_start, lock.l_len); } /* no more space. this will also happen if lockmax == lockcount == 0 */ if (adf->adf_lockmax == adf->adf_lockcount) { adf_lock_t *tmp = (adf_lock_t *) realloc(adf->adf_lock, sizeof(adf_lock_t)* (adf->adf_lockmax + ARRAY_BLOCK_SIZE)); if (!tmp) goto fcntl_lock_err; adf->adf_lock = tmp; adf->adf_lockmax += ARRAY_BLOCK_SIZE; } adflock = adf->adf_lock + adf->adf_lockcount; /* fill in fields */ memcpy(&adflock->lock, &lock, sizeof(lock)); adflock->user = fork; if (oldlock > -1) { adflock->refcount = (adf->adf_lock + oldlock)->refcount; } else if ((adflock->refcount = calloc(1, sizeof(int))) == NULL) { goto fcntl_lock_err; } (*adflock->refcount)++; adf->adf_lockcount++; return 0; fcntl_lock_err: lock.l_type = F_UNLCK; if (!adf->adf_excl) set_lock(adf->adf_fd, F_SETLK, &lock); return -1; } /* ------------------------- we are using lock as tristate variable we have a lock ==> 1 no ==> 0 error ==> -1 */ static int testlock(struct ad_fd *adf, off_t off, off_t len) { struct flock lock; adf_lock_t *plock; int i; lock.l_start = off; plock = adf->adf_lock; lock.l_whence = SEEK_SET; lock.l_len = len; /* Do we have a lock? */ for (i = 0; i < adf->adf_lockcount; i++) { if (OVERLAP(lock.l_start, 1, plock[i].lock.l_start, plock[i].lock.l_len)) return 1; /* */ } /* Does another process have a lock? */ lock.l_type = (adf->adf_flags & O_RDWR) ?F_WRLCK : F_RDLCK; if (set_lock(adf->adf_fd, F_GETLK, &lock) < 0) { /* is that kind of error possible ?*/ return (errno == EACCES || errno == EAGAIN)?1:-1; } if (lock.l_type == F_UNLCK) { return 0; } return 1; } /* --------------- */ int ad_testlock(struct adouble *ad, int eid, const off_t off) { struct ad_fd *adf; off_t lock_offset; lock_offset = off; if (eid == ADEID_DFORK) { adf = &ad->ad_data_fork; if (ad_meta_fileno(ad) != -1) { adf = ad->ad_md; lock_offset = df2off(off); } } else { /* rfork */ if (ad_meta_fileno(ad) == -1) { /* there's no resource fork. return no lock */ return 0; } adf = ad->ad_md; lock_offset = hf2off(off); } return testlock(adf, lock_offset, 1); } /* ------------------------- return if a file is open by another process. Optimized for the common case: - there's no locks held by another process (clients) - or we already know the answer and don't need to test. */ u_int16_t ad_openforks(struct adouble *ad, u_int16_t attrbits) { u_int16_t ret = 0; struct ad_fd *adf; off_t off; if (!(attrbits & (ATTRBIT_DOPEN | ATTRBIT_ROPEN))) { off_t len; /* XXX know the locks layout: AD_FILELOCK_OPEN_WR is first and use it for merging requests */ if (ad_meta_fileno(ad) != -1) { /* there's a resource fork test the four bytes for * data RW/RD and fork RW/RD locks in one request */ adf = ad->ad_md; off = LOCK_DATA_WR; len = 4; } else { /* no resource fork, only data RD/RW may exist */ adf = &ad->ad_data_fork; off = AD_FILELOCK_OPEN_WR; len = 2; } if (!testlock(adf, off, len)) return ret; } /* either there's a lock or we already know one fork is open */ if (!(attrbits & ATTRBIT_DOPEN)) { if (ad_meta_fileno(ad) != -1) { adf = ad->ad_md; off = LOCK_DATA_WR; } else { adf = &ad->ad_data_fork; off = AD_FILELOCK_OPEN_WR; } ret = testlock(adf, off, 2) > 0? ATTRBIT_DOPEN : 0; } if (!(attrbits & ATTRBIT_ROPEN)) { if (ad_meta_fileno(ad) != -1) { adf = ad->ad_md; off = LOCK_RSRC_WR; ret |= testlock(adf, off, 2) > 0? ATTRBIT_ROPEN : 0; } } return ret; } /* ------------------------- */ int ad_fcntl_tmplock(struct adouble *ad, const u_int32_t eid, const int locktype, const off_t off, const off_t len, const int fork) { struct flock lock; struct ad_fd *adf; int err; int type; lock.l_start = off; type = locktype; if (eid == ADEID_DFORK) { adf = &ad->ad_data_fork; } else { /* FIXME META */ adf = &ad->ad_resource_fork; if (adf->adf_fd == -1) { /* there's no resource fork. return success */ return 0; } /* if ADLOCK_FILELOCK we want a lock from offset 0 * it's used when deleting a file: * in open we put read locks on meta datas * in delete a write locks on the whole file * so if the file is open by somebody else it fails */ if (!(type & ADLOCK_FILELOCK)) lock.l_start += ad_getentryoff(ad, eid); } if (!(adf->adf_flags & O_RDWR) && (type & ADLOCK_WR)) { type = (type & ~ADLOCK_WR) | ADLOCK_RD; } lock.l_type = XLATE_FCNTL_LOCK(type & ADLOCK_MASK); lock.l_whence = SEEK_SET; lock.l_len = len; /* see if it's locked by another fork. */ if (fork && adf_findxlock(adf, fork, ADLOCK_WR | ((type & ADLOCK_WR) ? ADLOCK_RD : 0), lock.l_start, lock.l_len) > -1) { errno = EACCES; return -1; } /* okay, we might have ranges byte-locked. we need to make sure that * we restore the appropriate ranges once we're done. so, we check * for overlap on an unlock and relock. * XXX: in the future, all the byte locks will be sorted and contiguous. * we just want to upgrade all the locks and then downgrade them * here. */ if (!adf->adf_excl) { err = set_lock(adf->adf_fd, F_SETLK, &lock); } else { err = 0; } if (!err && (lock.l_type == F_UNLCK)) adf_relockrange(adf, adf->adf_fd, lock.l_start, len); return err; } /* ------------------------- the fork is opened in Read Write, Deny Read, Deny Write mode lock the whole file once */ int ad_excl_lock(struct adouble *ad, const u_int32_t eid) { struct ad_fd *adf; struct flock lock; int err; lock.l_start = 0; lock.l_type = F_WRLCK; lock.l_whence = SEEK_SET; lock.l_len = 0; if (eid == ADEID_DFORK) { adf = &ad->ad_data_fork; } else { adf = &ad->ad_resource_fork; lock.l_start = ad_getentryoff(ad, eid); } err = set_lock(adf->adf_fd, F_SETLK, &lock); if (!err) adf->adf_excl = 1; return err; } /* --------------------- */ void ad_fcntl_unlock(struct adouble *ad, const int fork) { if (ad_data_fileno(ad) != -1) { adf_unlock(&ad->ad_data_fork, fork); } if (ad_reso_fileno(ad) != -1) { adf_unlock(&ad->ad_resource_fork, fork); } if (ad->ad_flags != AD_VERSION1_SFM) { return; } if (ad_meta_fileno(ad) != -1) { adf_unlock(&ad->ad_metadata_fork, fork); } } netatalk-2.2.2/libatalk/adouble/ad_size.c0000644000175200017500000000134411662714300015225 00000000000000/* * $Id: ad_size.c,v 1.8 2010-02-26 14:13:16 didg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. * * if we could depend upon inline functions, this would be one. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include off_t ad_size(const struct adouble *ad, const u_int32_t eid) { if (eid == ADEID_DFORK) { struct stat st; if (ad->ad_data_fork.adf_syml) return strlen(ad->ad_data_fork.adf_syml); if (fstat(ad_data_fileno(ad), &st) < 0) return 0; return st.st_size; } #if 0 return ad_getentrylen(ad, eid); #endif return ad->ad_rlen; } netatalk-2.2.2/libatalk/adouble/ad_flush.c0000644000175200017500000001364411655731126015411 00000000000000/* * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include "ad_private.h" #if AD_VERSION == AD_VERSION1 #define EID_DISK(a) (a) #else static const u_int32_t set_eid[] = { 0,1,2,3,4,5,6,7,8, 9,10,11,12,13,14,15, AD_DEV, AD_INO, AD_SYN, AD_ID }; #define EID_DISK(a) (set_eid[a]) #endif /* rebuild the adouble header * XXX should be in a separate file ? */ int ad_rebuild_adouble_header(struct adouble *ad) { u_int32_t eid; u_int32_t temp; u_int16_t nent; char *buf, *nentp; /* * Rebuild any header information that might have changed. */ buf = ad->ad_data; temp = htonl( ad->ad_magic ); memcpy(buf, &temp, sizeof( temp )); buf += sizeof( temp ); temp = htonl( ad->ad_version ); memcpy(buf, &temp, sizeof( temp )); buf += sizeof( temp ); memcpy(buf, ad->ad_filler, sizeof( ad->ad_filler )); buf += sizeof( ad->ad_filler ); nentp = buf; buf += sizeof( nent ); for ( eid = 0, nent = 0; eid < ADEID_MAX; eid++ ) { if ( ad->ad_eid[ eid ].ade_off == 0 ) { continue; } temp = htonl( EID_DISK(eid) ); memcpy(buf, &temp, sizeof( temp )); buf += sizeof( temp ); temp = htonl( ad->ad_eid[ eid ].ade_off ); memcpy(buf, &temp, sizeof( temp )); buf += sizeof( temp ); temp = htonl( ad->ad_eid[ eid ].ade_len ); memcpy(buf, &temp, sizeof( temp )); buf += sizeof( temp ); nent++; } nent = htons( nent ); memcpy(nentp, &nent, sizeof( nent )); return ad_getentryoff(ad, ADEID_RFORK); } /* ------------------- * XXX copy only header with same size or comment * doesn't work well for adouble with different version. * */ int ad_copy_header(struct adouble *add, struct adouble *ads) { u_int32_t eid; u_int32_t len; for ( eid = 0; eid < ADEID_MAX; eid++ ) { if ( ads->ad_eid[ eid ].ade_off == 0 ) { continue; } if ( add->ad_eid[ eid ].ade_off == 0 ) { continue; } len = ads->ad_eid[ eid ].ade_len; if (!len) { continue; } if (eid != ADEID_COMMENT && add->ad_eid[ eid ].ade_len != len ) { continue; } ad_setentrylen( add, eid, len ); memcpy( ad_entry( add, eid ), ad_entry( ads, eid ), len ); } add->ad_rlen = ads->ad_rlen; return 0; } /* ------------------- */ int ad_rebuild_sfm_header(struct adouble *ad) { u_int32_t temp; u_int16_t attr; char *buf; /* * Rebuild any header information that might have changed. */ buf = ad->ad_data; /* FIXME */ /* temp = htonl( ad->ad_magic ); */ temp = ad->ad_magic; memcpy(buf, &temp, sizeof( temp )); /* temp = htonl( ad->ad_version ); */ temp = ad->ad_version; memcpy(buf +4, &temp, sizeof( temp )); /* need to save attrib */ if (!ad_getattr(ad, &attr)) { attr &= ~htons(ATTRBIT_DOPEN | ATTRBIT_ROPEN); memcpy(buf +48 +4, &attr, sizeof(attr)); } return AD_SFM_LEN; } int ad_flush( struct adouble *ad) { int len; if (( ad->ad_md->adf_flags & O_RDWR )) { /* sync our header */ if (ad->ad_rlen > 0xffffffff) { ad_setentrylen(ad, ADEID_RFORK, 0xffffffff); } else { ad_setentrylen(ad, ADEID_RFORK, ad->ad_rlen); } len = ad->ad_ops->ad_rebuild_header(ad); if (adf_pwrite(ad->ad_md, ad->ad_data, len, 0) != len) { if ( errno == 0 ) { errno = EIO; } return( -1 ); } } return( 0 ); } /* use refcounts so that we don't have to re-establish fcntl locks. */ int ad_close( struct adouble *ad, int adflags) { int err = 0; if ((adflags & ADFLAGS_DF) && (ad_data_fileno(ad) >= 0 || ad_data_fileno(ad) == -2) /* -2 means symlink */ && --ad->ad_data_fork.adf_refcount == 0) { if (ad->ad_data_fork.adf_syml != NULL) { free(ad->ad_data_fork.adf_syml); ad->ad_data_fork.adf_syml = 0; } else { if ( close( ad_data_fileno(ad) ) < 0 ) err = -1; } ad_data_fileno(ad) = -1; adf_lock_free(&ad->ad_data_fork); } if (!( adflags & ADFLAGS_HF )) { return err; } /* meta /resource fork */ if ( ad_meta_fileno(ad) != -1 && !(--ad->ad_md->adf_refcount)) { if ( close( ad_meta_fileno(ad) ) < 0 ) { err = -1; } ad_meta_fileno(ad) = -1; adf_lock_free(ad->ad_md); } if (ad->ad_flags != AD_VERSION1_SFM) { return err; } if ((adflags & ADFLAGS_DIR)) { return err; } if ( ad_reso_fileno(ad) != -1 && !(--ad->ad_resource_fork.adf_refcount)) { if ( close( ad_reso_fileno(ad) ) < 0 ) { err = -1; } ad_reso_fileno(ad) = -1; adf_lock_free(&ad->ad_resource_fork); } return err; } netatalk-2.2.2/libatalk/adouble/ad_mmap.c0000644000175200017500000000544211655731126015217 00000000000000/* * $Id: ad_mmap.c,v 1.6 2008-12-03 18:35:44 didg Exp $ * * ad_mmap provides interfaces to memory mapped files. as this is the * case, we don't have to deal w/ temporary buffers such as * ad_data. the ad_mmap routines are designed to not interact w/ the * ad_read/ad_write routines to avoid confusion. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef USE_MMAPPED_HEADERS #include #include #include #include "ad_private.h" static void *ad_mmap(const size_t length, const int prot, const int flags, const int fd, const off_t offset) { return mmap(0, length, prot, flags, fd, offset); } /* this just sets things up for mmap. as mmap can handle offsets, * we need to reset the file position before handing it off */ void *ad_mmapread(struct adouble *ad, const u_int32_t eid, const off_t off, const size_t buflen) { /* data fork */ if ( eid == ADEID_DFORK ) { if ( lseek( ad->ad_df.adf_fd, 0, SEEK_SET ) < 0 ) { perror( "df lseek" ); return (void *) -1; } ad->ad_df.adf_off = 0; return ad_mmap(buflen, PROT_READ | PROT_WRITE, MAP_PRIVATE, ad->ad_df.adf_fd, off); } /* resource fork */ if ( lseek( ad->ad_hf.adf_fd, 0, SEEK_SET ) < 0 ) { perror( "hf lseek" ); return (void *) -1; } ad->ad_hf.adf_off = 0; return ad_mmap(buflen, PROT_READ | PROT_WRITE, MAP_PRIVATE, ad->ad_hf.adf_fd, ad->ad_eid[eid].ade_off + off); } /* to do writeable mmaps correctly, we actually need to make sure that * the file to be mapped is large enough. that's what all the initial * mess is for. */ void *ad_mmapwrite(struct adouble *ad, const u_int32_t eid, off_t off, const int end, const size_t buflen) { struct stat st; /* data fork */ if ( eid == ADEID_DFORK ) { if ( fstat( ad->ad_df.adf_fd, &st ) < 0 ) { return (void *) -1; } if ( end ) { off = st.st_size - off; } /* make sure the file is large enough */ if (st.st_size < buflen + off) ftruncate(ad->ad_df.adf_fd, buflen + off); if ( lseek( ad->ad_df.adf_fd, 0, SEEK_SET ) < 0 ) { return (void *) -1; } ad->ad_df.adf_off = 0; return ad_mmap(buflen, PROT_READ | PROT_WRITE, MAP_SHARED, ad->ad_df.adf_fd, off); } if ( fstat( ad->ad_hf.adf_fd, &st ) < 0 ) { return (void *) -1; } if ( end ) { off = ad->ad_eid[ eid ].ade_len - off; } off += ad->ad_eid[eid].ade_off; /* make sure the file is large enough */ if (st.st_size < buflen + off) ftruncate(ad->ad_hf.adf_fd, buflen + off); if ( lseek( ad->ad_hf.adf_fd, 0, SEEK_SET ) < 0 ) { return (void *) -1; } ad->ad_hf.adf_off = 0; return ad_mmap(buflen, PROT_READ | PROT_WRITE, MAP_SHARED, ad->ad_hf.adf_fd, off); } #endif netatalk-2.2.2/libatalk/adouble/ad_read.c0000644000175200017500000000667111655731127015206 00000000000000/* * $Id: ad_read.c,v 1.10 2010-02-10 14:05:37 franklahm Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif /* ! MIN */ ssize_t adf_pread(struct ad_fd *ad_fd, void *buf, size_t count, off_t offset) { ssize_t cc; #ifndef HAVE_PREAD if ( ad_fd->adf_off != offset ) { if ( lseek( ad_fd->adf_fd, offset, SEEK_SET ) < 0 ) { return -1; } ad_fd->adf_off = offset; } if (( cc = read( ad_fd->adf_fd, buf, count )) < 0 ) { return -1; } ad_fd->adf_off += cc; #else cc = pread(ad_fd->adf_fd, buf, count, offset ); #endif return cc; } /* XXX: locks have to be checked before each stream of consecutive * ad_reads to prevent a denial in the middle from causing * problems. */ ssize_t ad_read( struct adouble *ad, const u_int32_t eid, off_t off, char *buf, const size_t buflen) { ssize_t cc; /* We're either reading the data fork (and thus the data file) * or we're reading anything else (and thus the header file). */ if ( eid == ADEID_DFORK ) { if (ad->ad_data_fork.adf_syml !=0 ) { /* It's a symlink, we already have the target in adf_syml */ cc = strlen(ad->ad_data_fork.adf_syml); if (buflen < cc) /* Request buffersize is too small, force AFPERR_PARAM */ return -1; memcpy(buf, ad->ad_data_fork.adf_syml, cc); } else { cc = adf_pread(&ad->ad_data_fork, buf, buflen, off); } } else { off_t r_off; if ( ad_reso_fileno( ad ) == -1 ) { /* resource fork is not open ( cf etc/afp/fork.c) */ return 0; } r_off = ad_getentryoff(ad, eid) + off; if (( cc = adf_pread( &ad->ad_resource_fork, buf, buflen, r_off )) < 0 ) { return( -1 ); } /* * We've just read in bytes from the disk that we read earlier * into ad_data. If we're going to write this buffer out later, * we need to update ad_data. * FIXME : always false? */ if (r_off < ad_getentryoff(ad, ADEID_RFORK)) { if ( ad->ad_resource_fork.adf_flags & O_RDWR ) { memcpy(buf, ad->ad_data + r_off, MIN(sizeof( ad->ad_data ) - r_off, cc)); } else { memcpy(ad->ad_data + r_off, buf, MIN(sizeof( ad->ad_data ) - r_off, cc)); } } } return( cc ); } netatalk-2.2.2/libatalk/adouble/ad_private.h0000644000175200017500000000161411655731127015742 00000000000000/* * $Id: ad_private.h,v 1.6 2008-12-03 18:35:44 didg Exp $ */ #ifndef LIBATALK_ADOUBLE_AD_PRIVATE_H #define LIBATALK_ADOUBLE_AD_PRIVATE_H 1 #include #ifndef MAP_FAILED #define MAP_FAILED ((void *) -1) #endif /* ! MAP_FAILED */ /* this is so that we can keep lists of fds referencing the same file * around. that way, we can honor locks created by the same process * with the same file. */ #define adf_lock_init(a) do { \ (a)->adf_lockmax = (a)->adf_lockcount = 0; \ (a)->adf_excl = 0;(a)->adf_lock = NULL; \ } while (0) #define adf_lock_free(a) do { \ int i;\ if (!(a)->adf_lock) \ break; \ for (i = 0; i < (a)->adf_lockcount; i++) {\ adf_lock_t *lock = (a)->adf_lock + i;\ if (--(*lock->refcount) < 1)free(lock->refcount); \ }\ free((a)->adf_lock); \ adf_lock_init(a); \ } while (0) #endif /* libatalk/adouble/ad_private.h */ netatalk-2.2.2/libatalk/adouble/ad_attr.c0000644000175200017500000001501211655731126015231 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #define FILEIOFF_ATTR 14 #define AFPFILEIOFF_ATTR 2 /* Note: the "shared" and "invisible" attributes are opaque and stored and retrieved from the FinderFlags. This fixes Bug #2802236: */ int ad_getattr(const struct adouble *ad, u_int16_t *attr) { u_int16_t fflags; *attr = 0; if (ad->ad_version == AD_VERSION1) { if (ad_getentryoff(ad, ADEID_FILEI)) { memcpy(attr, ad_entry(ad, ADEID_FILEI) + FILEIOFF_ATTR, sizeof(u_int16_t)); } } #if AD_VERSION == AD_VERSION2 else if (ad->ad_version == AD_VERSION2) { if (ad_getentryoff(ad, ADEID_AFPFILEI)) { memcpy(attr, ad_entry(ad, ADEID_AFPFILEI) + AFPFILEIOFF_ATTR, 2); /* Now get opaque flags from FinderInfo */ memcpy(&fflags, ad_entry(ad, ADEID_FINDERI) + FINDERINFO_FRFLAGOFF, 2); if (fflags & htons(FINDERINFO_INVISIBLE)) *attr |= htons(ATTRBIT_INVISIBLE); else *attr &= htons(~ATTRBIT_INVISIBLE); /* This one is tricky, I actually got it wrong the first time: for directories bit 1<<1 is ATTRBIT_EXPFLDR and is NOT opaque ! */ if ( ! (ad->ad_adflags & ADFLAGS_DIR)) { if (fflags & htons(FINDERINFO_ISHARED)) *attr |= htons(ATTRBIT_MULTIUSER); else *attr &= htons(~ATTRBIT_MULTIUSER); } } } #endif else return -1; *attr |= htons(ad->ad_open_forks); return 0; } /* ----------------- */ int ad_setattr(const struct adouble *ad, const u_int16_t attribute) { uint16_t fflags; /* we don't save open forks indicator */ u_int16_t attr = attribute & ~htons(ATTRBIT_DOPEN | ATTRBIT_ROPEN); /* Proactively (10.4 does indeed try to set ATTRBIT_MULTIUSER (=ATTRBIT_EXPFLDR) for dirs with SetFile -a M ) disable all flags not defined for dirs. */ if (ad->ad_adflags & ADFLAGS_DIR) attr &= ~(ATTRBIT_MULTIUSER | ATTRBIT_NOWRITE | ATTRBIT_NOCOPY); if (ad->ad_version == AD_VERSION1) { if (ad_getentryoff(ad, ADEID_FILEI)) { memcpy(ad_entry(ad, ADEID_FILEI) + FILEIOFF_ATTR, &attr, sizeof(attr)); } } #if AD_VERSION == AD_VERSION2 else if (ad->ad_version == AD_VERSION2) { if (ad_getentryoff(ad, ADEID_AFPFILEI) && ad_getentryoff(ad, ADEID_FINDERI)) { memcpy(ad_entry(ad, ADEID_AFPFILEI) + AFPFILEIOFF_ATTR, &attr, sizeof(attr)); /* Now set opaque flags in FinderInfo too */ memcpy(&fflags, ad_entry(ad, ADEID_FINDERI) + FINDERINFO_FRFLAGOFF, 2); if (attr & htons(ATTRBIT_INVISIBLE)) fflags |= htons(FINDERINFO_INVISIBLE); else fflags &= htons(~FINDERINFO_INVISIBLE); /* See above comment in ad_getattr() */ if (attr & htons(ATTRBIT_MULTIUSER)) { if ( ! (ad->ad_adflags & ADFLAGS_DIR) ) fflags |= htons(FINDERINFO_ISHARED); } else fflags &= htons(~FINDERINFO_ISHARED); memcpy(ad_entry(ad, ADEID_FINDERI) + FINDERINFO_FRFLAGOFF, &fflags, 2); } } #endif else return -1; return 0; } /* -------------- * save file/folder ID in AppleDoubleV2 netatalk private parameters * return 1 if resource fork has been modified */ #if AD_VERSION == AD_VERSION2 int ad_setid (struct adouble *adp, const dev_t dev, const ino_t ino , const u_int32_t id, const cnid_t did, const void *stamp) { if ((adp->ad_flags == AD_VERSION2) && (adp->ad_options & ADVOL_CACHE)) { /* ad_getid depends on this to detect presence of ALL entries */ ad_setentrylen( adp, ADEID_PRIVID, sizeof(id)); memcpy(ad_entry( adp, ADEID_PRIVID ), &id, sizeof(id)); ad_setentrylen( adp, ADEID_PRIVDEV, sizeof(dev_t)); if ((adp->ad_options & ADVOL_NODEV)) { memset(ad_entry( adp, ADEID_PRIVDEV ), 0, sizeof(dev_t)); } else { memcpy(ad_entry( adp, ADEID_PRIVDEV ), &dev, sizeof(dev_t)); } ad_setentrylen( adp, ADEID_PRIVINO, sizeof(ino_t)); memcpy(ad_entry( adp, ADEID_PRIVINO ), &ino, sizeof(ino_t)); ad_setentrylen( adp, ADEID_DID, sizeof(did)); memcpy(ad_entry( adp, ADEID_DID ), &did, sizeof(did)); ad_setentrylen( adp, ADEID_PRIVSYN, ADEDLEN_PRIVSYN); memcpy(ad_entry( adp, ADEID_PRIVSYN ), stamp, ADEDLEN_PRIVSYN); return 1; } return 0; } /* ----------------------------- */ u_int32_t ad_getid (struct adouble *adp, const dev_t st_dev, const ino_t st_ino , const cnid_t did, const void *stamp) { u_int32_t aint = 0; dev_t dev; ino_t ino; cnid_t a_did; char temp[ADEDLEN_PRIVSYN]; /* look in AD v2 header * note inode and device are opaques and not in network order * only use the ID if adouble is writable for us. */ if (adp && (adp->ad_options & ADVOL_CACHE) && (adp->ad_md->adf_flags & O_RDWR ) && (sizeof(dev_t) == ad_getentrylen(adp, ADEID_PRIVDEV)) /* One check to ensure ALL values are there */ ) { memcpy(&dev, ad_entry(adp, ADEID_PRIVDEV), sizeof(dev_t)); memcpy(&ino, ad_entry(adp, ADEID_PRIVINO), sizeof(ino_t)); memcpy(temp, ad_entry(adp, ADEID_PRIVSYN), sizeof(temp)); memcpy(&a_did, ad_entry(adp, ADEID_DID), sizeof(cnid_t)); if ( ((adp->ad_options & ADVOL_NODEV) || dev == st_dev) && ino == st_ino && (!did || a_did == did) && (memcmp(stamp, temp, sizeof(temp)) == 0) ) { memcpy(&aint, ad_entry(adp, ADEID_PRIVID), sizeof(aint)); return aint; } } return 0; } /* ----------------------------- */ u_int32_t ad_forcegetid (struct adouble *adp) { u_int32_t aint = 0; if (adp && (adp->ad_options & ADVOL_CACHE)) { memcpy(&aint, ad_entry(adp, ADEID_PRIVID), sizeof(aint)); return aint; } return 0; } #endif /* ----------------- * set resource fork filename attribute. */ int ad_setname(struct adouble *ad, const char *path) { int len; if ((len = strlen(path)) > ADEDLEN_NAME) len = ADEDLEN_NAME; if (path && ad_getentryoff(ad, ADEID_NAME)) { ad_setentrylen( ad, ADEID_NAME, len); memcpy(ad_entry( ad, ADEID_NAME ), path, len); return 1; } return 0; } netatalk-2.2.2/libatalk/adouble/ad_open.c0000644000175200017500000014526711677047042015241 00000000000000/* * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu * */ /*! * @file * Part of Netatalk's AppleDouble implementatation * @note We don't use inlines because a good compiler should be * able to optimize all the static funcs below. * @sa include/atalk/adouble.h */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include "ad_private.h" #include #ifndef MAX #define MAX(a, b) ((a) < (b) ? (b) : (a)) #endif /* ! MAX */ /* * AppleDouble entry default offsets. * The layout looks like this: * * this is the v1 layout: * 255 200 16 32 N * | NAME | COMMENT | FILEI | FINDERI | RFORK | * * we need to change it to look like this: * * v2 layout: * field length (in bytes) * NAME 255 * COMMENT 200 * FILEDATESI 16 replaces FILEI * FINDERI 32 * DID 4 new * AFPFILEI 4 new * SHORTNAME 12 8.3 new * RFORK N * * so, all we need to do is replace FILEI with FILEDATESI, move RFORK, * and add in the new fields. * * NOTE: the HFS module will need similar modifications to interact with * afpd correctly. */ #define ADEDOFF_MAGIC (0) #define ADEDOFF_VERSION (ADEDOFF_MAGIC + ADEDLEN_MAGIC) #define ADEDOFF_FILLER (ADEDOFF_VERSION + ADEDLEN_VERSION) #define ADEDOFF_NENTRIES (ADEDOFF_FILLER + ADEDLEN_FILLER) /* initial lengths of some of the fields */ #define ADEDLEN_INIT 0 /* make sure we don't redefine ADEDOFF_FILEI */ #ifdef ADEDOFF_FILEI #undef ADEDOFF_FILEI #endif /* ADEDOFF_FILEI */ #define ADEDOFF_NAME_V1 (AD_HEADER_LEN + ADEID_NUM_V1*AD_ENTRY_LEN) #define ADEDOFF_COMMENT_V1 (ADEDOFF_NAME_V1 + ADEDLEN_NAME) #define ADEDOFF_FILEI (ADEDOFF_COMMENT_V1 + ADEDLEN_COMMENT) #define ADEDOFF_FINDERI_V1 (ADEDOFF_FILEI + ADEDLEN_FILEI) #define ADEDOFF_RFORK_V1 (ADEDOFF_FINDERI_V1 + ADEDLEN_FINDERI) /* i stick things in a slightly different order than their eid order in * case i ever want to separate RootInfo behaviour from the rest of the * stuff. */ #define ADEDOFF_NAME_V2 (AD_HEADER_LEN + ADEID_NUM_V2*AD_ENTRY_LEN) #define ADEDOFF_COMMENT_V2 (ADEDOFF_NAME_V2 + ADEDLEN_NAME) #define ADEDOFF_FILEDATESI (ADEDOFF_COMMENT_V2 + ADEDLEN_COMMENT) #define ADEDOFF_FINDERI_V2 (ADEDOFF_FILEDATESI + ADEDLEN_FILEDATESI) #define ADEDOFF_DID (ADEDOFF_FINDERI_V2 + ADEDLEN_FINDERI) #define ADEDOFF_AFPFILEI (ADEDOFF_DID + ADEDLEN_DID) #define ADEDOFF_SHORTNAME (ADEDOFF_AFPFILEI + ADEDLEN_AFPFILEI) #define ADEDOFF_PRODOSFILEI (ADEDOFF_SHORTNAME + ADEDLEN_SHORTNAME) #define ADEDOFF_PRIVDEV (ADEDOFF_PRODOSFILEI + ADEDLEN_PRODOSFILEI) #define ADEDOFF_PRIVINO (ADEDOFF_PRIVDEV + ADEDLEN_PRIVDEV) #define ADEDOFF_PRIVSYN (ADEDOFF_PRIVINO + ADEDLEN_PRIVINO) #define ADEDOFF_PRIVID (ADEDOFF_PRIVSYN + ADEDLEN_PRIVSYN) #define ADEDOFF_RFORK_V2 (ADEDOFF_PRIVID + ADEDLEN_PRIVID) #define ADEID_NUM_OSX 2 #define ADEDOFF_FINDERI_OSX (AD_HEADER_LEN + ADEID_NUM_OSX*AD_ENTRY_LEN) #define ADEDOFF_RFORK_OSX (ADEDOFF_FINDERI_OSX + ADEDLEN_FINDERI) /* we keep local copies of a bunch of stuff so that we can initialize things * correctly. */ /* this is to prevent changing timezones from causing problems with localtime volumes. the screw-up is 30 years. we use a delta of 5 years. */ #define TIMEWARP_DELTA 157680000 struct entry { u_int32_t id, offset, len; }; static const struct entry entry_order1[ADEID_NUM_V1 +1] = { {ADEID_NAME, ADEDOFF_NAME_V1, ADEDLEN_INIT}, /* 3 */ {ADEID_COMMENT, ADEDOFF_COMMENT_V1, ADEDLEN_INIT}, /* 4 */ {ADEID_FILEI, ADEDOFF_FILEI, ADEDLEN_FILEI}, /* 7 */ {ADEID_FINDERI, ADEDOFF_FINDERI_V1, ADEDLEN_FINDERI}, /* 9 */ {ADEID_RFORK, ADEDOFF_RFORK_V1, ADEDLEN_INIT}, /* 2 */ {0, 0, 0} }; #if AD_VERSION == AD_VERSION1 #define DISK_EID(ad, a) (a) #else /* AD_VERSION == AD_VERSION2 */ static u_int32_t get_eid(struct adouble *ad, u_int32_t eid) { if (eid <= 15) return eid; if (ad->ad_version == AD_VERSION1) return 0; if (eid == AD_DEV) return ADEID_PRIVDEV; if (eid == AD_INO) return ADEID_PRIVINO; if (eid == AD_SYN) return ADEID_PRIVSYN; if (eid == AD_ID) return ADEID_PRIVID; return 0; } #define DISK_EID(ad, a) get_eid(ad, a) static const struct entry entry_order2[ADEID_NUM_V2 +1] = { {ADEID_NAME, ADEDOFF_NAME_V2, ADEDLEN_INIT}, {ADEID_COMMENT, ADEDOFF_COMMENT_V2, ADEDLEN_INIT}, {ADEID_FILEDATESI, ADEDOFF_FILEDATESI, ADEDLEN_FILEDATESI}, {ADEID_FINDERI, ADEDOFF_FINDERI_V2, ADEDLEN_FINDERI}, {ADEID_DID, ADEDOFF_DID, ADEDLEN_DID}, {ADEID_AFPFILEI, ADEDOFF_AFPFILEI, ADEDLEN_AFPFILEI}, {ADEID_SHORTNAME, ADEDOFF_SHORTNAME, ADEDLEN_INIT}, {ADEID_PRODOSFILEI, ADEDOFF_PRODOSFILEI, ADEDLEN_PRODOSFILEI}, {ADEID_PRIVDEV, ADEDOFF_PRIVDEV, ADEDLEN_INIT}, {ADEID_PRIVINO, ADEDOFF_PRIVINO, ADEDLEN_INIT}, {ADEID_PRIVSYN, ADEDOFF_PRIVSYN, ADEDLEN_INIT}, {ADEID_PRIVID, ADEDOFF_PRIVID, ADEDLEN_INIT}, {ADEID_RFORK, ADEDOFF_RFORK_V2, ADEDLEN_INIT}, {0, 0, 0} }; /* OS X adouble finder info and resource fork only */ static const struct entry entry_order_osx[ADEID_NUM_OSX +1] = { {ADEID_FINDERI, ADEDOFF_FINDERI_OSX, ADEDLEN_FINDERI}, {ADEID_RFORK, ADEDOFF_RFORK_OSX, ADEDLEN_INIT}, {0, 0, 0} }; #define ADEID_NUM_SFM 3 static const struct entry entry_order_sfm[ADEID_NUM_SFM +1] = { {ADEID_FINDERI, 16, ADEDLEN_FINDERI}, /* 9 */ {ADEID_SFMRESERVE2, 16+32, 6}, /* 21 */ {ADEID_FILEI, 60, ADEDLEN_FILEI}, /* 7 */ {0, 0, 0} }; #endif /* AD_VERSION == AD_VERSION2 */ #if AD_VERSION == AD_VERSION2 /* update a version 2 adouble resource fork with our private entries */ static int ad_update(struct adouble *ad, const char *path) { struct stat st; u_int16_t nentries = 0; off_t off, shiftdata=0; const struct entry *eid; static off_t entry_len[ADEID_MAX]; static char databuf[ADEID_MAX][256], *buf; int fd; int ret = -1; /* check to see if we should convert this header. */ if (!path || ad->ad_flags != AD_VERSION2) return 0; LOG(log_maxdebug, logtype_default, "ad_update: checking whether '%s' needs an upgrade.", path); if (!(ad->ad_md->adf_flags & O_RDWR)) { /* we were unable to open the file read write the last time */ return 0; } if (ad->ad_eid[ADEID_RFORK].ade_off) { shiftdata = ADEDOFF_RFORK_V2 -ad->ad_eid[ADEID_RFORK].ade_off; } memcpy(&nentries, ad->ad_data + ADEDOFF_NENTRIES, sizeof( nentries )); nentries = ntohs( nentries ); if ( shiftdata == 0 && nentries == ADEID_NUM_V2) return 0; memset(entry_len, 0, sizeof(entry_len)); memset(databuf, 0, sizeof(databuf)); /* bail if we can't get a lock */ if (ad_tmplock(ad, ADEID_RFORK, ADLOCK_WR, 0, 0, 0) < 0) goto bail_err; fd = ad->ad_md->adf_fd; if (fstat(fd, &st)) { goto bail_lock; } if (st.st_size > 0x7fffffff) { LOG(log_debug, logtype_default, "ad_update: file '%s' too big for update.", path); errno = EIO; goto bail_lock; } off = ad->ad_eid[ADEID_RFORK].ade_off; if (off > st.st_size) { LOG(log_error, logtype_default, "ad_update: invalid resource fork offset. (off: %u)", off); errno = EIO; goto bail_lock; } if (ad->ad_eid[ADEID_RFORK].ade_len > st.st_size - off) { LOG(log_error, logtype_default, "ad_update: invalid resource fork length. (rfork len: %u)", ad->ad_eid[ADEID_RFORK].ade_len); errno = EIO; goto bail_lock; } if ((void *) (buf = (char *) mmap(NULL, st.st_size + shiftdata, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED) { goto bail_lock; } /* last place for failure. */ if (sys_ftruncate(fd, st.st_size + shiftdata) < 0) { munmap(buf, st.st_size + shiftdata); goto bail_lock; } /* move the RFORK. this assumes that the RFORK is at the end */ if (off) { memmove(buf + ADEDOFF_RFORK_V2, buf + off, ad->ad_eid[ADEID_RFORK].ade_len); } munmap(buf, st.st_size + shiftdata); /* now, fix up our copy of the header */ memset(ad->ad_filler, 0, sizeof(ad->ad_filler)); /* save the header entries */ eid = entry_order2; while (eid->id) { if( ad->ad_eid[eid->id].ade_off != 0) { if ( eid->id > 2 && ad->ad_eid[eid->id].ade_len < 256) memcpy( databuf[eid->id], ad->ad_data +ad->ad_eid[eid->id].ade_off, ad->ad_eid[eid->id].ade_len); entry_len[eid->id] = ad->ad_eid[eid->id].ade_len; } eid++; } memset(ad->ad_data + AD_HEADER_LEN, 0, AD_DATASZ - AD_HEADER_LEN); /* copy the saved entries to the new header */ eid = entry_order2; while (eid->id) { if ( eid->id > 2 && entry_len[eid->id] > 0) { memcpy(ad->ad_data+eid->offset, databuf[eid->id], entry_len[eid->id]); } ad->ad_eid[eid->id].ade_off = eid->offset; ad->ad_eid[eid->id].ade_len = entry_len[eid->id]; eid++; } /* rebuild the header and cleanup */ LOG(log_debug, logtype_default, "updated AD2 header %s", path); ad_flush(ad ); ret = 0; bail_lock: ad_tmplock(ad, ADEID_RFORK, ADLOCK_CLR, 0, 0, 0); bail_err: return ret; } /* ------------------------------------------ FIXME work only if < 2GB */ static int ad_convert(struct adouble *ad, const char *path) { struct stat st; u_int16_t attr; char *buf; int fd, off; int ret = -1; /* use resource fork offset from file */ int shiftdata; int toV2; int toV1; if (!path) { return 0; } if (!(ad->ad_md->adf_flags & ( O_RDWR))) { /* we were unable to open the file read write the last time */ return 0; } /* check to see if we should convert this header. */ toV2 = ad->ad_version == AD_VERSION1 && ad->ad_flags == AD_VERSION2; toV1 = ad->ad_version == AD_VERSION2 && ad->ad_flags == AD_VERSION1; if (!toV2 && !toV1) return 0; /* convert from v1 to v2. what does this mean? * 1) change FILEI into FILEDATESI * 2) create space for SHORTNAME, AFPFILEI, DID, and PRODOSI * 3) move FILEI attributes into AFPFILEI * 4) initialize ACCESS field of FILEDATESI. * 5) move the resource fork */ /* bail if we can't get a lock */ if (ad_tmplock(ad, ADEID_RFORK, ADLOCK_WR, 0, 0, 0) < 0) goto bail_err; /* we reuse fd from the resource fork */ fd = ad->ad_md->adf_fd; if (ad->ad_eid[ADEID_RFORK].ade_off) { shiftdata = ADEDOFF_RFORK_V2 -ad->ad_eid[ADEID_RFORK].ade_off; } else { shiftdata = ADEDOFF_RFORK_V2 -ADEDOFF_RFORK_V1; /* 136 */ } if (fstat(fd, &st)) { goto bail_lock; } if (st.st_size > 0x7fffffff -shiftdata) { LOG(log_debug, logtype_default, "ad_v1tov2: file too big."); errno = EIO; goto bail_lock; } off = ad->ad_eid[ADEID_RFORK].ade_off; if (off > st.st_size) { LOG(log_error, logtype_default, "ad_v1tov2: invalid resource fork offset. (off: %u)", off); errno = EIO; goto bail_lock; } if (ad->ad_eid[ADEID_RFORK].ade_len > st.st_size - off) { LOG(log_error, logtype_default, "ad_v1tov2: invalid resource fork length. (rfork len: %u)", ad->ad_eid[ADEID_RFORK].ade_len); errno = EIO; goto bail_lock; } if ((void *) (buf = (char *) mmap(NULL, st.st_size + shiftdata, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED) { goto bail_lock; } /* last place for failure. */ if (sys_ftruncate(fd, st.st_size + shiftdata) < 0) { goto bail_lock; } /* move the RFORK. this assumes that the RFORK is at the end */ if (off) { memmove(buf + ADEDOFF_RFORK_V2, buf + off, ad->ad_eid[ADEID_RFORK].ade_len); } munmap(buf, st.st_size + shiftdata); /* now, fix up our copy of the header */ memset(ad->ad_filler, 0, sizeof(ad->ad_filler)); /* replace FILEI with FILEDATESI */ ad_getattr(ad, &attr); ad->ad_eid[ADEID_FILEDATESI].ade_off = ADEDOFF_FILEDATESI; ad->ad_eid[ADEID_FILEDATESI].ade_len = ADEDLEN_FILEDATESI; ad->ad_eid[ADEID_FILEI].ade_off = 0; ad->ad_eid[ADEID_FILEI].ade_len = 0; /* add in the new entries */ ad->ad_eid[ADEID_DID].ade_off = ADEDOFF_DID; ad->ad_eid[ADEID_DID].ade_len = ADEDLEN_DID; ad->ad_eid[ADEID_AFPFILEI].ade_off = ADEDOFF_AFPFILEI; ad->ad_eid[ADEID_AFPFILEI].ade_len = ADEDLEN_AFPFILEI; ad->ad_eid[ADEID_SHORTNAME].ade_off = ADEDOFF_SHORTNAME; ad->ad_eid[ADEID_SHORTNAME].ade_len = ADEDLEN_INIT; ad->ad_eid[ADEID_PRODOSFILEI].ade_off = ADEDOFF_PRODOSFILEI; ad->ad_eid[ADEID_PRODOSFILEI].ade_len = ADEDLEN_PRODOSFILEI; ad->ad_eid[ADEID_PRIVDEV].ade_off = ADEDOFF_PRIVDEV; ad->ad_eid[ADEID_PRIVDEV].ade_len = ADEDLEN_INIT; ad->ad_eid[ADEID_PRIVINO].ade_off = ADEDOFF_PRIVINO; ad->ad_eid[ADEID_PRIVINO].ade_len = ADEDLEN_INIT; ad->ad_eid[ADEID_PRIVSYN].ade_off = ADEDOFF_PRIVSYN; ad->ad_eid[ADEID_PRIVSYN].ade_len = ADEDLEN_INIT; ad->ad_eid[ADEID_PRIVID].ade_off = ADEDOFF_PRIVID; ad->ad_eid[ADEID_PRIVID].ade_len = ADEDLEN_INIT; /* shift the old entries (NAME, COMMENT, FINDERI, RFORK) */ ad->ad_eid[ADEID_NAME].ade_off = ADEDOFF_NAME_V2; ad->ad_eid[ADEID_COMMENT].ade_off = ADEDOFF_COMMENT_V2; ad->ad_eid[ADEID_FINDERI].ade_off = ADEDOFF_FINDERI_V2; ad->ad_eid[ADEID_RFORK].ade_off = ADEDOFF_RFORK_V2; /* switch to dest version */ ad->ad_version = (toV2)?AD_VERSION2:AD_VERSION1; /* move our data buffer to make space for the new entries. */ memmove(ad->ad_data + ADEDOFF_NAME_V2, ad->ad_data + ADEDOFF_NAME_V1, ADEDOFF_RFORK_V1 - ADEDOFF_NAME_V1); /* now, fill in the space with appropriate stuff. we're operating as a v2 file now. */ ad_setdate(ad, AD_DATE_ACCESS | AD_DATE_UNIX, st.st_mtime); memset(ad_entry(ad, ADEID_DID), 0, ADEDLEN_DID); memset(ad_entry(ad, ADEID_AFPFILEI), 0, ADEDLEN_AFPFILEI); ad_setattr(ad, attr); memset(ad_entry(ad, ADEID_SHORTNAME), 0, ADEDLEN_SHORTNAME); memset(ad_entry(ad, ADEID_PRODOSFILEI), 0, ADEDLEN_PRODOSFILEI); /* rebuild the header and cleanup */ ad_flush(ad ); ret = 0; bail_lock: ad_tmplock(ad, ADEID_RFORK, ADLOCK_CLR, 0, 0, 0); bail_err: return ret; } #endif /* AD_VERSION == AD_VERSION2 */ /* ------------------------------------- read in the entries */ static void parse_entries(struct adouble *ad, char *buf, u_int16_t nentries) { u_int32_t eid, len, off; int warning = 0; /* now, read in the entry bits */ for (; nentries > 0; nentries-- ) { memcpy(&eid, buf, sizeof( eid )); eid = DISK_EID(ad, ntohl( eid )); buf += sizeof( eid ); memcpy(&off, buf, sizeof( off )); off = ntohl( off ); buf += sizeof( off ); memcpy(&len, buf, sizeof( len )); len = ntohl( len ); buf += sizeof( len ); if (eid && eid < ADEID_MAX && off < sizeof(ad->ad_data) && (off +len <= sizeof(ad->ad_data) || eid == ADEID_RFORK)) { ad->ad_eid[ eid ].ade_off = off; ad->ad_eid[ eid ].ade_len = len; } else if (!warning) { warning = 1; LOG(log_debug, logtype_default, "ad_refresh: nentries %hd eid %d", nentries, eid ); } } } /* this reads enough of the header so that we can figure out all of * the entry lengths and offsets. once that's done, we just read/mmap * the rest of the header in. * * NOTE: we're assuming that the resource fork is kept at the end of * the file. also, mmapping won't work for the hfs fs until it * understands how to mmap header files. */ static int ad_header_read(struct adouble *ad, struct stat *hst) { char *buf = ad->ad_data; u_int16_t nentries; int len; ssize_t header_len; static int warning = 0; struct stat st; /* read the header */ if ((header_len = adf_pread( ad->ad_md, buf, sizeof(ad->ad_data), 0)) < 0) { return -1; } if (header_len < AD_HEADER_LEN) { errno = EIO; return -1; } memcpy(&ad->ad_magic, buf, sizeof( ad->ad_magic )); memcpy(&ad->ad_version, buf + ADEDOFF_VERSION, sizeof( ad->ad_version )); /* tag broken v1 headers. just assume they're all right. * we detect two cases: null magic/version * byte swapped magic/version * XXX: in the future, you'll need the v1compat flag. * (ad->ad_flags & ADFLAGS_V1COMPAT) */ if (!ad->ad_magic && !ad->ad_version) { if (!warning) { LOG(log_debug, logtype_default, "notice: fixing up null v1 magic/version."); warning++; } ad->ad_magic = AD_MAGIC; ad->ad_version = AD_VERSION1; } else if (ad->ad_magic == AD_MAGIC && ad->ad_version == AD_VERSION1) { if (!warning) { LOG(log_debug, logtype_default, "notice: fixing up byte-swapped v1 magic/version."); warning++; } } else { ad->ad_magic = ntohl( ad->ad_magic ); ad->ad_version = ntohl( ad->ad_version ); } if ((ad->ad_magic != AD_MAGIC) || ((ad->ad_version != AD_VERSION1) #if AD_VERSION == AD_VERSION2 && (ad->ad_version != AD_VERSION2) #endif /* AD_VERSION == AD_VERSION2 */ )) { LOG(log_debug, logtype_default, "ad_open: can't parse AppleDouble header."); errno = EIO; return -1; } memcpy(ad->ad_filler, buf + ADEDOFF_FILLER, sizeof( ad->ad_filler )); memcpy(&nentries, buf + ADEDOFF_NENTRIES, sizeof( nentries )); nentries = ntohs( nentries ); /* read in all the entry headers. if we have more than the * maximum, just hope that the rfork is specified early on. */ len = nentries*AD_ENTRY_LEN; if (len + AD_HEADER_LEN > sizeof(ad->ad_data)) len = sizeof(ad->ad_data) - AD_HEADER_LEN; buf += AD_HEADER_LEN; if (len > header_len - AD_HEADER_LEN) { LOG(log_debug, logtype_default, "ad_header_read: can't read entry info."); errno = EIO; return -1; } /* figure out all of the entry offsets and lengths. if we aren't * able to read a resource fork entry, bail. */ nentries = len / AD_ENTRY_LEN; parse_entries(ad, buf, nentries); if (!ad_getentryoff(ad, ADEID_RFORK) || (ad_getentryoff(ad, ADEID_RFORK) > sizeof(ad->ad_data)) ) { LOG(log_debug, logtype_default, "ad_header_read: problem with rfork entry offset."); errno = EIO; return -1; } if (ad_getentryoff(ad, ADEID_RFORK) > header_len) { LOG(log_debug, logtype_default, "ad_header_read: can't read in entries."); errno = EIO; return -1; } if (hst == NULL) { hst = &st; if (fstat(ad->ad_md->adf_fd, &st) < 0) { return 1; /* fail silently */ } } ad->ad_rlen = hst->st_size - ad_getentryoff(ad, ADEID_RFORK); /* fix up broken dates */ if (ad->ad_version == AD_VERSION1) { u_int32_t aint; /* check to see if the ad date is wrong. just see if we have * a modification date in the future. */ if (((ad_getdate(ad, AD_DATE_MODIFY | AD_DATE_UNIX, &aint)) == 0) && (aint > TIMEWARP_DELTA + hst->st_mtime)) { ad_setdate(ad, AD_DATE_MODIFY | AD_DATE_UNIX, aint - AD_DATE_DELTA); ad_getdate(ad, AD_DATE_CREATE | AD_DATE_UNIX, &aint); ad_setdate(ad, AD_DATE_CREATE | AD_DATE_UNIX, aint - AD_DATE_DELTA); ad_getdate(ad, AD_DATE_BACKUP | AD_DATE_UNIX, &aint); ad_setdate(ad, AD_DATE_BACKUP | AD_DATE_UNIX, aint - AD_DATE_DELTA); } } return 0; } /* --------------------------- SFM structure */ #if 0 typedef struct { byte afpi_Signature[4]; /* Must be 0x00504641 */ byte afpi_Version[4]; /* Must be 0x00010000 */ byte afpi_Reserved1[4]; byte afpi_BackupTime[4]; /* Backup time for the file/dir */ byte finderinfo[32]; /* Finder info */ byte afpi_ProDosInfo[6]; /* ProDos Info */ byte afpi_Reserved2[6]; } sfm_info; #endif static int ad_header_sfm_read(struct adouble *ad, struct stat *hst) { char *buf = ad->ad_data; const struct entry *eid; ssize_t header_len; struct stat st; /* read the header */ if ((header_len = adf_pread( ad->ad_md, buf, sizeof(ad->ad_data), 0)) < 0) { return -1; } if (header_len != AD_SFM_LEN) { errno = EIO; return -1; } memcpy(&ad->ad_magic, buf, sizeof( ad->ad_magic )); memcpy(&ad->ad_version, buf + 4, sizeof( ad->ad_version )); /* FIXME in the great Microsoft tradition they aren't in network order */ #if 0 if (ad->ad_magic == SFM_MAGIC && ad->ad_version == AD_VERSION1) { static int warning = 0; if (!warning) { LOG(log_debug, logtype_default, "notice: fixing up byte-swapped v1 magic/version."); warning++; } } else { ad->ad_magic = ntohl( ad->ad_magic ); ad->ad_version = ntohl( ad->ad_version ); } #endif if ((ad->ad_magic != SFM_MAGIC) || ((ad->ad_version != AD_VERSION1) )) { errno = EIO; LOG(log_debug, logtype_default, "ad_header_sfm_read: can't parse AppleDouble header."); return -1; } /* reinit adouble table */ eid = entry_order_sfm; while (eid->id) { ad->ad_eid[eid->id].ade_off = eid->offset; ad->ad_eid[eid->id].ade_len = eid->len; eid++; } /* steal some prodos for attribute */ { u_int16_t attribute; memcpy(&attribute, buf + 48 +4, sizeof(attribute)); ad_setattr(ad, attribute ); } if (ad->ad_resource_fork.adf_fd != -1) { /* we have a resource fork use it rather than the metadata */ if (fstat(ad->ad_resource_fork.adf_fd, &st) < 0) { /* XXX set to zero ? ad->ad_rlen = 0; */ return 1; } ad->ad_rlen = st.st_size; hst = &st; } else if (hst == NULL) { hst = &st; if (fstat(ad->ad_md->adf_fd, &st) < 0) { return 1; /* fail silently */ } } /* fix up broken dates */ if (ad->ad_version == AD_VERSION1) { u_int32_t aint; /* check to see if the ad date is wrong. just see if we have * a modification date in the future. */ if (((ad_getdate(ad, AD_DATE_MODIFY | AD_DATE_UNIX, &aint)) == 0) && (aint > TIMEWARP_DELTA + hst->st_mtime)) { ad_setdate(ad, AD_DATE_MODIFY | AD_DATE_UNIX, aint - AD_DATE_DELTA); ad_getdate(ad, AD_DATE_CREATE | AD_DATE_UNIX, &aint); ad_setdate(ad, AD_DATE_CREATE | AD_DATE_UNIX, aint - AD_DATE_DELTA); ad_getdate(ad, AD_DATE_BACKUP | AD_DATE_UNIX, &aint); ad_setdate(ad, AD_DATE_BACKUP | AD_DATE_UNIX, aint - AD_DATE_DELTA); } } return 0; } /* --------------------------------------- * Put the .AppleDouble where it needs to be: * * / a/.AppleDouble/b * a/b * \ b/.AppleDouble/.Parent * * FIXME: should do something for pathname > MAXPATHLEN */ char * ad_path( const char *path, int adflags) { static char pathbuf[ MAXPATHLEN + 1]; const char *slash; size_t l ; if ( adflags & ADFLAGS_DIR ) { l = strlcpy( pathbuf, path, sizeof(pathbuf)); if ( l && l < MAXPATHLEN) { pathbuf[l++] = '/'; } strlcpy(pathbuf +l, ".AppleDouble/.Parent", sizeof(pathbuf) -l); } else { if (NULL != ( slash = strrchr( path, '/' )) ) { slash++; l = slash - path; /* XXX we must return NULL here and test in the caller */ if (l > MAXPATHLEN) l = MAXPATHLEN; memcpy( pathbuf, path, l); } else { l = 0; slash = path; } l += strlcpy( pathbuf +l, ".AppleDouble/", sizeof(pathbuf) -l); strlcpy( pathbuf + l, slash, sizeof(pathbuf) -l); } return( pathbuf ); } /* -------------------- */ static int ad_mkrf(char *path) { char *slash; /* * Probably .AppleDouble doesn't exist, try to mkdir it. */ if (NULL == ( slash = strrchr( path, '/' )) ) { return -1; } *slash = '\0'; errno = 0; if ( ad_mkdir( path, 0777 ) < 0 ) { return -1; } *slash = '/'; return 0; } /* --------------------------------------- * Put the resource fork where it needs to be: * ._name */ char * ad_path_osx(const char *path, int adflags _U_) { static char pathbuf[ MAXPATHLEN + 1]; char c, *slash, buf[MAXPATHLEN + 1]; if (!strcmp(path,".")) { /* fixme */ getcwd(buf, MAXPATHLEN); } else { strlcpy(buf, path, MAXPATHLEN +1); } if (NULL != ( slash = strrchr( buf, '/' )) ) { c = *++slash; *slash = '\0'; strlcpy( pathbuf, buf, MAXPATHLEN +1); *slash = c; } else { pathbuf[ 0 ] = '\0'; slash = buf; } strlcat( pathbuf, "._", MAXPATHLEN +1); strlcat( pathbuf, slash, MAXPATHLEN +1); return pathbuf; } /* -------------------- */ static int ad_mkrf_osx(char *path _U_) { return 0; } /* --------------------------------------- * Put the .AppleDouble where it needs to be: * * / a/.AppleDouble/b/AFP_AfpInfo * a/b * \ b/.AppleDouble/.Parent/AFP_AfpInfo * */ char * ad_path_sfm( const char *path, int adflags) { static char pathbuf[ MAXPATHLEN + 1]; char c, *slash, buf[MAXPATHLEN + 1]; size_t l; l = strlcpy(buf, path, MAXPATHLEN +1); if ( adflags & ADFLAGS_DIR ) { strcpy( pathbuf, buf); if ( *buf != '\0' && l < MAXPATHLEN) { pathbuf[l++] = '/'; pathbuf[l] = 0; } slash = ".Parent"; } else { if (NULL != ( slash = strrchr( buf, '/' )) ) { c = *++slash; *slash = '\0'; strcpy( pathbuf, buf); *slash = c; } else { pathbuf[ 0 ] = '\0'; slash = buf; } } strlcat( pathbuf, ".AppleDouble/", MAXPATHLEN +1); strlcat( pathbuf, slash, MAXPATHLEN +1); if ((adflags == ADFLAGS_RF)) { strlcat( pathbuf, "/AFP_Resource", MAXPATHLEN +1); } else { strlcat( pathbuf, "/AFP_AfpInfo", MAXPATHLEN +1); } return( pathbuf ); } /* -------------------- */ static int ad_mkrf_sfm(char *path) { char *slash; /* * Probably .AppleDouble doesn't exist, try to mkdir it. */ if (NULL == ( slash = strrchr( path, '/' )) ) { return -1; } *slash = 0; errno = 0; if ( ad_mkdir( path, 0777 ) < 0 ) { if ( errno == ENOENT ) { char *slash1; if (NULL == ( slash1 = strrchr( path, '/' )) ) return -1; errno = 0; *slash1 = 0; if ( ad_mkdir( path, 0777 ) < 0 ) return -1; *slash1 = '/'; if ( ad_mkdir( path, 0777 ) < 0 ) return -1; } else return -1; } *slash = '/'; return 0; } /* ------------------------- * Support inherited protection modes for AppleDouble files. The supplied * mode is ANDed with the parent directory's mask value in lieu of "umask", * and that value is returned. */ #define DEFMASK 07700 /* be conservative */ char *ad_dir(const char *path) { static char modebuf[ MAXPATHLEN + 1]; char *slash; /* * For a path with directories in it, remove the final component * (path or subdirectory name) to get the name we want to stat. * For a path which is just a filename, use "." instead. */ slash = strrchr( path, '/' ); if (slash) { size_t len; len = slash - path; if (len >= MAXPATHLEN) { errno = ENAMETOOLONG; return NULL; /* can't do it */ } memcpy( modebuf, path, len ); modebuf[len] = '\0'; /* is last char a '/' ? */ if (slash[1] == 0) { slash = modebuf+ len; /* remove them */ while (modebuf < slash && slash[-1] == '/') { --slash; } if (modebuf == slash) { goto use_cur; } *slash = '\0'; while (modebuf < slash && *slash != '/') { --slash; } if (modebuf == slash) { goto use_cur; } *slash = '\0'; /* remove pathname component */ } return modebuf; } use_cur: modebuf[0] = '.'; /* use current directory */ modebuf[1] = '\0'; return modebuf; } /* ---------------- */ static uid_t default_uid = -1; int ad_setfuid(const uid_t id) { default_uid = id; return 0; } /* ---------------- */ uid_t ad_getfuid(void) { return default_uid; } /* ---------------- return inode of path parent directory */ int ad_stat(const char *path, struct stat *stbuf) { char *p; p = ad_dir(path); if (!p) { return -1; } //FIXME! return lstat( p, stbuf ); } /* ---------------- if we are root change path user/ group It can be a native function for BSD cf. FAQ.Q10 path: pathname to chown stbuf: parent directory inode use fstat and fchown or lchown with linux? */ #define EMULATE_SUIDDIR static int ad_chown(const char *path, struct stat *stbuf) { int ret = 0; #ifdef EMULATE_SUIDDIR uid_t id; if (default_uid != (uid_t)-1) { /* we are root (admin) */ id = (default_uid)?default_uid:stbuf->st_uid; ret = lchown( path, id, stbuf->st_gid ); } #endif return ret; } /* ---------------- return access right and inode of path parent directory */ static int ad_mode_st(const char *path, int *mode, struct stat *stbuf) { if (*mode == 0) { return -1; } if (ad_stat(path, stbuf) != 0) { *mode &= DEFMASK; return -1; } *mode &= stbuf->st_mode; return 0; } /* ---------------- return access right of path parent directory */ int ad_mode( const char *path, int mode) { struct stat stbuf; ad_mode_st(path, &mode, &stbuf); return mode; } /* * Use mkdir() with mode bits taken from ad_mode(). */ int ad_mkdir( const char *path, int mode) { int ret; int st_invalid; struct stat stbuf; LOG(log_debug, logtype_default, "ad_mkdir(\"%s\", %04o) {cwd: \"%s\"}", path, mode, getcwdpath()); st_invalid = ad_mode_st(path, &mode, &stbuf); ret = mkdir( path, mode ); if (ret || st_invalid) return ret; ad_chown(path, &stbuf); return ret; } /* ----------------- */ static int ad_error(struct adouble *ad, int adflags) { int err = errno; if ((adflags & ADFLAGS_NOHF)) { /* FIXME double check : set header offset ?*/ return 0; } if ((adflags & ADFLAGS_DF)) { ad_close( ad, ADFLAGS_DF ); err = errno; } return -1 ; } static int new_rfork(const char *path, struct adouble *ad, int adflags); #ifdef HAVE_PREAD #define AD_SET(a) #else #define AD_SET(a) a = 0 #endif /* --------------------------- */ static int ad_check_size(struct adouble *ad _U_, struct stat *st) { if (st->st_size > 0 && st->st_size < AD_DATASZ1) return 1; return 0; } /* --------------------------- */ static int ad_check_size_sfm(struct adouble *ad _U_, struct stat *st) { if (st->st_size > 0 && st->st_size < AD_SFM_LEN) return 1; return 0; } /* --------------------------- */ static int ad_header_upgrade(struct adouble *ad, char *name) { #if AD_VERSION == AD_VERSION2 int ret; if ( (ret = ad_convert(ad, name)) < 0 || (ret = ad_update(ad, name) < 0)) { return ret; } #endif return 0; } /* --------------------------- */ static int ad_header_upgrade_none(struct adouble *ad _U_, char *name _U_) { return 0; } /* --------------------------- */ static struct adouble_fops ad_osx = { &ad_path_osx, &ad_mkrf_osx, &ad_rebuild_adouble_header, &ad_check_size, &ad_header_read, &ad_header_upgrade, }; static struct adouble_fops ad_sfm = { &ad_path_sfm, &ad_mkrf_sfm, &ad_rebuild_sfm_header, &ad_check_size_sfm, &ad_header_sfm_read, &ad_header_upgrade_none, }; static struct adouble_fops ad_adouble = { &ad_path, &ad_mkrf, &ad_rebuild_adouble_header, &ad_check_size, &ad_header_read, &ad_header_upgrade, }; void ad_init(struct adouble *ad, int flags, int options) { ad->ad_inited = 0; ad->ad_flags = flags; if (flags == AD_VERSION2_OSX) { ad->ad_ops = &ad_osx; ad->ad_md = &ad->ad_resource_fork; } else if (flags == AD_VERSION1_SFM) { ad->ad_ops = &ad_sfm; ad->ad_md = &ad->ad_metadata_fork; } else { ad->ad_ops = &ad_adouble; ad->ad_md = &ad->ad_resource_fork; } ad->ad_options = options; ad_data_fileno(ad) = -1; ad_reso_fileno(ad) = -1; ad_meta_fileno(ad) = -1; /* following can be read even if there's no * meda data. */ memset(ad->ad_eid, 0, sizeof( ad->ad_eid )); ad->ad_rlen = 0; } /*! * Open data-, metadata(header)- or ressource fork * * You must call ad_init() before ad_open, usually you'll just call it like this: \n * @code * struct adoube ad; * ad_init(&ad, vol->v_adouble, vol->v_ad_options); * @endcode * * @param path Path to file or directory * * @param adflags ADFLAGS_DF: open data file/fork\n * ADFLAGS_HF: open header (metadata) file\n * ADFLAGS_RF: open ressource fork *** FIXME: not used ?! *** \n * ADFLAGS_CREATE: indicate creation\n * ADFLAGS_NOHF: it's not an error if header file couldn't be created\n * ADFLAGS_DIR: if path is a directory you MUST or ADFLAGS_DIR to adflags\n * ADFLAGS_NOADOUBLE: dont create adouble files if not necessary\n * ADFLAGS_RDONLY: open read only\n * ADFLAGS_OPENFORKS: check for open forks from other processes\n * ADFLAGS_MD: alias for ADFLAGS_HF\n * ADFLAGS_V1COMPAT: obsolete * * @param oflags flags passed through to open syscall: \n * O_RDONLY: *** FIXME *** \n * O_RDWR: *** FIXME *** \n * O_CREAT: create fork\n * O_EXCL: fail if exists with O_CREAT * * @param mode passed to open with O_CREAT * * @param ad pointer to struct adouble * * @returns 0 on success * * @note It's not possible to open the header file O_RDONLY -- the read * will fail and return an error. this refcounts things now.\n * metadata(ressource)-fork only gets created with O_CREAT. */ int ad_open( const char *path, int adflags, int oflags, int mode, struct adouble *ad) { struct stat st_dir; struct stat st_meta; struct stat *pst = NULL; char *ad_p; int hoflags, admode; int st_invalid = -1; int open_df = 0; if (ad->ad_inited != AD_INITED) { ad->ad_inited = AD_INITED; ad->ad_refcount = 1; ad->ad_open_forks = 0; ad->ad_adflags = adflags; ad->ad_resource_fork.adf_refcount = 0; ad->ad_data_fork.adf_refcount = 0; ad->ad_data_fork.adf_syml=0; } else { ad->ad_open_forks = ((ad->ad_data_fork.adf_refcount > 0) ? ATTRBIT_DOPEN : 0); /* XXX not true if we have a meta data fork ? */ if ((ad->ad_resource_fork.adf_refcount > ad->ad_data_fork.adf_refcount)) ad->ad_open_forks |= ATTRBIT_ROPEN; } if ((adflags & ADFLAGS_DF)) { if (ad_data_fileno(ad) == -1) { hoflags = (oflags & ~(O_RDONLY | O_WRONLY)) | O_RDWR; admode = mode; if ((oflags & O_CREAT)) { st_invalid = ad_mode_st(path, &admode, &st_dir); if ((ad->ad_options & ADVOL_UNIXPRIV)) { admode = mode; } } ad->ad_data_fork.adf_fd =open( path, hoflags | O_NOFOLLOW, admode ); if (ad->ad_data_fork.adf_fd == -1) { if ((errno == EACCES || errno == EROFS) && !(oflags & O_RDWR)) { hoflags = oflags; ad->ad_data_fork.adf_fd = open( path, hoflags | O_NOFOLLOW, admode ); } if (ad->ad_data_fork.adf_fd == -1 && errno == OPEN_NOFOLLOW_ERRNO) { int lsz; ad->ad_data_fork.adf_syml = malloc(MAXPATHLEN+1); lsz = readlink(path, ad->ad_data_fork.adf_syml, MAXPATHLEN); if (lsz <= 0) { free(ad->ad_data_fork.adf_syml); return -1; } ad->ad_data_fork.adf_syml[lsz] = 0; ad->ad_data_fork.adf_fd = -2; /* -2 means its a symlink */ } } if ( ad->ad_data_fork.adf_fd == -1 ) return -1; AD_SET(ad->ad_data_fork.adf_off); ad->ad_data_fork.adf_flags = hoflags; if (!st_invalid) { /* just created, set owner if admin (root) */ ad_chown(path, &st_dir); } adf_lock_init(&ad->ad_data_fork); } else { /* the file is already open... but */ if ((oflags & ( O_RDWR | O_WRONLY)) && /* we want write access */ !(ad->ad_data_fork.adf_flags & ( O_RDWR | O_WRONLY))) /* and it was denied the first time */ { errno = EACCES; return -1; } /* FIXME * for now ad_open is never called with O_TRUNC or O_EXCL if the file is * already open. Should we check for it? ie * O_EXCL --> error * O_TRUNC --> truncate the fork. * idem for ressource fork. */ } open_df = ADFLAGS_DF; ad->ad_data_fork.adf_refcount++; } if (!(adflags & ADFLAGS_HF)) return 0; /* ****************************************** */ if (ad_meta_fileno(ad) != -1) { /* the file is already open */ if ((oflags & ( O_RDWR | O_WRONLY)) && !(ad->ad_md->adf_flags & ( O_RDWR | O_WRONLY))) { if (open_df) { /* don't call with ADFLAGS_HF because we didn't open ressource fork */ ad_close( ad, open_df ); } errno = EACCES; return -1; } ad_refresh(ad); /* it's not new anymore */ ad->ad_md->adf_flags &= ~( O_TRUNC | O_CREAT ); ad->ad_md->adf_refcount++; goto sfm; } memset(ad->ad_eid, 0, sizeof( ad->ad_eid )); ad->ad_rlen = 0; ad_p = ad->ad_ops->ad_path( path, adflags ); hoflags = oflags & ~(O_CREAT | O_EXCL); if (!(adflags & ADFLAGS_RDONLY)) { hoflags = (hoflags & ~(O_RDONLY | O_WRONLY)) | O_RDWR; } ad->ad_md->adf_fd = open( ad_p, hoflags | O_NOFOLLOW, 0 ); if (ad->ad_md->adf_fd < 0 ) { if ((errno == EACCES || errno == EROFS) && !(oflags & O_RDWR)) { hoflags = oflags & ~(O_CREAT | O_EXCL); ad->ad_md->adf_fd = open( ad_p, hoflags | O_NOFOLLOW, 0 ); } } if ( ad->ad_md->adf_fd < 0 ) { if (errno == ENOENT && (oflags & O_CREAT) ) { /* * We're expecting to create a new adouble header file, * here. * if ((oflags & O_CREAT) ==> (oflags & O_RDWR) */ LOG(log_debug, logtype_default, "ad_open(\"%s\"): {cwd: \"%s\"} creating adouble file", ad_p, getcwdpath()); admode = mode; errno = 0; st_invalid = ad_mode_st(ad_p, &admode, &st_dir); if ((ad->ad_options & ADVOL_UNIXPRIV)) { admode = mode; } admode = ad_hf_mode(admode); if ((errno == ENOENT) && (ad->ad_flags != AD_VERSION2_OSX)) { if (ad->ad_ops->ad_mkrf( ad_p) < 0) { return ad_error(ad, adflags); } admode = mode; st_invalid = ad_mode_st(ad_p, &admode, &st_dir); if ((ad->ad_options & ADVOL_UNIXPRIV)) { admode = mode; } admode = ad_hf_mode(admode); } /* retry with O_CREAT */ ad->ad_md->adf_fd = open( ad_p, oflags,admode ); if ( ad->ad_md->adf_fd < 0 ) { return ad_error(ad, adflags); } ad->ad_md->adf_flags = oflags; /* just created, set owner if admin owner (root) */ if (!st_invalid) { ad_chown(ad_p, &st_dir); } } else { return ad_error(ad, adflags); } } else { ad->ad_md->adf_flags = hoflags; if (fstat(ad->ad_md->adf_fd, &st_meta) == 0 && st_meta.st_size == 0) { /* for 0 length files, treat them as new. */ ad->ad_md->adf_flags |= O_TRUNC; } else { /* we have valid data in st_meta stat structure, reused it in ad_header_read */ pst = &st_meta; } } AD_SET(ad->ad_md->adf_off); ad->ad_md->adf_refcount = 1; adf_lock_init(ad->ad_md); if ((ad->ad_md->adf_flags & ( O_TRUNC | O_CREAT ))) { /* * This is a new adouble header file. Initialize the structure, * instead of reading it. */ if (new_rfork(path, ad, adflags) < 0) { int err = errno; /* the file is already deleted, perm, whatever, so return an error*/ ad_close(ad, adflags); errno = err; return -1; } ad_flush(ad); } else { /* Read the adouble header in and parse it.*/ if (ad->ad_ops->ad_header_read( ad , pst) < 0 || ad->ad_ops->ad_header_upgrade(ad, ad_p) < 0) { int err = errno; ad_close( ad, adflags ); errno = err; return -1; } } /* ****************************************** */ /* open the resource fork if SFM */ sfm: if (ad->ad_flags != AD_VERSION1_SFM) { return 0; } if ((adflags & ADFLAGS_DIR)) { /* no resource fork for directories / volumes XXX it's false! */ return 0; } /* untrue yet but ad_close will decremente it*/ ad->ad_resource_fork.adf_refcount++; if (ad_reso_fileno(ad) != -1) { /* the file is already open */ if ((oflags & ( O_RDWR | O_WRONLY)) && !(ad->ad_resource_fork.adf_flags & ( O_RDWR | O_WRONLY))) { ad_close( ad, open_df | ADFLAGS_HF); errno = EACCES; return -1; } return 0; } ad_p = ad->ad_ops->ad_path( path, ADFLAGS_RF ); admode = mode; st_invalid = ad_mode_st(ad_p, &admode, &st_dir); if ((ad->ad_options & ADVOL_UNIXPRIV)) { admode = mode; } hoflags = (oflags & ~(O_RDONLY | O_WRONLY)) | O_RDWR; ad->ad_resource_fork.adf_fd = open( ad_p, hoflags, admode ); if (ad->ad_resource_fork.adf_fd < 0 ) { if ((errno == EACCES || errno == EROFS) && !(oflags & O_RDWR)) { hoflags = oflags; ad->ad_resource_fork.adf_fd =open( ad_p, hoflags, admode ); } } if ( ad->ad_resource_fork.adf_fd < 0) { int err = errno; ad_close( ad, adflags ); errno = err; return -1; } adf_lock_init(&ad->ad_resource_fork); AD_SET(ad->ad_resource_fork.adf_off); ad->ad_resource_fork.adf_flags = hoflags; if ((oflags & O_CREAT) && !st_invalid) { /* just created, set owner if admin (root) */ ad_chown(ad_p, &st_dir); } else if (!fstat(ad->ad_resource_fork.adf_fd, &st_meta)) { ad->ad_rlen = st_meta.st_size; } return 0 ; } /*! * @brief open metadata, possibly as root * * Return only metadata but try very hard ie at first try as user, then try as root. * * @param name name of file/dir * @param flags ADFLAGS_DIR: name is a directory \n * ADFLAGS_CREATE: force creation of header file, but only as user, not as root\n * ADFLAGS_OPENFORKS: test if name is open by another afpd process * * @param adp pointer to struct adouble * * @note caller MUST pass ADFLAGS_DIR for directories. Whether ADFLAGS_CREATE really creates * a adouble file depends on various other volume options, eg. ADVOL_CACHE */ int ad_metadata(const char *name, int flags, struct adouble *adp) { uid_t uid; int ret, err, dir; int create = O_RDONLY; dir = flags & ADFLAGS_DIR; /* Check if we shall call ad_open with O_CREAT */ if ( (adp->ad_options & ADVOL_CACHE) && ! (adp->ad_options & ADVOL_NOADOUBLE) && (flags & ADFLAGS_CREATE) ) { create = O_CREAT | O_RDWR; } if ((ret = ad_open(name, ADFLAGS_HF | dir, create, 0666, adp)) < 0 && errno == EACCES) { uid = geteuid(); if (seteuid(0)) { LOG(log_error, logtype_default, "ad_metadata(%s): seteuid failed %s", name, strerror(errno)); errno = EACCES; return -1; } /* we are root open read only */ ret = ad_open(name, ADFLAGS_HF|ADFLAGS_RDONLY| dir, O_RDONLY, 0, adp); err = errno; if ( seteuid(uid) < 0) { LOG(log_error, logtype_default, "ad_metadata: can't seteuid back"); exit(EXITERR_SYS); } errno = err; } if (!ret && (ADFLAGS_OPENFORKS & flags)) { /* we need to check if the file is open by another process. it's slow so we only do it if we have to: - it's requested. - we don't already have the answer! */ adp->ad_open_forks |= ad_openforks(adp, adp->ad_open_forks); } return ret; } /* * @brief openat like wrapper for ad_metadata */ int ad_metadataat(int dirfd, const char *name, int flags, struct adouble *adp) { int ret = 0; int cwdfd = -1; if (dirfd != -1) { if ((cwdfd = open(".", O_RDONLY) == -1) || (fchdir(dirfd) != 0)) { ret = -1; goto exit; } } if (ad_metadata(name, flags, adp) < 0) { ret = -1; goto exit; } if (dirfd != -1) { if (fchdir(cwdfd) != 0) { LOG(log_error, logtype_afpd, "ad_openat: cant chdir back, exiting"); exit(EXITERR_SYS); } } exit: if (cwdfd != -1) close(cwdfd); return ret; } /* ----------------------------------- */ static int new_rfork(const char *path, struct adouble *ad, int adflags) { const struct entry *eid; u_int16_t ashort; struct stat st; ad->ad_magic = AD_MAGIC; ad->ad_version = ad->ad_flags & 0x0f0000; if (!ad->ad_version) { ad->ad_version = AD_VERSION; } memset(ad->ad_filler, 0, sizeof( ad->ad_filler )); memset(ad->ad_data, 0, sizeof(ad->ad_data)); #if AD_VERSION == AD_VERSION2 if (ad->ad_flags == AD_VERSION2) eid = entry_order2; else if (ad->ad_flags == AD_VERSION2_OSX) eid = entry_order_osx; else if (ad->ad_flags == AD_VERSION1_SFM) { ad->ad_magic = SFM_MAGIC; eid = entry_order_sfm; } else #endif eid = entry_order1; while (eid->id) { ad->ad_eid[eid->id].ade_off = eid->offset; ad->ad_eid[eid->id].ade_len = eid->len; eid++; } /* put something sane in the directory finderinfo */ if ((adflags & ADFLAGS_DIR)) { /* set default view */ ashort = htons(FINDERINFO_CLOSEDVIEW); memcpy(ad_entry(ad, ADEID_FINDERI) + FINDERINFO_FRVIEWOFF, &ashort, sizeof(ashort)); } else { /* set default creator/type fields */ memcpy(ad_entry(ad, ADEID_FINDERI) + FINDERINFO_FRTYPEOFF,"\0\0\0\0", 4); memcpy(ad_entry(ad, ADEID_FINDERI) + FINDERINFO_FRCREATOFF,"\0\0\0\0", 4); } /* make things invisible */ if ((ad->ad_options & ADVOL_INVDOTS) && !(adflags & ADFLAGS_CREATE) && (*path == '.') && strcmp(path, ".") && strcmp(path, "..")) { ashort = htons(ATTRBIT_INVISIBLE); ad_setattr(ad, ashort); ashort = htons(FINDERINFO_INVISIBLE); memcpy(ad_entry(ad, ADEID_FINDERI) + FINDERINFO_FRFLAGOFF, &ashort, sizeof(ashort)); } if (lstat(path, &st) < 0) { return -1; } /* put something sane in the date fields */ ad_setdate(ad, AD_DATE_CREATE | AD_DATE_UNIX, st.st_mtime); ad_setdate(ad, AD_DATE_MODIFY | AD_DATE_UNIX, st.st_mtime); ad_setdate(ad, AD_DATE_ACCESS | AD_DATE_UNIX, st.st_mtime); ad_setdate(ad, AD_DATE_BACKUP, AD_DATE_START); return 0; } /* to do this with mmap, we need the hfs fs to understand how to mmap header files. */ int ad_refresh(struct adouble *ad) { if (ad_meta_fileno(ad) < 0) return -1; return ad->ad_ops->ad_header_read(ad, NULL); } int ad_openat(int dirfd, /* dir fd openat like */ const char *path, int adflags, int oflags, int mode, struct adouble *ad) { int ret = 0; int cwdfd = -1; if (dirfd != -1) { if ((cwdfd = open(".", O_RDONLY) == -1) || (fchdir(dirfd) != 0)) { ret = -1; goto exit; } } if (ad_open(path, adflags, oflags, mode, ad) < 0) { ret = -1; goto exit; } if (dirfd != -1) { if (fchdir(cwdfd) != 0) { LOG(log_error, logtype_afpd, "ad_openat: cant chdir back, exiting"); exit(EXITERR_SYS); } } exit: if (cwdfd != -1) close(cwdfd); return ret; } netatalk-2.2.2/libatalk/adouble/ad_write.c0000644000175200017500000000717411655731127015424 00000000000000/* * Copyright (c) 1990,1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif /* ! MIN */ /* XXX: locking has to be checked before each stream of consecutive * ad_writes to prevent a lock in the middle from causing problems. */ ssize_t adf_pwrite(struct ad_fd *ad_fd, const void *buf, size_t count, off_t offset) { ssize_t cc; #ifndef HAVE_PWRITE if ( ad_fd->adf_off != offset ) { if ( lseek( ad_fd->adf_fd, offset, SEEK_SET ) < 0 ) { return -1; } ad_fd->adf_off = offset; } cc = write( ad_fd->adf_fd, buf, count ); if ( cc < 0 ) { return -1; } ad_fd->adf_off += cc; #else cc = pwrite(ad_fd->adf_fd, buf, count, offset ); #endif return cc; } /* end is always 0 */ ssize_t ad_write(struct adouble *ad, const u_int32_t eid, off_t off, const int end, const char *buf, const size_t buflen) { struct stat st; ssize_t cc; if (ad_data_fileno(ad) == -2) { /* It's a symlink */ errno = EACCES; return -1; } if ( eid == ADEID_DFORK ) { if ( end ) { if ( fstat( ad_data_fileno(ad), &st ) < 0 ) { return( -1 ); } off = st.st_size - off; } cc = adf_pwrite(&ad->ad_data_fork, buf, buflen, off); } else if ( eid == ADEID_RFORK ) { off_t r_off; if ( end ) { if ( fstat( ad_data_fileno(ad), &st ) < 0 ) { return( -1 ); } off = st.st_size - off -ad_getentryoff(ad, eid); } r_off = ad_getentryoff(ad, eid) + off; cc = adf_pwrite(&ad->ad_resource_fork, buf, buflen, r_off); /* sync up our internal buffer FIXME always false? */ if (r_off < ad_getentryoff(ad, ADEID_RFORK)) { memcpy(ad->ad_data + r_off, buf, MIN(sizeof(ad->ad_data) -r_off, cc)); } if ( ad->ad_rlen < off + cc ) { ad->ad_rlen = off + cc; } } else { return -1; /* we don't know how to write if it's not a ressource or data fork */ } return( cc ); } /* * the caller set the locks * ftruncate is undefined when the file length is smaller than 'size' */ int sys_ftruncate(int fd, off_t length) { #ifndef HAVE_PWRITE off_t curpos; #endif int err; struct stat st; char c = 0; if (!ftruncate(fd, length)) { return 0; } /* maybe ftruncate doesn't work if we try to extend the size */ err = errno; #ifndef HAVE_PWRITE /* we only care about file pointer if we don't use pwrite */ if ((off_t)-1 == (curpos = lseek(fd, 0, SEEK_CUR)) ) { errno = err; return -1; } #endif if ( fstat( fd, &st ) < 0 ) { errno = err; return -1; } if (st.st_size > length) { errno = err; return -1; } if (lseek(fd, length -1, SEEK_SET) != length -1) { errno = err; return -1; } if (1 != write( fd, &c, 1 )) { /* return the write errno */ return -1; } #ifndef HAVE_PWRITE if (curpos != lseek(fd, curpos, SEEK_SET)) { errno = err; return -1; } #endif return 0; } /* ------------------------ */ int ad_rtruncate( struct adouble *ad, const off_t size) { if ( sys_ftruncate( ad_reso_fileno(ad), size + ad->ad_eid[ ADEID_RFORK ].ade_off ) < 0 ) { return -1; } ad->ad_rlen = size; return 0; } int ad_dtruncate(struct adouble *ad, const off_t size) { if (sys_ftruncate(ad_data_fileno(ad), size) < 0) { return -1; } return 0; } netatalk-2.2.2/libatalk/adouble/ad_date.c0000644000175200017500000000302011655731126015170 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include int ad_setdate(struct adouble *ad, unsigned int dateoff, u_int32_t date) { int xlate = (dateoff & AD_DATE_UNIX); dateoff &= AD_DATE_MASK; if (xlate) date = AD_DATE_FROM_UNIX(date); if (ad->ad_version == AD_VERSION1) { if (!ad_getentryoff(ad, ADEID_FILEI)) return -1; if (dateoff > AD_DATE_BACKUP) return -1; memcpy(ad_entry(ad, ADEID_FILEI) + dateoff, &date, sizeof(date)); } else if (ad->ad_version == AD_VERSION2) { if (!ad_getentryoff(ad, ADEID_FILEDATESI)) return -1; if (dateoff > AD_DATE_ACCESS) return -1; memcpy(ad_entry(ad, ADEID_FILEDATESI) + dateoff, &date, sizeof(date)); } else return -1; return 0; } int ad_getdate(const struct adouble *ad, unsigned int dateoff, u_int32_t *date) { int xlate = (dateoff & AD_DATE_UNIX); dateoff &= AD_DATE_MASK; if (ad->ad_version == AD_VERSION1) { if (dateoff > AD_DATE_BACKUP) return -1; if (!ad_getentryoff(ad, ADEID_FILEI)) return -1; memcpy(date, ad_entry(ad, ADEID_FILEI) + dateoff, sizeof(u_int32_t)); } else if (ad->ad_version == AD_VERSION2) { if (!ad_getentryoff(ad, ADEID_FILEDATESI)) return -1; if (dateoff > AD_DATE_ACCESS) return -1; memcpy(date, ad_entry(ad, ADEID_FILEDATESI) + dateoff, sizeof(u_int32_t)); } else return -1; if (xlate) *date = AD_DATE_TO_UNIX(*date); return 0; } netatalk-2.2.2/libatalk/bstring/0000777000175200017500000000000011704770416013571 500000000000000netatalk-2.2.2/libatalk/bstring/bstradd.c0000644000175200017500000001133511655731127015300 00000000000000/* $Id: bstradd.c,v 1.1.2.1 2010-02-01 10:56:08 franklahm Exp $ Copyright (c) 2010 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ /*! * @file * Additional functions for bstrlib */ #include #include #include #include #include #include #include /* Optionally include a mechanism for debugging memory */ #if defined(MEMORY_DEBUG) || defined(BSTRLIB_MEMORY_DEBUG) #include "memdbg.h" #endif #ifndef bstr__alloc #define bstr__alloc(x) malloc (x) #endif #ifndef bstr__free #define bstr__free(p) free (p) #endif #ifndef bstr__realloc #define bstr__realloc(p,x) realloc ((p), (x)) #endif #ifndef bstr__memcpy #define bstr__memcpy(d,s,l) memcpy ((d), (s), (l)) #endif #ifndef bstr__memmove #define bstr__memmove(d,s,l) memmove ((d), (s), (l)) #endif #ifndef bstr__memset #define bstr__memset(d,c,l) memset ((d), (c), (l)) #endif #ifndef bstr__memcmp #define bstr__memcmp(d,c,l) memcmp ((d), (c), (l)) #endif #ifndef bstr__memchr #define bstr__memchr(s,c,l) memchr ((s), (c), (l)) #endif /************************************************************************* * Stuff for making bstrings referencing c-strings ************************************************************************/ /*! * @brief Create a bstring referencing "str" * * This is usefull if a well know code path uses string, often doing strlen on string. * By converting to bstring which carries the strlen, the repeated computation can be avoided. */ bstring brefcstr (char *str) { bstring b; int i; size_t j; if (str == NULL) return NULL; j = strlen(str); b = (bstring)bstr__alloc(sizeof(struct tagbstring)); if (NULL == b) return NULL; b->slen = (int) j; b->mlen = -1; b->data = str; return b; } /*! * @brief Free up the bstring, WITHOUT freeing the pointed to c-string! */ int bunrefcstr (bstring b) { if (b == NULL || b->slen < 0 || b->mlen > 0 || b->data == NULL) return BSTR_ERR; /* In case there is any stale usage, there is one more chance to notice this error. */ b->slen = -1; b->mlen = -__LINE__; b->data = NULL; bstr__free (b); return BSTR_OK; } /************************************************************************* * stuff for bstrList ************************************************************************/ /*! * @brief Create an empty list with preallocated storage for at least 'min' members */ struct bstrList *bstrListCreateMin(int min) { struct bstrList *sl = NULL; if ((sl = bstrListCreate()) == NULL) return NULL; if ((bstrListAlloc(sl, min)) != BSTR_OK) { bstrListDestroy(sl); return NULL; } return sl; } /*! * @brief Push a bstring to the end of a list */ int bstrListPush(struct bstrList *sl, bstring bs) { if (sl->qty == sl->mlen) { if ((bstrListAlloc(sl, sl->qty + 1)) != BSTR_OK) return BSTR_ERR; } sl->entry[sl->qty] = bs; sl->qty++; return BSTR_OK; } /*! * @brief Pop a bstring from the end of a list */ bstring bstrListPop(struct bstrList *sl) { return NULL; } /*! * @brief Inverse bjoin */ bstring bjoinInv(const struct bstrList * bl, const_bstring sep) { bstring b; int i, j, c, v; if (bl == NULL || bl->qty < 0) return NULL; if (sep != NULL && (sep->slen < 0 || sep->data == NULL)) return NULL; for (i = 0, c = 1; i < bl->qty; i++) { v = bl->entry[i]->slen; if (v < 0) return NULL;/* Invalid input */ c += v; if (c < 0) return NULL;/* Wrap around ?? */ } if (sep != NULL) c += (bl->qty - 1) * sep->slen; b = (bstring) bstr__alloc (sizeof (struct tagbstring)); if (NULL == b) return NULL; /* Out of memory */ b->data = (unsigned char *) bstr__alloc (c); if (b->data == NULL) { bstr__free (b); return NULL; } b->mlen = c; b->slen = c-1; for (i = bl->qty - 1, c = 0, j = 0; i >= 0; i--, j++) { if (j > 0 && sep != NULL) { bstr__memcpy (b->data + c, sep->data, sep->slen); c += sep->slen; } v = bl->entry[i]->slen; bstr__memcpy (b->data + c, bl->entry[i]->data, v); c += v; } b->data[c] = (unsigned char) '\0'; return b; } netatalk-2.2.2/libatalk/bstring/Makefile.am0000644000175200017500000000016611655731127015545 00000000000000# Makefile.am for libatalk/adouble/ noinst_LTLIBRARIES = libbstring.la libbstring_la_SOURCES = bstrlib.c bstradd.c netatalk-2.2.2/libatalk/bstring/Makefile.in0000644000175200017500000003720211703521726015553 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/adouble/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = libatalk/bstring DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libbstring_la_LIBADD = am_libbstring_la_OBJECTS = bstrlib.lo bstradd.lo libbstring_la_OBJECTS = $(am_libbstring_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libbstring_la_SOURCES) DIST_SOURCES = $(libbstring_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libbstring.la libbstring_la_SOURCES = bstrlib.c bstradd.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/bstring/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/bstring/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libbstring.la: $(libbstring_la_OBJECTS) $(libbstring_la_DEPENDENCIES) $(LINK) $(libbstring_la_OBJECTS) $(libbstring_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bstradd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bstrlib.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/bstring/bstrlib.c0000644000175200017500000025441211655731127015323 00000000000000/* * This source file is part of the bstring string library. This code was * written by Paul Hsieh in 2002-2008, and is covered by the BSD open source * license and the GPL. Refer to the accompanying documentation for details * on usage and license. */ /* * bstrlib.c * * This file is the core module for implementing the bstring functions. */ #include #include #include #include #include #include #include /* Optionally include a mechanism for debugging memory */ #if defined(MEMORY_DEBUG) || defined(BSTRLIB_MEMORY_DEBUG) #include "memdbg.h" #endif #ifndef bstr__alloc #define bstr__alloc(x) malloc (x) #endif #ifndef bstr__free #define bstr__free(p) free (p) #endif #ifndef bstr__realloc #define bstr__realloc(p,x) realloc ((p), (x)) #endif #ifndef bstr__memcpy #define bstr__memcpy(d,s,l) memcpy ((d), (s), (l)) #endif #ifndef bstr__memmove #define bstr__memmove(d,s,l) memmove ((d), (s), (l)) #endif #ifndef bstr__memset #define bstr__memset(d,c,l) memset ((d), (c), (l)) #endif #ifndef bstr__memcmp #define bstr__memcmp(d,c,l) memcmp ((d), (c), (l)) #endif #ifndef bstr__memchr #define bstr__memchr(s,c,l) memchr ((s), (c), (l)) #endif /* Just a length safe wrapper for memmove. */ #define bBlockCopy(D,S,L) { if ((L) > 0) bstr__memmove ((D),(S),(L)); } /* Compute the snapped size for a given requested size. By snapping to powers of 2 like this, repeated reallocations are avoided. */ static int snapUpSize (int i) { if (i < 8) { i = 8; } else { unsigned int j; j = (unsigned int) i; j |= (j >> 1); j |= (j >> 2); j |= (j >> 4); j |= (j >> 8); /* Ok, since int >= 16 bits */ #if (UINT_MAX != 0xffff) j |= (j >> 16); /* For 32 bit int systems */ #if (UINT_MAX > 0xffffffffUL) j |= (j >> 32); /* For 64 bit int systems */ #endif #endif /* Least power of two greater than i */ j++; if ((int) j >= i) i = (int) j; } return i; } /* int balloc (bstring b, int len) * * Increase the size of the memory backing the bstring b to at least len. */ int balloc (bstring b, int olen) { int len; if (b == NULL || b->data == NULL || b->slen < 0 || b->mlen <= 0 || b->mlen < b->slen || olen <= 0) { return BSTR_ERR; } if (olen >= b->mlen) { unsigned char * x; if ((len = snapUpSize (olen)) <= b->mlen) return BSTR_OK; /* Assume probability of a non-moving realloc is 0.125 */ if (7 * b->mlen < 8 * b->slen) { /* If slen is close to mlen in size then use realloc to reduce the memory defragmentation */ reallocStrategy:; x = (unsigned char *) bstr__realloc (b->data, (size_t) len); if (x == NULL) { /* Since we failed, try allocating the tighest possible allocation */ if (NULL == (x = (unsigned char *) bstr__realloc (b->data, (size_t) (len = olen)))) { return BSTR_ERR; } } } else { /* If slen is not close to mlen then avoid the penalty of copying the extra bytes that are allocated, but not considered part of the string */ if (NULL == (x = (unsigned char *) bstr__alloc ((size_t) len))) { /* Perhaps there is no available memory for the two allocations to be in memory at once */ goto reallocStrategy; } else { if (b->slen) bstr__memcpy ((char *) x, (char *) b->data, (size_t) b->slen); bstr__free (b->data); } } b->data = x; b->mlen = len; b->data[b->slen] = (unsigned char) '\0'; } return BSTR_OK; } /* int ballocmin (bstring b, int len) * * Set the size of the memory backing the bstring b to len or b->slen+1, * whichever is larger. Note that repeated use of this function can degrade * performance. */ int ballocmin (bstring b, int len) { unsigned char * s; if (b == NULL || b->data == NULL || (b->slen+1) < 0 || b->mlen <= 0 || b->mlen < b->slen || len <= 0) { return BSTR_ERR; } if (len < b->slen + 1) len = b->slen + 1; if (len != b->mlen) { s = (unsigned char *) bstr__realloc (b->data, (size_t) len); if (NULL == s) return BSTR_ERR; s[b->slen] = (unsigned char) '\0'; b->data = s; b->mlen = len; } return BSTR_OK; } /* bstring bfromcstr (const char * str) * * Create a bstring which contains the contents of the '\0' terminated char * * buffer str. */ bstring bfromcstr (const char * str) { bstring b; int i; size_t j; if (str == NULL) return NULL; j = (strlen) (str); i = snapUpSize ((int) (j + (2 - (j != 0)))); if (i <= (int) j) return NULL; b = (bstring) bstr__alloc (sizeof (struct tagbstring)); if (NULL == b) return NULL; b->slen = (int) j; if (NULL == (b->data = (unsigned char *) bstr__alloc (b->mlen = i))) { bstr__free (b); return NULL; } bstr__memcpy (b->data, str, j+1); return b; } /* bstring bfromcstralloc (int mlen, const char * str) * * Create a bstring which contains the contents of the '\0' terminated char * * buffer str. The memory buffer backing the string is at least len * characters in length. */ bstring bfromcstralloc (int mlen, const char * str) { bstring b; int i; size_t j; if (str == NULL) return NULL; j = (strlen) (str); i = snapUpSize ((int) (j + (2 - (j != 0)))); if (i <= (int) j) return NULL; b = (bstring) bstr__alloc (sizeof (struct tagbstring)); if (b == NULL) return NULL; b->slen = (int) j; if (i < mlen) i = mlen; if (NULL == (b->data = (unsigned char *) bstr__alloc (b->mlen = i))) { bstr__free (b); return NULL; } bstr__memcpy (b->data, str, j+1); return b; } /* bstring blk2bstr (const void * blk, int len) * * Create a bstring which contains the content of the block blk of length * len. */ bstring blk2bstr (const void * blk, int len) { bstring b; int i; if (blk == NULL || len < 0) return NULL; b = (bstring) bstr__alloc (sizeof (struct tagbstring)); if (b == NULL) return NULL; b->slen = len; i = len + (2 - (len != 0)); i = snapUpSize (i); b->mlen = i; b->data = (unsigned char *) bstr__alloc ((size_t) b->mlen); if (b->data == NULL) { bstr__free (b); return NULL; } if (len > 0) bstr__memcpy (b->data, blk, (size_t) len); b->data[len] = (unsigned char) '\0'; return b; } /* char * bstr2cstr (const_bstring s, char z) * * Create a '\0' terminated char * buffer which is equal to the contents of * the bstring s, except that any contained '\0' characters are converted * to the character in z. This returned value should be freed with a * bcstrfree () call, by the calling application. */ char * bstr2cstr (const_bstring b, char z) { int i, l; char * r; if (b == NULL || b->slen < 0 || b->data == NULL) return NULL; l = b->slen; r = (char *) bstr__alloc ((size_t) (l + 1)); if (r == NULL) return r; for (i=0; i < l; i ++) { r[i] = (char) ((b->data[i] == '\0') ? z : (char) (b->data[i])); } r[l] = (unsigned char) '\0'; return r; } /* int bcstrfree (char * s) * * Frees a C-string generated by bstr2cstr (). This is normally unnecessary * since it just wraps a call to bstr__free (), however, if bstr__alloc () * and bstr__free () have been redefined as a macros within the bstrlib * module (via defining them in memdbg.h after defining * BSTRLIB_MEMORY_DEBUG) with some difference in behaviour from the std * library functions, then this allows a correct way of freeing the memory * that allows higher level code to be independent from these macro * redefinitions. */ int bcstrfree (char * s) { if (s) { bstr__free (s); return BSTR_OK; } return BSTR_ERR; } /* int bconcat (bstring b0, const_bstring b1) * * Concatenate the bstring b1 to the bstring b0. */ int bconcat (bstring b0, const_bstring b1) { int len, d; bstring aux = (bstring) b1; if (b0 == NULL || b1 == NULL || b0->data == NULL || b1->data == NULL) return BSTR_ERR; d = b0->slen; len = b1->slen; if ((d | (b0->mlen - d) | len | (d + len)) < 0) return BSTR_ERR; if (b0->mlen <= d + len + 1) { ptrdiff_t pd = b1->data - b0->data; if (0 <= pd && pd < b0->mlen) { if (NULL == (aux = bstrcpy (b1))) return BSTR_ERR; } if (balloc (b0, d + len + 1) != BSTR_OK) { if (aux != b1) bdestroy (aux); return BSTR_ERR; } } bBlockCopy (&b0->data[d], &aux->data[0], (size_t) len); b0->data[d + len] = (unsigned char) '\0'; b0->slen = d + len; if (aux != b1) bdestroy (aux); return BSTR_OK; } /* int bconchar (bstring b, char c) / * * Concatenate the single character c to the bstring b. */ int bconchar (bstring b, char c) { int d; if (b == NULL) return BSTR_ERR; d = b->slen; if ((d | (b->mlen - d)) < 0 || balloc (b, d + 2) != BSTR_OK) return BSTR_ERR; b->data[d] = (unsigned char) c; b->data[d + 1] = (unsigned char) '\0'; b->slen++; return BSTR_OK; } /* int bcatcstr (bstring b, const char * s) * * Concatenate a char * string to a bstring. */ int bcatcstr (bstring b, const char * s) { char * d; int i, l; if (b == NULL || b->data == NULL || b->slen < 0 || b->mlen < b->slen || b->mlen <= 0 || s == NULL) return BSTR_ERR; /* Optimistically concatenate directly */ l = b->mlen - b->slen; d = (char *) &b->data[b->slen]; for (i=0; i < l; i++) { if ((*d++ = *s++) == '\0') { b->slen += i; return BSTR_OK; } } b->slen += i; /* Need to explicitely resize and concatenate tail */ return bcatblk (b, (const void *) s, (int) strlen (s)); } /* int bcatblk (bstring b, const void * s, int len) * * Concatenate a fixed length buffer to a bstring. */ int bcatblk (bstring b, const void * s, int len) { int nl; if (b == NULL || b->data == NULL || b->slen < 0 || b->mlen < b->slen || b->mlen <= 0 || s == NULL || len < 0) return BSTR_ERR; if (0 > (nl = b->slen + len)) return BSTR_ERR; /* Overflow? */ if (b->mlen <= nl && 0 > balloc (b, nl + 1)) return BSTR_ERR; bBlockCopy (&b->data[b->slen], s, (size_t) len); b->slen = nl; b->data[nl] = (unsigned char) '\0'; return BSTR_OK; } /* bstring bstrcpy (const_bstring b) * * Create a copy of the bstring b. */ bstring bstrcpy (const_bstring b) { bstring b0; int i,j; /* Attempted to copy an invalid string? */ if (b == NULL || b->slen < 0 || b->data == NULL) return NULL; b0 = (bstring) bstr__alloc (sizeof (struct tagbstring)); if (b0 == NULL) { /* Unable to allocate memory for string header */ return NULL; } i = b->slen; j = snapUpSize (i + 1); b0->data = (unsigned char *) bstr__alloc (j); if (b0->data == NULL) { j = i + 1; b0->data = (unsigned char *) bstr__alloc (j); if (b0->data == NULL) { /* Unable to allocate memory for string data */ bstr__free (b0); return NULL; } } b0->mlen = j; b0->slen = i; if (i) bstr__memcpy ((char *) b0->data, (char *) b->data, i); b0->data[b0->slen] = (unsigned char) '\0'; return b0; } /* int bassign (bstring a, const_bstring b) * * Overwrite the string a with the contents of string b. */ int bassign (bstring a, const_bstring b) { if (b == NULL || b->data == NULL || b->slen < 0) return BSTR_ERR; if (b->slen != 0) { if (balloc (a, b->slen) != BSTR_OK) return BSTR_ERR; bstr__memmove (a->data, b->data, b->slen); } else { if (a == NULL || a->data == NULL || a->mlen < a->slen || a->slen < 0 || a->mlen == 0) return BSTR_ERR; } a->data[b->slen] = (unsigned char) '\0'; a->slen = b->slen; return BSTR_OK; } /* int bassignmidstr (bstring a, const_bstring b, int left, int len) * * Overwrite the string a with the middle of contents of string b * starting from position left and running for a length len. left and * len are clamped to the ends of b as with the function bmidstr. */ int bassignmidstr (bstring a, const_bstring b, int left, int len) { if (b == NULL || b->data == NULL || b->slen < 0) return BSTR_ERR; if (left < 0) { len += left; left = 0; } if (len > b->slen - left) len = b->slen - left; if (a == NULL || a->data == NULL || a->mlen < a->slen || a->slen < 0 || a->mlen == 0) return BSTR_ERR; if (len > 0) { if (balloc (a, len) != BSTR_OK) return BSTR_ERR; bstr__memmove (a->data, b->data + left, len); a->slen = len; } else { a->slen = 0; } a->data[a->slen] = (unsigned char) '\0'; return BSTR_OK; } /* int bassigncstr (bstring a, const char * str) * * Overwrite the string a with the contents of char * string str. Note that * the bstring a must be a well defined and writable bstring. If an error * occurs BSTR_ERR is returned however a may be partially overwritten. */ int bassigncstr (bstring a, const char * str) { int i; size_t len; if (a == NULL || a->data == NULL || a->mlen < a->slen || a->slen < 0 || a->mlen == 0 || NULL == str) return BSTR_ERR; for (i=0; i < a->mlen; i++) { if ('\0' == (a->data[i] = str[i])) { a->slen = i; return BSTR_OK; } } a->slen = i; len = strlen (str + i); if (len > INT_MAX || i + len + 1 > INT_MAX || 0 > balloc (a, (int) (i + len + 1))) return BSTR_ERR; bBlockCopy (a->data + i, str + i, (size_t) len + 1); a->slen += (int) len; return BSTR_OK; } /* int bassignblk (bstring a, const void * s, int len) * * Overwrite the string a with the contents of the block (s, len). Note that * the bstring a must be a well defined and writable bstring. If an error * occurs BSTR_ERR is returned and a is not overwritten. */ int bassignblk (bstring a, const void * s, int len) { if (a == NULL || a->data == NULL || a->mlen < a->slen || a->slen < 0 || a->mlen == 0 || NULL == s || len + 1 < 1) return BSTR_ERR; if (len + 1 > a->mlen && 0 > balloc (a, len + 1)) return BSTR_ERR; bBlockCopy (a->data, s, (size_t) len); a->data[len] = (unsigned char) '\0'; a->slen = len; return BSTR_OK; } /* int btrunc (bstring b, int n) * * Truncate the bstring to at most n characters. */ int btrunc (bstring b, int n) { if (n < 0 || b == NULL || b->data == NULL || b->mlen < b->slen || b->slen < 0 || b->mlen <= 0) return BSTR_ERR; if (b->slen > n) { b->slen = n; b->data[n] = (unsigned char) '\0'; } return BSTR_OK; } #define upcase(c) (toupper ((unsigned char) c)) #define downcase(c) (tolower ((unsigned char) c)) #define wspace(c) (isspace ((unsigned char) c)) /* int btoupper (bstring b) * * Convert contents of bstring to upper case. */ int btoupper (bstring b) { int i, len; if (b == NULL || b->data == NULL || b->mlen < b->slen || b->slen < 0 || b->mlen <= 0) return BSTR_ERR; for (i=0, len = b->slen; i < len; i++) { b->data[i] = (unsigned char) upcase (b->data[i]); } return BSTR_OK; } /* int btolower (bstring b) * * Convert contents of bstring to lower case. */ int btolower (bstring b) { int i, len; if (b == NULL || b->data == NULL || b->mlen < b->slen || b->slen < 0 || b->mlen <= 0) return BSTR_ERR; for (i=0, len = b->slen; i < len; i++) { b->data[i] = (unsigned char) downcase (b->data[i]); } return BSTR_OK; } /* int bstricmp (const_bstring b0, const_bstring b1) * * Compare two strings without differentiating between case. The return * value is the difference of the values of the characters where the two * strings first differ after lower case transformation, otherwise 0 is * returned indicating that the strings are equal. If the lengths are * different, then a difference from 0 is given, but if the first extra * character is '\0', then it is taken to be the value UCHAR_MAX+1. */ int bstricmp (const_bstring b0, const_bstring b1) { int i, v, n; if (bdata (b0) == NULL || b0->slen < 0 || bdata (b1) == NULL || b1->slen < 0) return SHRT_MIN; if ((n = b0->slen) > b1->slen) n = b1->slen; else if (b0->slen == b1->slen && b0->data == b1->data) return BSTR_OK; for (i = 0; i < n; i ++) { v = (char) downcase (b0->data[i]) - (char) downcase (b1->data[i]); if (0 != v) return v; } if (b0->slen > n) { v = (char) downcase (b0->data[n]); if (v) return v; return UCHAR_MAX + 1; } if (b1->slen > n) { v = - (char) downcase (b1->data[n]); if (v) return v; return - (int) (UCHAR_MAX + 1); } return BSTR_OK; } /* int bstrnicmp (const_bstring b0, const_bstring b1, int n) * * Compare two strings without differentiating between case for at most n * characters. If the position where the two strings first differ is * before the nth position, the return value is the difference of the values * of the characters, otherwise 0 is returned. If the lengths are different * and less than n characters, then a difference from 0 is given, but if the * first extra character is '\0', then it is taken to be the value * UCHAR_MAX+1. */ int bstrnicmp (const_bstring b0, const_bstring b1, int n) { int i, v, m; if (bdata (b0) == NULL || b0->slen < 0 || bdata (b1) == NULL || b1->slen < 0 || n < 0) return SHRT_MIN; m = n; if (m > b0->slen) m = b0->slen; if (m > b1->slen) m = b1->slen; if (b0->data != b1->data) { for (i = 0; i < m; i ++) { v = (char) downcase (b0->data[i]); v -= (char) downcase (b1->data[i]); if (v != 0) return b0->data[i] - b1->data[i]; } } if (n == m || b0->slen == b1->slen) return BSTR_OK; if (b0->slen > m) { v = (char) downcase (b0->data[m]); if (v) return v; return UCHAR_MAX + 1; } v = - (char) downcase (b1->data[m]); if (v) return v; return - (int) (UCHAR_MAX + 1); } /* int biseqcaseless (const_bstring b0, const_bstring b1) * * Compare two strings for equality without differentiating between case. * If the strings differ other than in case, 0 is returned, if the strings * are the same, 1 is returned, if there is an error, -1 is returned. If * the length of the strings are different, this function is O(1). '\0' * termination characters are not treated in any special way. */ int biseqcaseless (const_bstring b0, const_bstring b1) { int i, n; if (bdata (b0) == NULL || b0->slen < 0 || bdata (b1) == NULL || b1->slen < 0) return BSTR_ERR; if (b0->slen != b1->slen) return BSTR_OK; if (b0->data == b1->data || b0->slen == 0) return 1; for (i=0, n=b0->slen; i < n; i++) { if (b0->data[i] != b1->data[i]) { unsigned char c = (unsigned char) downcase (b0->data[i]); if (c != (unsigned char) downcase (b1->data[i])) return 0; } } return 1; } /* int bisstemeqcaselessblk (const_bstring b0, const void * blk, int len) * * Compare beginning of string b0 with a block of memory of length len * without differentiating between case for equality. If the beginning of b0 * differs from the memory block other than in case (or if b0 is too short), * 0 is returned, if the strings are the same, 1 is returned, if there is an * error, -1 is returned. '\0' characters are not treated in any special * way. */ int bisstemeqcaselessblk (const_bstring b0, const void * blk, int len) { int i; if (bdata (b0) == NULL || b0->slen < 0 || NULL == blk || len < 0) return BSTR_ERR; if (b0->slen < len) return BSTR_OK; if (b0->data == (const unsigned char *) blk || len == 0) return 1; for (i = 0; i < len; i ++) { if (b0->data[i] != ((const unsigned char *) blk)[i]) { if (downcase (b0->data[i]) != downcase (((const unsigned char *) blk)[i])) return 0; } } return 1; } /* * int bltrimws (bstring b) * * Delete whitespace contiguous from the left end of the string. */ int bltrimws (bstring b) { int i, len; if (b == NULL || b->data == NULL || b->mlen < b->slen || b->slen < 0 || b->mlen <= 0) return BSTR_ERR; for (len = b->slen, i = 0; i < len; i++) { if (!wspace (b->data[i])) { return bdelete (b, 0, i); } } b->data[0] = (unsigned char) '\0'; b->slen = 0; return BSTR_OK; } /* * int brtrimws (bstring b) * * Delete whitespace contiguous from the right end of the string. */ int brtrimws (bstring b) { int i; if (b == NULL || b->data == NULL || b->mlen < b->slen || b->slen < 0 || b->mlen <= 0) return BSTR_ERR; for (i = b->slen - 1; i >= 0; i--) { if (!wspace (b->data[i])) { if (b->mlen > i) b->data[i+1] = (unsigned char) '\0'; b->slen = i + 1; return BSTR_OK; } } b->data[0] = (unsigned char) '\0'; b->slen = 0; return BSTR_OK; } /* * int btrimws (bstring b) * * Delete whitespace contiguous from both ends of the string. */ int btrimws (bstring b) { int i, j; if (b == NULL || b->data == NULL || b->mlen < b->slen || b->slen < 0 || b->mlen <= 0) return BSTR_ERR; for (i = b->slen - 1; i >= 0; i--) { if (!wspace (b->data[i])) { if (b->mlen > i) b->data[i+1] = (unsigned char) '\0'; b->slen = i + 1; for (j = 0; wspace (b->data[j]); j++) {} return bdelete (b, 0, j); } } b->data[0] = (unsigned char) '\0'; b->slen = 0; return BSTR_OK; } /* int biseq (const_bstring b0, const_bstring b1) * * Compare the string b0 and b1. If the strings differ, 0 is returned, if * the strings are the same, 1 is returned, if there is an error, -1 is * returned. If the length of the strings are different, this function is * O(1). '\0' termination characters are not treated in any special way. */ int biseq (const_bstring b0, const_bstring b1) { if (b0 == NULL || b1 == NULL || b0->data == NULL || b1->data == NULL || b0->slen < 0 || b1->slen < 0) return BSTR_ERR; if (b0->slen != b1->slen) return BSTR_OK; if (b0->data == b1->data || b0->slen == 0) return 1; return !bstr__memcmp (b0->data, b1->data, b0->slen); } /* int bisstemeqblk (const_bstring b0, const void * blk, int len) * * Compare beginning of string b0 with a block of memory of length len for * equality. If the beginning of b0 differs from the memory block (or if b0 * is too short), 0 is returned, if the strings are the same, 1 is returned, * if there is an error, -1 is returned. '\0' characters are not treated in * any special way. */ int bisstemeqblk (const_bstring b0, const void * blk, int len) { int i; if (bdata (b0) == NULL || b0->slen < 0 || NULL == blk || len < 0) return BSTR_ERR; if (b0->slen < len) return BSTR_OK; if (b0->data == (const unsigned char *) blk || len == 0) return 1; for (i = 0; i < len; i ++) { if (b0->data[i] != ((const unsigned char *) blk)[i]) return BSTR_OK; } return 1; } /* int biseqcstr (const_bstring b, const char *s) * * Compare the bstring b and char * string s. The C string s must be '\0' * terminated at exactly the length of the bstring b, and the contents * between the two must be identical with the bstring b with no '\0' * characters for the two contents to be considered equal. This is * equivalent to the condition that their current contents will be always be * equal when comparing them in the same format after converting one or the * other. If the strings are equal 1 is returned, if they are unequal 0 is * returned and if there is a detectable error BSTR_ERR is returned. */ int biseqcstr (const_bstring b, const char * s) { int i; if (b == NULL || s == NULL || b->data == NULL || b->slen < 0) return BSTR_ERR; for (i=0; i < b->slen; i++) { if (s[i] == '\0' || b->data[i] != (unsigned char) s[i]) return BSTR_OK; } return s[i] == '\0'; } /* int biseqcstrcaseless (const_bstring b, const char *s) * * Compare the bstring b and char * string s. The C string s must be '\0' * terminated at exactly the length of the bstring b, and the contents * between the two must be identical except for case with the bstring b with * no '\0' characters for the two contents to be considered equal. This is * equivalent to the condition that their current contents will be always be * equal ignoring case when comparing them in the same format after * converting one or the other. If the strings are equal, except for case, * 1 is returned, if they are unequal regardless of case 0 is returned and * if there is a detectable error BSTR_ERR is returned. */ int biseqcstrcaseless (const_bstring b, const char * s) { int i; if (b == NULL || s == NULL || b->data == NULL || b->slen < 0) return BSTR_ERR; for (i=0; i < b->slen; i++) { if (s[i] == '\0' || (b->data[i] != (unsigned char) s[i] && downcase (b->data[i]) != (unsigned char) downcase (s[i]))) return BSTR_OK; } return s[i] == '\0'; } /* int bstrcmp (const_bstring b0, const_bstring b1) * * Compare the string b0 and b1. If there is an error, SHRT_MIN is returned, * otherwise a value less than or greater than zero, indicating that the * string pointed to by b0 is lexicographically less than or greater than * the string pointed to by b1 is returned. If the the string lengths are * unequal but the characters up until the length of the shorter are equal * then a value less than, or greater than zero, indicating that the string * pointed to by b0 is shorter or longer than the string pointed to by b1 is * returned. 0 is returned if and only if the two strings are the same. If * the length of the strings are different, this function is O(n). Like its * standard C library counter part strcmp, the comparison does not proceed * past any '\0' termination characters encountered. */ int bstrcmp (const_bstring b0, const_bstring b1) { int i, v, n; if (b0 == NULL || b1 == NULL || b0->data == NULL || b1->data == NULL || b0->slen < 0 || b1->slen < 0) return SHRT_MIN; n = b0->slen; if (n > b1->slen) n = b1->slen; if (b0->slen == b1->slen && (b0->data == b1->data || b0->slen == 0)) return BSTR_OK; for (i = 0; i < n; i ++) { v = ((char) b0->data[i]) - ((char) b1->data[i]); if (v != 0) return v; if (b0->data[i] == (unsigned char) '\0') return BSTR_OK; } if (b0->slen > n) return 1; if (b1->slen > n) return -1; return BSTR_OK; } /* int bstrncmp (const_bstring b0, const_bstring b1, int n) * * Compare the string b0 and b1 for at most n characters. If there is an * error, SHRT_MIN is returned, otherwise a value is returned as if b0 and * b1 were first truncated to at most n characters then bstrcmp was called * with these new strings are paremeters. If the length of the strings are * different, this function is O(n). Like its standard C library counter * part strcmp, the comparison does not proceed past any '\0' termination * characters encountered. */ int bstrncmp (const_bstring b0, const_bstring b1, int n) { int i, v, m; if (b0 == NULL || b1 == NULL || b0->data == NULL || b1->data == NULL || b0->slen < 0 || b1->slen < 0) return SHRT_MIN; m = n; if (m > b0->slen) m = b0->slen; if (m > b1->slen) m = b1->slen; if (b0->data != b1->data) { for (i = 0; i < m; i ++) { v = ((char) b0->data[i]) - ((char) b1->data[i]); if (v != 0) return v; if (b0->data[i] == (unsigned char) '\0') return BSTR_OK; } } if (n == m || b0->slen == b1->slen) return BSTR_OK; if (b0->slen > m) return 1; return -1; } /* bstring bmidstr (const_bstring b, int left, int len) * * Create a bstring which is the substring of b starting from position left * and running for a length len (clamped by the end of the bstring b.) If * b is detectably invalid, then NULL is returned. The section described * by (left, len) is clamped to the boundaries of b. */ bstring bmidstr (const_bstring b, int left, int len) { if (b == NULL || b->slen < 0 || b->data == NULL) return NULL; if (left < 0) { len += left; left = 0; } if (len > b->slen - left) len = b->slen - left; if (len <= 0) return bfromcstr (""); return blk2bstr (b->data + left, len); } /* int bdelete (bstring b, int pos, int len) * * Removes characters from pos to pos+len-1 inclusive and shifts the tail of * the bstring starting from pos+len to pos. len must be positive for this * call to have any effect. The section of the string described by (pos, * len) is clamped to boundaries of the bstring b. */ int bdelete (bstring b, int pos, int len) { /* Clamp to left side of bstring */ if (pos < 0) { len += pos; pos = 0; } if (len < 0 || b == NULL || b->data == NULL || b->slen < 0 || b->mlen < b->slen || b->mlen <= 0) return BSTR_ERR; if (len > 0 && pos < b->slen) { if (pos + len >= b->slen) { b->slen = pos; } else { bBlockCopy ((char *) (b->data + pos), (char *) (b->data + pos + len), b->slen - (pos+len)); b->slen -= len; } b->data[b->slen] = (unsigned char) '\0'; } return BSTR_OK; } /* int bdestroy (bstring b) * * Free up the bstring. Note that if b is detectably invalid or not writable * then no action is performed and BSTR_ERR is returned. Like a freed memory * allocation, dereferences, writes or any other action on b after it has * been bdestroyed is undefined. */ int bdestroy (bstring b) { if (b == NULL || b->slen < 0 || b->mlen <= 0 || b->mlen < b->slen || b->data == NULL) return BSTR_ERR; bstr__free (b->data); /* In case there is any stale usage, there is one more chance to notice this error. */ b->slen = -1; b->mlen = -__LINE__; b->data = NULL; bstr__free (b); return BSTR_OK; } /* int binstr (const_bstring b1, int pos, const_bstring b2) * * Search for the bstring b2 in b1 starting from position pos, and searching * forward. If it is found then return with the first position where it is * found, otherwise return BSTR_ERR. Note that this is just a brute force * string searcher that does not attempt clever things like the Boyer-Moore * search algorithm. Because of this there are many degenerate cases where * this can take much longer than it needs to. */ int binstr (const_bstring b1, int pos, const_bstring b2) { int j, ii, ll, lf; unsigned char * d0; unsigned char c0; register unsigned char * d1; register unsigned char c1; register int i; if (b1 == NULL || b1->data == NULL || b1->slen < 0 || b2 == NULL || b2->data == NULL || b2->slen < 0) return BSTR_ERR; if (b1->slen == pos) return (b2->slen == 0)?pos:BSTR_ERR; if (b1->slen < pos || pos < 0) return BSTR_ERR; if (b2->slen == 0) return pos; /* No space to find such a string? */ if ((lf = b1->slen - b2->slen + 1) <= pos) return BSTR_ERR; /* An obvious alias case */ if (b1->data == b2->data && pos == 0) return 0; i = pos; d0 = b2->data; d1 = b1->data; ll = b2->slen; /* Peel off the b2->slen == 1 case */ c0 = d0[0]; if (1 == ll) { for (;i < lf; i++) if (c0 == d1[i]) return i; return BSTR_ERR; } c1 = c0; j = 0; lf = b1->slen - 1; ii = -1; if (i < lf) do { /* Unrolled current character test */ if (c1 != d1[i]) { if (c1 != d1[1+i]) { i += 2; continue; } i++; } /* Take note if this is the start of a potential match */ if (0 == j) ii = i; /* Shift the test character down by one */ j++; i++; /* If this isn't past the last character continue */ if (j < ll) { c1 = d0[j]; continue; } N0:; /* If no characters mismatched, then we matched */ if (i == ii+j) return ii; /* Shift back to the beginning */ i -= j; j = 0; c1 = c0; } while (i < lf); /* Deal with last case if unrolling caused a misalignment */ if (i == lf && ll == j+1 && c1 == d1[i]) goto N0; return BSTR_ERR; } /* int binstrr (const_bstring b1, int pos, const_bstring b2) * * Search for the bstring b2 in b1 starting from position pos, and searching * backward. If it is found then return with the first position where it is * found, otherwise return BSTR_ERR. Note that this is just a brute force * string searcher that does not attempt clever things like the Boyer-Moore * search algorithm. Because of this there are many degenerate cases where * this can take much longer than it needs to. */ int binstrr (const_bstring b1, int pos, const_bstring b2) { int j, i, l; unsigned char * d0, * d1; if (b1 == NULL || b1->data == NULL || b1->slen < 0 || b2 == NULL || b2->data == NULL || b2->slen < 0) return BSTR_ERR; if (b1->slen == pos && b2->slen == 0) return pos; if (b1->slen < pos || pos < 0) return BSTR_ERR; if (b2->slen == 0) return pos; /* Obvious alias case */ if (b1->data == b2->data && pos == 0 && b2->slen <= b1->slen) return 0; i = pos; if ((l = b1->slen - b2->slen) < 0) return BSTR_ERR; /* If no space to find such a string then snap back */ if (l + 1 <= i) i = l; j = 0; d0 = b2->data; d1 = b1->data; l = b2->slen; for (;;) { if (d0[j] == d1[i + j]) { j ++; if (j >= l) return i; } else { i --; if (i < 0) break; j=0; } } return BSTR_ERR; } /* int binstrcaseless (const_bstring b1, int pos, const_bstring b2) * * Search for the bstring b2 in b1 starting from position pos, and searching * forward but without regard to case. If it is found then return with the * first position where it is found, otherwise return BSTR_ERR. Note that * this is just a brute force string searcher that does not attempt clever * things like the Boyer-Moore search algorithm. Because of this there are * many degenerate cases where this can take much longer than it needs to. */ int binstrcaseless (const_bstring b1, int pos, const_bstring b2) { int j, i, l, ll; unsigned char * d0, * d1; if (b1 == NULL || b1->data == NULL || b1->slen < 0 || b2 == NULL || b2->data == NULL || b2->slen < 0) return BSTR_ERR; if (b1->slen == pos) return (b2->slen == 0)?pos:BSTR_ERR; if (b1->slen < pos || pos < 0) return BSTR_ERR; if (b2->slen == 0) return pos; l = b1->slen - b2->slen + 1; /* No space to find such a string? */ if (l <= pos) return BSTR_ERR; /* An obvious alias case */ if (b1->data == b2->data && pos == 0) return BSTR_OK; i = pos; j = 0; d0 = b2->data; d1 = b1->data; ll = b2->slen; for (;;) { if (d0[j] == d1[i + j] || downcase (d0[j]) == downcase (d1[i + j])) { j ++; if (j >= ll) return i; } else { i ++; if (i >= l) break; j=0; } } return BSTR_ERR; } /* int binstrrcaseless (const_bstring b1, int pos, const_bstring b2) * * Search for the bstring b2 in b1 starting from position pos, and searching * backward but without regard to case. If it is found then return with the * first position where it is found, otherwise return BSTR_ERR. Note that * this is just a brute force string searcher that does not attempt clever * things like the Boyer-Moore search algorithm. Because of this there are * many degenerate cases where this can take much longer than it needs to. */ int binstrrcaseless (const_bstring b1, int pos, const_bstring b2) { int j, i, l; unsigned char * d0, * d1; if (b1 == NULL || b1->data == NULL || b1->slen < 0 || b2 == NULL || b2->data == NULL || b2->slen < 0) return BSTR_ERR; if (b1->slen == pos && b2->slen == 0) return pos; if (b1->slen < pos || pos < 0) return BSTR_ERR; if (b2->slen == 0) return pos; /* Obvious alias case */ if (b1->data == b2->data && pos == 0 && b2->slen <= b1->slen) return BSTR_OK; i = pos; if ((l = b1->slen - b2->slen) < 0) return BSTR_ERR; /* If no space to find such a string then snap back */ if (l + 1 <= i) i = l; j = 0; d0 = b2->data; d1 = b1->data; l = b2->slen; for (;;) { if (d0[j] == d1[i + j] || downcase (d0[j]) == downcase (d1[i + j])) { j ++; if (j >= l) return i; } else { i --; if (i < 0) break; j=0; } } return BSTR_ERR; } /* int bstrchrp (const_bstring b, int c, int pos) * * Search for the character c in b forwards from the position pos * (inclusive). */ int bstrchrp (const_bstring b, int c, int pos) { unsigned char * p; if (b == NULL || b->data == NULL || b->slen <= pos || pos < 0) return BSTR_ERR; p = (unsigned char *) bstr__memchr ((b->data + pos), (unsigned char) c, (b->slen - pos)); if (p) return (int) (p - b->data); return BSTR_ERR; } /* int bstrrchrp (const_bstring b, int c, int pos) * * Search for the character c in b backwards from the position pos in string * (inclusive). */ int bstrrchrp (const_bstring b, int c, int pos) { int i; if (b == NULL || b->data == NULL || b->slen <= pos || pos < 0) return BSTR_ERR; for (i=pos; i >= 0; i--) { if (b->data[i] == (unsigned char) c) return i; } return BSTR_ERR; } #if !defined (BSTRLIB_AGGRESSIVE_MEMORY_FOR_SPEED_TRADEOFF) #define LONG_LOG_BITS_QTY (3) #define LONG_BITS_QTY (1 << LONG_LOG_BITS_QTY) #define LONG_TYPE unsigned char #define CFCLEN ((1 << CHAR_BIT) / LONG_BITS_QTY) struct charField { LONG_TYPE content[CFCLEN]; }; #define testInCharField(cf,c) ((cf)->content[(c) >> LONG_LOG_BITS_QTY] & (((long)1) << ((c) & (LONG_BITS_QTY-1)))) #define setInCharField(cf,idx) { \ unsigned int c = (unsigned int) (idx); \ (cf)->content[c >> LONG_LOG_BITS_QTY] |= (LONG_TYPE) (1ul << (c & (LONG_BITS_QTY-1))); \ } #else #define CFCLEN (1 << CHAR_BIT) struct charField { unsigned char content[CFCLEN]; }; #define testInCharField(cf,c) ((cf)->content[(unsigned char) (c)]) #define setInCharField(cf,idx) (cf)->content[(unsigned int) (idx)] = ~0 #endif /* Convert a bstring to charField */ static int buildCharField (struct charField * cf, const_bstring b) { int i; if (b == NULL || b->data == NULL || b->slen <= 0) return BSTR_ERR; memset ((void *) cf->content, 0, sizeof (struct charField)); for (i=0; i < b->slen; i++) { setInCharField (cf, b->data[i]); } return BSTR_OK; } static void invertCharField (struct charField * cf) { int i; for (i=0; i < CFCLEN; i++) cf->content[i] = ~cf->content[i]; } /* Inner engine for binchr */ static int binchrCF (const unsigned char * data, int len, int pos, const struct charField * cf) { int i; for (i=pos; i < len; i++) { unsigned char c = (unsigned char) data[i]; if (testInCharField (cf, c)) return i; } return BSTR_ERR; } /* int binchr (const_bstring b0, int pos, const_bstring b1); * * Search for the first position in b0 starting from pos or after, in which * one of the characters in b1 is found and return it. If such a position * does not exist in b0, then BSTR_ERR is returned. */ int binchr (const_bstring b0, int pos, const_bstring b1) { struct charField chrs; if (pos < 0 || b0 == NULL || b0->data == NULL || b0->slen <= pos) return BSTR_ERR; if (1 == b1->slen) return bstrchrp (b0, b1->data[0], pos); if (0 > buildCharField (&chrs, b1)) return BSTR_ERR; return binchrCF (b0->data, b0->slen, pos, &chrs); } /* Inner engine for binchrr */ static int binchrrCF (const unsigned char * data, int pos, const struct charField * cf) { int i; for (i=pos; i >= 0; i--) { unsigned int c = (unsigned int) data[i]; if (testInCharField (cf, c)) return i; } return BSTR_ERR; } /* int binchrr (const_bstring b0, int pos, const_bstring b1); * * Search for the last position in b0 no greater than pos, in which one of * the characters in b1 is found and return it. If such a position does not * exist in b0, then BSTR_ERR is returned. */ int binchrr (const_bstring b0, int pos, const_bstring b1) { struct charField chrs; if (pos < 0 || b0 == NULL || b0->data == NULL || b1 == NULL || b0->slen < pos) return BSTR_ERR; if (pos == b0->slen) pos--; if (1 == b1->slen) return bstrrchrp (b0, b1->data[0], pos); if (0 > buildCharField (&chrs, b1)) return BSTR_ERR; return binchrrCF (b0->data, pos, &chrs); } /* int bninchr (const_bstring b0, int pos, const_bstring b1); * * Search for the first position in b0 starting from pos or after, in which * none of the characters in b1 is found and return it. If such a position * does not exist in b0, then BSTR_ERR is returned. */ int bninchr (const_bstring b0, int pos, const_bstring b1) { struct charField chrs; if (pos < 0 || b0 == NULL || b0->data == NULL || b0->slen <= pos) return BSTR_ERR; if (buildCharField (&chrs, b1) < 0) return BSTR_ERR; invertCharField (&chrs); return binchrCF (b0->data, b0->slen, pos, &chrs); } /* int bninchrr (const_bstring b0, int pos, const_bstring b1); * * Search for the last position in b0 no greater than pos, in which none of * the characters in b1 is found and return it. If such a position does not * exist in b0, then BSTR_ERR is returned. */ int bninchrr (const_bstring b0, int pos, const_bstring b1) { struct charField chrs; if (pos < 0 || b0 == NULL || b0->data == NULL || b0->slen < pos) return BSTR_ERR; if (pos == b0->slen) pos--; if (buildCharField (&chrs, b1) < 0) return BSTR_ERR; invertCharField (&chrs); return binchrrCF (b0->data, pos, &chrs); } /* int bsetstr (bstring b0, int pos, bstring b1, unsigned char fill) * * Overwrite the string b0 starting at position pos with the string b1. If * the position pos is past the end of b0, then the character "fill" is * appended as necessary to make up the gap between the end of b0 and pos. * If b1 is NULL, it behaves as if it were a 0-length string. */ int bsetstr (bstring b0, int pos, const_bstring b1, unsigned char fill) { int d, newlen; ptrdiff_t pd; bstring aux = (bstring) b1; if (pos < 0 || b0 == NULL || b0->slen < 0 || NULL == b0->data || b0->mlen < b0->slen || b0->mlen <= 0) return BSTR_ERR; if (b1 != NULL && (b1->slen < 0 || b1->data == NULL)) return BSTR_ERR; d = pos; /* Aliasing case */ if (NULL != aux) { if ((pd = (ptrdiff_t) (b1->data - b0->data)) >= 0 && pd < (ptrdiff_t) b0->mlen) { if (NULL == (aux = bstrcpy (b1))) return BSTR_ERR; } d += aux->slen; } /* Increase memory size if necessary */ if (balloc (b0, d + 1) != BSTR_OK) { if (aux != b1) bdestroy (aux); return BSTR_ERR; } newlen = b0->slen; /* Fill in "fill" character as necessary */ if (pos > newlen) { bstr__memset (b0->data + b0->slen, (int) fill, (size_t) (pos - b0->slen)); newlen = pos; } /* Copy b1 to position pos in b0. */ if (aux != NULL) { bBlockCopy ((char *) (b0->data + pos), (char *) aux->data, aux->slen); if (aux != b1) bdestroy (aux); } /* Indicate the potentially increased size of b0 */ if (d > newlen) newlen = d; b0->slen = newlen; b0->data[newlen] = (unsigned char) '\0'; return BSTR_OK; } /* int binsert (bstring b1, int pos, bstring b2, unsigned char fill) * * Inserts the string b2 into b1 at position pos. If the position pos is * past the end of b1, then the character "fill" is appended as necessary to * make up the gap between the end of b1 and pos. Unlike bsetstr, binsert * does not allow b2 to be NULL. */ int binsert (bstring b1, int pos, const_bstring b2, unsigned char fill) { int d, l; ptrdiff_t pd; bstring aux = (bstring) b2; if (pos < 0 || b1 == NULL || b2 == NULL || b1->slen < 0 || b2->slen < 0 || b1->mlen < b1->slen || b1->mlen <= 0) return BSTR_ERR; /* Aliasing case */ if ((pd = (ptrdiff_t) (b2->data - b1->data)) >= 0 && pd < (ptrdiff_t) b1->mlen) { if (NULL == (aux = bstrcpy (b2))) return BSTR_ERR; } /* Compute the two possible end pointers */ d = b1->slen + aux->slen; l = pos + aux->slen; if ((d|l) < 0) return BSTR_ERR; if (l > d) { /* Inserting past the end of the string */ if (balloc (b1, l + 1) != BSTR_OK) { if (aux != b2) bdestroy (aux); return BSTR_ERR; } bstr__memset (b1->data + b1->slen, (int) fill, (size_t) (pos - b1->slen)); b1->slen = l; } else { /* Inserting in the middle of the string */ if (balloc (b1, d + 1) != BSTR_OK) { if (aux != b2) bdestroy (aux); return BSTR_ERR; } bBlockCopy (b1->data + l, b1->data + pos, d - l); b1->slen = d; } bBlockCopy (b1->data + pos, aux->data, aux->slen); b1->data[b1->slen] = (unsigned char) '\0'; if (aux != b2) bdestroy (aux); return BSTR_OK; } /* int breplace (bstring b1, int pos, int len, bstring b2, * unsigned char fill) * * Replace a section of a string from pos for a length len with the string b2. * fill is used is pos > b1->slen. */ int breplace (bstring b1, int pos, int len, const_bstring b2, unsigned char fill) { int pl, ret; ptrdiff_t pd; bstring aux = (bstring) b2; if (pos < 0 || len < 0 || (pl = pos + len) < 0 || b1 == NULL || b2 == NULL || b1->data == NULL || b2->data == NULL || b1->slen < 0 || b2->slen < 0 || b1->mlen < b1->slen || b1->mlen <= 0) return BSTR_ERR; /* Straddles the end? */ if (pl >= b1->slen) { if ((ret = bsetstr (b1, pos, b2, fill)) < 0) return ret; if (pos + b2->slen < b1->slen) { b1->slen = pos + b2->slen; b1->data[b1->slen] = (unsigned char) '\0'; } return ret; } /* Aliasing case */ if ((pd = (ptrdiff_t) (b2->data - b1->data)) >= 0 && pd < (ptrdiff_t) b1->slen) { if (NULL == (aux = bstrcpy (b2))) return BSTR_ERR; } if (aux->slen > len) { if (balloc (b1, b1->slen + aux->slen - len) != BSTR_OK) { if (aux != b2) bdestroy (aux); return BSTR_ERR; } } if (aux->slen != len) bstr__memmove (b1->data + pos + aux->slen, b1->data + pos + len, b1->slen - (pos + len)); bstr__memcpy (b1->data + pos, aux->data, aux->slen); b1->slen += aux->slen - len; b1->data[b1->slen] = (unsigned char) '\0'; if (aux != b2) bdestroy (aux); return BSTR_OK; } /* int bfindreplace (bstring b, const_bstring find, const_bstring repl, * int pos) * * Replace all occurrences of a find string with a replace string after a * given point in a bstring. */ typedef int (*instr_fnptr) (const_bstring s1, int pos, const_bstring s2); static int findreplaceengine (bstring b, const_bstring find, const_bstring repl, int pos, instr_fnptr instr) { int i, ret, slen, mlen, delta, acc; int * d; int static_d[32]; ptrdiff_t pd; bstring auxf = (bstring) find; bstring auxr = (bstring) repl; if (b == NULL || b->data == NULL || find == NULL || find->data == NULL || repl == NULL || repl->data == NULL || pos < 0 || find->slen <= 0 || b->mlen < 0 || b->slen > b->mlen || b->mlen <= 0 || b->slen < 0 || repl->slen < 0) return BSTR_ERR; if (pos > b->slen - find->slen) return BSTR_OK; /* Alias with find string */ pd = (ptrdiff_t) (find->data - b->data); if ((ptrdiff_t) (pos - find->slen) < pd && pd < (ptrdiff_t) b->slen) { if (NULL == (auxf = bstrcpy (find))) return BSTR_ERR; } /* Alias with repl string */ pd = (ptrdiff_t) (repl->data - b->data); if ((ptrdiff_t) (pos - repl->slen) < pd && pd < (ptrdiff_t) b->slen) { if (NULL == (auxr = bstrcpy (repl))) { if (auxf != find) bdestroy (auxf); return BSTR_ERR; } } delta = auxf->slen - auxr->slen; /* in-place replacement since find and replace strings are of equal length */ if (delta == 0) { while ((pos = instr (b, pos, auxf)) >= 0) { bstr__memcpy (b->data + pos, auxr->data, auxr->slen); pos += auxf->slen; } if (auxf != find) bdestroy (auxf); if (auxr != repl) bdestroy (auxr); return BSTR_OK; } /* shrinking replacement since auxf->slen > auxr->slen */ if (delta > 0) { acc = 0; while ((i = instr (b, pos, auxf)) >= 0) { if (acc && i > pos) bstr__memmove (b->data + pos - acc, b->data + pos, i - pos); if (auxr->slen) bstr__memcpy (b->data + i - acc, auxr->data, auxr->slen); acc += delta; pos = i + auxf->slen; } if (acc) { i = b->slen; if (i > pos) bstr__memmove (b->data + pos - acc, b->data + pos, i - pos); b->slen -= acc; b->data[b->slen] = (unsigned char) '\0'; } if (auxf != find) bdestroy (auxf); if (auxr != repl) bdestroy (auxr); return BSTR_OK; } /* expanding replacement since find->slen < repl->slen. Its a lot more complicated. */ mlen = 32; d = (int *) static_d; /* Avoid malloc for trivial cases */ acc = slen = 0; while ((pos = instr (b, pos, auxf)) >= 0) { if (slen + 1 >= mlen) { int sl; int * t; mlen += mlen; sl = sizeof (int *) * mlen; if (static_d == d) d = NULL; if (sl < mlen || NULL == (t = (int *) bstr__realloc (d, sl))) { ret = BSTR_ERR; goto done; } if (NULL == d) bstr__memcpy (t, static_d, sizeof (static_d)); d = t; } d[slen] = pos; slen++; acc -= delta; pos += auxf->slen; if (pos < 0 || acc < 0) { ret = BSTR_ERR; goto done; } } d[slen] = b->slen; if (BSTR_OK == (ret = balloc (b, b->slen + acc + 1))) { b->slen += acc; for (i = slen-1; i >= 0; i--) { int s, l; s = d[i] + auxf->slen; l = d[i+1] - s; if (l) { bstr__memmove (b->data + s + acc, b->data + s, l); } if (auxr->slen) { bstr__memmove (b->data + s + acc - auxr->slen, auxr->data, auxr->slen); } acc += delta; } b->data[b->slen] = (unsigned char) '\0'; } done:; if (static_d == d) d = NULL; bstr__free (d); if (auxf != find) bdestroy (auxf); if (auxr != repl) bdestroy (auxr); return ret; } /* int bfindreplace (bstring b, const_bstring find, const_bstring repl, * int pos) * * Replace all occurrences of a find string with a replace string after a * given point in a bstring. */ int bfindreplace (bstring b, const_bstring find, const_bstring repl, int pos) { return findreplaceengine (b, find, repl, pos, binstr); } /* int bfindreplacecaseless (bstring b, const_bstring find, const_bstring repl, * int pos) * * Replace all occurrences of a find string, ignoring case, with a replace * string after a given point in a bstring. */ int bfindreplacecaseless (bstring b, const_bstring find, const_bstring repl, int pos) { return findreplaceengine (b, find, repl, pos, binstrcaseless); } /* int binsertch (bstring b, int pos, int len, unsigned char fill) * * Inserts the character fill repeatedly into b at position pos for a * length len. If the position pos is past the end of b, then the * character "fill" is appended as necessary to make up the gap between the * end of b and the position pos + len. */ int binsertch (bstring b, int pos, int len, unsigned char fill) { int d, l, i; if (pos < 0 || b == NULL || b->slen < 0 || b->mlen < b->slen || b->mlen <= 0 || len < 0) return BSTR_ERR; /* Compute the two possible end pointers */ d = b->slen + len; l = pos + len; if ((d|l) < 0) return BSTR_ERR; if (l > d) { /* Inserting past the end of the string */ if (balloc (b, l + 1) != BSTR_OK) return BSTR_ERR; pos = b->slen; b->slen = l; } else { /* Inserting in the middle of the string */ if (balloc (b, d + 1) != BSTR_OK) return BSTR_ERR; for (i = d - 1; i >= l; i--) { b->data[i] = b->data[i - len]; } b->slen = d; } for (i=pos; i < l; i++) b->data[i] = fill; b->data[b->slen] = (unsigned char) '\0'; return BSTR_OK; } /* int bpattern (bstring b, int len) * * Replicate the bstring, b in place, end to end repeatedly until it * surpasses len characters, then chop the result to exactly len characters. * This function operates in-place. The function will return with BSTR_ERR * if b is NULL or of length 0, otherwise BSTR_OK is returned. */ int bpattern (bstring b, int len) { int i, d; d = blength (b); if (d <= 0 || len < 0 || balloc (b, len + 1) != BSTR_OK) return BSTR_ERR; if (len > 0) { if (d == 1) return bsetstr (b, len, NULL, b->data[0]); for (i = d; i < len; i++) b->data[i] = b->data[i - d]; } b->data[len] = (unsigned char) '\0'; b->slen = len; return BSTR_OK; } #define BS_BUFF_SZ (1024) /* int breada (bstring b, bNread readPtr, void * parm) * * Use a finite buffer fread-like function readPtr to concatenate to the * bstring b the entire contents of file-like source data in a roughly * efficient way. */ int breada (bstring b, bNread readPtr, void * parm) { int i, l, n; if (b == NULL || b->mlen <= 0 || b->slen < 0 || b->mlen < b->slen || b->mlen <= 0 || readPtr == NULL) return BSTR_ERR; i = b->slen; for (n=i+16; ; n += ((n < BS_BUFF_SZ) ? n : BS_BUFF_SZ)) { if (BSTR_OK != balloc (b, n + 1)) return BSTR_ERR; l = (int) readPtr ((void *) (b->data + i), 1, n - i, parm); i += l; b->slen = i; if (i < n) break; } b->data[i] = (unsigned char) '\0'; return BSTR_OK; } /* bstring bread (bNread readPtr, void * parm) * * Use a finite buffer fread-like function readPtr to create a bstring * filled with the entire contents of file-like source data in a roughly * efficient way. */ bstring bread (bNread readPtr, void * parm) { bstring buff; if (0 > breada (buff = bfromcstr (""), readPtr, parm)) { bdestroy (buff); return NULL; } return buff; } /* int bassigngets (bstring b, bNgetc getcPtr, void * parm, char terminator) * * Use an fgetc-like single character stream reading function (getcPtr) to * obtain a sequence of characters which are concatenated to the end of the * bstring b. The stream read is terminated by the passed in terminator * parameter. * * If getcPtr returns with a negative number, or the terminator character * (which is appended) is read, then the stream reading is halted and the * function returns with a partial result in b. If there is an empty partial * result, 1 is returned. If no characters are read, or there is some other * detectable error, BSTR_ERR is returned. */ int bassigngets (bstring b, bNgetc getcPtr, void * parm, char terminator) { int c, d, e; if (b == NULL || b->mlen <= 0 || b->slen < 0 || b->mlen < b->slen || b->mlen <= 0 || getcPtr == NULL) return BSTR_ERR; d = 0; e = b->mlen - 2; while ((c = getcPtr (parm)) >= 0) { if (d > e) { b->slen = d; if (balloc (b, d + 2) != BSTR_OK) return BSTR_ERR; e = b->mlen - 2; } b->data[d] = (unsigned char) c; d++; if (c == terminator) break; } b->data[d] = (unsigned char) '\0'; b->slen = d; return d == 0 && c < 0; } /* int bgetsa (bstring b, bNgetc getcPtr, void * parm, char terminator) * * Use an fgetc-like single character stream reading function (getcPtr) to * obtain a sequence of characters which are concatenated to the end of the * bstring b. The stream read is terminated by the passed in terminator * parameter. * * If getcPtr returns with a negative number, or the terminator character * (which is appended) is read, then the stream reading is halted and the * function returns with a partial result concatentated to b. If there is * an empty partial result, 1 is returned. If no characters are read, or * there is some other detectable error, BSTR_ERR is returned. */ int bgetsa (bstring b, bNgetc getcPtr, void * parm, char terminator) { int c, d, e; if (b == NULL || b->mlen <= 0 || b->slen < 0 || b->mlen < b->slen || b->mlen <= 0 || getcPtr == NULL) return BSTR_ERR; d = b->slen; e = b->mlen - 2; while ((c = getcPtr (parm)) >= 0) { if (d > e) { b->slen = d; if (balloc (b, d + 2) != BSTR_OK) return BSTR_ERR; e = b->mlen - 2; } b->data[d] = (unsigned char) c; d++; if (c == terminator) break; } b->data[d] = (unsigned char) '\0'; b->slen = d; return d == 0 && c < 0; } /* bstring bgetstream (bNgetc getcPtr, void * parm, char terminator) * * Use an fgetc-like single character stream reading function (getcPtr) to * obtain a sequence of characters which are concatenated into a bstring. * The stream read is terminated by the passed in terminator function. * * If getcPtr returns with a negative number, or the terminator character * (which is appended) is read, then the stream reading is halted and the * result obtained thus far is returned. If no characters are read, or * there is some other detectable error, NULL is returned. */ bstring bgetstream (bNgetc getcPtr, void * parm, char terminator) { bstring buff; if (0 > bgetsa (buff = bfromcstr (""), getcPtr, parm, terminator) || 0 >= buff->slen) { bdestroy (buff); buff = NULL; } return buff; } struct bStream { bstring buff; /* Buffer for over-reads */ void * parm; /* The stream handle for core stream */ bNread readFnPtr; /* fread compatible fnptr for core stream */ int isEOF; /* track file's EOF state */ int maxBuffSz; }; /* struct bStream * bsopen (bNread readPtr, void * parm) * * Wrap a given open stream (described by a fread compatible function * pointer and stream handle) into an open bStream suitable for the bstring * library streaming functions. */ struct bStream * bsopen (bNread readPtr, void * parm) { struct bStream * s; if (readPtr == NULL) return NULL; s = (struct bStream *) bstr__alloc (sizeof (struct bStream)); if (s == NULL) return NULL; s->parm = parm; s->buff = bfromcstr (""); s->readFnPtr = readPtr; s->maxBuffSz = BS_BUFF_SZ; s->isEOF = 0; return s; } /* int bsbufflength (struct bStream * s, int sz) * * Set the length of the buffer used by the bStream. If sz is zero, the * length is not set. This function returns with the previous length. */ int bsbufflength (struct bStream * s, int sz) { int oldSz; if (s == NULL || sz < 0) return BSTR_ERR; oldSz = s->maxBuffSz; if (sz > 0) s->maxBuffSz = sz; return oldSz; } int bseof (const struct bStream * s) { if (s == NULL || s->readFnPtr == NULL) return BSTR_ERR; return s->isEOF && (s->buff->slen == 0); } /* void * bsclose (struct bStream * s) * * Close the bStream, and return the handle to the stream that was originally * used to open the given stream. */ void * bsclose (struct bStream * s) { void * parm; if (s == NULL) return NULL; s->readFnPtr = NULL; if (s->buff) bdestroy (s->buff); s->buff = NULL; parm = s->parm; s->parm = NULL; s->isEOF = 1; bstr__free (s); return parm; } /* int bsreadlna (bstring r, struct bStream * s, char terminator) * * Read a bstring terminated by the terminator character or the end of the * stream from the bStream (s) and return it into the parameter r. This * function may read additional characters from the core stream that are not * returned, but will be retained for subsequent read operations. */ int bsreadlna (bstring r, struct bStream * s, char terminator) { int i, l, ret, rlo; char * b; struct tagbstring x; if (s == NULL || s->buff == NULL || r == NULL || r->mlen <= 0 || r->slen < 0 || r->mlen < r->slen) return BSTR_ERR; l = s->buff->slen; if (BSTR_OK != balloc (s->buff, s->maxBuffSz + 1)) return BSTR_ERR; b = (char *) s->buff->data; x.data = (unsigned char *) b; /* First check if the current buffer holds the terminator */ b[l] = terminator; /* Set sentinel */ for (i=0; b[i] != terminator; i++) ; if (i < l) { x.slen = i + 1; ret = bconcat (r, &x); s->buff->slen = l; if (BSTR_OK == ret) bdelete (s->buff, 0, i + 1); return BSTR_OK; } rlo = r->slen; /* If not then just concatenate the entire buffer to the output */ x.slen = l; if (BSTR_OK != bconcat (r, &x)) return BSTR_ERR; /* Perform direct in-place reads into the destination to allow for the minimum of data-copies */ for (;;) { if (BSTR_OK != balloc (r, r->slen + s->maxBuffSz + 1)) return BSTR_ERR; b = (char *) (r->data + r->slen); l = (int) s->readFnPtr (b, 1, s->maxBuffSz, s->parm); if (l <= 0) { r->data[r->slen] = (unsigned char) '\0'; s->buff->slen = 0; s->isEOF = 1; /* If nothing was read return with an error message */ return BSTR_ERR & -(r->slen == rlo); } b[l] = terminator; /* Set sentinel */ for (i=0; b[i] != terminator; i++) ; if (i < l) break; r->slen += l; } /* Terminator found, push over-read back to buffer */ i++; r->slen += i; s->buff->slen = l - i; bstr__memcpy (s->buff->data, b + i, l - i); r->data[r->slen] = (unsigned char) '\0'; return BSTR_OK; } /* int bsreadlnsa (bstring r, struct bStream * s, bstring term) * * Read a bstring terminated by any character in the term string or the end * of the stream from the bStream (s) and return it into the parameter r. * This function may read additional characters from the core stream that * are not returned, but will be retained for subsequent read operations. */ int bsreadlnsa (bstring r, struct bStream * s, const_bstring term) { int i, l, ret, rlo; unsigned char * b; struct tagbstring x; struct charField cf; if (s == NULL || s->buff == NULL || r == NULL || term == NULL || term->data == NULL || r->mlen <= 0 || r->slen < 0 || r->mlen < r->slen) return BSTR_ERR; if (term->slen == 1) return bsreadlna (r, s, term->data[0]); if (term->slen < 1 || buildCharField (&cf, term)) return BSTR_ERR; l = s->buff->slen; if (BSTR_OK != balloc (s->buff, s->maxBuffSz + 1)) return BSTR_ERR; b = (unsigned char *) s->buff->data; x.data = b; /* First check if the current buffer holds the terminator */ b[l] = term->data[0]; /* Set sentinel */ for (i=0; !testInCharField (&cf, b[i]); i++) ; if (i < l) { x.slen = i + 1; ret = bconcat (r, &x); s->buff->slen = l; if (BSTR_OK == ret) bdelete (s->buff, 0, i + 1); return BSTR_OK; } rlo = r->slen; /* If not then just concatenate the entire buffer to the output */ x.slen = l; if (BSTR_OK != bconcat (r, &x)) return BSTR_ERR; /* Perform direct in-place reads into the destination to allow for the minimum of data-copies */ for (;;) { if (BSTR_OK != balloc (r, r->slen + s->maxBuffSz + 1)) return BSTR_ERR; b = (unsigned char *) (r->data + r->slen); l = (int) s->readFnPtr (b, 1, s->maxBuffSz, s->parm); if (l <= 0) { r->data[r->slen] = (unsigned char) '\0'; s->buff->slen = 0; s->isEOF = 1; /* If nothing was read return with an error message */ return BSTR_ERR & -(r->slen == rlo); } b[l] = term->data[0]; /* Set sentinel */ for (i=0; !testInCharField (&cf, b[i]); i++) ; if (i < l) break; r->slen += l; } /* Terminator found, push over-read back to buffer */ i++; r->slen += i; s->buff->slen = l - i; bstr__memcpy (s->buff->data, b + i, l - i); r->data[r->slen] = (unsigned char) '\0'; return BSTR_OK; } /* int bsreada (bstring r, struct bStream * s, int n) * * Read a bstring of length n (or, if it is fewer, as many bytes as is * remaining) from the bStream. This function may read additional * characters from the core stream that are not returned, but will be * retained for subsequent read operations. This function will not read * additional characters from the core stream beyond virtual stream pointer. */ int bsreada (bstring r, struct bStream * s, int n) { int l, ret, orslen; char * b; struct tagbstring x; if (s == NULL || s->buff == NULL || r == NULL || r->mlen <= 0 || r->slen < 0 || r->mlen < r->slen || n <= 0) return BSTR_ERR; n += r->slen; if (n <= 0) return BSTR_ERR; l = s->buff->slen; orslen = r->slen; if (0 == l) { if (s->isEOF) return BSTR_ERR; if (r->mlen > n) { l = (int) s->readFnPtr (r->data + r->slen, 1, n - r->slen, s->parm); if (0 >= l || l > n - r->slen) { s->isEOF = 1; return BSTR_ERR; } r->slen += l; r->data[r->slen] = (unsigned char) '\0'; return 0; } } if (BSTR_OK != balloc (s->buff, s->maxBuffSz + 1)) return BSTR_ERR; b = (char *) s->buff->data; x.data = (unsigned char *) b; do { if (l + r->slen >= n) { x.slen = n - r->slen; ret = bconcat (r, &x); s->buff->slen = l; if (BSTR_OK == ret) bdelete (s->buff, 0, x.slen); return BSTR_ERR & -(r->slen == orslen); } x.slen = l; if (BSTR_OK != bconcat (r, &x)) break; l = n - r->slen; if (l > s->maxBuffSz) l = s->maxBuffSz; l = (int) s->readFnPtr (b, 1, l, s->parm); } while (l > 0); if (l < 0) l = 0; if (l == 0) s->isEOF = 1; s->buff->slen = l; return BSTR_ERR & -(r->slen == orslen); } /* int bsreadln (bstring r, struct bStream * s, char terminator) * * Read a bstring terminated by the terminator character or the end of the * stream from the bStream (s) and return it into the parameter r. This * function may read additional characters from the core stream that are not * returned, but will be retained for subsequent read operations. */ int bsreadln (bstring r, struct bStream * s, char terminator) { if (s == NULL || s->buff == NULL || r == NULL || r->mlen <= 0) return BSTR_ERR; if (BSTR_OK != balloc (s->buff, s->maxBuffSz + 1)) return BSTR_ERR; r->slen = 0; return bsreadlna (r, s, terminator); } /* int bsreadlns (bstring r, struct bStream * s, bstring term) * * Read a bstring terminated by any character in the term string or the end * of the stream from the bStream (s) and return it into the parameter r. * This function may read additional characters from the core stream that * are not returned, but will be retained for subsequent read operations. */ int bsreadlns (bstring r, struct bStream * s, const_bstring term) { if (s == NULL || s->buff == NULL || r == NULL || term == NULL || term->data == NULL || r->mlen <= 0) return BSTR_ERR; if (term->slen == 1) return bsreadln (r, s, term->data[0]); if (term->slen < 1) return BSTR_ERR; if (BSTR_OK != balloc (s->buff, s->maxBuffSz + 1)) return BSTR_ERR; r->slen = 0; return bsreadlnsa (r, s, term); } /* int bsread (bstring r, struct bStream * s, int n) * * Read a bstring of length n (or, if it is fewer, as many bytes as is * remaining) from the bStream. This function may read additional * characters from the core stream that are not returned, but will be * retained for subsequent read operations. This function will not read * additional characters from the core stream beyond virtual stream pointer. */ int bsread (bstring r, struct bStream * s, int n) { if (s == NULL || s->buff == NULL || r == NULL || r->mlen <= 0 || n <= 0) return BSTR_ERR; if (BSTR_OK != balloc (s->buff, s->maxBuffSz + 1)) return BSTR_ERR; r->slen = 0; return bsreada (r, s, n); } /* int bsunread (struct bStream * s, const_bstring b) * * Insert a bstring into the bStream at the current position. These * characters will be read prior to those that actually come from the core * stream. */ int bsunread (struct bStream * s, const_bstring b) { if (s == NULL || s->buff == NULL) return BSTR_ERR; return binsert (s->buff, 0, b, (unsigned char) '?'); } /* int bspeek (bstring r, const struct bStream * s) * * Return the currently buffered characters from the bStream that will be * read prior to reads from the core stream. */ int bspeek (bstring r, const struct bStream * s) { if (s == NULL || s->buff == NULL) return BSTR_ERR; return bassign (r, s->buff); } /* bstring bjoin (const struct bstrList * bl, const_bstring sep); * * Join the entries of a bstrList into one bstring by sequentially * concatenating them with the sep string in between. If there is an error * NULL is returned, otherwise a bstring with the correct result is returned. */ bstring bjoin (const struct bstrList * bl, const_bstring sep) { bstring b; int i, c, v; if (bl == NULL || bl->qty < 0) return NULL; if (sep != NULL && (sep->slen < 0 || sep->data == NULL)) return NULL; for (i = 0, c = 1; i < bl->qty; i++) { v = bl->entry[i]->slen; if (v < 0) return NULL; /* Invalid input */ c += v; if (c < 0) return NULL; /* Wrap around ?? */ } if (sep != NULL) c += (bl->qty - 1) * sep->slen; b = (bstring) bstr__alloc (sizeof (struct tagbstring)); if (NULL == b) return NULL; /* Out of memory */ b->data = (unsigned char *) bstr__alloc (c); if (b->data == NULL) { bstr__free (b); return NULL; } b->mlen = c; b->slen = c-1; for (i = 0, c = 0; i < bl->qty; i++) { if (i > 0 && sep != NULL) { bstr__memcpy (b->data + c, sep->data, sep->slen); c += sep->slen; } v = bl->entry[i]->slen; bstr__memcpy (b->data + c, bl->entry[i]->data, v); c += v; } b->data[c] = (unsigned char) '\0'; return b; } #define BSSSC_BUFF_LEN (256) /* int bssplitscb (struct bStream * s, const_bstring splitStr, * int (* cb) (void * parm, int ofs, const_bstring entry), void * parm) * * Iterate the set of disjoint sequential substrings read from a stream * divided by any of the characters in splitStr. An empty splitStr causes * the whole stream to be iterated once. * * Note: At the point of calling the cb function, the bStream pointer is * pointed exactly at the position right after having read the split * character. The cb function can act on the stream by causing the bStream * pointer to move, and bssplitscb will continue by starting the next split * at the position of the pointer after the return from cb. * * However, if the cb causes the bStream s to be destroyed then the cb must * return with a negative value, otherwise bssplitscb will continue in an * undefined manner. */ int bssplitscb (struct bStream * s, const_bstring splitStr, int (* cb) (void * parm, int ofs, const_bstring entry), void * parm) { struct charField chrs; bstring buff; int i, p, ret; if (cb == NULL || s == NULL || s->readFnPtr == NULL || splitStr == NULL || splitStr->slen < 0) return BSTR_ERR; if (NULL == (buff = bfromcstr (""))) return BSTR_ERR; if (splitStr->slen == 0) { while (bsreada (buff, s, BSSSC_BUFF_LEN) >= 0) ; if ((ret = cb (parm, 0, buff)) > 0) ret = 0; } else { buildCharField (&chrs, splitStr); ret = p = i = 0; for (;;) { if (i >= buff->slen) { bsreada (buff, s, BSSSC_BUFF_LEN); if (i >= buff->slen) { if (0 < (ret = cb (parm, p, buff))) ret = 0; break; } } if (testInCharField (&chrs, buff->data[i])) { struct tagbstring t; unsigned char c; blk2tbstr (t, buff->data + i + 1, buff->slen - (i + 1)); if ((ret = bsunread (s, &t)) < 0) break; buff->slen = i; c = buff->data[i]; buff->data[i] = (unsigned char) '\0'; if ((ret = cb (parm, p, buff)) < 0) break; buff->data[i] = c; buff->slen = 0; p += i + 1; i = -1; } i++; } } bdestroy (buff); return ret; } /* int bssplitstrcb (struct bStream * s, const_bstring splitStr, * int (* cb) (void * parm, int ofs, const_bstring entry), void * parm) * * Iterate the set of disjoint sequential substrings read from a stream * divided by the entire substring splitStr. An empty splitStr causes * each character of the stream to be iterated. * * Note: At the point of calling the cb function, the bStream pointer is * pointed exactly at the position right after having read the split * character. The cb function can act on the stream by causing the bStream * pointer to move, and bssplitscb will continue by starting the next split * at the position of the pointer after the return from cb. * * However, if the cb causes the bStream s to be destroyed then the cb must * return with a negative value, otherwise bssplitscb will continue in an * undefined manner. */ int bssplitstrcb (struct bStream * s, const_bstring splitStr, int (* cb) (void * parm, int ofs, const_bstring entry), void * parm) { bstring buff; int i, p, ret; if (cb == NULL || s == NULL || s->readFnPtr == NULL || splitStr == NULL || splitStr->slen < 0) return BSTR_ERR; if (splitStr->slen == 1) return bssplitscb (s, splitStr, cb, parm); if (NULL == (buff = bfromcstr (""))) return BSTR_ERR; if (splitStr->slen == 0) { for (i=0; bsreada (buff, s, BSSSC_BUFF_LEN) >= 0; i++) { if ((ret = cb (parm, 0, buff)) < 0) { bdestroy (buff); return ret; } buff->slen = 0; } return BSTR_OK; } else { ret = p = i = 0; for (i=p=0;;) { if ((ret = binstr (buff, 0, splitStr)) >= 0) { struct tagbstring t; blk2tbstr (t, buff->data, ret); i = ret + splitStr->slen; if ((ret = cb (parm, p, &t)) < 0) break; p += i; bdelete (buff, 0, i); } else { bsreada (buff, s, BSSSC_BUFF_LEN); if (bseof (s)) { if ((ret = cb (parm, p, buff)) > 0) ret = 0; break; } } } } bdestroy (buff); return ret; } /* int bstrListCreate (void) * * Create a bstrList. */ struct bstrList * bstrListCreate (void) { struct bstrList * sl = (struct bstrList *) bstr__alloc (sizeof (struct bstrList)); if (sl) { sl->entry = (bstring *) bstr__alloc (1*sizeof (bstring)); if (!sl->entry) { bstr__free (sl); sl = NULL; } else { sl->qty = 0; sl->mlen = 1; } } return sl; } /* int bstrListDestroy (struct bstrList * sl) * * Destroy a bstrList that has been created by bsplit, bsplits or bstrListCreate. */ int bstrListDestroy (struct bstrList * sl) { int i; if (sl == NULL || sl->qty < 0) return BSTR_ERR; for (i=0; i < sl->qty; i++) { if (sl->entry[i]) { bdestroy (sl->entry[i]); sl->entry[i] = NULL; } } sl->qty = -1; sl->mlen = -1; bstr__free (sl->entry); sl->entry = NULL; bstr__free (sl); return BSTR_OK; } /* int bstrListAlloc (struct bstrList * sl, int msz) * * Ensure that there is memory for at least msz number of entries for the * list. */ int bstrListAlloc (struct bstrList * sl, int msz) { bstring * l; int smsz; size_t nsz; if (!sl || msz <= 0 || !sl->entry || sl->qty < 0 || sl->mlen <= 0 || sl->qty > sl->mlen) return BSTR_ERR; if (sl->mlen >= msz) return BSTR_OK; smsz = snapUpSize (msz); nsz = ((size_t) smsz) * sizeof (bstring); if (nsz < (size_t) smsz) return BSTR_ERR; l = (bstring *) bstr__realloc (sl->entry, nsz); if (!l) { smsz = msz; nsz = ((size_t) smsz) * sizeof (bstring); l = (bstring *) bstr__realloc (sl->entry, nsz); if (!l) return BSTR_ERR; } sl->mlen = smsz; sl->entry = l; return BSTR_OK; } /* int bstrListAllocMin (struct bstrList * sl, int msz) * * Try to allocate the minimum amount of memory for the list to include at * least msz entries or sl->qty whichever is greater. */ int bstrListAllocMin (struct bstrList * sl, int msz) { bstring * l; size_t nsz; if (!sl || msz <= 0 || !sl->entry || sl->qty < 0 || sl->mlen <= 0 || sl->qty > sl->mlen) return BSTR_ERR; if (msz < sl->qty) msz = sl->qty; if (sl->mlen == msz) return BSTR_OK; nsz = ((size_t) msz) * sizeof (bstring); if (nsz < (size_t) msz) return BSTR_ERR; l = (bstring *) bstr__realloc (sl->entry, nsz); if (!l) return BSTR_ERR; sl->mlen = msz; sl->entry = l; return BSTR_OK; } /* int bsplitcb (const_bstring str, unsigned char splitChar, int pos, * int (* cb) (void * parm, int ofs, int len), void * parm) * * Iterate the set of disjoint sequential substrings over str divided by the * character in splitChar. * * Note: Non-destructive modification of str from within the cb function * while performing this split is not undefined. bsplitcb behaves in * sequential lock step with calls to cb. I.e., after returning from a cb * that return a non-negative integer, bsplitcb continues from the position * 1 character after the last detected split character and it will halt * immediately if the length of str falls below this point. However, if the * cb function destroys str, then it *must* return with a negative value, * otherwise bsplitcb will continue in an undefined manner. */ int bsplitcb (const_bstring str, unsigned char splitChar, int pos, int (* cb) (void * parm, int ofs, int len), void * parm) { int i, p, ret; if (cb == NULL || str == NULL || pos < 0 || pos > str->slen) return BSTR_ERR; p = pos; do { for (i=p; i < str->slen; i++) { if (str->data[i] == splitChar) break; } if ((ret = cb (parm, p, i - p)) < 0) return ret; p = i + 1; } while (p <= str->slen); return BSTR_OK; } /* int bsplitscb (const_bstring str, const_bstring splitStr, int pos, * int (* cb) (void * parm, int ofs, int len), void * parm) * * Iterate the set of disjoint sequential substrings over str divided by any * of the characters in splitStr. An empty splitStr causes the whole str to * be iterated once. * * Note: Non-destructive modification of str from within the cb function * while performing this split is not undefined. bsplitscb behaves in * sequential lock step with calls to cb. I.e., after returning from a cb * that return a non-negative integer, bsplitscb continues from the position * 1 character after the last detected split character and it will halt * immediately if the length of str falls below this point. However, if the * cb function destroys str, then it *must* return with a negative value, * otherwise bsplitscb will continue in an undefined manner. */ int bsplitscb (const_bstring str, const_bstring splitStr, int pos, int (* cb) (void * parm, int ofs, int len), void * parm) { struct charField chrs; int i, p, ret; if (cb == NULL || str == NULL || pos < 0 || pos > str->slen || splitStr == NULL || splitStr->slen < 0) return BSTR_ERR; if (splitStr->slen == 0) { if ((ret = cb (parm, 0, str->slen)) > 0) ret = 0; return ret; } if (splitStr->slen == 1) return bsplitcb (str, splitStr->data[0], pos, cb, parm); buildCharField (&chrs, splitStr); p = pos; do { for (i=p; i < str->slen; i++) { if (testInCharField (&chrs, str->data[i])) break; } if ((ret = cb (parm, p, i - p)) < 0) return ret; p = i + 1; } while (p <= str->slen); return BSTR_OK; } /* int bsplitstrcb (const_bstring str, const_bstring splitStr, int pos, * int (* cb) (void * parm, int ofs, int len), void * parm) * * Iterate the set of disjoint sequential substrings over str divided by the * substring splitStr. An empty splitStr causes the whole str to be * iterated once. * * Note: Non-destructive modification of str from within the cb function * while performing this split is not undefined. bsplitstrcb behaves in * sequential lock step with calls to cb. I.e., after returning from a cb * that return a non-negative integer, bsplitscb continues from the position * 1 character after the last detected split character and it will halt * immediately if the length of str falls below this point. However, if the * cb function destroys str, then it *must* return with a negative value, * otherwise bsplitscb will continue in an undefined manner. */ int bsplitstrcb (const_bstring str, const_bstring splitStr, int pos, int (* cb) (void * parm, int ofs, int len), void * parm) { int i, p, ret; if (cb == NULL || str == NULL || pos < 0 || pos > str->slen || splitStr == NULL || splitStr->slen < 0) return BSTR_ERR; if (0 == splitStr->slen) { for (i=pos; i < str->slen; i++) { if ((ret = cb (parm, i, 1)) < 0) return ret; } return BSTR_OK; } if (splitStr->slen == 1) return bsplitcb (str, splitStr->data[0], pos, cb, parm); for (i=p=pos; i <= str->slen - splitStr->slen; i++) { if (0 == bstr__memcmp (splitStr->data, str->data + i, splitStr->slen)) { if ((ret = cb (parm, p, i - p)) < 0) return ret; i += splitStr->slen; p = i; } } if ((ret = cb (parm, p, str->slen - p)) < 0) return ret; return BSTR_OK; } struct genBstrList { bstring b; struct bstrList * bl; }; static int bscb (void * parm, int ofs, int len) { struct genBstrList * g = (struct genBstrList *) parm; if (g->bl->qty >= g->bl->mlen) { int mlen = g->bl->mlen * 2; bstring * tbl; while (g->bl->qty >= mlen) { if (mlen < g->bl->mlen) return BSTR_ERR; mlen += mlen; } tbl = (bstring *) bstr__realloc (g->bl->entry, sizeof (bstring) * mlen); if (tbl == NULL) return BSTR_ERR; g->bl->entry = tbl; g->bl->mlen = mlen; } g->bl->entry[g->bl->qty] = bmidstr (g->b, ofs, len); g->bl->qty++; return BSTR_OK; } /* struct bstrList * bsplit (const_bstring str, unsigned char splitChar) * * Create an array of sequential substrings from str divided by the character * splitChar. */ struct bstrList * bsplit (const_bstring str, unsigned char splitChar) { struct genBstrList g; if (str == NULL || str->data == NULL || str->slen < 0) return NULL; g.bl = (struct bstrList *) bstr__alloc (sizeof (struct bstrList)); if (g.bl == NULL) return NULL; g.bl->mlen = 4; g.bl->entry = (bstring *) bstr__alloc (g.bl->mlen * sizeof (bstring)); if (NULL == g.bl->entry) { bstr__free (g.bl); return NULL; } g.b = (bstring) str; g.bl->qty = 0; if (bsplitcb (str, splitChar, 0, bscb, &g) < 0) { bstrListDestroy (g.bl); return NULL; } return g.bl; } /* struct bstrList * bsplitstr (const_bstring str, const_bstring splitStr) * * Create an array of sequential substrings from str divided by the entire * substring splitStr. */ struct bstrList * bsplitstr (const_bstring str, const_bstring splitStr) { struct genBstrList g; if (str == NULL || str->data == NULL || str->slen < 0) return NULL; g.bl = (struct bstrList *) bstr__alloc (sizeof (struct bstrList)); if (g.bl == NULL) return NULL; g.bl->mlen = 4; g.bl->entry = (bstring *) bstr__alloc (g.bl->mlen * sizeof (bstring)); if (NULL == g.bl->entry) { bstr__free (g.bl); return NULL; } g.b = (bstring) str; g.bl->qty = 0; if (bsplitstrcb (str, splitStr, 0, bscb, &g) < 0) { bstrListDestroy (g.bl); return NULL; } return g.bl; } /* struct bstrList * bsplits (const_bstring str, bstring splitStr) * * Create an array of sequential substrings from str divided by any of the * characters in splitStr. An empty splitStr causes a single entry bstrList * containing a copy of str to be returned. */ struct bstrList * bsplits (const_bstring str, const_bstring splitStr) { struct genBstrList g; if ( str == NULL || str->slen < 0 || str->data == NULL || splitStr == NULL || splitStr->slen < 0 || splitStr->data == NULL) return NULL; g.bl = (struct bstrList *) bstr__alloc (sizeof (struct bstrList)); if (g.bl == NULL) return NULL; g.bl->mlen = 4; g.bl->entry = (bstring *) bstr__alloc (g.bl->mlen * sizeof (bstring)); if (NULL == g.bl->entry) { bstr__free (g.bl); return NULL; } g.b = (bstring) str; g.bl->qty = 0; if (bsplitscb (str, splitStr, 0, bscb, &g) < 0) { bstrListDestroy (g.bl); return NULL; } return g.bl; } #if defined (__TURBOC__) && !defined (__BORLANDC__) # ifndef BSTRLIB_NOVSNP # define BSTRLIB_NOVSNP # endif #endif /* Give WATCOM C/C++, MSVC some latitude for their non-support of vsnprintf */ #if defined(__WATCOMC__) || defined(_MSC_VER) #define exvsnprintf(r,b,n,f,a) {r = _vsnprintf (b,n,f,a);} #else #ifdef BSTRLIB_NOVSNP /* This is just a hack. If you are using a system without a vsnprintf, it is not recommended that bformat be used at all. */ #define exvsnprintf(r,b,n,f,a) {vsprintf (b,f,a); r = -1;} #define START_VSNBUFF (256) #else #ifdef __GNUC__ /* Something is making gcc complain about this prototype not being here, so I've just gone ahead and put it in. */ extern int vsnprintf (char *buf, size_t count, const char *format, va_list arg); #endif #define exvsnprintf(r,b,n,f,a) {r = vsnprintf (b,n,f,a);} #endif #endif #if !defined (BSTRLIB_NOVSNP) #ifndef START_VSNBUFF #define START_VSNBUFF (16) #endif /* On IRIX vsnprintf returns n-1 when the operation would overflow the target buffer, WATCOM and MSVC both return -1, while C99 requires that the returned value be exactly what the length would be if the buffer would be large enough. This leads to the idea that if the return value is larger than n, then changing n to the return value will reduce the number of iterations required. */ /* int bformata (bstring b, const char * fmt, ...) * * After the first parameter, it takes the same parameters as printf (), but * rather than outputting results to stdio, it appends the results to * a bstring which contains what would have been output. Note that if there * is an early generation of a '\0' character, the bstring will be truncated * to this end point. */ int bformata (bstring b, const char * fmt, ...) { va_list arglist; bstring buff; int n, r; if (b == NULL || fmt == NULL || b->data == NULL || b->mlen <= 0 || b->slen < 0 || b->slen > b->mlen) return BSTR_ERR; /* Since the length is not determinable beforehand, a search is performed using the truncating "vsnprintf" call (to avoid buffer overflows) on increasing potential sizes for the output result. */ if ((n = (int) (2*strlen (fmt))) < START_VSNBUFF) n = START_VSNBUFF; if (NULL == (buff = bfromcstralloc (n + 2, ""))) { n = 1; if (NULL == (buff = bfromcstralloc (n + 2, ""))) return BSTR_ERR; } for (;;) { va_start (arglist, fmt); exvsnprintf (r, (char *) buff->data, n + 1, fmt, arglist); va_end (arglist); buff->data[n] = (unsigned char) '\0'; buff->slen = (int) (strlen) ((char *) buff->data); if (buff->slen < n) break; if (r > n) n = r; else n += n; if (BSTR_OK != balloc (buff, n + 2)) { bdestroy (buff); return BSTR_ERR; } } r = bconcat (b, buff); bdestroy (buff); return r; } /* int bassignformat (bstring b, const char * fmt, ...) * * After the first parameter, it takes the same parameters as printf (), but * rather than outputting results to stdio, it outputs the results to * the bstring parameter b. Note that if there is an early generation of a * '\0' character, the bstring will be truncated to this end point. */ int bassignformat (bstring b, const char * fmt, ...) { va_list arglist; bstring buff; int n, r; if (b == NULL || fmt == NULL || b->data == NULL || b->mlen <= 0 || b->slen < 0 || b->slen > b->mlen) return BSTR_ERR; /* Since the length is not determinable beforehand, a search is performed using the truncating "vsnprintf" call (to avoid buffer overflows) on increasing potential sizes for the output result. */ if ((n = (int) (2*strlen (fmt))) < START_VSNBUFF) n = START_VSNBUFF; if (NULL == (buff = bfromcstralloc (n + 2, ""))) { n = 1; if (NULL == (buff = bfromcstralloc (n + 2, ""))) return BSTR_ERR; } for (;;) { va_start (arglist, fmt); exvsnprintf (r, (char *) buff->data, n + 1, fmt, arglist); va_end (arglist); buff->data[n] = (unsigned char) '\0'; buff->slen = (int) (strlen) ((char *) buff->data); if (buff->slen < n) break; if (r > n) n = r; else n += n; if (BSTR_OK != balloc (buff, n + 2)) { bdestroy (buff); return BSTR_ERR; } } r = bassign (b, buff); bdestroy (buff); return r; } /* bstring bformat (const char * fmt, ...) * * Takes the same parameters as printf (), but rather than outputting results * to stdio, it forms a bstring which contains what would have been output. * Note that if there is an early generation of a '\0' character, the * bstring will be truncated to this end point. */ bstring bformat (const char * fmt, ...) { va_list arglist; bstring buff; int n, r; if (fmt == NULL) return NULL; /* Since the length is not determinable beforehand, a search is performed using the truncating "vsnprintf" call (to avoid buffer overflows) on increasing potential sizes for the output result. */ if ((n = (int) (2*strlen (fmt))) < START_VSNBUFF) n = START_VSNBUFF; if (NULL == (buff = bfromcstralloc (n + 2, ""))) { n = 1; if (NULL == (buff = bfromcstralloc (n + 2, ""))) return NULL; } for (;;) { va_start (arglist, fmt); exvsnprintf (r, (char *) buff->data, n + 1, fmt, arglist); va_end (arglist); buff->data[n] = (unsigned char) '\0'; buff->slen = (int) (strlen) ((char *) buff->data); if (buff->slen < n) break; if (r > n) n = r; else n += n; if (BSTR_OK != balloc (buff, n + 2)) { bdestroy (buff); return NULL; } } return buff; } /* int bvcformata (bstring b, int count, const char * fmt, va_list arglist) * * The bvcformata function formats data under control of the format control * string fmt and attempts to append the result to b. The fmt parameter is * the same as that of the printf function. The variable argument list is * replaced with arglist, which has been initialized by the va_start macro. * The size of the output is upper bounded by count. If the required output * exceeds count, the string b is not augmented with any contents and a value * below BSTR_ERR is returned. If a value below -count is returned then it * is recommended that the negative of this value be used as an update to the * count in a subsequent pass. On other errors, such as running out of * memory, parameter errors or numeric wrap around BSTR_ERR is returned. * BSTR_OK is returned when the output is successfully generated and * appended to b. * * Note: There is no sanity checking of arglist, and this function is * destructive of the contents of b from the b->slen point onward. If there * is an early generation of a '\0' character, the bstring will be truncated * to this end point. */ int bvcformata (bstring b, int count, const char * fmt, va_list arg) { int n, r, l; if (b == NULL || fmt == NULL || count <= 0 || b->data == NULL || b->mlen <= 0 || b->slen < 0 || b->slen > b->mlen) return BSTR_ERR; if (count > (n = b->slen + count) + 2) return BSTR_ERR; if (BSTR_OK != balloc (b, n + 2)) return BSTR_ERR; exvsnprintf (r, (char *) b->data + b->slen, count + 2, fmt, arg); /* Did the operation complete successfully within bounds? */ if (n >= (l = b->slen + (int) (strlen) ((const char *) b->data + b->slen))) { b->slen = l; return BSTR_OK; } /* Abort, since the buffer was not large enough. The return value tries to help set what the retry length should be. */ b->data[b->slen] = '\0'; if (r > count+1) l = r; else { l = count+count; if (count > l) l = INT_MAX; } n = -l; if (n > BSTR_ERR-1) n = BSTR_ERR-1; return n; } #endif netatalk-2.2.2/libatalk/asp/0000777000175200017500000000000011704770423012702 500000000000000netatalk-2.2.2/libatalk/asp/asp_close.c0000644000175200017500000000320411655731127014734 00000000000000/* * $Id: asp_close.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include int asp_close(ASP asp) { struct atp_block atpb; struct iovec iov[ 1 ]; int err = 0; memset(asp->commands, 0, sizeof(u_int32_t)); atpb.atp_saddr = &asp->asp_sat; iov[ 0 ].iov_base = asp->commands; iov[ 0 ].iov_len = sizeof(u_int32_t); atpb.atp_sresiov = iov; atpb.atp_sresiovcnt = 1; if (atp_sresp( asp->asp_atp, &atpb ) < 0) err = -1; if (atp_close( asp->asp_atp ) < 0) err = -1; free( asp ); return err; } netatalk-2.2.2/libatalk/asp/Makefile.am0000644000175200017500000000040511655731127014654 00000000000000# Makefile.am for libatalk/asp/ AM_CFLAGS = -I$(top_srcdir) noinst_LTLIBRARIES = libasp.la libasp_la_SOURCES = asp_attn.c asp_close.c asp_cmdreply.c asp_getreq.c asp_getsess.c asp_init.c asp_write.c asp_shutdown.c asp_tickle.c noinst_HEADERS = asp_child.h netatalk-2.2.2/libatalk/asp/Makefile.in0000644000175200017500000004062411703521726014670 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/asp/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = libatalk/asp DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libasp_la_LIBADD = am_libasp_la_OBJECTS = asp_attn.lo asp_close.lo asp_cmdreply.lo \ asp_getreq.lo asp_getsess.lo asp_init.lo asp_write.lo \ asp_shutdown.lo asp_tickle.lo libasp_la_OBJECTS = $(am_libasp_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libasp_la_SOURCES) DIST_SOURCES = $(libasp_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = -I$(top_srcdir) noinst_LTLIBRARIES = libasp.la libasp_la_SOURCES = asp_attn.c asp_close.c asp_cmdreply.c asp_getreq.c asp_getsess.c asp_init.c asp_write.c asp_shutdown.c asp_tickle.c noinst_HEADERS = asp_child.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/asp/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/asp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libasp.la: $(libasp_la_OBJECTS) $(libasp_la_DEPENDENCIES) $(LINK) $(libasp_la_OBJECTS) $(libasp_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asp_attn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asp_close.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asp_cmdreply.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asp_getreq.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asp_getsess.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asp_init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asp_shutdown.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asp_tickle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asp_write.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/asp/asp_child.h0000644000175200017500000000220711655731127014721 00000000000000/* * $Id: asp_child.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef _ASP_CHILD_H #define _ASP_CHILD_H 1 struct asp_child { int ac_pid; int ac_state; struct sockaddr_at ac_sat; }; #define ACSTATE_DEAD 0 #define ACSTATE_OK 1 #define ACSTATE_BAD 7 #endif /* _ASP_CHILD_H */ netatalk-2.2.2/libatalk/asp/asp_getsess.c0000644000175200017500000002161211655731127015307 00000000000000/* * $Id: asp_getsess.c,v 1.9 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1996 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #include #include #ifdef HAVE_SYS_WAIT_H #include #endif /* HAVE_SYS_WAIT_H */ #include #include #include #include #include #include #include "asp_child.h" #ifndef WEXITSTATUS #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif /* ! WEXITSTATUS */ #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif /* ! WIFEXITED */ #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif /* ! MIN */ static ASP server_asp; static struct server_child *children = NULL; static struct asp_child **asp_ac = NULL; /* send tickles and check tickle status of connections * thoughts on using a hashed list: * + child_cleanup, finding slots * - tickle_handler, freeing, tickles * if setup for a large number of connections, * + space: if actual connections < potential * - space: actual connections ~ potential */ static void tickle_handler(int sig _U_) { int sid; /* check status */ for (sid = 0; sid < children->nsessions; sid++) { if (asp_ac[sid] == NULL || asp_ac[sid]->ac_state == ACSTATE_DEAD) continue; if (++asp_ac[sid]->ac_state >= ACSTATE_BAD) { /* kill. if already dead, just continue */ if (kill( asp_ac[ sid ]->ac_pid, SIGTERM) == 0) LOG(log_info, logtype_default, "asp_alrm: %d timed out", asp_ac[ sid ]->ac_pid ); asp_ac[ sid ]->ac_state = ACSTATE_DEAD; continue; } /* send off a tickle */ asp_tickle(server_asp, sid, &asp_ac[sid]->ac_sat); } } static void child_cleanup(const pid_t pid) { int i; for (i = 0; i < children->nsessions; i++) if (asp_ac[i] && (asp_ac[i]->ac_pid == pid)) { asp_ac[i]->ac_state = ACSTATE_DEAD; break; } } /* kill children */ void asp_kill(int sig) { if (children) server_child_kill(children, CHILD_ASPFORK, sig); } void asp_stop_tickle(void) { if (server_asp && server_asp->inited) { static const struct itimerval timer = {{0, 0}, {0, 0}}; setitimer(ITIMER_REAL, &timer, NULL); } } /* * This call handles open, tickle, and getstatus requests. On a * successful open, it forks a child process. * It returns an ASP to the child and parent and NULL if there is * an error. */ static void set_asp_ac(int sid, struct asp_child *tmp); ASP asp_getsession(ASP asp, server_child *server_children, const int tickleval) { struct sigaction action; struct itimerval timer; struct sockaddr_at sat; struct atp_block atpb; ATP atp; struct iovec iov[ 8 ]; pid_t pid; int i, iovcnt, sid; u_int16_t asperr; char *buf; int buflen; if (!asp->inited) { if (!(children = server_children)) return NULL; /* only calloc once */ if (!asp_ac && (asp_ac = (struct asp_child **) calloc(server_children->nsessions, sizeof(struct asp_child *))) == NULL) return NULL; server_asp = asp; /* install cleanup pointer */ server_child_setup(children, CHILD_ASPFORK, child_cleanup); /* install tickle handler * we are the parent process */ memset(&action, 0, sizeof(action)); action.sa_handler = tickle_handler; sigemptyset(&action.sa_mask); sigaddset(&action.sa_mask, SIGHUP); sigaddset(&action.sa_mask, SIGTERM); sigaddset(&action.sa_mask, SIGCHLD); action.sa_flags = SA_RESTART; timer.it_interval.tv_sec = timer.it_value.tv_sec = tickleval; timer.it_interval.tv_usec = timer.it_value.tv_usec = 0; if ((sigaction(SIGALRM, &action, NULL) < 0) || (setitimer(ITIMER_REAL, &timer, NULL) < 0)) { free(asp_ac); server_asp = NULL; asp_ac = NULL; return NULL; } asp->inited = 1; } memset( &sat, 0, sizeof( struct sockaddr_at )); #ifdef BSD4_4 sat.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ sat.sat_family = AF_APPLETALK; sat.sat_addr.s_net = ATADDR_ANYNET; sat.sat_addr.s_node = ATADDR_ANYNODE; sat.sat_port = ATADDR_ANYPORT; atpb.atp_saddr = &sat; atpb.atp_rreqdata = asp->cmdbuf; atpb.atp_rreqdlen = sizeof( asp->cmdbuf ); while ( atp_rreq( asp->asp_atp, &atpb ) < 0 ) { if ( errno == EINTR || errno == EAGAIN ) { continue; } return( NULL ); } switch ( asp->cmdbuf[ 0 ] ) { case ASPFUNC_TICKLE: sid = asp->cmdbuf[1]; if ((asp_ac[sid] != NULL) && (asp_ac[sid]->ac_state != ACSTATE_DEAD)) asp_ac[sid]->ac_state = ACSTATE_OK; break; case ASPFUNC_STAT : #ifdef EBUG printf( "asp stat\n" ); #endif /* EBUG */ if ( asp->asp_slen > 0 ) { i = 0; while(atpb.atp_bitmap) { i++; atpb.atp_bitmap >>= 1; } /* asp->data is big enough ... */ memcpy( asp->data, asp->asp_status, MIN(asp->asp_slen, i*ASP_CMDSIZ)); buflen = MIN(asp->asp_slen, i*ASP_CMDSIZ); buf = asp->data; iovcnt = 0; /* If status information is too big to fit into the available * ASP packets, we simply send as much as we can. * Older client versions will most likely not be able to use * the additional information anyway, like directory services * or UTF8 server name. A very long fqdn could be a problem, * we could end up with an invalid address list. */ do { iov[ iovcnt ].iov_base = buf; memmove(buf + ASP_HDRSIZ, buf, buflen); memset( iov[ iovcnt ].iov_base, 0, ASP_HDRSIZ ); if ( buflen > ASP_CMDSIZ ) { buf += ASP_CMDMAXSIZ; buflen -= ASP_CMDSIZ; iov[ iovcnt ].iov_len = ASP_CMDMAXSIZ; } else { iov[ iovcnt ].iov_len = buflen + ASP_HDRSIZ; buflen = 0; } iovcnt++; } while ( iovcnt < i && buflen > 0 ); atpb.atp_sresiovcnt = iovcnt; atpb.atp_sresiov = iov; atp_sresp( asp->asp_atp, &atpb ); } break; case ASPFUNC_OPEN : if (children->count < children->nsessions) { struct asp_child *asp_ac_tmp; /* find a slot */ for (sid = 0; sid < children->nsessions; sid++) { if (asp_ac[sid] == NULL) break; if (asp_ac[sid]->ac_state == ACSTATE_DEAD) { free(asp_ac[sid]); asp_ac[sid] = NULL; break; } } if ((atp = atp_open(ATADDR_ANYPORT, &(atp_sockaddr(asp->asp_atp)->sat_addr))) == NULL) return NULL; int dummy[2]; switch ((pid = fork())) { case 0 : /* child */ server_reset_signal(); /* free/close some things */ for (i = 0; i < children->nsessions; i++ ) { if ( asp_ac[i] != NULL ) free( asp_ac[i] ); } free(asp_ac); server_child_free(children); children = NULL; atp_close(asp->asp_atp); asp->child = 1; asp->asp_atp = atp; asp->asp_sat = sat; asp->asp_wss = asp->cmdbuf[1]; asp->asp_seq = 0; asp->asp_sid = sid; asp->asp_flags = ASPFL_SSS; return asp; case -1 : /* error */ asp->cmdbuf[ 0 ] = 0; asp->cmdbuf[ 1 ] = 0; asperr = ASPERR_SERVBUSY; break; default : /* parent process */ /* we need atomic setting or pb with tickle_handler */ if (server_child_add(children, CHILD_ASPFORK, pid, dummy)) { if ((asp_ac_tmp = malloc(sizeof(struct asp_child))) == NULL) { kill(pid, SIGQUIT); break; } asp_ac_tmp->ac_pid = pid; asp_ac_tmp->ac_state = ACSTATE_OK; asp_ac_tmp->ac_sat = sat; asp_ac_tmp->ac_sat.sat_port = asp->cmdbuf[1]; asp->cmdbuf[0] = atp_sockaddr(atp)->sat_port; asp->cmdbuf[1] = sid; set_asp_ac(sid, asp_ac_tmp); asperr = ASPERR_OK; break; } else { kill(pid, SIGQUIT); break; } atp_close(atp); break; } } else { asp->cmdbuf[0] = asp->cmdbuf[1] = 0; asperr = ASPERR_SERVBUSY; } memcpy( asp->cmdbuf + 2, &asperr, sizeof(asperr)); iov[ 0 ].iov_base = asp->cmdbuf; iov[ 0 ].iov_len = 4; atpb.atp_sresiov = iov; atpb.atp_sresiovcnt = 1; atp_sresp( asp->asp_atp, &atpb ); break; default: LOG(log_info, logtype_default, "ASPUnknown %d", asp->cmdbuf[0]); break; } return asp; } /* with fn defined after use, assume it's not optimized by the compiler */ static void set_asp_ac(int sid, struct asp_child *tmp) { asp_ac[sid] = tmp; } netatalk-2.2.2/libatalk/asp/asp_init.c0000644000175200017500000000374011655731127014577 00000000000000/* * $Id: asp_init.c,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include ASP asp_init(ATP atp) { ASP asp; if (( asp = (struct ASP *)calloc(1, sizeof( struct ASP ))) == NULL ) { return( NULL ); } asp->asp_atp = atp; #ifdef BSD4_4 asp->asp_sat.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ asp->asp_sat.sat_family = AF_APPLETALK; asp->asp_sat.sat_addr.s_net = ATADDR_ANYNET; asp->asp_sat.sat_addr.s_node = ATADDR_ANYNODE; asp->asp_sat.sat_port = ATADDR_ANYPORT; asp->asp_status = NULL; asp->asp_slen = 0; asp->asp_sid = 0; asp->asp_flags = ASPFL_SLS; asp->cmdlen = asp->datalen = 0; asp->read_count = asp->write_count = 0; asp->commands = asp->cmdbuf + 4; return( asp ); } void asp_setstatus(ASP asp, char *status, const int slen) { asp->asp_status = status; asp->asp_slen = slen; } netatalk-2.2.2/libatalk/asp/asp_write.c0000644000175200017500000000543611655731127014772 00000000000000/* * $Id: asp_write.c,v 1.4 2009-10-22 12:35:39 franklahm Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #if defined(BSD) || defined(BSD4_3) #define memmove(a, b, n) bcopy((b), (a), (n)) #endif /* BSD || BSD4_3 */ int asp_wrtcont(ASP asp, char *buf, size_t *buflen) { struct iovec iov[ ASP_MAXPACKETS ]; struct atp_block atpb; char *p; int iovcnt = ASP_MAXPACKETS; u_int16_t blen, seq; u_int8_t oport; p = buf; *p++ = ASPFUNC_WRTCONT; *p++ = asp->asp_sid; seq = htons( asp->asp_seq ); memcpy( p, &seq, sizeof(seq)); p += sizeof(seq); blen = htons(*buflen); memcpy( p, &blen, sizeof(blen)); p += sizeof(blen); for ( iovcnt = 0; iovcnt < ASP_MAXPACKETS; iovcnt++ ) { iov[iovcnt].iov_base = buf + iovcnt*ASP_CMDMAXSIZ; iov[ iovcnt ].iov_len = ASP_CMDMAXSIZ; } oport = asp->asp_sat.sat_port; atpb.atp_saddr = &asp->asp_sat; atpb.atp_saddr->sat_port = asp->asp_wss; atpb.atp_sreqdata = buf; atpb.atp_sreqdlen = p - buf; atpb.atp_sreqto = 2; atpb.atp_sreqtries = 5; if ( atp_sreq( asp->asp_atp, &atpb, iovcnt, ATP_XO ) < 0 ) { asp->asp_sat.sat_port = oport; return( -1 ); } asp->write_count += atpb.atp_sreqdlen; atpb.atp_rresiov = iov; atpb.atp_rresiovcnt = iovcnt; if ( atp_rresp( asp->asp_atp, &atpb ) < 0 ) { asp->asp_sat.sat_port = oport; return( -1 ); } asp->asp_sat.sat_port = oport; /* get rid of the 4-byte headers */ p = buf; for ( iovcnt = 0; iovcnt < atpb.atp_rresiovcnt; iovcnt++ ) { memmove(p, (char *) iov[ iovcnt ].iov_base + ASP_HDRSIZ, iov[ iovcnt ].iov_len - ASP_HDRSIZ ); p += ( iov[ iovcnt ].iov_len - ASP_HDRSIZ ); } *buflen = p - buf; asp->read_count += *buflen; return 0; } netatalk-2.2.2/libatalk/asp/asp_attn.c0000644000175200017500000000301311655731127014573 00000000000000/* * $Id: asp_attn.c,v 1.7 2002-12-04 10:59:37 didg Exp $ * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include /* attentions can get sent at any time. as a consequence, we don't * want to touch anything that might be used elsewhere. */ int asp_attention(ASP asp, AFPUserBytes flags) { char cmds[ASP_HDRSIZ], data[ASP_HDRSIZ]; struct sockaddr_at sat; struct atp_block atpb; struct iovec iov[ 1 ]; cmds[0] = ASPFUNC_ATTN; cmds[1] = asp->asp_sid; flags = htons(flags); memcpy(cmds + 2, &flags, sizeof(flags)); sat = asp->asp_sat; sat.sat_port = asp->asp_wss; atpb.atp_saddr = &sat; atpb.atp_sreqdata = cmds; atpb.atp_sreqdlen = sizeof(cmds); atpb.atp_sreqto = 2; atpb.atp_sreqtries = 5; if ( atp_sreq( asp->asp_atp, &atpb, 1, 0 ) < 0 ) { LOG(log_error, logtype_default, "atp_sreq: %s", strerror(errno) ); return 0; } iov[ 0 ].iov_base = data; iov[ 0 ].iov_len = sizeof( data ); atpb.atp_rresiov = iov; atpb.atp_rresiovcnt = sizeof( iov )/sizeof( iov[ 0 ] ); if ( atp_rresp( asp->asp_atp, &atpb ) < 0 ) { LOG(log_error, logtype_default, "atp_rresp: %s", strerror(errno) ); return 0; } return 1; } netatalk-2.2.2/libatalk/asp/asp_shutdown.c0000644000175200017500000000251211655731127015503 00000000000000/* * $Id: asp_shutdown.c,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1996 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include int asp_shutdown(ASP asp) { struct atp_block atpb; struct iovec iov; char *p; u_int16_t seq; u_int8_t oport; p = asp->commands; *p++ = ASPFUNC_CLOSE; *p++ = asp->asp_sid; seq = 0; memcpy( p, &seq, sizeof(seq)); p += sizeof(seq); oport = asp->asp_sat.sat_port; atpb.atp_saddr = &asp->asp_sat; atpb.atp_saddr->sat_port = asp->asp_wss; atpb.atp_sreqdata = asp->commands; atpb.atp_sreqdlen = p - asp->commands; atpb.atp_sreqto = 2; atpb.atp_sreqtries = 5; if ( atp_sreq( asp->asp_atp, &atpb, 1, ATP_XO ) < 0 ) { asp->asp_sat.sat_port = oport; return( -1 ); } iov.iov_base = asp->commands; iov.iov_len = ASP_CMDSIZ; atpb.atp_rresiov = &iov; atpb.atp_rresiovcnt = 1; if ( atp_rresp( asp->asp_atp, &atpb ) < 0 ) { asp->asp_sat.sat_port = oport; return( -1 ); } asp->asp_sat.sat_port = oport; return( 0 ); } netatalk-2.2.2/libatalk/asp/asp_tickle.c0000644000175200017500000000153411655731127015106 00000000000000/* * $Id: asp_tickle.c,v 1.7 2002-12-04 10:59:37 didg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #ifdef HAVE_SYS_TYPES_H #include #endif /* HAVE_SYS_TYPES_H */ #include #include #include #include /* send off a tickle */ int asp_tickle(ASP asp, const u_int8_t sid, struct sockaddr_at *sat) { struct atp_block atpb; char buf[ASP_HDRSIZ]; buf[ 0 ] = ASPFUNC_TICKLE; buf[ 1 ] = sid; buf[ 2 ] = buf[ 3 ] = 0; atpb.atp_saddr = sat; atpb.atp_sreqdata = buf; atpb.atp_sreqdlen = sizeof(buf); atpb.atp_sreqto = 0; atpb.atp_sreqtries = 1; if ( atp_sreq( asp->asp_atp, &atpb, 0, 0 ) < 0 ) { LOG(log_error, logtype_default, "atp_sreq: %s", strerror(errno) ); return 0; } return 1; } netatalk-2.2.2/libatalk/asp/asp_cmdreply.c0000644000175200017500000000445311655731127015455 00000000000000/* * $Id: asp_cmdreply.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #if defined(BSD) || defined(BSD4_3) #define memmove(a, b, n) bcopy((b), (a), (n)) #endif /* BSD || BSD4_3 */ int asp_cmdreply(ASP asp, int result) { struct iovec iov[ ASP_MAXPACKETS ]; struct atp_block atpb; int iovcnt, buflen; char *buf; /* unpack data into a format that atp likes. it needs to get * 4-byte headers prepended before each ASP_CMDSIZ chunk. */ buf = (char *) asp->data; buflen = asp->datalen; asp->write_count += buflen; result = htonl(result); iovcnt = 0; do { iov[ iovcnt ].iov_base = buf; memmove(buf + ASP_HDRSIZ, buf, buflen); if ( iovcnt == 0 ) { memcpy( iov[ iovcnt ].iov_base, &result, ASP_HDRSIZ ); } else { memset( iov[ iovcnt ].iov_base, 0, ASP_HDRSIZ ); } if ( buflen > ASP_CMDSIZ ) { buf += ASP_CMDMAXSIZ; buflen -= ASP_CMDSIZ; iov[ iovcnt ].iov_len = ASP_CMDMAXSIZ; } else { iov[ iovcnt ].iov_len = buflen + ASP_HDRSIZ; buflen = 0; } iovcnt++; } while ( buflen > 0 ); atpb.atp_saddr = &asp->asp_sat; atpb.atp_sresiov = iov; atpb.atp_sresiovcnt = iovcnt; if ( atp_sresp( asp->asp_atp, &atpb ) < 0 ) { return( -1 ); } asp->asp_seq++; return( 0 ); } netatalk-2.2.2/libatalk/asp/asp_getreq.c0000644000175200017500000000350311655731127015120 00000000000000/* * $Id: asp_getreq.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include int asp_getrequest(ASP asp) { struct atp_block atpb; u_int16_t seq; asp->asp_sat.sat_port = ATADDR_ANYPORT; atpb.atp_saddr = &asp->asp_sat; atpb.atp_rreqdata = asp->cmdbuf; atpb.atp_rreqdlen = sizeof(asp->cmdbuf); if ( atp_rreq( asp->asp_atp, &atpb ) < 0 ) { return( -1 ); } asp->cmdlen = atpb.atp_rreqdlen - 4; asp->read_count += asp->cmdlen; memcpy( &seq, asp->cmdbuf + 2, sizeof(seq)); seq = ntohs( seq ); if ((asp->cmdbuf[0] != ASPFUNC_CLOSE) && (seq != asp->asp_seq)) { return( -2 ); } if ( asp->cmdbuf[1] != asp->asp_sid ) { return( -3 ); } return( asp->cmdbuf[0] ); /* the command */ } netatalk-2.2.2/libatalk/atp/0000777000175200017500000000000011704770423012703 500000000000000netatalk-2.2.2/libatalk/atp/Makefile.am0000644000175200017500000000034011655731127014653 00000000000000# Makefile.am for libatalk/atp/ noinst_LTLIBRARIES = libatp.la libatp_la_SOURCES = atp_bufs.c atp_close.c atp_open.c atp_packet.c atp_rreq.c atp_rresp.c atp_rsel.c atp_sreq.c atp_sresp.c noinst_HEADERS = atp_internals.h netatalk-2.2.2/libatalk/atp/Makefile.in0000644000175200017500000004053011703521726014665 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/atp/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = libatalk/atp DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libatp_la_LIBADD = am_libatp_la_OBJECTS = atp_bufs.lo atp_close.lo atp_open.lo \ atp_packet.lo atp_rreq.lo atp_rresp.lo atp_rsel.lo atp_sreq.lo \ atp_sresp.lo libatp_la_OBJECTS = $(am_libatp_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libatp_la_SOURCES) DIST_SOURCES = $(libatp_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libatp.la libatp_la_SOURCES = atp_bufs.c atp_close.c atp_open.c atp_packet.c atp_rreq.c atp_rresp.c atp_rsel.c atp_sreq.c atp_sresp.c noinst_HEADERS = atp_internals.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/atp/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/atp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libatp.la: $(libatp_la_OBJECTS) $(libatp_la_DEPENDENCIES) $(LINK) $(libatp_la_OBJECTS) $(libatp_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atp_bufs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atp_close.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atp_open.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atp_packet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atp_rreq.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atp_rresp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atp_rsel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atp_sreq.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atp_sresp.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/atp/atp_rreq.c0000644000175200017500000000602111655731127014602 00000000000000/* * $Id: atp_rreq.c,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include "atp_internals.h" /* wait for a tranasaction service request */ int atp_rreq( ATP ah, /* open atp handle */ struct atp_block *atpb) /* parameter block */ { struct atpbuf *req_buf; /* for receiving request packet */ struct atphdr req_hdr; /* request header overlay */ struct sockaddr_at faddr; /* sender's address */ int recvlen; /* length of received packet */ u_int16_t tid; int rc; u_int8_t func; #ifdef EBUG atp_print_bufuse( ah, "atp_rreq" ); #endif /* EBUG */ while (( rc = atp_rsel( ah, atpb->atp_saddr, ATP_TREQ )) == 0 ) { ; } if ( rc != ATP_TREQ ) { #ifdef EBUG printf( "<%d> atp_rreq: atp_rsel returns err %d\n", getpid(), rc ); #endif /* EBUG */ return( rc ); } /* allocate a buffer for receiving request */ if (( req_buf = atp_alloc_buf()) == NULL ) { return -1; } memcpy( &faddr, atpb->atp_saddr, sizeof( struct sockaddr_at )); func = ATP_TREQ; if (( recvlen = atp_recv_atp( ah, &faddr, &func, ATP_TIDANY, req_buf->atpbuf_info.atpbuf_data, 1 )) < 0 ) { atp_free_buf( req_buf ); return -1; } memcpy( &req_hdr, req_buf->atpbuf_info.atpbuf_data + 1, sizeof( struct atphdr )); tid = ntohs( req_hdr.atphd_tid ); ah->atph_rtid = tid; if (( ah->atph_rxo = req_hdr.atphd_ctrlinfo & ATP_XO ) != 0 ) { ah->atph_rreltime = ATP_RELTIME * ( 1 << ( req_hdr.atphd_ctrlinfo & ATP_TRELMASK )); } memcpy( atpb->atp_saddr, &faddr, sizeof( struct sockaddr_at )); if ( recvlen - ATP_HDRSIZE > atpb->atp_rreqdlen ) { atp_free_buf( req_buf ); errno = EMSGSIZE; return -1; } atpb->atp_rreqdlen = recvlen - ATP_HDRSIZE; memcpy( atpb->atp_rreqdata, req_buf->atpbuf_info.atpbuf_data + ATP_HDRSIZE, recvlen - ATP_HDRSIZE ); atpb->atp_bitmap = req_hdr.atphd_bitmap; atp_free_buf( req_buf ); return( 0 ); } netatalk-2.2.2/libatalk/atp/atp_packet.c0000644000175200017500000002141611655731127015105 00000000000000/* * $Id: atp_packet.c,v 1.6 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include "atp_internals.h" /* FIXME/SOCKLEN_T: socklen_t is a unix98 feature. */ #ifndef SOCKLEN_T #define SOCKLEN_T unsigned int #endif /* ! SOCKLEN_T */ #ifdef EBUG #include static void print_func(u_int8_t ctrlinfo) { switch ( ctrlinfo & ATP_FUNCMASK ) { case ATP_TREQ: printf( "TREQ" ); break; case ATP_TRESP: printf( "TRESP" ); break; case ATP_TREL: printf( "ANY/TREL" ); break; case ATP_TIDANY: printf( "*" ); break; default: printf( "%x", ctrlinfo & ATP_FUNCMASK ); } } static void dump_packet(char *buf, int len) { int i; for ( i = 0; i < len; ++i ) { printf( "%x-%c ", buf[i], buf[i] ); } putchar( '\n' ); } void atp_print_addr(char *s, struct sockaddr_at *saddr) { printf( "%s ", s ); saddr->sat_family == AF_APPLETALK ? printf( "at." ) : printf( "%d.", saddr->sat_family ); saddr->sat_addr.s_net == ATADDR_ANYNET ? printf( "*." ) : printf( "%d.", ntohs( saddr->sat_addr.s_net )); saddr->sat_addr.s_node == ATADDR_ANYNODE ? printf( "*." ) : printf( "%d.", saddr->sat_addr.s_node ); saddr->sat_port == ATADDR_ANYPORT ? printf( "*" ) : printf( "%d", saddr->sat_port ); } #endif /* EBUG */ void atp_build_req_packet( struct atpbuf *pktbuf, u_int16_t tid, u_int8_t ctrl, struct atp_block *atpb ) { struct atphdr hdr; /* fill in the packet fields */ hdr.atphd_ctrlinfo = ctrl; hdr.atphd_bitmap = atpb->atp_bitmap; hdr.atphd_tid = htons( tid ); *(pktbuf->atpbuf_info.atpbuf_data) = DDPTYPE_ATP; memcpy(pktbuf->atpbuf_info.atpbuf_data + 1, &hdr, sizeof( struct atphdr )); memcpy(pktbuf->atpbuf_info.atpbuf_data + ATP_HDRSIZE, atpb->atp_sreqdata, atpb->atp_sreqdlen ); /* set length */ pktbuf->atpbuf_dlen = ATP_HDRSIZE + (size_t) atpb->atp_sreqdlen; } void atp_build_resp_packet( struct atpbuf *pktbuf, u_int16_t tid, u_int8_t ctrl, struct atp_block *atpb, u_int8_t seqnum ) { struct atphdr hdr; /* fill in the packet fields */ *(pktbuf->atpbuf_info.atpbuf_data) = DDPTYPE_ATP; hdr.atphd_ctrlinfo = ctrl; hdr.atphd_bitmap = seqnum; hdr.atphd_tid = htons( tid ); memcpy(pktbuf->atpbuf_info.atpbuf_data + 1, &hdr, sizeof( struct atphdr )); memcpy(pktbuf->atpbuf_info.atpbuf_data + ATP_HDRSIZE, atpb->atp_sresiov[ seqnum ].iov_base, atpb->atp_sresiov[ seqnum ].iov_len ); /* set length */ pktbuf->atpbuf_dlen = ATP_HDRSIZE + (size_t) atpb->atp_sresiov[ seqnum ].iov_len; } int atp_recv_atp( ATP ah, struct sockaddr_at *fromaddr, u_int8_t *func, u_int16_t tid, char *rbuf, int wait ) { /* Receive a packet from address fromaddr of the correct function type and with the correct tid. fromaddr = AT_ANY... and function == ATP_TYPEANY and tid == ATP_TIDANY can be used to wildcard match. recv_atp returns the length of the packet received (or -1 if error) The function code for the packet received is returned in *func (ATP_TREQ or ATP_TRESP). */ struct atpbuf *pq, *cq; struct atphdr ahdr; u_int16_t rfunc; u_int16_t rtid; int i; int dlen = -1; int recvlen; struct sockaddr_at faddr; SOCKLEN_T faddrlen; struct atpbuf *inbuf; tid = htons( tid ); /* first check the queue */ #ifdef EBUG atp_print_bufuse( ah, "recv_atp checking queue" ); #endif /* EBUG */ for ( pq = NULL, cq = ah->atph_queue; cq != NULL; pq = cq, cq = cq->atpbuf_next ) { memcpy(&ahdr, cq->atpbuf_info.atpbuf_data + 1, sizeof( struct atphdr )); rfunc = ahdr.atphd_ctrlinfo & ATP_FUNCMASK; #ifdef EBUG printf( "<%d> checking", getpid()); printf( " tid=%hu func=", ntohs( ahdr.atphd_tid )); print_func( rfunc ); atp_print_addr( " from", &cq->atpbuf_addr ); putchar( '\n' ); #endif /* EBUG */ if ((( tid & ahdr.atphd_tid ) == ahdr.atphd_tid ) && (( *func & rfunc ) == rfunc ) && at_addr_eq( fromaddr, &cq->atpbuf_addr )) { break; } } if ( cq != NULL ) { /* we found one in the queue -- copy to rbuf */ dlen = (int) cq->atpbuf_dlen; *func = rfunc; memcpy( fromaddr, &cq->atpbuf_addr, sizeof( struct sockaddr_at )); memcpy( rbuf, cq->atpbuf_info.atpbuf_data, cq->atpbuf_dlen ); /* remove packet from queue and free buffer */ if ( pq == NULL ) { ah->atph_queue = NULL; } else { pq->atpbuf_next = cq->atpbuf_next; } atp_free_buf( cq ); return( dlen ); } /* we need to get it the net -- call on ddp to receive a packet */ #ifdef EBUG printf( "<%d>", getpid()); atp_print_addr( " waiting on address", &ah->atph_saddr ); printf( "\nfor tid=%hu func=", ntohs( tid )); print_func( *func ); atp_print_addr( " from", fromaddr ); putchar( '\n' ); #endif /* EBUG */ do { #ifdef EBUG fflush( stdout ); #endif /* EBUG */ faddrlen = sizeof( struct sockaddr_at ); memset( &faddr, 0, sizeof( struct sockaddr_at )); if (( recvlen = netddp_recvfrom( ah->atph_socket, rbuf, ATP_BUFSIZ, 0, (struct sockaddr *) &faddr, &faddrlen )) < 0 ) { return -1; } memcpy( &ahdr, rbuf + 1, sizeof( struct atphdr )); if ( recvlen >= ATP_HDRSIZE && *rbuf == DDPTYPE_ATP) { /* this is a valid ATP packet -- check for a match */ rfunc = ahdr.atphd_ctrlinfo & ATP_FUNCMASK; rtid = ahdr.atphd_tid; #ifdef EBUG printf( "<%d> got tid=%hu func=", getpid(), ntohs( rtid )); print_func( rfunc ); atp_print_addr( " from", &faddr ); putchar( '\n' ); bprint( rbuf, recvlen ); #endif /* EBUG */ if ( rfunc == ATP_TREL ) { /* remove response from sent list */ for ( pq = NULL, cq = ah->atph_sent; cq != NULL; pq = cq, cq = cq->atpbuf_next ) { if ( at_addr_eq( &faddr, &cq->atpbuf_addr ) && cq->atpbuf_info.atpbuf_xo.atpxo_tid == ntohs( rtid )) break; } if ( cq != NULL ) { #ifdef EBUG printf( "<%d> releasing transaction %hu\n", getpid(), ntohs( rtid )); #endif /* EBUG */ if ( pq == NULL ) { ah->atph_sent = cq->atpbuf_next; } else { pq->atpbuf_next = cq->atpbuf_next; } for ( i = 0; i < 8; ++i ) { if ( cq->atpbuf_info.atpbuf_xo.atpxo_packet[ i ] != NULL ) { atp_free_buf ( cq->atpbuf_info.atpbuf_xo.atpxo_packet[ i ] ); } } atp_free_buf( cq ); } } else if ((( tid & rtid ) == rtid ) && (( *func & rfunc ) == rfunc ) && at_addr_eq( fromaddr, &faddr )) { /* got what we wanted */ *func = rfunc; dlen = recvlen; memcpy( fromaddr, &faddr, sizeof( struct sockaddr_at )); } else { /* add packet to incoming queue */ #ifdef EBUG printf( "<%d> queuing incoming...\n", getpid() ); #endif /* EBUG */ if (( inbuf = atp_alloc_buf()) == NULL ) { return -1; } memcpy( &inbuf->atpbuf_addr, &faddr, sizeof( struct sockaddr_at )); inbuf->atpbuf_next = ah->atph_queue; inbuf->atpbuf_dlen = (size_t) recvlen; memcpy( inbuf->atpbuf_info.atpbuf_data, rbuf, recvlen ); } } if ( !wait && dlen < 0 ) { return( 0 ); } } while ( dlen < 0 ); return( dlen ); } int at_addr_eq( struct sockaddr_at *paddr, /* primary address */ struct sockaddr_at *saddr) /* secondary address */ { /* compare two atalk addresses -- only check the non-zero fields of paddr against saddr. return zero if not equal, non-zero if equal */ return (( paddr->sat_port == ATADDR_ANYPORT || paddr->sat_port == saddr->sat_port ) && ( paddr->sat_addr.s_net == ATADDR_ANYNET || paddr->sat_addr.s_net == saddr->sat_addr.s_net ) && ( paddr->sat_addr.s_node == ATADDR_ANYNODE || paddr->sat_addr.s_node == saddr->sat_addr.s_node )); } netatalk-2.2.2/libatalk/atp/atp_sreq.c0000644000175200017500000000750711655731127014615 00000000000000/* * $Id: atp_sreq.c,v 1.5 2002-01-17 06:08:55 srittau Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "atp_internals.h" /* * ah: open atp handle * atpb: parameter block * respcount: buffers available for response * flags: ATP_XO, ATP_TREL */ int atp_sreq( ATP ah, struct atp_block *atpb, int respcount, u_int8_t flags ) { struct atpbuf *req_buf; int i; #ifdef EBUG atp_print_bufuse( ah, "atp_sreq" ); #endif /* EBUG */ /* check parameters */ if ( atpb->atp_sreqdlen < 4 || atpb->atp_sreqdlen > ATP_MAXDATA || ( respcount < 0 ) || ( respcount > 8 ) || ( atpb->atp_sreqto < 0 ) || (( atpb->atp_sreqtries < 1 ) && ( atpb->atp_sreqtries != ATP_TRIES_INFINITE ))) { errno = EINVAL; return -1; } /* clean up any packet fragments left from last request */ for ( i = 0; i < 8; ++i ) { if ( ah->atph_resppkt[ i ] != NULL ) { atp_free_buf( ah->atph_resppkt[ i ] ); ah->atph_resppkt[ i ] = NULL; } } /* generate bitmap, tid and ctrlinfo */ atpb->atp_bitmap = ( 1 << respcount ) - 1; /* allocate a new buffer and build request packet */ if (( req_buf = atp_alloc_buf()) == NULL ) { return( -1 ); } atp_build_req_packet( req_buf, ah->atph_tid++, flags | ATP_TREQ, atpb ); memcpy( &req_buf->atpbuf_addr, atpb->atp_saddr, sizeof( struct sockaddr_at )); /* send the initial request */ #ifdef EBUG printf( "\n<%d> atp_sreq: sending a %ld byte packet ", getpid(), req_buf->atpbuf_dlen ); atp_print_addr( " to", atpb->atp_saddr ); putchar( '\n' ); bprint( req_buf->atpbuf_info.atpbuf_data, req_buf->atpbuf_dlen ); #endif /* EBUG */ gettimeofday( &ah->atph_reqtv, (struct timezone *)0 ); #ifdef DROPPACKETS if (( random() % 3 ) != 2 ) { #endif /* DROPPACKETS */ if ( netddp_sendto( ah->atph_socket, req_buf->atpbuf_info.atpbuf_data, req_buf->atpbuf_dlen, 0, (struct sockaddr *) atpb->atp_saddr, sizeof( struct sockaddr_at )) != req_buf->atpbuf_dlen ) { atp_free_buf( req_buf ); return( -1 ); } #ifdef DROPPACKETS } else printf( "<%d> atp_sreq: dropped request\n", getpid() ); #endif /* DROPPACKETS */ if ( atpb->atp_sreqto != 0 ) { if ( ah->atph_reqpkt != NULL ) { atp_free_buf( ah->atph_reqpkt ); } ah->atph_reqto = atpb->atp_sreqto; if ( atpb->atp_sreqtries == ATP_TRIES_INFINITE ) { ah->atph_reqtries = ATP_TRIES_INFINITE; } else { /* we already sent one */ ah->atph_reqtries = atpb->atp_sreqtries - 1; } ah->atph_reqpkt = req_buf; ah->atph_rbitmap = ( 1 << respcount ) - 1; ah->atph_rrespcount = respcount; } else { atp_free_buf( req_buf ); ah->atph_rrespcount = 0; } return( 0 ); } netatalk-2.2.2/libatalk/atp/atp_open.c0000644000175200017500000000425111655731127014575 00000000000000/* * $Id: atp_open.c,v 1.5 2001-08-15 02:17:57 srittau Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include "atp_internals.h" ATP atp_open(u_int8_t port, const struct at_addr *saddr) { struct sockaddr_at addr; int s; ATP atp; struct timeval tv; int pid; #ifdef DEBUG printf( "<%d> atp_open\n", getpid()); #endif /* DEBUG */ memset(&addr, 0, sizeof(addr)); addr.sat_port = port; if (saddr) memcpy(&addr.sat_addr, saddr, sizeof(struct at_addr)); if ((s = netddp_open(&addr, NULL)) < 0) return NULL; if (( atp = (ATP) atp_alloc_buf()) == NULL ) { netddp_close(s); return NULL; } /* initialize the atp handle */ memset(atp, 0, sizeof( struct atp_handle )); memcpy(&atp->atph_saddr, &addr, sizeof(addr)); atp->atph_socket = s; atp->atph_reqto = -1; gettimeofday( &tv, (struct timezone *) 0 ); pid = getpid(); atp->atph_tid = tv.tv_sec ^ ((( pid << 8 ) & 0xff00 ) | ( pid >> 8 )); #ifdef EBUG srandom( tv.tv_sec ); #endif /* EBUG */ return atp; } netatalk-2.2.2/libatalk/atp/atp_bufs.c0000644000175200017500000000626411655731127014601 00000000000000/* * $Id: atp_bufs.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ /* * Our own memory maintenance for atp */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include "atp_internals.h" #define N_MORE_BUFS 10 static struct atpbuf *free_list = NULL; /* free buffers */ #ifdef EBUG static int numbufs = 0; #endif /* EBUG */ /* only call this when the free_list is empty... * N_MORE_BUFS must be >= one */ static int more_bufs(void) { int i; char *mem; struct atpbuf *bp; /* get the whole chunk in one malloc call */ if (( mem = malloc( N_MORE_BUFS * sizeof( struct atpbuf ))) == NULL ) { errno = ENOBUFS; return -1; } /* now split into separate bufs */ bp = free_list = (struct atpbuf *) mem; for ( i = 1; i < N_MORE_BUFS; ++i ) { bp->atpbuf_next = (struct atpbuf *) ( mem += sizeof( struct atpbuf )); bp = bp->atpbuf_next; } bp->atpbuf_next = NULL; return 0; } #ifdef EBUG void atp_print_bufuse(ATP ah, char *s) { struct atpbuf *bp; int i, sentcount, incount, respcount; sentcount = 0; for ( bp = ah->atph_sent; bp != NULL; bp = bp->atpbuf_next ) { ++sentcount; for ( i = 0; i < 8; ++i ) { if ( bp->atpbuf_info.atpbuf_xo.atpxo_packet[ i ] != NULL ) { ++sentcount; } } } if ( ah->atph_reqpkt != NULL ) { ++sentcount; } incount = 0; for ( bp = ah->atph_queue; bp != NULL; bp = bp->atpbuf_next, ++incount ); respcount = 0; for ( i = 0; i < 8; ++i ) { if ( ah->atph_resppkt[ i ] != NULL ) { ++respcount; } } printf( "<%d> %s: bufs total %d sent %d incoming %d req %d resp %d\n", getpid(), s, numbufs, sentcount, incount, ( ah->atph_reqpkt != NULL ) ? 1: 0, respcount ); } #endif /* EBUG */ struct atpbuf *atp_alloc_buf(void) { struct atpbuf *bp; if ( free_list == NULL && more_bufs() ) return NULL; bp = free_list; free_list = free_list->atpbuf_next; #ifdef EBUG ++numbufs; #endif /* EBUG */ return bp; } int atp_free_buf(struct atpbuf *bp) { if ( bp == NULL ) { return -1; } bp->atpbuf_next = free_list; free_list = bp; #ifdef EBUG --numbufs; #endif /* EBUG */ return 0; } netatalk-2.2.2/libatalk/atp/atp_rsel.c0000644000175200017500000002323411655731127014603 00000000000000/* * $Id: atp_rsel.c,v 1.6 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1997 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include "atp_internals.h" #ifdef DROP_ATPTREL static int release_count = 0; #endif /* DROP_ATPTREL */ static int resend_request(ATP ah) { /* * update bitmap and send request packet */ struct atphdr req_hdr; #ifdef EBUG printf( "\n<%d> resend_request: resending %ld byte request packet", getpid(), ah->atph_reqpkt->atpbuf_dlen ); atp_print_addr( " to", &ah->atph_reqpkt->atpbuf_addr ); putchar( '\n' ); bprint( ah->atph_reqpkt->atpbuf_info.atpbuf_data, ah->atph_reqpkt->atpbuf_dlen ); #endif /* EBUG */ memcpy( &req_hdr, ah->atph_reqpkt->atpbuf_info.atpbuf_data + 1, sizeof( struct atphdr )); req_hdr.atphd_bitmap = ah->atph_rbitmap; memcpy( ah->atph_reqpkt->atpbuf_info.atpbuf_data + 1, &req_hdr, sizeof( struct atphdr )); gettimeofday( &ah->atph_reqtv, (struct timezone *)0 ); if ( netddp_sendto( ah->atph_socket, ah->atph_reqpkt->atpbuf_info.atpbuf_data, ah->atph_reqpkt->atpbuf_dlen, 0, (struct sockaddr *) &ah->atph_reqpkt->atpbuf_addr, sizeof( struct sockaddr_at )) != ah->atph_reqpkt->atpbuf_dlen ) { return( -1 ); } if ( ah->atph_reqtries > 0 ) { --(ah->atph_reqtries); } return( 0 ); } int atp_rsel( ATP ah, /* open atp handle */ struct sockaddr_at *faddr, /* address to receive from */ int func) /* which function(s) to wait for; 0 means request or response */ { struct atpbuf *abuf, *pb, *cb; struct atphdr req_hdr, resp_hdr; fd_set fds; int i, recvlen, requesting, mask, c; u_int8_t rfunc; u_int16_t tid; struct timeval tv; struct sockaddr_at saddr; #ifdef EBUG atp_print_bufuse( ah, "atp_rsel at top" ); #endif /* EBUG */ if ( func == 0 ) { func = ATP_FUNCANY; } requesting = ( func & ATP_TRESP ) && ah->atph_rrespcount > 0 && ( ah->atph_reqtries > 0 || ah->atph_reqtries == ATP_TRIES_INFINITE ); if ( requesting && ah->atph_rbitmap == 0 ) { /* * we already have a complete atp response; just return */ return( ATP_TRESP ); } if (( abuf = atp_alloc_buf()) == NULL ) { return( -1 ); } if ( requesting ) { #ifdef EBUG printf( "<%d> atp_rsel: request pending\n", getpid()); #endif /* EBUG */ gettimeofday( &tv, (struct timezone *)0 ); if ( tv.tv_sec - ah->atph_reqtv.tv_sec > ah->atph_reqto ) { if ( resend_request( ah ) < 0 ) { atp_free_buf( abuf ); return( -1 ); } } } for ( ;; ) { rfunc = func; if ( requesting ) { FD_ZERO( &fds ); FD_SET( ah->atph_socket, &fds ); tv.tv_sec = ah->atph_reqto; tv.tv_usec = 0; if (( c = select( ah->atph_socket + 1, &fds, NULL, NULL, &tv )) < 0 ) { atp_free_buf( abuf ); return( -1 ); } if ( c == 0 || FD_ISSET( ah->atph_socket, &fds ) == 0 ) { recvlen = -1; errno = EINTR; goto timeout; } } memcpy( &saddr, faddr, sizeof( struct sockaddr_at )); #ifdef EBUG printf( "<%d> atp_rsel calling recv_atp,", getpid()); atp_print_addr( " accepting from: ", &saddr ); putchar( '\n' ); #endif /* EBUG */ if (( recvlen = atp_recv_atp( ah, &saddr, &rfunc, ATP_TIDANY, abuf->atpbuf_info.atpbuf_data, 0 )) >= 0 ) { break; /* we received something */ } timeout : if ( !requesting || errno != EINTR ) { break; /* error */ } if ( ah->atph_reqtries <= 0 && ah->atph_reqtries != ATP_TRIES_INFINITE ) { errno = ETIMEDOUT; break; } if ( resend_request( ah ) < 0 ) { break; /* error */ } } if ( recvlen <= 0 ) { /* error */ atp_free_buf( abuf ); return( recvlen ); } #ifdef EBUG printf( "<%d> atp_rsel: rcvd %d bytes", getpid(), recvlen ); atp_print_addr( " from: ", &saddr ); putchar( '\n' ); bprint( abuf->atpbuf_info.atpbuf_data, recvlen ); #endif /* EBUG */ abuf->atpbuf_dlen = (size_t) recvlen; memcpy( &resp_hdr, abuf->atpbuf_info.atpbuf_data + 1, sizeof( struct atphdr )); if ( rfunc == ATP_TREQ ) { /* * we got a request: check to see if it is a duplicate (XO) * while we are at it, we expire old XO responses from sent list */ memcpy( &req_hdr, abuf->atpbuf_info.atpbuf_data + 1, sizeof( struct atphdr )); tid = ntohs( req_hdr.atphd_tid ); gettimeofday( &tv, (struct timezone *)0 ); for ( pb = NULL, cb = ah->atph_sent; cb != NULL; pb = cb, cb = cb->atpbuf_next ) { #ifdef EBUG printf( "<%d>", getpid()); atp_print_addr( " examining", &cb->atpbuf_addr ); printf( " %hu", cb->atpbuf_info.atpbuf_xo.atpxo_tid ); atp_print_addr( " (looking for", &saddr ); printf( " %hu)\n", tid ); #endif /* EBUG */ if ( tv.tv_sec - cb->atpbuf_info.atpbuf_xo.atpxo_tv.tv_sec > cb->atpbuf_info.atpbuf_xo.atpxo_reltime ) { /* discard expired response */ #ifdef EBUG printf( "<%d> expiring tid %hu\n", getpid(), cb->atpbuf_info.atpbuf_xo.atpxo_tid ); #endif /* EBUG */ if ( pb == NULL ) { ah->atph_sent = cb->atpbuf_next; } else { pb->atpbuf_next = cb->atpbuf_next; } for ( i = 0; i < 8; ++i ) { if ( cb->atpbuf_info.atpbuf_xo.atpxo_packet[ i ] != NULL ) { atp_free_buf( cb->atpbuf_info.atpbuf_xo.atpxo_packet[ i ] ); } } atp_free_buf( cb ); if (( cb = pb ) == NULL ) break; } else if ( at_addr_eq( &saddr, &cb->atpbuf_addr )) { if ( cb->atpbuf_info.atpbuf_xo.atpxo_tid == tid ) { break; } } } if ( cb != NULL ) { #ifdef EBUG printf( "<%d> duplicate request -- re-sending XO resp\n", getpid()); #endif /* EBUG */ /* matches an old response -- just re-send and reset expire */ cb->atpbuf_info.atpbuf_xo.atpxo_tv = tv; for ( i = 0; i < 8; ++i ) { if ( cb->atpbuf_info.atpbuf_xo.atpxo_packet[i] != NULL && req_hdr.atphd_bitmap & ( 1 << i )) { netddp_sendto( ah->atph_socket, cb->atpbuf_info.atpbuf_xo.atpxo_packet[i]->atpbuf_info.atpbuf_data, cb->atpbuf_info.atpbuf_xo.atpxo_packet[i]->atpbuf_dlen, 0, (struct sockaddr *) &saddr, sizeof( struct sockaddr_at)); } } } if ( cb == NULL ) { /* new request -- queue it and return */ memcpy( &abuf->atpbuf_addr, &saddr, sizeof( struct sockaddr_at )); memcpy( faddr, &saddr, sizeof( struct sockaddr_at )); abuf->atpbuf_next = ah->atph_queue; ah->atph_queue = abuf; return( ATP_TREQ ); } else { atp_free_buf( abuf ); return( 0 ); } } /* * we got a response: update bitmap */ memcpy( &req_hdr, ah->atph_reqpkt->atpbuf_info.atpbuf_data + 1, sizeof( struct atphdr )); if ( requesting && ah->atph_rbitmap & ( 1<atph_rbitmap &= ~( 1<atph_resppkt[ resp_hdr.atphd_bitmap ] != NULL ) { atp_free_buf( ah->atph_resppkt[ resp_hdr.atphd_bitmap ] ); } ah->atph_resppkt[ resp_hdr.atphd_bitmap ] = abuf; /* if End Of Message, clear all higher bitmap bits */ if ( resp_hdr.atphd_ctrlinfo & ATP_EOM ) { #ifdef EBUG printf( "<%d> EOM -- seq num %d current bitmap %d\n", getpid(), resp_hdr.atphd_bitmap, ah->atph_rbitmap ); #endif /* EBUG */ mask = 1 << resp_hdr.atphd_bitmap; ah->atph_rbitmap &= ( mask | (mask-1) ); } /* if Send Trans. Status, send updated request */ if ( resp_hdr.atphd_ctrlinfo & ATP_STS ) { #ifdef EBUG puts( "STS" ); #endif /* EBUG */ req_hdr.atphd_bitmap = ah->atph_rbitmap; memcpy(ah->atph_reqpkt->atpbuf_info.atpbuf_data + 1, &req_hdr, sizeof( struct atphdr )); if ( netddp_sendto( ah->atph_socket, ah->atph_reqpkt->atpbuf_info.atpbuf_data, ah->atph_reqpkt->atpbuf_dlen, 0, (struct sockaddr *) &ah->atph_reqpkt->atpbuf_addr, sizeof( struct sockaddr_at )) != ah->atph_reqpkt->atpbuf_dlen ) { atp_free_buf( abuf ); return( -1 ); } } } else { /* * we are not expecting this response -- toss it */ atp_free_buf( abuf ); #ifdef EBUG printf( "atp_rsel: ignoring resp bm=%x tid=%d (expected %x/%d)\n", resp_hdr.atphd_bitmap, ntohs( resp_hdr.atphd_tid ), ah->atph_rbitmap, ah->atph_tid ); #endif /* EBUG */ } if ( !ah->atph_rbitmap && ( req_hdr.atphd_ctrlinfo & ATP_XO )) { /* * successful completion - send release * the release consists of DDP type byte + ATP header + 4 user bytes */ req_hdr.atphd_ctrlinfo = ATP_TREL; memcpy( ah->atph_reqpkt->atpbuf_info.atpbuf_data + 1, &req_hdr, sizeof( struct atphdr )); memset( ah->atph_reqpkt->atpbuf_info.atpbuf_data + ATP_HDRSIZE, 0, 4 ); ah->atph_reqpkt->atpbuf_dlen = sizeof( struct atphdr ) + ATP_HDRSIZE; #ifdef EBUG printf( "<%d> sending TREL", getpid() ); bprint( ah->atph_reqpkt->atpbuf_info.atpbuf_data, ah->atph_reqpkt->atpbuf_dlen ); #endif /* EBUG */ #ifdef DROP_ATPTREL if (( ++release_count % 10 ) != 0 ) { #endif /* DROP_ATPTREL */ netddp_sendto( ah->atph_socket, ah->atph_reqpkt->atpbuf_info.atpbuf_data, ah->atph_reqpkt->atpbuf_dlen, 0, (struct sockaddr *) &ah->atph_reqpkt->atpbuf_addr, sizeof( struct sockaddr_at)); #ifdef DROP_ATPTREL } #endif /* DROP_ATPTREL */ } if ( ah->atph_rbitmap != 0 ) { if ( ah->atph_reqtries > 0 || ah->atph_reqtries == ATP_TRIES_INFINITE ) { return( 0 ); } else { errno = ETIMEDOUT; return( -1 ); } } memcpy( faddr, &saddr, sizeof( struct sockaddr_at )); return( ATP_TRESP ); } netatalk-2.2.2/libatalk/atp/atp_rresp.c0000644000175200017500000000473111655731127014772 00000000000000/* * $Id: atp_rresp.c,v 1.6 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #ifdef EBUG #include #endif /* EBUG */ #include "atp_internals.h" int atp_rresp( ATP ah, /* open atp handle */ struct atp_block *atpb) /* parameter block */ { int i, rc; size_t len; #ifdef EBUG atp_print_bufuse( ah, "atp_rresp" ); #endif /* EBUG */ /* check parameters */ if ( atpb->atp_rresiovcnt <= 0 || atpb->atp_rresiovcnt > 8 ) { errno = EINVAL; return( -1 ); } while (( rc = atp_rsel( ah, atpb->atp_saddr, ATP_TRESP )) == 0 ) { ; } if ( rc != ATP_TRESP ) { return( rc ); } for ( i = 0; i < 8; ++i ) { if ( ah->atph_resppkt[ i ] == NULL ) { break; } len = ah->atph_resppkt[ i ]->atpbuf_dlen - ATP_HDRSIZE; if ( i > atpb->atp_rresiovcnt - 1 || len > atpb->atp_rresiov[ i ].iov_len ) { errno = EMSGSIZE; return( -1 ); } #ifdef EBUG fprintf( stderr, "atp_rresp copying %ld bytes packet %d\n", len, i ); bprint( (char *)ah->atph_resppkt[ i ]->atpbuf_info.atpbuf_data, len + ATP_HDRSIZE ); #endif /* EBUG */ memcpy(atpb->atp_rresiov[ i ].iov_base, ah->atph_resppkt[ i ]->atpbuf_info.atpbuf_data + ATP_HDRSIZE, len ); atpb->atp_rresiov[ i ].iov_len = len; atp_free_buf( ah->atph_resppkt[ i ] ); ah->atph_resppkt[ i ] = NULL; } atpb->atp_rresiovcnt = i; return( 0 ); } netatalk-2.2.2/libatalk/atp/atp_internals.h0000644000175200017500000000366111655731127015644 00000000000000/* * $Id: atp_internals.h,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef ATP_INTERNALS_H #define ATP_INTERNALS_H 1 #include #include #include #include #include /* * masks for matching incoming packets */ #define ATP_FUNCANY ATP_TREQ | ATP_TRESP | ATP_TREL #define ATP_TIDANY 0xffff /* in atp_bufs.c */ extern struct atpbuf *atp_alloc_buf (void); extern void atp_print_bufuse (ATP, char *); extern int atp_free_buf (struct atpbuf *); /* in atp_packet.c */ extern int at_addr_eq (struct sockaddr_at *, struct sockaddr_at *); extern void atp_build_req_packet (struct atpbuf *, u_int16_t, u_int8_t, struct atp_block *); extern void atp_build_resp_packet (struct atpbuf *, u_int16_t, u_int8_t, struct atp_block *, u_int8_t); extern int atp_recv_atp (ATP, struct sockaddr_at *, u_int8_t *, u_int16_t, char *, int); #ifdef EBUG extern void atp_print_addr (char *, struct sockaddr_at *); #endif /* EBUG */ #endif /* ATP_INTERNALS_H */ netatalk-2.2.2/libatalk/atp/atp_close.c0000644000175200017500000000303311655731127014736 00000000000000/* * $Id: atp_close.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1997 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include "atp_internals.h" #ifdef EBUG #include #endif /* EBUG */ int atp_close(ATP ah) { struct atpbuf *cq; int i; /* remove from list of open atp sockets & discard queued data */ #ifdef EBUG print_bufuse( ah, "atp_close"); #endif /* EBUG */ while ( ah->atph_queue != NULL ) { cq = ah->atph_queue; ah->atph_queue = cq->atpbuf_next; atp_free_buf( cq ); } while ( ah->atph_sent != NULL ) { cq = ah->atph_sent; for ( i = 0; i < 8; ++i ) { if ( cq->atpbuf_info.atpbuf_xo.atpxo_packet[ i ] != NULL ) { atp_free_buf( cq->atpbuf_info.atpbuf_xo.atpxo_packet[ i ] ); } } ah->atph_sent = cq->atpbuf_next; atp_free_buf( cq ); } if ( ah->atph_reqpkt != NULL ) { atp_free_buf( ah->atph_reqpkt ); ah->atph_reqpkt = NULL; } for ( i = 0; i < 8; ++i ) { if ( ah->atph_resppkt[ i ] != NULL ) { atp_free_buf( ah->atph_resppkt[ i ] ); ah->atph_resppkt[ i ] = NULL; } } #ifdef EBUG print_bufuse( ah, "atp_close end"); #endif /* EBUG */ i = ah->atph_socket; atp_free_buf( (struct atpbuf *) ah ); if (netddp_close(i) < 0) return -1; return 0; } netatalk-2.2.2/libatalk/atp/atp_sresp.c0000644000175200017500000001055411655731127014773 00000000000000/* * $Id: atp_sresp.c,v 1.6 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include "atp_internals.h" /* send a transaction response */ int atp_sresp( ATP ah, /* open atp handle */ struct atp_block *atpb) /* parameter block */ { int i; u_int8_t ctrlinfo; struct atpbuf *resp_buf; struct atpbuf *save_buf; /* uninitialized, OK 310105 */ #ifdef EBUG atp_print_bufuse( ah, "atp_sresp" ); #endif /* EBUG */ /* check parameters */ for ( i = atpb->atp_sresiovcnt - 1; i >= 0; --i ) { if ( atpb->atp_sresiov[ i ].iov_len > ATP_MAXDATA ) break; } if ( i >= 0 || atpb->atp_sresiovcnt < 1 || atpb->atp_sresiovcnt > 8 ) { errno = EINVAL; return -1; } /* allocate a new buffer for reponse packet construction */ if (( resp_buf = atp_alloc_buf()) == NULL ) { return -1; } /* send all the response packets * also need to attach list to ah for dup. detection (if XO) */ #ifdef EBUG printf( "<%d> preparing to send %s response tid=%hu ", getpid(), ah->atph_rxo ? "XO" : "", ah->atph_rtid ); atp_print_addr( " to", atpb->atp_saddr ); putchar( '\n' ); #endif /* EBUG */ if ( ah->atph_rxo ) { if (( save_buf = atp_alloc_buf()) == NULL ) { return -1; } for ( i = 0; i < 8; save_buf->atpbuf_info.atpbuf_xo.atpxo_packet[ i++ ] = NULL ); } for ( i = 0; i < atpb->atp_sresiovcnt; ++i ) { ctrlinfo = ATP_TRESP; #ifdef STS_RESPONSES ctrlinfo |= ATP_STS; #endif /* STS_RESPONSES */ if ( i == atpb->atp_sresiovcnt-1 ) { ctrlinfo |= ATP_EOM; } atp_build_resp_packet( resp_buf, ah->atph_rtid, ctrlinfo, atpb, i ); if ( ah->atph_rxo ) { save_buf->atpbuf_info.atpbuf_xo.atpxo_packet[i] = resp_buf; } #ifdef DROPPACKETS if (( random() % 3 ) != 2 ) { #endif /* DROPPACKETS */ #ifdef EBUG printf( "<%d> sending packet tid=%hu serial no.=%d\n", getpid(), ah->atph_rtid, i ); bprint( resp_buf->atpbuf_info.atpbuf_data, resp_buf->atpbuf_dlen ); #endif /* EBUG */ if ( netddp_sendto( ah->atph_socket, resp_buf->atpbuf_info.atpbuf_data, resp_buf->atpbuf_dlen, 0, (struct sockaddr *) atpb->atp_saddr, sizeof( struct sockaddr_at )) != resp_buf->atpbuf_dlen ) { if ( ah->atph_rxo ) { for ( ; i >= 0; --i ) { atp_free_buf( save_buf->atpbuf_info.atpbuf_xo.atpxo_packet[ i ] ); } atp_free_buf( save_buf ); } return -1; } #ifdef DROPPACKETS } else printf( "<%d> atp_sresp: dropped serial no. %d\n", getpid(), i ); #endif /* DROPPACKETS */ /* allocate a buffer for next packet (if XO mode) */ if ( ah->atph_rxo && ( resp_buf = atp_alloc_buf()) == NULL ) { return -1; } } atp_free_buf( resp_buf ); if ( ah->atph_rxo ) { /* record timestamp, tid, release time, and destination address */ gettimeofday( &save_buf->atpbuf_info.atpbuf_xo.atpxo_tv, (struct timezone *) 0 ); save_buf->atpbuf_info.atpbuf_xo.atpxo_tid = ah->atph_rtid; save_buf->atpbuf_info.atpbuf_xo.atpxo_reltime = ah->atph_rreltime; memcpy( &save_buf->atpbuf_addr, atpb->atp_saddr, sizeof( struct sockaddr_at )); /* add to list of packets we have sent */ save_buf->atpbuf_next = ah->atph_sent; ah->atph_sent = save_buf; #ifdef EBUG printf( "<%d> saved XO response\n", getpid()); #endif /* EBUG */ } return 0; } netatalk-2.2.2/libatalk/unicode/0000777000175200017500000000000011704770422013544 500000000000000netatalk-2.2.2/libatalk/unicode/Makefile.am0000644000175200017500000000064611655731127015526 00000000000000# Makefile.am for libatalk/util/ noinst_LTLIBRARIES = libunicode.la AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/sys @ICONV_CFLAGS@ SUBDIRS = charsets LIBUNICODE_DEPS = charsets/libcharsets.la libunicode_la_SOURCES = \ util_unistr.c \ iconv.c \ charcnv.c \ utf8.c \ utf16_case.c libunicode_la_LIBADD = $(LIBUNICODE_DEPS) noinst_HEADERS = utf16_casetable.h precompose.h byteorder.h LIBS=@ICONV_LIBS@ netatalk-2.2.2/libatalk/unicode/Makefile.in0000644000175200017500000005020711703521730015524 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/util/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = libatalk/unicode DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libunicode_la_DEPENDENCIES = $(LIBUNICODE_DEPS) am_libunicode_la_OBJECTS = util_unistr.lo iconv.lo charcnv.lo utf8.lo \ utf16_case.lo libunicode_la_OBJECTS = $(am_libunicode_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libunicode_la_SOURCES) DIST_SOURCES = $(libunicode_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @ICONV_LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libunicode.la AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/sys @ICONV_CFLAGS@ SUBDIRS = charsets LIBUNICODE_DEPS = charsets/libcharsets.la libunicode_la_SOURCES = \ util_unistr.c \ iconv.c \ charcnv.c \ utf8.c \ utf16_case.c libunicode_la_LIBADD = $(LIBUNICODE_DEPS) noinst_HEADERS = utf16_casetable.h precompose.h byteorder.h all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/unicode/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/unicode/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libunicode.la: $(libunicode_la_OBJECTS) $(libunicode_la_DEPENDENCIES) $(LINK) $(libunicode_la_OBJECTS) $(libunicode_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/charcnv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf16_case.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util_unistr.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/unicode/byteorder.h0000644000175200017500000001710011655731127015633 00000000000000/* Unix SMB/CIFS implementation. SMB Byte handling Copyright (C) Andrew Tridgell 1992-1998 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _BYTEORDER_H #define _BYTEORDER_H #include /* This file implements macros for machine independent short and int manipulation Here is a description of this file that I emailed to the samba list once: > I am confused about the way that byteorder.h works in Samba. I have > looked at it, and I would have thought that you might make a distinction > between LE and BE machines, but you only seem to distinguish between 386 > and all other architectures. > > Can you give me a clue? sure. The distinction between 386 and other architectures is only there as an optimisation. You can take it out completely and it will make no difference. The routines (macros) in byteorder.h are totally byteorder independent. The 386 optimsation just takes advantage of the fact that the x86 processors don't care about alignment, so we don't have to align ints on int boundaries etc. If there are other processors out there that aren't alignment sensitive then you could also define CAREFUL_ALIGNMENT=0 on those processors as well. Ok, now to the macros themselves. I'll take a simple example, say we want to extract a 2 byte integer from a SMB packet and put it into a type called uint16 that is in the local machines byte order, and you want to do it with only the assumption that uint16 is _at_least_ 16 bits long (this last condition is very important for architectures that don't have any int types that are 2 bytes long) You do this: #define CVAL(buf,pos) (((unsigned char *)(buf))[pos]) #define PVAL(buf,pos) ((unsigned)CVAL(buf,pos)) #define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8) then to extract a uint16 value at offset 25 in a buffer you do this: char *buffer = foo_bar(); uint16 xx = SVAL(buffer,25); We are using the byteoder independence of the ANSI C bitshifts to do the work. A good optimising compiler should turn this into efficient code, especially if it happens to have the right byteorder :-) I know these macros can be made a bit tidier by removing some of the casts, but you need to look at byteorder.h as a whole to see the reasoning behind them. byteorder.h defines the following macros: SVAL(buf,pos) - extract a 2 byte SMB value IVAL(buf,pos) - extract a 4 byte SMB value SVALS(buf,pos) signed version of SVAL() IVALS(buf,pos) signed version of IVAL() SSVAL(buf,pos,val) - put a 2 byte SMB value into a buffer SIVAL(buf,pos,val) - put a 4 byte SMB value into a buffer SSVALS(buf,pos,val) - signed version of SSVAL() SIVALS(buf,pos,val) - signed version of SIVAL() RSVAL(buf,pos) - like SVAL() but for NMB byte ordering RSVALS(buf,pos) - like SVALS() but for NMB byte ordering RIVAL(buf,pos) - like IVAL() but for NMB byte ordering RIVALS(buf,pos) - like IVALS() but for NMB byte ordering RSSVAL(buf,pos,val) - like SSVAL() but for NMB ordering RSIVAL(buf,pos,val) - like SIVAL() but for NMB ordering RSIVALS(buf,pos,val) - like SIVALS() but for NMB ordering it also defines lots of intermediate macros, just ignore those :-) */ #undef CAREFUL_ALIGNMENT /* we know that the 386 can handle misalignment and has the "right" byteorder */ #ifdef __i386__ #define CAREFUL_ALIGNMENT 0 #endif #ifndef CAREFUL_ALIGNMENT #define CAREFUL_ALIGNMENT 1 #endif #define CVAL(buf,pos) ((unsigned)(((const unsigned char *)(buf))[pos])) #define CVAL_NC(buf,pos) (((unsigned char *)(buf))[pos]) /* Non-const version of CVAL */ #define PVAL(buf,pos) (CVAL(buf,pos)) #define SCVAL(buf,pos,val) (CVAL_NC(buf,pos) = (val)) #if CAREFUL_ALIGNMENT #if BYTE_ORDER==BIG_ENDIAN #define SVAL(buf,pos) (PVAL(buf,(pos)+1)|PVAL(buf,pos)<<8) #define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16) #define SSVALX(buf,pos,val) (CVAL_NC(buf,pos+1)=(unsigned char)((val)&0xFF),CVAL_NC(buf,pos)=(unsigned char)((val)>>8)) #define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16)) #define SVALS(buf,pos) ((int16)SVAL(buf,pos)) #define IVALS(buf,pos) ((int32_t)IVAL(buf,pos)) #define SSVAL(buf,pos,val) SSVALX((buf),(pos),((u_int16_t)(val))) #define SIVAL(buf,pos,val) SIVALX((buf),(pos),((u_int32_t)(val))) #define SSVALS(buf,pos,val) SSVALX((buf),(pos),((int16)(val))) #define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32_t)(val))) #else #define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8) #define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16) #define SSVALX(buf,pos,val) (CVAL_NC(buf,pos)=(unsigned char)((val)&0xFF),CVAL_NC(buf,pos+1)=(unsigned char)((val)>>8)) #define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16)) #define SVALS(buf,pos) ((int16)SVAL(buf,pos)) #define IVALS(buf,pos) ((int32_t)IVAL(buf,pos)) #define SSVAL(buf,pos,val) SSVALX((buf),(pos),((u_int16_t)(val))) #define SIVAL(buf,pos,val) SIVALX((buf),(pos),((u_int32_t)(val))) #define SSVALS(buf,pos,val) SSVALX((buf),(pos),((int16)(val))) #define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32_t)(val))) #endif #else /* CAREFUL_ALIGNMENT */ /* this handles things for architectures like the 386 that can handle alignment errors */ /* WARNING: This section is dependent on the length of int16 and int32 being correct */ /* get single value from an SMB buffer */ #define SVAL(buf,pos) (*(const u_int16_t *)((const char *)(buf) + (pos))) #define SVAL_NC(buf,pos) (*(u_int16_t *)((char *)(buf) + (pos))) /* Non const version of above. */ #define IVAL(buf,pos) (*(const u_int32_t *)((const char *)(buf) + (pos))) #define IVAL_NC(buf,pos) (*(u_int32_t *)((char *)(buf) + (pos))) /* Non const version of above. */ #define SVALS(buf,pos) (*(const int16_t *)((const char *)(buf) + (pos))) #define SVALS_NC(buf,pos) (*(int16 *)((char *)(buf) + (pos))) /* Non const version of above. */ #define IVALS(buf,pos) (*(const int32_t *)((const char *)(buf) + (pos))) #define IVALS_NC(buf,pos) (*(int32_t *)((char *)(buf) + (pos))) /* Non const version of above. */ /* store single value in an SMB buffer */ #define SSVAL(buf,pos,val) SVAL_NC(buf,pos)=((u_int16_t)(val)) #define SIVAL(buf,pos,val) IVAL_NC(buf,pos)=((u_int32_t)(val)) #define SSVALS(buf,pos,val) SVALS_NC(buf,pos)=((int16)(val)) #define SIVALS(buf,pos,val) IVALS_NC(buf,pos)=((int32_t)(val)) #endif /* CAREFUL_ALIGNMENT */ /* now the reverse routines - these are used in nmb packets (mostly) */ #define SREV(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF)) #define IREV(x) ((SREV(x)<<16) | (SREV((x)>>16))) #define RSVAL(buf,pos) SREV(SVAL(buf,pos)) #define RSVALS(buf,pos) SREV(SVALS(buf,pos)) #define RIVAL(buf,pos) IREV(IVAL(buf,pos)) #define RIVALS(buf,pos) IREV(IVALS(buf,pos)) #define RSSVAL(buf,pos,val) SSVAL(buf,pos,SREV(val)) #define RSSVALS(buf,pos,val) SSVALS(buf,pos,SREV(val)) #define RSIVAL(buf,pos,val) SIVAL(buf,pos,IREV(val)) #define RSIVALS(buf,pos,val) SIVALS(buf,pos,IREV(val)) /* Alignment macros. */ #define ALIGN4(p,base) ((p) + ((4 - (PTR_DIFF((p), (base)) & 3)) & 3)) #define ALIGN2(p,base) ((p) + ((2 - (PTR_DIFF((p), (base)) & 1)) & 1)) #endif /* _BYTEORDER_H */ netatalk-2.2.2/libatalk/unicode/utf8.c0000644000175200017500000001545311655731127014526 00000000000000/* Unix SMB/CIFS implementation. minimal iconv implementation Copyright (C) Andrew Tridgell 2001 Copyright (C) Jelmer Vernooij 2002,2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. From samba 3.0 beta and GNU libiconv-1.8 It's bad but most of the time we can't use libc iconv service: - it doesn't round trip for most encoding - it doesn't know about Apple extension */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include "byteorder.h" /* Given a trailing UTF-8 byte, get the contribution from it to * the Unicode scalar value for a particular bit shift amount */ #define GETUCVAL(utf8_trailbyte,shift) ((unsigned int) (( utf8_trailbyte & 0x3F) << shift)) /* Given a unicode scalar, get a trail UTF-8 byte for a particular bit shift amount */ #define GETUTF8TRAILBYTE(uc,shift) ((char)( 0x80 | ((uc >> shift) & 0x3F) ) ) static size_t utf8_pull(void *,char **, size_t *, char **, size_t *); static size_t utf8_push(void *,char **, size_t *, char **, size_t *); struct charset_functions charset_utf8 = { "UTF8", 0x08000103, utf8_pull, utf8_push, CHARSET_VOLUME | CHARSET_MULTIBYTE | CHARSET_PRECOMPOSED, NULL, NULL, NULL }; struct charset_functions charset_utf8_mac = { "UTF8-MAC", 0x08000103, utf8_pull, utf8_push, CHARSET_VOLUME | CHARSET_CLIENT | CHARSET_MULTIBYTE | CHARSET_DECOMPOSED, NULL, NULL, NULL }; /* ------------------- Convert from UTF-8 to UTF-16 -------------------*/ static size_t utf8_pull(void *cd _U_, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { ucs2_t uc = 0; unsigned int codepoint; int len; while (*inbytesleft >= 1 && *outbytesleft >= 2) { unsigned char *c = (unsigned char *)*inbuf; len = 1; /* Arrange conditionals in the order of most frequent occurrence * for users of Latin-based chars */ if ((c[0] & 0x80) == 0) { uc = c[0]; } else if ((c[0] & 0xe0) == 0xc0) { if (*inbytesleft < 2) { LOG(log_debug, logtype_default, "short utf8 char"); goto badseq; } uc = (ucs2_t) (((c[0] & 0x1f) << 6) | GETUCVAL(c[1],0)) ; len = 2; } else if ((c[0] & 0xf0) == 0xe0) { if (*inbytesleft < 3) { LOG(log_debug, logtype_default, "short utf8 char"); goto badseq; } uc = (ucs2_t) (((c[0] & 0x0f) << 12) | GETUCVAL(c[1],6) | GETUCVAL(c[2],0)) ; len = 3; } else if ((c[0] & 0xf8) == 0xf0) { /* 4 bytes, which happens for surrogate pairs only */ if (*inbytesleft < 4) { LOG(log_debug, logtype_default, "short utf8 char"); goto badseq; } if (*outbytesleft < 4) { LOG(log_debug, logtype_default, "short ucs-2 write"); errno = E2BIG; return -1; } codepoint = ((c[0] & 0x07) << 18) | GETUCVAL(c[1],12) | GETUCVAL(c[2],6) | GETUCVAL(c[3],0); SSVAL(*outbuf,0,(((codepoint - 0x10000) >> 10) + 0xD800)); /* hi */ SSVAL(*outbuf,2,(0xDC00 + (codepoint & 0x03FF))); /* low */ len = 4; (*inbuf) += 4; (*inbytesleft) -= 4; (*outbytesleft) -= 4; (*outbuf) += 4; continue; } else { errno = EINVAL; return -1; } SSVAL(*outbuf,0,uc); (*inbuf) += len; (*inbytesleft) -= len; (*outbytesleft) -= 2; (*outbuf) += 2; } if (*inbytesleft > 0) { errno = E2BIG; return -1; } return 0; badseq: errno = EINVAL; return -1; } /* --------------------- Convert from UTF-16 to UTF-8 -----------*/ static size_t utf8_push(void *cd _U_, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { ucs2_t uc=0; ucs2_t hi, low; unsigned int codepoint; int olen, ilen; while (*inbytesleft >= 2 && *outbytesleft >= 1) { unsigned char *c = (unsigned char *)*outbuf; uc = SVAL((*inbuf),0); olen=1; ilen=2; /* Arrange conditionals in the order of most frequent occurrence for users of Latin-based chars */ if (uc < 0x80) { c[0] = uc; } else if (uc < 0x800) { if (*outbytesleft < 2) { LOG(log_debug, logtype_default, "short utf8 write"); goto toobig; } c[1] = GETUTF8TRAILBYTE(uc, 0); c[0] = (char)(0xc0 | ((uc >> 6) & 0x1f)); olen = 2; } else if ( uc >= 0x202a && uc <= 0x202e ) { /* ignore bidi hint characters */ olen = 0; } /* * A 2-byte uc value represents a stand-alone Unicode character if * 0 <= uc < 0xd800 or 0xdfff < uc <= 0xffff. * If 0xd800 <= uc <= 0xdfff, uc itself does not represent a Unicode character. * Rather, it is just part of a surrogate pair. A surrogate pair consists of * a high surrogate in the range [0xd800 ... 0xdbff] and a low surrogate in the * range [0xdc00 ... 0xdfff]. Together the pair maps to a single Unicode character * whose scalar value is 64K or larger. It is this scalar value that is transformed * to UTF-8, not the individual surrogates. * * See www.unicode.org/faq/utf_bom.html for more info. */ else if ( 0xd800 <= uc && uc <= 0xdfff) { /* surrogate - needs 4 bytes from input and 4 bytes for output to UTF-8 */ if (*outbytesleft < 4) { LOG(log_debug, logtype_default, "short utf8 write"); goto toobig; } if (*inbytesleft < 4) { errno = EINVAL; return -1; } hi = SVAL((*inbuf),0); low = SVAL((*inbuf),2); if ( 0xd800 <= hi && hi <= 0xdbff && 0xdc00 <= low && low <= 0xdfff) { codepoint = ((hi - 0xd800) << 10) + (low - 0xdc00) + 0x10000; c[3] = GETUTF8TRAILBYTE(codepoint, 0); c[2] = GETUTF8TRAILBYTE(codepoint, 6); c[1] = GETUTF8TRAILBYTE(codepoint, 12); c[0] = (char)(0xf0 | ((codepoint >> 18) & 0x07)); ilen = olen = 4; } else { /* invalid values for surrogate */ errno = EINVAL; return -1; } } else { if (*outbytesleft < 3) { LOG(log_debug, logtype_default, "short utf8 write"); goto toobig; } c[2] = GETUTF8TRAILBYTE(uc, 0); c[1] = GETUTF8TRAILBYTE(uc, 6); c[0] = (char)(0xe0 | ((uc >> 12) & 0x0f)); olen = 3; } (*inbytesleft) -= ilen; (*outbytesleft) -= olen; (*inbuf) += ilen; (*outbuf) += olen; } if (*inbytesleft == 1) { errno = EINVAL; return -1; } if (*inbytesleft > 1) { errno = E2BIG; return -1; } return 0; toobig: errno = E2BIG; return -1; } netatalk-2.2.2/libatalk/unicode/util_unistr.c0000644000175200017500000004723011700340470016203 00000000000000/******************************************************************* NOTE: The early netatalk 2.x was based on UCS-2. UCS-2 don't support chars above U+10000. Recent netatalk is based on UTF-16. UTF-16 can support chars above U+10000, using Surrogate Pair. However, Surrogate Pair is complex, dirty, filthy and disagreeable. There might still be latent bugs... ********************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include "precompose.h" #include "byteorder.h" /******************************************************************* Convert a string to lower case. return True if any char is converted ********************************************************************/ /* surrogate pair support */ int strlower_w(ucs2_t *s) { int ret = 0; while (*s) { if ((0xD800 <= *s) && (*s < 0xDC00)) { if ((0xDC00 <= s[1]) && (s[1] < 0xE000)) { u_int32_t s_sp = (u_int32_t)*s << 16 | (u_int32_t)s[1]; u_int32_t v_sp = tolower_sp(s_sp); if (v_sp != s_sp) { *s = v_sp >> 16; s++; *s = v_sp & 0xFFFF; ret = 1; } } } else { ucs2_t v = tolower_w(*s); if (v != *s) { *s = v; ret = 1; } } s++; } return ret; } /******************************************************************* Convert a string to upper case. return True if any char is converted ********************************************************************/ /* surrogate pair support */ int strupper_w(ucs2_t *s) { int ret = 0; while (*s) { if ((0xD800 <= *s) && (*s < 0xDC00)) { if ((0xDC00 <= s[1]) && (s[1] < 0xE000)) { u_int32_t s_sp = (u_int32_t)*s << 16 | (u_int32_t)s[1]; u_int32_t v_sp = toupper_sp(s_sp); if (v_sp != s_sp) { *s = v_sp >> 16; s++; *s = v_sp & 0xFFFF; ret = 1; } } } else { ucs2_t v = toupper_w(*s); if (v != *s) { *s = v; ret = 1; } } s++; } return ret; } /******************************************************************* wide & sp islower() determine if a character is lowercase ********************************************************************/ /* These functions are not used. */ int islower_w(ucs2_t c) { return ( c == tolower_w(c)); } int islower_sp(u_int32_t c_sp) { return ( c_sp == tolower_sp(c_sp)); } /******************************************************************* wide & sp isupper() determine if a character is uppercase ********************************************************************/ /* These functions are not used. */ int isupper_w(ucs2_t c) { return ( c == toupper_w(c)); } int isupper_sp(u_int32_t c_sp) { return ( c_sp == toupper_sp(c_sp)); } /******************************************************************* wide strlen() Count the number of characters in a UTF-16 string. ********************************************************************/ /* NOTE: one surrogate pair is two characters. */ size_t strlen_w(const ucs2_t *src) { size_t len; for(len = 0; *src++; len++) ; return len; } /******************************************************************* wide strnlen() Count up to max number of characters in a UTF-16 string. ********************************************************************/ /* NOTE: one surrogate pair is two characters. */ size_t strnlen_w(const ucs2_t *src, size_t max) { size_t len; for(len = 0; *src++ && (len < max); len++) ; return len; } /******************************************************************* wide strchr() ********************************************************************/ /* NOTE: hi and lo of surrogate pair are separately processed. */ ucs2_t *strchr_w(const ucs2_t *s, ucs2_t c) { while (*s != 0) { if (c == *s) return (ucs2_t *)s; s++; } if (c == *s) return (ucs2_t *)s; return NULL; } /******************************************************************* wide & sp strcasechr() ********************************************************************/ /* NOTE: separately process BMP and surrogate pair */ ucs2_t *strcasechr_w(const ucs2_t *s, ucs2_t c) { while (*s != 0) { if (tolower_w(c) == tolower_w(*s)) return (ucs2_t *)s; s++; } if (c == *s) return (ucs2_t *)s; return NULL; } ucs2_t *strcasechr_sp(const ucs2_t *s, u_int32_t c_sp) { if (*s == 0) return NULL; while (s[1] != 0) { if (tolower_sp(c_sp) == tolower_sp((u_int32_t)*s << 16 | (u_int32_t)s[1])) return (ucs2_t *)s; s++; } return NULL; } /******************************************************************* wide strcmp() ********************************************************************/ /* no problem of surrogate pair */ int strcmp_w(const ucs2_t *a, const ucs2_t *b) { while (*b && *a == *b) { a++; b++; } return (*a - *b); /* warning: if *a != *b and both are not 0 we retrun a random greater or lesser than 0 number not realted to which string is longer */ } /******************************************************************* wide strncmp() ********************************************************************/ /* no problem of surrogate pair */ int strncmp_w(const ucs2_t *a, const ucs2_t *b, size_t len) { size_t n = 0; while ((n < len) && *b && *a == *b) { a++; b++; n++;} return (len - n)?(*a - *b):0; } /******************************************************************* wide strstr() ********************************************************************/ /* no problem of surrogate pair */ ucs2_t *strstr_w(const ucs2_t *s, const ucs2_t *ins) { ucs2_t *r; size_t slen, inslen; if (!s || !*s || !ins || !*ins) return NULL; slen = strlen_w(s); inslen = strlen_w(ins); r = (ucs2_t *)s; while ((r = strchr_w(r, *ins))) { if (strncmp_w(r, ins, inslen) == 0) return r; r++; } return NULL; } /******************************************************************* wide strcasestr() ********************************************************************/ /* surrogate pair support */ ucs2_t *strcasestr_w(const ucs2_t *s, const ucs2_t *ins) { ucs2_t *r; size_t slen, inslen; if (!s || !*s || !ins || !*ins) return NULL; slen = strlen_w(s); inslen = strlen_w(ins); r = (ucs2_t *)s; if ((0xD800 <= *ins) && (*ins < 0xDC00)) { if ((0xDC00 <= ins[1]) && (ins[1] < 0xE000)) { u_int32_t ins_sp = (u_int32_t)*ins << 16 | (u_int32_t)ins[1]; while ((r = strcasechr_sp(r, ins_sp))) { if (strncasecmp_w(r, ins, inslen) == 0) return r; r++; } } else { return NULL; /* illegal sequence */ } } else { while ((r = strcasechr_w(r, *ins))) { if (strncasecmp_w(r, ins, inslen) == 0) return r; r++; } } return NULL; } /******************************************************************* wide strcasecmp() case insensitive string comparison ********************************************************************/ /* surrogate pair support */ int strcasecmp_w(const ucs2_t *a, const ucs2_t *b) { int ret; while (*a && *b) { if ((0xD800 <= *a) && (*a < 0xDC00)) { if (ret = tolower_sp((u_int32_t)*a << 16 | (u_int32_t)a[1]) - tolower_sp((u_int32_t)*b << 16 | (u_int32_t)b[1])) return ret; a++; b++; if (!(*a && *b)) return (tolower_w(*a) - tolower_w(*b)); /* avoid buffer over run */ } else { if (ret = tolower_w(*a) - tolower_w(*b)) return ret; } a++; b++; } return (tolower_w(*a) - tolower_w(*b)); } /******************************************************************* wide strncasecmp() case insensitive string comparison, length limited ********************************************************************/ /* NOTE: compare up to 'len+1' if 'len' isolate surrogate pair */ int strncasecmp_w(const ucs2_t *a, const ucs2_t *b, size_t len) { size_t n = 0; int ret; while ((n < len) && *a && *b) { if ((0xD800 <= *a) && (*a < 0xDC00)) { if (ret = tolower_sp((u_int32_t)*a << 16 | (u_int32_t)a[1]) - tolower_sp((u_int32_t)*b << 16 | (u_int32_t)b[1])) return ret; a++; b++; n++; if (!((n < len) && *a && *b)) return (tolower_w(*a) - tolower_w(*b)); } else { if (ret = tolower_w(*a) - tolower_w(*b)) return ret; } a++; b++; n++; } return (len - n)?(tolower_w(*a) - tolower_w(*b)):0; } /******************************************************************* wide strndup() duplicate string ********************************************************************/ /* NOTE: not check isolation of surrogate pair */ /* if len == 0 then duplicate the whole string */ ucs2_t *strndup_w(const ucs2_t *src, size_t len) { ucs2_t *dest; if (!len) len = strlen_w(src); dest = (ucs2_t *)malloc((len + 1) * sizeof(ucs2_t)); if (!dest) { LOG (log_error, logtype_default, "strdup_w: out of memory!"); return NULL; } memcpy(dest, src, len * sizeof(ucs2_t)); dest[len] = 0; return dest; } /******************************************************************* wide strdup() duplicate string ********************************************************************/ /* no problem of surrogate pair */ ucs2_t *strdup_w(const ucs2_t *src) { return strndup_w(src, 0); } /******************************************************************* copy a string with max len ********************************************************************/ /* This function is not used. */ /* NOTE: not check isolation of surrogate pair */ ucs2_t *strncpy_w(ucs2_t *dest, const ucs2_t *src, const size_t max) { size_t len; if (!dest || !src) return NULL; for (len = 0; (src[len] != 0) && (len < max); len++) dest[len] = src[len]; while (len < max) dest[len++] = 0; return dest; } /******************************************************************* append a string of len bytes and add a terminator ********************************************************************/ /* These functions are not used. */ /* NOTE: not check isolation of surrogate pair */ ucs2_t *strncat_w(ucs2_t *dest, const ucs2_t *src, const size_t max) { size_t start; size_t len; if (!dest || !src) return NULL; start = strlen_w(dest); len = strnlen_w(src, max); memcpy(&dest[start], src, len*sizeof(ucs2_t)); dest[start+len] = 0; return dest; } /* no problem of surrogate pair */ ucs2_t *strcat_w(ucs2_t *dest, const ucs2_t *src) { size_t start; size_t len; if (!dest || !src) return NULL; start = strlen_w(dest); len = strlen_w(src); memcpy(&dest[start], src, len*sizeof(ucs2_t)); dest[start+len] = 0; return dest; } /******************************************************************* binary search for pre|decomposition ********************************************************************/ static ucs2_t do_precomposition(unsigned int base, unsigned int comb) { int min = 0; int max = PRECOMP_COUNT - 1; int mid; u_int32_t sought = (base << 16) | comb, that; /* binary search */ while (max >= min) { mid = (min + max) / 2; that = (precompositions[mid].base << 16) | (precompositions[mid].comb); if (that < sought) { min = mid + 1; } else if (that > sought) { max = mid - 1; } else { return precompositions[mid].replacement; } } /* no match */ return 0; } /* ------------------------ */ static u_int32_t do_precomposition_sp(unsigned int base_sp, unsigned int comb_sp) { int min = 0; int max = PRECOMP_SP_COUNT - 1; int mid; u_int64_t sought_sp = ((u_int64_t)base_sp << 32) | (u_int64_t)comb_sp, that_sp; /* binary search */ while (max >= min) { mid = (min + max) / 2; that_sp = ((u_int64_t)precompositions_sp[mid].base_sp << 32) | ((u_int64_t)precompositions_sp[mid].comb_sp); if (that_sp < sought_sp) { min = mid + 1; } else if (that_sp > sought_sp) { max = mid - 1; } else { return precompositions_sp[mid].replacement_sp; } } /* no match */ return 0; } /* -------------------------- */ static u_int32_t do_decomposition(ucs2_t base) { int min = 0; int max = DECOMP_COUNT - 1; int mid; u_int32_t sought = base; u_int32_t result, that; /* binary search */ while (max >= min) { mid = (min + max) / 2; that = decompositions[mid].replacement; if (that < sought) { min = mid + 1; } else if (that > sought) { max = mid - 1; } else { result = (decompositions[mid].base << 16) | (decompositions[mid].comb); return result; } } /* no match */ return 0; } /* -------------------------- */ static u_int64_t do_decomposition_sp(unsigned int base_sp) { int min = 0; int max = DECOMP_SP_COUNT - 1; int mid; u_int32_t sought_sp = base_sp; u_int32_t that_sp; u_int64_t result_sp; /* binary search */ while (max >= min) { mid = (min + max) / 2; that_sp = decompositions_sp[mid].replacement_sp; if (that_sp < sought_sp) { min = mid + 1; } else if (that_sp > sought_sp) { max = mid - 1; } else { result_sp = ((u_int64_t)decompositions_sp[mid].base_sp << 32) | ((u_int64_t)decompositions_sp[mid].comb_sp); return result_sp; } } /* no match */ return 0; } /******************************************************************* pre|decomposition we can't use static, this stuff needs to be reentrant static char comp[MAXPATHLEN +1]; We don't implement Singleton and Canonical Ordering. We ignore CompositionExclusions.txt. because they cause the problem of the roundtrip such as Dancing Icon. exclude U2000-U2FFF, UFE30-UFE4F and U2F800-U2FA1F ranges in precompose.h from composition according to AFP 3.x spec ********************************************************************/ size_t precompose_w (ucs2_t *name, size_t inplen, ucs2_t *comp, size_t *outlen) { size_t i; ucs2_t base, comb; u_int32_t base_sp, comb_sp; ucs2_t *in, *out; ucs2_t lindex, vindex; ucs2_t result; u_int32_t result_sp; size_t o_len = *outlen; if (!inplen || (inplen & 1) || inplen > o_len) return (size_t)-1; i = 0; in = name; out = comp; base = *in; while (*outlen > 2) { i += 2; if (i == inplen) { *out = base; out++; *out = 0; *outlen -= 2; return o_len - *outlen; } in++; comb = *in; result = 0; /* Non-Combination Character */ if (comb < 0x300) ; /* Unicode Standard Annex #15 A10.3 Hangul Composition */ /* Step 1 */ else if ((VBASE <= comb) && (comb <= VBASE + VCOUNT)) { if ((LBASE <= base) && (base < LBASE + LCOUNT)) { result = 1; lindex = base - LBASE; vindex = comb - VBASE; base = SBASE + (lindex * VCOUNT + vindex) * TCOUNT; } } /* Step 2 */ else if ((TBASE < comb) && (comb < TBASE + TCOUNT)) { if ((SBASE <= base) && (base < SBASE + SCOUNT) && (((base - SBASE) % TCOUNT) == 0)) { result = 1; base += comb - TBASE; } } /* Binary Search for Surrogate Pair */ else if ((0xD800 <= base) && (base < 0xDC00)) { if ((0xDC00 <= comb) && (comb < 0xE000) && (i + 6 <= inplen)) { base_sp = ((u_int32_t)base << 16) | (u_int32_t)comb; do { comb_sp = ((u_int32_t)in[1] << 16) | (u_int32_t)in[2]; if (result_sp = do_precomposition_sp(base_sp, comb_sp)) { base_sp = result_sp; i += 4; in +=2; } } while ((i + 6 <= inplen) && result_sp) ; *out = base_sp >> 16; out++; *outlen -= 2; if (*outlen <= 2) { errno = E2BIG; return (size_t)-1; } *out = base_sp & 0xFFFF; out++; *outlen -= 2; i += 2; if (i == inplen) { out++; *out = 0; return o_len - *outlen; } in++; base = *in; result = 1; } } /* Binary Search for BMP */ else if (result = do_precomposition(base, comb)) { base = result; } if (!result) { *out = base; out++; *outlen -= 2; base = comb; } } errno = E2BIG; return (size_t)-1; } /* --------------- */ size_t decompose_w (ucs2_t *name, size_t inplen, ucs2_t *comp, size_t *outlen) { size_t i; size_t comblen; ucs2_t base, comb[COMBBUFLEN]; u_int32_t base_sp; ucs2_t sindex, tjamo; ucs2_t *in, *out; unsigned int result; u_int64_t result_sp; size_t o_len = *outlen; if (!inplen || (inplen & 1)) return (size_t)-1; i = 0; in = name; out = comp; while (i < inplen) { base = *in; comblen = 0; /* check ASCII first. this is frequent. */ if (base <= 0x007f) ; /* Unicode Standard Annex #15 A10.2 Hangul Decomposition */ else if ((SBASE <= base) && (base < SBASE + SCOUNT)) { sindex = base - SBASE; base = LBASE + sindex / NCOUNT; comb[COMBBUFLEN-2] = VBASE + (sindex % NCOUNT) / TCOUNT; /* */ if ((tjamo = TBASE + sindex % TCOUNT) == TBASE) { comb[COMBBUFLEN-1] = comb[COMBBUFLEN-2]; comblen = 1; } /* */ else { comb[COMBBUFLEN-1] = tjamo; comblen = 2; } } /* Binary Search for Surrogate Pair */ else if ((0xD800 <= base) && (base < 0xDC00)) { if (i + 2 < inplen) { base_sp = ((u_int32_t)base << 16) | (u_int32_t)in[1]; do { if ( !(result_sp = do_decomposition_sp(base_sp))) break; comblen += 2; base_sp = result_sp >> 32; comb[COMBBUFLEN-comblen] = (result_sp >> 16) & 0xFFFF; /* hi */ comb[COMBBUFLEN-comblen+1] = result_sp & 0xFFFF; /* lo */ } while (comblen < MAXCOMBSPLEN); if (*outlen < (comblen + 1) << 1) { errno = E2BIG; return (size_t)-1; } *out = base_sp >> 16; /* hi */ out++; *outlen -= 2; base = base_sp & 0xFFFF; /* lo */ i += 2; in++; } } /* Binary Search for BMP */ else { do { if ( !(result = do_decomposition(base))) break; comblen++; base = result >> 16; comb[COMBBUFLEN-comblen] = result & 0xFFFF; } while ((0x007f < base) && (comblen < MAXCOMBLEN)); } if (*outlen < (comblen + 1) << 1) { errno = E2BIG; return (size_t)-1; } *out = base; out++; *outlen -= 2; while ( comblen > 0 ) { *out = comb[COMBBUFLEN-comblen]; out++; *outlen -= 2; comblen--; } i += 2; in++; } *out = 0; return o_len-*outlen; } /******************************************************************* length of UTF-8 character and string ********************************************************************/ size_t utf8_charlen ( char* utf8 ) { unsigned char *p; p = (unsigned char*) utf8; if ( *p < 0x80 ) return (1); else if ( *p > 0xC1 && *p < 0xe0 && *(p+1) > 0x7f && *(p+1) < 0xC0) return (2); else if ( *p == 0xe0 && *(p+1) > 0x9f && *(p+1) < 0xc0 && *(p+2) > 0x7f && *(p+2) < 0xc0) return (3); else if ( *p > 0xe0 && *p < 0xf0 && *(p+1) > 0x7f && *(p+1) < 0xc0 && *(p+2) > 0x7f && *(p+2) < 0xc0) return (3); else if ( *p == 0xf0 && *(p+1) > 0x8f && *(p+1) < 0xc0 && *(p+2) > 0x7f && *(p+2) < 0xc0 && *(p+3) > 0x7f && *(p+3) < 0xc0 ) return (4); else if ( *p > 0xf0 && *p < 0xf4 && *(p+1) > 0x7f && *(p+1) < 0xc0 && *(p+2) > 0x7f && *(p+2) < 0xc0 && *(p+3) > 0x7f && *(p+3) < 0xc0 ) return (4); else if ( *p == 0xf4 && *(p+1) > 0x7f && *(p+1) < 0x90 && *(p+2) > 0x7f && *(p+2) < 0xc0 && *(p+3) > 0x7f && *(p+3) < 0xc0 ) return (4); else return ((size_t) -1); } size_t utf8_strlen_validate ( char * utf8 ) { size_t len; unsigned char *p; p = (unsigned char*) utf8; len = 0; /* see http://www.unicode.org/unicode/reports/tr27/ for an explanation */ while ( *p != '\0') { if ( *p < 0x80 ) p++; else if ( *p > 0xC1 && *p < 0xe0 && *(p+1) > 0x7f && *(p+1) < 0xC0) p += 2; else if ( *p == 0xe0 && *(p+1) > 0x9f && *(p+1) < 0xc0 && *(p+2) > 0x7f && *(p+2) < 0xc0) p += 3; else if ( *p > 0xe0 && *p < 0xf0 && *(p+1) > 0x7f && *(p+1) < 0xc0 && *(p+2) > 0x7f && *(p+2) < 0xc0) p += 3; else if ( *p == 0xf0 && *(p+1) > 0x8f && *(p+1) < 0xc0 && *(p+2) > 0x7f && *(p+2) < 0xc0 && *(p+3) > 0x7f && *(p+3) < 0xc0 ) p += 4; else if ( *p > 0xf0 && *p < 0xf4 && *(p+1) > 0x7f && *(p+1) < 0xc0 && *(p+2) > 0x7f && *(p+2) < 0xc0 && *(p+3) > 0x7f && *(p+3) < 0xc0 ) p += 4; else if ( *p == 0xf4 && *(p+1) > 0x7f && *(p+1) < 0x90 && *(p+2) > 0x7f && *(p+2) < 0xc0 && *(p+3) > 0x7f && *(p+3) < 0xc0 ) p += 4; else return ((size_t) -1); len++; } return (len); } netatalk-2.2.2/libatalk/unicode/utf16_casetable.h0000644000175200017500000067256711655731245016635 00000000000000/* DO NOT EDIT BY HAND!!! This file is generated by contrib/shell_utils/make-casetable.pl UnicodeData.txt utf16_casetable.h utf16_case.c UnicodeData.txt is got from http://www.unicode.org/Public/UNIDATA/UnicodeData.txt */ static const u_int16_t upper_table_1[704] = { 0x0000, /*U+0000*/ /**/ 0x0001, /*U+0001*/ /**/ 0x0002, /*U+0002*/ /**/ 0x0003, /*U+0003*/ /**/ 0x0004, /*U+0004*/ /**/ 0x0005, /*U+0005*/ /**/ 0x0006, /*U+0006*/ /**/ 0x0007, /*U+0007*/ /**/ 0x0008, /*U+0008*/ /**/ 0x0009, /*U+0009*/ /**/ 0x000A, /*U+000A*/ /**/ 0x000B, /*U+000B*/ /**/ 0x000C, /*U+000C*/ /**/ 0x000D, /*U+000D*/ /**/ 0x000E, /*U+000E*/ /**/ 0x000F, /*U+000F*/ /**/ 0x0010, /*U+0010*/ /**/ 0x0011, /*U+0011*/ /**/ 0x0012, /*U+0012*/ /**/ 0x0013, /*U+0013*/ /**/ 0x0014, /*U+0014*/ /**/ 0x0015, /*U+0015*/ /**/ 0x0016, /*U+0016*/ /**/ 0x0017, /*U+0017*/ /**/ 0x0018, /*U+0018*/ /**/ 0x0019, /*U+0019*/ /**/ 0x001A, /*U+001A*/ /**/ 0x001B, /*U+001B*/ /**/ 0x001C, /*U+001C*/ /**/ 0x001D, /*U+001D*/ /**/ 0x001E, /*U+001E*/ /**/ 0x001F, /*U+001F*/ /**/ 0x0020, /*U+0020*/ /**/ 0x0021, /*U+0021*/ /**/ 0x0022, /*U+0022*/ /**/ 0x0023, /*U+0023*/ /**/ 0x0024, /*U+0024*/ /**/ 0x0025, /*U+0025*/ /**/ 0x0026, /*U+0026*/ /**/ 0x0027, /*U+0027*/ /**/ 0x0028, /*U+0028*/ /**/ 0x0029, /*U+0029*/ /**/ 0x002A, /*U+002A*/ /**/ 0x002B, /*U+002B*/ /**/ 0x002C, /*U+002C*/ /**/ 0x002D, /*U+002D*/ /**/ 0x002E, /*U+002E*/ /**/ 0x002F, /*U+002F*/ /**/ 0x0030, /*U+0030*/ /**/ 0x0031, /*U+0031*/ /**/ 0x0032, /*U+0032*/ /**/ 0x0033, /*U+0033*/ /**/ 0x0034, /*U+0034*/ /**/ 0x0035, /*U+0035*/ /**/ 0x0036, /*U+0036*/ /**/ 0x0037, /*U+0037*/ /**/ 0x0038, /*U+0038*/ /**/ 0x0039, /*U+0039*/ /**/ 0x003A, /*U+003A*/ /**/ 0x003B, /*U+003B*/ /**/ 0x003C, /*U+003C*/ /**/ 0x003D, /*U+003D*/ /**/ 0x003E, /*U+003E*/ /**/ 0x003F, /*U+003F*/ /**/ 0x0040, /*U+0040*/ /**/ 0x0041, /*U+0041*/ /**/ 0x0042, /*U+0042*/ /**/ 0x0043, /*U+0043*/ /**/ 0x0044, /*U+0044*/ /**/ 0x0045, /*U+0045*/ /**/ 0x0046, /*U+0046*/ /**/ 0x0047, /*U+0047*/ /**/ 0x0048, /*U+0048*/ /**/ 0x0049, /*U+0049*/ /**/ 0x004A, /*U+004A*/ /**/ 0x004B, /*U+004B*/ /**/ 0x004C, /*U+004C*/ /**/ 0x004D, /*U+004D*/ /**/ 0x004E, /*U+004E*/ /**/ 0x004F, /*U+004F*/ /**/ 0x0050, /*U+0050*/ /**/ 0x0051, /*U+0051*/ /**/ 0x0052, /*U+0052*/ /**/ 0x0053, /*U+0053*/ /**/ 0x0054, /*U+0054*/ /**/ 0x0055, /*U+0055*/ /**/ 0x0056, /*U+0056*/ /**/ 0x0057, /*U+0057*/ /**/ 0x0058, /*U+0058*/ /**/ 0x0059, /*U+0059*/ /**/ 0x005A, /*U+005A*/ /**/ 0x005B, /*U+005B*/ /**/ 0x005C, /*U+005C*/ /**/ 0x005D, /*U+005D*/ /**/ 0x005E, /*U+005E*/ /**/ 0x005F, /*U+005F*/ /**/ 0x0060, /*U+0060*/ /**/ 0x0041, /*U+0061*/ /*LATIN SMALL LETTER A*/ 0x0042, /*U+0062*/ /*LATIN SMALL LETTER B*/ 0x0043, /*U+0063*/ /*LATIN SMALL LETTER C*/ 0x0044, /*U+0064*/ /*LATIN SMALL LETTER D*/ 0x0045, /*U+0065*/ /*LATIN SMALL LETTER E*/ 0x0046, /*U+0066*/ /*LATIN SMALL LETTER F*/ 0x0047, /*U+0067*/ /*LATIN SMALL LETTER G*/ 0x0048, /*U+0068*/ /*LATIN SMALL LETTER H*/ 0x0049, /*U+0069*/ /*LATIN SMALL LETTER I*/ 0x004A, /*U+006A*/ /*LATIN SMALL LETTER J*/ 0x004B, /*U+006B*/ /*LATIN SMALL LETTER K*/ 0x004C, /*U+006C*/ /*LATIN SMALL LETTER L*/ 0x004D, /*U+006D*/ /*LATIN SMALL LETTER M*/ 0x004E, /*U+006E*/ /*LATIN SMALL LETTER N*/ 0x004F, /*U+006F*/ /*LATIN SMALL LETTER O*/ 0x0050, /*U+0070*/ /*LATIN SMALL LETTER P*/ 0x0051, /*U+0071*/ /*LATIN SMALL LETTER Q*/ 0x0052, /*U+0072*/ /*LATIN SMALL LETTER R*/ 0x0053, /*U+0073*/ /*LATIN SMALL LETTER S*/ 0x0054, /*U+0074*/ /*LATIN SMALL LETTER T*/ 0x0055, /*U+0075*/ /*LATIN SMALL LETTER U*/ 0x0056, /*U+0076*/ /*LATIN SMALL LETTER V*/ 0x0057, /*U+0077*/ /*LATIN SMALL LETTER W*/ 0x0058, /*U+0078*/ /*LATIN SMALL LETTER X*/ 0x0059, /*U+0079*/ /*LATIN SMALL LETTER Y*/ 0x005A, /*U+007A*/ /*LATIN SMALL LETTER Z*/ 0x007B, /*U+007B*/ /**/ 0x007C, /*U+007C*/ /**/ 0x007D, /*U+007D*/ /**/ 0x007E, /*U+007E*/ /**/ 0x007F, /*U+007F*/ /**/ 0x0080, /*U+0080*/ /**/ 0x0081, /*U+0081*/ /**/ 0x0082, /*U+0082*/ /**/ 0x0083, /*U+0083*/ /**/ 0x0084, /*U+0084*/ /**/ 0x0085, /*U+0085*/ /**/ 0x0086, /*U+0086*/ /**/ 0x0087, /*U+0087*/ /**/ 0x0088, /*U+0088*/ /**/ 0x0089, /*U+0089*/ /**/ 0x008A, /*U+008A*/ /**/ 0x008B, /*U+008B*/ /**/ 0x008C, /*U+008C*/ /**/ 0x008D, /*U+008D*/ /**/ 0x008E, /*U+008E*/ /**/ 0x008F, /*U+008F*/ /**/ 0x0090, /*U+0090*/ /**/ 0x0091, /*U+0091*/ /**/ 0x0092, /*U+0092*/ /**/ 0x0093, /*U+0093*/ /**/ 0x0094, /*U+0094*/ /**/ 0x0095, /*U+0095*/ /**/ 0x0096, /*U+0096*/ /**/ 0x0097, /*U+0097*/ /**/ 0x0098, /*U+0098*/ /**/ 0x0099, /*U+0099*/ /**/ 0x009A, /*U+009A*/ /**/ 0x009B, /*U+009B*/ /**/ 0x009C, /*U+009C*/ /**/ 0x009D, /*U+009D*/ /**/ 0x009E, /*U+009E*/ /**/ 0x009F, /*U+009F*/ /**/ 0x00A0, /*U+00A0*/ /**/ 0x00A1, /*U+00A1*/ /**/ 0x00A2, /*U+00A2*/ /**/ 0x00A3, /*U+00A3*/ /**/ 0x00A4, /*U+00A4*/ /**/ 0x00A5, /*U+00A5*/ /**/ 0x00A6, /*U+00A6*/ /**/ 0x00A7, /*U+00A7*/ /**/ 0x00A8, /*U+00A8*/ /**/ 0x00A9, /*U+00A9*/ /**/ 0x00AA, /*U+00AA*/ /**/ 0x00AB, /*U+00AB*/ /**/ 0x00AC, /*U+00AC*/ /**/ 0x00AD, /*U+00AD*/ /**/ 0x00AE, /*U+00AE*/ /**/ 0x00AF, /*U+00AF*/ /**/ 0x00B0, /*U+00B0*/ /**/ 0x00B1, /*U+00B1*/ /**/ 0x00B2, /*U+00B2*/ /**/ 0x00B3, /*U+00B3*/ /**/ 0x00B4, /*U+00B4*/ /**/ 0x039C, /*U+00B5*/ /*MICRO SIGN*/ 0x00B6, /*U+00B6*/ /**/ 0x00B7, /*U+00B7*/ /**/ 0x00B8, /*U+00B8*/ /**/ 0x00B9, /*U+00B9*/ /**/ 0x00BA, /*U+00BA*/ /**/ 0x00BB, /*U+00BB*/ /**/ 0x00BC, /*U+00BC*/ /**/ 0x00BD, /*U+00BD*/ /**/ 0x00BE, /*U+00BE*/ /**/ 0x00BF, /*U+00BF*/ /**/ 0x00C0, /*U+00C0*/ /**/ 0x00C1, /*U+00C1*/ /**/ 0x00C2, /*U+00C2*/ /**/ 0x00C3, /*U+00C3*/ /**/ 0x00C4, /*U+00C4*/ /**/ 0x00C5, /*U+00C5*/ /**/ 0x00C6, /*U+00C6*/ /**/ 0x00C7, /*U+00C7*/ /**/ 0x00C8, /*U+00C8*/ /**/ 0x00C9, /*U+00C9*/ /**/ 0x00CA, /*U+00CA*/ /**/ 0x00CB, /*U+00CB*/ /**/ 0x00CC, /*U+00CC*/ /**/ 0x00CD, /*U+00CD*/ /**/ 0x00CE, /*U+00CE*/ /**/ 0x00CF, /*U+00CF*/ /**/ 0x00D0, /*U+00D0*/ /**/ 0x00D1, /*U+00D1*/ /**/ 0x00D2, /*U+00D2*/ /**/ 0x00D3, /*U+00D3*/ /**/ 0x00D4, /*U+00D4*/ /**/ 0x00D5, /*U+00D5*/ /**/ 0x00D6, /*U+00D6*/ /**/ 0x00D7, /*U+00D7*/ /**/ 0x00D8, /*U+00D8*/ /**/ 0x00D9, /*U+00D9*/ /**/ 0x00DA, /*U+00DA*/ /**/ 0x00DB, /*U+00DB*/ /**/ 0x00DC, /*U+00DC*/ /**/ 0x00DD, /*U+00DD*/ /**/ 0x00DE, /*U+00DE*/ /**/ 0x00DF, /*U+00DF*/ /**/ 0x00C0, /*U+00E0*/ /*LATIN SMALL LETTER A WITH GRAVE*/ 0x00C1, /*U+00E1*/ /*LATIN SMALL LETTER A WITH ACUTE*/ 0x00C2, /*U+00E2*/ /*LATIN SMALL LETTER A WITH CIRCUMFLEX*/ 0x00C3, /*U+00E3*/ /*LATIN SMALL LETTER A WITH TILDE*/ 0x00C4, /*U+00E4*/ /*LATIN SMALL LETTER A WITH DIAERESIS*/ 0x00C5, /*U+00E5*/ /*LATIN SMALL LETTER A WITH RING ABOVE*/ 0x00C6, /*U+00E6*/ /*LATIN SMALL LETTER AE*/ 0x00C7, /*U+00E7*/ /*LATIN SMALL LETTER C WITH CEDILLA*/ 0x00C8, /*U+00E8*/ /*LATIN SMALL LETTER E WITH GRAVE*/ 0x00C9, /*U+00E9*/ /*LATIN SMALL LETTER E WITH ACUTE*/ 0x00CA, /*U+00EA*/ /*LATIN SMALL LETTER E WITH CIRCUMFLEX*/ 0x00CB, /*U+00EB*/ /*LATIN SMALL LETTER E WITH DIAERESIS*/ 0x00CC, /*U+00EC*/ /*LATIN SMALL LETTER I WITH GRAVE*/ 0x00CD, /*U+00ED*/ /*LATIN SMALL LETTER I WITH ACUTE*/ 0x00CE, /*U+00EE*/ /*LATIN SMALL LETTER I WITH CIRCUMFLEX*/ 0x00CF, /*U+00EF*/ /*LATIN SMALL LETTER I WITH DIAERESIS*/ 0x00D0, /*U+00F0*/ /*LATIN SMALL LETTER ETH*/ 0x00D1, /*U+00F1*/ /*LATIN SMALL LETTER N WITH TILDE*/ 0x00D2, /*U+00F2*/ /*LATIN SMALL LETTER O WITH GRAVE*/ 0x00D3, /*U+00F3*/ /*LATIN SMALL LETTER O WITH ACUTE*/ 0x00D4, /*U+00F4*/ /*LATIN SMALL LETTER O WITH CIRCUMFLEX*/ 0x00D5, /*U+00F5*/ /*LATIN SMALL LETTER O WITH TILDE*/ 0x00D6, /*U+00F6*/ /*LATIN SMALL LETTER O WITH DIAERESIS*/ 0x00F7, /*U+00F7*/ /**/ 0x00D8, /*U+00F8*/ /*LATIN SMALL LETTER O WITH STROKE*/ 0x00D9, /*U+00F9*/ /*LATIN SMALL LETTER U WITH GRAVE*/ 0x00DA, /*U+00FA*/ /*LATIN SMALL LETTER U WITH ACUTE*/ 0x00DB, /*U+00FB*/ /*LATIN SMALL LETTER U WITH CIRCUMFLEX*/ 0x00DC, /*U+00FC*/ /*LATIN SMALL LETTER U WITH DIAERESIS*/ 0x00DD, /*U+00FD*/ /*LATIN SMALL LETTER Y WITH ACUTE*/ 0x00DE, /*U+00FE*/ /*LATIN SMALL LETTER THORN*/ 0x0178, /*U+00FF*/ /*LATIN SMALL LETTER Y WITH DIAERESIS*/ 0x0100, /*U+0100*/ /**/ 0x0100, /*U+0101*/ /*LATIN SMALL LETTER A WITH MACRON*/ 0x0102, /*U+0102*/ /**/ 0x0102, /*U+0103*/ /*LATIN SMALL LETTER A WITH BREVE*/ 0x0104, /*U+0104*/ /**/ 0x0104, /*U+0105*/ /*LATIN SMALL LETTER A WITH OGONEK*/ 0x0106, /*U+0106*/ /**/ 0x0106, /*U+0107*/ /*LATIN SMALL LETTER C WITH ACUTE*/ 0x0108, /*U+0108*/ /**/ 0x0108, /*U+0109*/ /*LATIN SMALL LETTER C WITH CIRCUMFLEX*/ 0x010A, /*U+010A*/ /**/ 0x010A, /*U+010B*/ /*LATIN SMALL LETTER C WITH DOT ABOVE*/ 0x010C, /*U+010C*/ /**/ 0x010C, /*U+010D*/ /*LATIN SMALL LETTER C WITH CARON*/ 0x010E, /*U+010E*/ /**/ 0x010E, /*U+010F*/ /*LATIN SMALL LETTER D WITH CARON*/ 0x0110, /*U+0110*/ /**/ 0x0110, /*U+0111*/ /*LATIN SMALL LETTER D WITH STROKE*/ 0x0112, /*U+0112*/ /**/ 0x0112, /*U+0113*/ /*LATIN SMALL LETTER E WITH MACRON*/ 0x0114, /*U+0114*/ /**/ 0x0114, /*U+0115*/ /*LATIN SMALL LETTER E WITH BREVE*/ 0x0116, /*U+0116*/ /**/ 0x0116, /*U+0117*/ /*LATIN SMALL LETTER E WITH DOT ABOVE*/ 0x0118, /*U+0118*/ /**/ 0x0118, /*U+0119*/ /*LATIN SMALL LETTER E WITH OGONEK*/ 0x011A, /*U+011A*/ /**/ 0x011A, /*U+011B*/ /*LATIN SMALL LETTER E WITH CARON*/ 0x011C, /*U+011C*/ /**/ 0x011C, /*U+011D*/ /*LATIN SMALL LETTER G WITH CIRCUMFLEX*/ 0x011E, /*U+011E*/ /**/ 0x011E, /*U+011F*/ /*LATIN SMALL LETTER G WITH BREVE*/ 0x0120, /*U+0120*/ /**/ 0x0120, /*U+0121*/ /*LATIN SMALL LETTER G WITH DOT ABOVE*/ 0x0122, /*U+0122*/ /**/ 0x0122, /*U+0123*/ /*LATIN SMALL LETTER G WITH CEDILLA*/ 0x0124, /*U+0124*/ /**/ 0x0124, /*U+0125*/ /*LATIN SMALL LETTER H WITH CIRCUMFLEX*/ 0x0126, /*U+0126*/ /**/ 0x0126, /*U+0127*/ /*LATIN SMALL LETTER H WITH STROKE*/ 0x0128, /*U+0128*/ /**/ 0x0128, /*U+0129*/ /*LATIN SMALL LETTER I WITH TILDE*/ 0x012A, /*U+012A*/ /**/ 0x012A, /*U+012B*/ /*LATIN SMALL LETTER I WITH MACRON*/ 0x012C, /*U+012C*/ /**/ 0x012C, /*U+012D*/ /*LATIN SMALL LETTER I WITH BREVE*/ 0x012E, /*U+012E*/ /**/ 0x012E, /*U+012F*/ /*LATIN SMALL LETTER I WITH OGONEK*/ 0x0130, /*U+0130*/ /**/ 0x0049, /*U+0131*/ /*LATIN SMALL LETTER DOTLESS I*/ 0x0132, /*U+0132*/ /**/ 0x0132, /*U+0133*/ /*LATIN SMALL LIGATURE IJ*/ 0x0134, /*U+0134*/ /**/ 0x0134, /*U+0135*/ /*LATIN SMALL LETTER J WITH CIRCUMFLEX*/ 0x0136, /*U+0136*/ /**/ 0x0136, /*U+0137*/ /*LATIN SMALL LETTER K WITH CEDILLA*/ 0x0138, /*U+0138*/ /**/ 0x0139, /*U+0139*/ /**/ 0x0139, /*U+013A*/ /*LATIN SMALL LETTER L WITH ACUTE*/ 0x013B, /*U+013B*/ /**/ 0x013B, /*U+013C*/ /*LATIN SMALL LETTER L WITH CEDILLA*/ 0x013D, /*U+013D*/ /**/ 0x013D, /*U+013E*/ /*LATIN SMALL LETTER L WITH CARON*/ 0x013F, /*U+013F*/ /**/ 0x013F, /*U+0140*/ /*LATIN SMALL LETTER L WITH MIDDLE DOT*/ 0x0141, /*U+0141*/ /**/ 0x0141, /*U+0142*/ /*LATIN SMALL LETTER L WITH STROKE*/ 0x0143, /*U+0143*/ /**/ 0x0143, /*U+0144*/ /*LATIN SMALL LETTER N WITH ACUTE*/ 0x0145, /*U+0145*/ /**/ 0x0145, /*U+0146*/ /*LATIN SMALL LETTER N WITH CEDILLA*/ 0x0147, /*U+0147*/ /**/ 0x0147, /*U+0148*/ /*LATIN SMALL LETTER N WITH CARON*/ 0x0149, /*U+0149*/ /**/ 0x014A, /*U+014A*/ /**/ 0x014A, /*U+014B*/ /*LATIN SMALL LETTER ENG*/ 0x014C, /*U+014C*/ /**/ 0x014C, /*U+014D*/ /*LATIN SMALL LETTER O WITH MACRON*/ 0x014E, /*U+014E*/ /**/ 0x014E, /*U+014F*/ /*LATIN SMALL LETTER O WITH BREVE*/ 0x0150, /*U+0150*/ /**/ 0x0150, /*U+0151*/ /*LATIN SMALL LETTER O WITH DOUBLE ACUTE*/ 0x0152, /*U+0152*/ /**/ 0x0152, /*U+0153*/ /*LATIN SMALL LIGATURE OE*/ 0x0154, /*U+0154*/ /**/ 0x0154, /*U+0155*/ /*LATIN SMALL LETTER R WITH ACUTE*/ 0x0156, /*U+0156*/ /**/ 0x0156, /*U+0157*/ /*LATIN SMALL LETTER R WITH CEDILLA*/ 0x0158, /*U+0158*/ /**/ 0x0158, /*U+0159*/ /*LATIN SMALL LETTER R WITH CARON*/ 0x015A, /*U+015A*/ /**/ 0x015A, /*U+015B*/ /*LATIN SMALL LETTER S WITH ACUTE*/ 0x015C, /*U+015C*/ /**/ 0x015C, /*U+015D*/ /*LATIN SMALL LETTER S WITH CIRCUMFLEX*/ 0x015E, /*U+015E*/ /**/ 0x015E, /*U+015F*/ /*LATIN SMALL LETTER S WITH CEDILLA*/ 0x0160, /*U+0160*/ /**/ 0x0160, /*U+0161*/ /*LATIN SMALL LETTER S WITH CARON*/ 0x0162, /*U+0162*/ /**/ 0x0162, /*U+0163*/ /*LATIN SMALL LETTER T WITH CEDILLA*/ 0x0164, /*U+0164*/ /**/ 0x0164, /*U+0165*/ /*LATIN SMALL LETTER T WITH CARON*/ 0x0166, /*U+0166*/ /**/ 0x0166, /*U+0167*/ /*LATIN SMALL LETTER T WITH STROKE*/ 0x0168, /*U+0168*/ /**/ 0x0168, /*U+0169*/ /*LATIN SMALL LETTER U WITH TILDE*/ 0x016A, /*U+016A*/ /**/ 0x016A, /*U+016B*/ /*LATIN SMALL LETTER U WITH MACRON*/ 0x016C, /*U+016C*/ /**/ 0x016C, /*U+016D*/ /*LATIN SMALL LETTER U WITH BREVE*/ 0x016E, /*U+016E*/ /**/ 0x016E, /*U+016F*/ /*LATIN SMALL LETTER U WITH RING ABOVE*/ 0x0170, /*U+0170*/ /**/ 0x0170, /*U+0171*/ /*LATIN SMALL LETTER U WITH DOUBLE ACUTE*/ 0x0172, /*U+0172*/ /**/ 0x0172, /*U+0173*/ /*LATIN SMALL LETTER U WITH OGONEK*/ 0x0174, /*U+0174*/ /**/ 0x0174, /*U+0175*/ /*LATIN SMALL LETTER W WITH CIRCUMFLEX*/ 0x0176, /*U+0176*/ /**/ 0x0176, /*U+0177*/ /*LATIN SMALL LETTER Y WITH CIRCUMFLEX*/ 0x0178, /*U+0178*/ /**/ 0x0179, /*U+0179*/ /**/ 0x0179, /*U+017A*/ /*LATIN SMALL LETTER Z WITH ACUTE*/ 0x017B, /*U+017B*/ /**/ 0x017B, /*U+017C*/ /*LATIN SMALL LETTER Z WITH DOT ABOVE*/ 0x017D, /*U+017D*/ /**/ 0x017D, /*U+017E*/ /*LATIN SMALL LETTER Z WITH CARON*/ 0x0053, /*U+017F*/ /*LATIN SMALL LETTER LONG S*/ 0x0243, /*U+0180*/ /*LATIN SMALL LETTER B WITH STROKE*/ 0x0181, /*U+0181*/ /**/ 0x0182, /*U+0182*/ /**/ 0x0182, /*U+0183*/ /*LATIN SMALL LETTER B WITH TOPBAR*/ 0x0184, /*U+0184*/ /**/ 0x0184, /*U+0185*/ /*LATIN SMALL LETTER TONE SIX*/ 0x0186, /*U+0186*/ /**/ 0x0187, /*U+0187*/ /**/ 0x0187, /*U+0188*/ /*LATIN SMALL LETTER C WITH HOOK*/ 0x0189, /*U+0189*/ /**/ 0x018A, /*U+018A*/ /**/ 0x018B, /*U+018B*/ /**/ 0x018B, /*U+018C*/ /*LATIN SMALL LETTER D WITH TOPBAR*/ 0x018D, /*U+018D*/ /**/ 0x018E, /*U+018E*/ /**/ 0x018F, /*U+018F*/ /**/ 0x0190, /*U+0190*/ /**/ 0x0191, /*U+0191*/ /**/ 0x0191, /*U+0192*/ /*LATIN SMALL LETTER F WITH HOOK*/ 0x0193, /*U+0193*/ /**/ 0x0194, /*U+0194*/ /**/ 0x01F6, /*U+0195*/ /*LATIN SMALL LETTER HV*/ 0x0196, /*U+0196*/ /**/ 0x0197, /*U+0197*/ /**/ 0x0198, /*U+0198*/ /**/ 0x0198, /*U+0199*/ /*LATIN SMALL LETTER K WITH HOOK*/ 0x023D, /*U+019A*/ /*LATIN SMALL LETTER L WITH BAR*/ 0x019B, /*U+019B*/ /**/ 0x019C, /*U+019C*/ /**/ 0x019D, /*U+019D*/ /**/ 0x0220, /*U+019E*/ /*LATIN SMALL LETTER N WITH LONG RIGHT LEG*/ 0x019F, /*U+019F*/ /**/ 0x01A0, /*U+01A0*/ /**/ 0x01A0, /*U+01A1*/ /*LATIN SMALL LETTER O WITH HORN*/ 0x01A2, /*U+01A2*/ /**/ 0x01A2, /*U+01A3*/ /*LATIN SMALL LETTER OI*/ 0x01A4, /*U+01A4*/ /**/ 0x01A4, /*U+01A5*/ /*LATIN SMALL LETTER P WITH HOOK*/ 0x01A6, /*U+01A6*/ /**/ 0x01A7, /*U+01A7*/ /**/ 0x01A7, /*U+01A8*/ /*LATIN SMALL LETTER TONE TWO*/ 0x01A9, /*U+01A9*/ /**/ 0x01AA, /*U+01AA*/ /**/ 0x01AB, /*U+01AB*/ /**/ 0x01AC, /*U+01AC*/ /**/ 0x01AC, /*U+01AD*/ /*LATIN SMALL LETTER T WITH HOOK*/ 0x01AE, /*U+01AE*/ /**/ 0x01AF, /*U+01AF*/ /**/ 0x01AF, /*U+01B0*/ /*LATIN SMALL LETTER U WITH HORN*/ 0x01B1, /*U+01B1*/ /**/ 0x01B2, /*U+01B2*/ /**/ 0x01B3, /*U+01B3*/ /**/ 0x01B3, /*U+01B4*/ /*LATIN SMALL LETTER Y WITH HOOK*/ 0x01B5, /*U+01B5*/ /**/ 0x01B5, /*U+01B6*/ /*LATIN SMALL LETTER Z WITH STROKE*/ 0x01B7, /*U+01B7*/ /**/ 0x01B8, /*U+01B8*/ /**/ 0x01B8, /*U+01B9*/ /*LATIN SMALL LETTER EZH REVERSED*/ 0x01BA, /*U+01BA*/ /**/ 0x01BB, /*U+01BB*/ /**/ 0x01BC, /*U+01BC*/ /**/ 0x01BC, /*U+01BD*/ /*LATIN SMALL LETTER TONE FIVE*/ 0x01BE, /*U+01BE*/ /**/ 0x01F7, /*U+01BF*/ /*LATIN LETTER WYNN*/ 0x01C0, /*U+01C0*/ /**/ 0x01C1, /*U+01C1*/ /**/ 0x01C2, /*U+01C2*/ /**/ 0x01C3, /*U+01C3*/ /**/ 0x01C4, /*U+01C4*/ /**/ 0x01C4, /*U+01C5*/ /*LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON*/ 0x01C4, /*U+01C6*/ /*LATIN SMALL LETTER DZ WITH CARON*/ 0x01C7, /*U+01C7*/ /**/ 0x01C7, /*U+01C8*/ /*LATIN CAPITAL LETTER L WITH SMALL LETTER J*/ 0x01C7, /*U+01C9*/ /*LATIN SMALL LETTER LJ*/ 0x01CA, /*U+01CA*/ /**/ 0x01CA, /*U+01CB*/ /*LATIN CAPITAL LETTER N WITH SMALL LETTER J*/ 0x01CA, /*U+01CC*/ /*LATIN SMALL LETTER NJ*/ 0x01CD, /*U+01CD*/ /**/ 0x01CD, /*U+01CE*/ /*LATIN SMALL LETTER A WITH CARON*/ 0x01CF, /*U+01CF*/ /**/ 0x01CF, /*U+01D0*/ /*LATIN SMALL LETTER I WITH CARON*/ 0x01D1, /*U+01D1*/ /**/ 0x01D1, /*U+01D2*/ /*LATIN SMALL LETTER O WITH CARON*/ 0x01D3, /*U+01D3*/ /**/ 0x01D3, /*U+01D4*/ /*LATIN SMALL LETTER U WITH CARON*/ 0x01D5, /*U+01D5*/ /**/ 0x01D5, /*U+01D6*/ /*LATIN SMALL LETTER U WITH DIAERESIS AND MACRON*/ 0x01D7, /*U+01D7*/ /**/ 0x01D7, /*U+01D8*/ /*LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE*/ 0x01D9, /*U+01D9*/ /**/ 0x01D9, /*U+01DA*/ /*LATIN SMALL LETTER U WITH DIAERESIS AND CARON*/ 0x01DB, /*U+01DB*/ /**/ 0x01DB, /*U+01DC*/ /*LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE*/ 0x018E, /*U+01DD*/ /*LATIN SMALL LETTER TURNED E*/ 0x01DE, /*U+01DE*/ /**/ 0x01DE, /*U+01DF*/ /*LATIN SMALL LETTER A WITH DIAERESIS AND MACRON*/ 0x01E0, /*U+01E0*/ /**/ 0x01E0, /*U+01E1*/ /*LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON*/ 0x01E2, /*U+01E2*/ /**/ 0x01E2, /*U+01E3*/ /*LATIN SMALL LETTER AE WITH MACRON*/ 0x01E4, /*U+01E4*/ /**/ 0x01E4, /*U+01E5*/ /*LATIN SMALL LETTER G WITH STROKE*/ 0x01E6, /*U+01E6*/ /**/ 0x01E6, /*U+01E7*/ /*LATIN SMALL LETTER G WITH CARON*/ 0x01E8, /*U+01E8*/ /**/ 0x01E8, /*U+01E9*/ /*LATIN SMALL LETTER K WITH CARON*/ 0x01EA, /*U+01EA*/ /**/ 0x01EA, /*U+01EB*/ /*LATIN SMALL LETTER O WITH OGONEK*/ 0x01EC, /*U+01EC*/ /**/ 0x01EC, /*U+01ED*/ /*LATIN SMALL LETTER O WITH OGONEK AND MACRON*/ 0x01EE, /*U+01EE*/ /**/ 0x01EE, /*U+01EF*/ /*LATIN SMALL LETTER EZH WITH CARON*/ 0x01F0, /*U+01F0*/ /**/ 0x01F1, /*U+01F1*/ /**/ 0x01F1, /*U+01F2*/ /*LATIN CAPITAL LETTER D WITH SMALL LETTER Z*/ 0x01F1, /*U+01F3*/ /*LATIN SMALL LETTER DZ*/ 0x01F4, /*U+01F4*/ /**/ 0x01F4, /*U+01F5*/ /*LATIN SMALL LETTER G WITH ACUTE*/ 0x01F6, /*U+01F6*/ /**/ 0x01F7, /*U+01F7*/ /**/ 0x01F8, /*U+01F8*/ /**/ 0x01F8, /*U+01F9*/ /*LATIN SMALL LETTER N WITH GRAVE*/ 0x01FA, /*U+01FA*/ /**/ 0x01FA, /*U+01FB*/ /*LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE*/ 0x01FC, /*U+01FC*/ /**/ 0x01FC, /*U+01FD*/ /*LATIN SMALL LETTER AE WITH ACUTE*/ 0x01FE, /*U+01FE*/ /**/ 0x01FE, /*U+01FF*/ /*LATIN SMALL LETTER O WITH STROKE AND ACUTE*/ 0x0200, /*U+0200*/ /**/ 0x0200, /*U+0201*/ /*LATIN SMALL LETTER A WITH DOUBLE GRAVE*/ 0x0202, /*U+0202*/ /**/ 0x0202, /*U+0203*/ /*LATIN SMALL LETTER A WITH INVERTED BREVE*/ 0x0204, /*U+0204*/ /**/ 0x0204, /*U+0205*/ /*LATIN SMALL LETTER E WITH DOUBLE GRAVE*/ 0x0206, /*U+0206*/ /**/ 0x0206, /*U+0207*/ /*LATIN SMALL LETTER E WITH INVERTED BREVE*/ 0x0208, /*U+0208*/ /**/ 0x0208, /*U+0209*/ /*LATIN SMALL LETTER I WITH DOUBLE GRAVE*/ 0x020A, /*U+020A*/ /**/ 0x020A, /*U+020B*/ /*LATIN SMALL LETTER I WITH INVERTED BREVE*/ 0x020C, /*U+020C*/ /**/ 0x020C, /*U+020D*/ /*LATIN SMALL LETTER O WITH DOUBLE GRAVE*/ 0x020E, /*U+020E*/ /**/ 0x020E, /*U+020F*/ /*LATIN SMALL LETTER O WITH INVERTED BREVE*/ 0x0210, /*U+0210*/ /**/ 0x0210, /*U+0211*/ /*LATIN SMALL LETTER R WITH DOUBLE GRAVE*/ 0x0212, /*U+0212*/ /**/ 0x0212, /*U+0213*/ /*LATIN SMALL LETTER R WITH INVERTED BREVE*/ 0x0214, /*U+0214*/ /**/ 0x0214, /*U+0215*/ /*LATIN SMALL LETTER U WITH DOUBLE GRAVE*/ 0x0216, /*U+0216*/ /**/ 0x0216, /*U+0217*/ /*LATIN SMALL LETTER U WITH INVERTED BREVE*/ 0x0218, /*U+0218*/ /**/ 0x0218, /*U+0219*/ /*LATIN SMALL LETTER S WITH COMMA BELOW*/ 0x021A, /*U+021A*/ /**/ 0x021A, /*U+021B*/ /*LATIN SMALL LETTER T WITH COMMA BELOW*/ 0x021C, /*U+021C*/ /**/ 0x021C, /*U+021D*/ /*LATIN SMALL LETTER YOGH*/ 0x021E, /*U+021E*/ /**/ 0x021E, /*U+021F*/ /*LATIN SMALL LETTER H WITH CARON*/ 0x0220, /*U+0220*/ /**/ 0x0221, /*U+0221*/ /**/ 0x0222, /*U+0222*/ /**/ 0x0222, /*U+0223*/ /*LATIN SMALL LETTER OU*/ 0x0224, /*U+0224*/ /**/ 0x0224, /*U+0225*/ /*LATIN SMALL LETTER Z WITH HOOK*/ 0x0226, /*U+0226*/ /**/ 0x0226, /*U+0227*/ /*LATIN SMALL LETTER A WITH DOT ABOVE*/ 0x0228, /*U+0228*/ /**/ 0x0228, /*U+0229*/ /*LATIN SMALL LETTER E WITH CEDILLA*/ 0x022A, /*U+022A*/ /**/ 0x022A, /*U+022B*/ /*LATIN SMALL LETTER O WITH DIAERESIS AND MACRON*/ 0x022C, /*U+022C*/ /**/ 0x022C, /*U+022D*/ /*LATIN SMALL LETTER O WITH TILDE AND MACRON*/ 0x022E, /*U+022E*/ /**/ 0x022E, /*U+022F*/ /*LATIN SMALL LETTER O WITH DOT ABOVE*/ 0x0230, /*U+0230*/ /**/ 0x0230, /*U+0231*/ /*LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON*/ 0x0232, /*U+0232*/ /**/ 0x0232, /*U+0233*/ /*LATIN SMALL LETTER Y WITH MACRON*/ 0x0234, /*U+0234*/ /**/ 0x0235, /*U+0235*/ /**/ 0x0236, /*U+0236*/ /**/ 0x0237, /*U+0237*/ /**/ 0x0238, /*U+0238*/ /**/ 0x0239, /*U+0239*/ /**/ 0x023A, /*U+023A*/ /**/ 0x023B, /*U+023B*/ /**/ 0x023B, /*U+023C*/ /*LATIN SMALL LETTER C WITH STROKE*/ 0x023D, /*U+023D*/ /**/ 0x023E, /*U+023E*/ /**/ 0x2C7E, /*U+023F*/ /*LATIN SMALL LETTER S WITH SWASH TAIL*/ 0x2C7F, /*U+0240*/ /*LATIN SMALL LETTER Z WITH SWASH TAIL*/ 0x0241, /*U+0241*/ /**/ 0x0241, /*U+0242*/ /*LATIN SMALL LETTER GLOTTAL STOP*/ 0x0243, /*U+0243*/ /**/ 0x0244, /*U+0244*/ /**/ 0x0245, /*U+0245*/ /**/ 0x0246, /*U+0246*/ /**/ 0x0246, /*U+0247*/ /*LATIN SMALL LETTER E WITH STROKE*/ 0x0248, /*U+0248*/ /**/ 0x0248, /*U+0249*/ /*LATIN SMALL LETTER J WITH STROKE*/ 0x024A, /*U+024A*/ /**/ 0x024A, /*U+024B*/ /*LATIN SMALL LETTER Q WITH HOOK TAIL*/ 0x024C, /*U+024C*/ /**/ 0x024C, /*U+024D*/ /*LATIN SMALL LETTER R WITH STROKE*/ 0x024E, /*U+024E*/ /**/ 0x024E, /*U+024F*/ /*LATIN SMALL LETTER Y WITH STROKE*/ 0x2C6F, /*U+0250*/ /*LATIN SMALL LETTER TURNED A*/ 0x2C6D, /*U+0251*/ /*LATIN SMALL LETTER ALPHA*/ 0x2C70, /*U+0252*/ /*LATIN SMALL LETTER TURNED ALPHA*/ 0x0181, /*U+0253*/ /*LATIN SMALL LETTER B WITH HOOK*/ 0x0186, /*U+0254*/ /*LATIN SMALL LETTER OPEN O*/ 0x0255, /*U+0255*/ /**/ 0x0189, /*U+0256*/ /*LATIN SMALL LETTER D WITH TAIL*/ 0x018A, /*U+0257*/ /*LATIN SMALL LETTER D WITH HOOK*/ 0x0258, /*U+0258*/ /**/ 0x018F, /*U+0259*/ /*LATIN SMALL LETTER SCHWA*/ 0x025A, /*U+025A*/ /**/ 0x0190, /*U+025B*/ /*LATIN SMALL LETTER OPEN E*/ 0x025C, /*U+025C*/ /**/ 0x025D, /*U+025D*/ /**/ 0x025E, /*U+025E*/ /**/ 0x025F, /*U+025F*/ /**/ 0x0193, /*U+0260*/ /*LATIN SMALL LETTER G WITH HOOK*/ 0x0261, /*U+0261*/ /**/ 0x0262, /*U+0262*/ /**/ 0x0194, /*U+0263*/ /*LATIN SMALL LETTER GAMMA*/ 0x0264, /*U+0264*/ /**/ 0xA78D, /*U+0265*/ /*LATIN SMALL LETTER TURNED H*/ 0x0266, /*U+0266*/ /**/ 0x0267, /*U+0267*/ /**/ 0x0197, /*U+0268*/ /*LATIN SMALL LETTER I WITH STROKE*/ 0x0196, /*U+0269*/ /*LATIN SMALL LETTER IOTA*/ 0x026A, /*U+026A*/ /**/ 0x2C62, /*U+026B*/ /*LATIN SMALL LETTER L WITH MIDDLE TILDE*/ 0x026C, /*U+026C*/ /**/ 0x026D, /*U+026D*/ /**/ 0x026E, /*U+026E*/ /**/ 0x019C, /*U+026F*/ /*LATIN SMALL LETTER TURNED M*/ 0x0270, /*U+0270*/ /**/ 0x2C6E, /*U+0271*/ /*LATIN SMALL LETTER M WITH HOOK*/ 0x019D, /*U+0272*/ /*LATIN SMALL LETTER N WITH LEFT HOOK*/ 0x0273, /*U+0273*/ /**/ 0x0274, /*U+0274*/ /**/ 0x019F, /*U+0275*/ /*LATIN SMALL LETTER BARRED O*/ 0x0276, /*U+0276*/ /**/ 0x0277, /*U+0277*/ /**/ 0x0278, /*U+0278*/ /**/ 0x0279, /*U+0279*/ /**/ 0x027A, /*U+027A*/ /**/ 0x027B, /*U+027B*/ /**/ 0x027C, /*U+027C*/ /**/ 0x2C64, /*U+027D*/ /*LATIN SMALL LETTER R WITH TAIL*/ 0x027E, /*U+027E*/ /**/ 0x027F, /*U+027F*/ /**/ 0x01A6, /*U+0280*/ /*LATIN LETTER SMALL CAPITAL R*/ 0x0281, /*U+0281*/ /**/ 0x0282, /*U+0282*/ /**/ 0x01A9, /*U+0283*/ /*LATIN SMALL LETTER ESH*/ 0x0284, /*U+0284*/ /**/ 0x0285, /*U+0285*/ /**/ 0x0286, /*U+0286*/ /**/ 0x0287, /*U+0287*/ /**/ 0x01AE, /*U+0288*/ /*LATIN SMALL LETTER T WITH RETROFLEX HOOK*/ 0x0244, /*U+0289*/ /*LATIN SMALL LETTER U BAR*/ 0x01B1, /*U+028A*/ /*LATIN SMALL LETTER UPSILON*/ 0x01B2, /*U+028B*/ /*LATIN SMALL LETTER V WITH HOOK*/ 0x0245, /*U+028C*/ /*LATIN SMALL LETTER TURNED V*/ 0x028D, /*U+028D*/ /**/ 0x028E, /*U+028E*/ /**/ 0x028F, /*U+028F*/ /**/ 0x0290, /*U+0290*/ /**/ 0x0291, /*U+0291*/ /**/ 0x01B7, /*U+0292*/ /*LATIN SMALL LETTER EZH*/ 0x0293, /*U+0293*/ /**/ 0x0294, /*U+0294*/ /**/ 0x0295, /*U+0295*/ /**/ 0x0296, /*U+0296*/ /**/ 0x0297, /*U+0297*/ /**/ 0x0298, /*U+0298*/ /**/ 0x0299, /*U+0299*/ /**/ 0x029A, /*U+029A*/ /**/ 0x029B, /*U+029B*/ /**/ 0x029C, /*U+029C*/ /**/ 0x029D, /*U+029D*/ /**/ 0x029E, /*U+029E*/ /**/ 0x029F, /*U+029F*/ /**/ 0x02A0, /*U+02A0*/ /**/ 0x02A1, /*U+02A1*/ /**/ 0x02A2, /*U+02A2*/ /**/ 0x02A3, /*U+02A3*/ /**/ 0x02A4, /*U+02A4*/ /**/ 0x02A5, /*U+02A5*/ /**/ 0x02A6, /*U+02A6*/ /**/ 0x02A7, /*U+02A7*/ /**/ 0x02A8, /*U+02A8*/ /**/ 0x02A9, /*U+02A9*/ /**/ 0x02AA, /*U+02AA*/ /**/ 0x02AB, /*U+02AB*/ /**/ 0x02AC, /*U+02AC*/ /**/ 0x02AD, /*U+02AD*/ /**/ 0x02AE, /*U+02AE*/ /**/ 0x02AF, /*U+02AF*/ /**/ 0x02B0, /*U+02B0*/ /**/ 0x02B1, /*U+02B1*/ /**/ 0x02B2, /*U+02B2*/ /**/ 0x02B3, /*U+02B3*/ /**/ 0x02B4, /*U+02B4*/ /**/ 0x02B5, /*U+02B5*/ /**/ 0x02B6, /*U+02B6*/ /**/ 0x02B7, /*U+02B7*/ /**/ 0x02B8, /*U+02B8*/ /**/ 0x02B9, /*U+02B9*/ /**/ 0x02BA, /*U+02BA*/ /**/ 0x02BB, /*U+02BB*/ /**/ 0x02BC, /*U+02BC*/ /**/ 0x02BD, /*U+02BD*/ /**/ 0x02BE, /*U+02BE*/ /**/ 0x02BF, /*U+02BF*/ /**/ }; static const u_int16_t upper_table_2[640] = { 0x0340, /*U+0340*/ /**/ 0x0341, /*U+0341*/ /**/ 0x0342, /*U+0342*/ /**/ 0x0343, /*U+0343*/ /**/ 0x0344, /*U+0344*/ /**/ 0x0399, /*U+0345*/ /*COMBINING GREEK YPOGEGRAMMENI*/ 0x0346, /*U+0346*/ /**/ 0x0347, /*U+0347*/ /**/ 0x0348, /*U+0348*/ /**/ 0x0349, /*U+0349*/ /**/ 0x034A, /*U+034A*/ /**/ 0x034B, /*U+034B*/ /**/ 0x034C, /*U+034C*/ /**/ 0x034D, /*U+034D*/ /**/ 0x034E, /*U+034E*/ /**/ 0x034F, /*U+034F*/ /**/ 0x0350, /*U+0350*/ /**/ 0x0351, /*U+0351*/ /**/ 0x0352, /*U+0352*/ /**/ 0x0353, /*U+0353*/ /**/ 0x0354, /*U+0354*/ /**/ 0x0355, /*U+0355*/ /**/ 0x0356, /*U+0356*/ /**/ 0x0357, /*U+0357*/ /**/ 0x0358, /*U+0358*/ /**/ 0x0359, /*U+0359*/ /**/ 0x035A, /*U+035A*/ /**/ 0x035B, /*U+035B*/ /**/ 0x035C, /*U+035C*/ /**/ 0x035D, /*U+035D*/ /**/ 0x035E, /*U+035E*/ /**/ 0x035F, /*U+035F*/ /**/ 0x0360, /*U+0360*/ /**/ 0x0361, /*U+0361*/ /**/ 0x0362, /*U+0362*/ /**/ 0x0363, /*U+0363*/ /**/ 0x0364, /*U+0364*/ /**/ 0x0365, /*U+0365*/ /**/ 0x0366, /*U+0366*/ /**/ 0x0367, /*U+0367*/ /**/ 0x0368, /*U+0368*/ /**/ 0x0369, /*U+0369*/ /**/ 0x036A, /*U+036A*/ /**/ 0x036B, /*U+036B*/ /**/ 0x036C, /*U+036C*/ /**/ 0x036D, /*U+036D*/ /**/ 0x036E, /*U+036E*/ /**/ 0x036F, /*U+036F*/ /**/ 0x0370, /*U+0370*/ /**/ 0x0370, /*U+0371*/ /*GREEK SMALL LETTER HETA*/ 0x0372, /*U+0372*/ /**/ 0x0372, /*U+0373*/ /*GREEK SMALL LETTER ARCHAIC SAMPI*/ 0x0374, /*U+0374*/ /**/ 0x0375, /*U+0375*/ /**/ 0x0376, /*U+0376*/ /**/ 0x0376, /*U+0377*/ /*GREEK SMALL LETTER PAMPHYLIAN DIGAMMA*/ 0x0378, /*U+0378*/ /**/ 0x0379, /*U+0379*/ /**/ 0x037A, /*U+037A*/ /**/ 0x03FD, /*U+037B*/ /*GREEK SMALL REVERSED LUNATE SIGMA SYMBOL*/ 0x03FE, /*U+037C*/ /*GREEK SMALL DOTTED LUNATE SIGMA SYMBOL*/ 0x03FF, /*U+037D*/ /*GREEK SMALL REVERSED DOTTED LUNATE SIGMA SYMBOL*/ 0x037E, /*U+037E*/ /**/ 0x037F, /*U+037F*/ /**/ 0x0380, /*U+0380*/ /**/ 0x0381, /*U+0381*/ /**/ 0x0382, /*U+0382*/ /**/ 0x0383, /*U+0383*/ /**/ 0x0384, /*U+0384*/ /**/ 0x0385, /*U+0385*/ /**/ 0x0386, /*U+0386*/ /**/ 0x0387, /*U+0387*/ /**/ 0x0388, /*U+0388*/ /**/ 0x0389, /*U+0389*/ /**/ 0x038A, /*U+038A*/ /**/ 0x038B, /*U+038B*/ /**/ 0x038C, /*U+038C*/ /**/ 0x038D, /*U+038D*/ /**/ 0x038E, /*U+038E*/ /**/ 0x038F, /*U+038F*/ /**/ 0x0390, /*U+0390*/ /**/ 0x0391, /*U+0391*/ /**/ 0x0392, /*U+0392*/ /**/ 0x0393, /*U+0393*/ /**/ 0x0394, /*U+0394*/ /**/ 0x0395, /*U+0395*/ /**/ 0x0396, /*U+0396*/ /**/ 0x0397, /*U+0397*/ /**/ 0x0398, /*U+0398*/ /**/ 0x0399, /*U+0399*/ /**/ 0x039A, /*U+039A*/ /**/ 0x039B, /*U+039B*/ /**/ 0x039C, /*U+039C*/ /**/ 0x039D, /*U+039D*/ /**/ 0x039E, /*U+039E*/ /**/ 0x039F, /*U+039F*/ /**/ 0x03A0, /*U+03A0*/ /**/ 0x03A1, /*U+03A1*/ /**/ 0x03A2, /*U+03A2*/ /**/ 0x03A3, /*U+03A3*/ /**/ 0x03A4, /*U+03A4*/ /**/ 0x03A5, /*U+03A5*/ /**/ 0x03A6, /*U+03A6*/ /**/ 0x03A7, /*U+03A7*/ /**/ 0x03A8, /*U+03A8*/ /**/ 0x03A9, /*U+03A9*/ /**/ 0x03AA, /*U+03AA*/ /**/ 0x03AB, /*U+03AB*/ /**/ 0x0386, /*U+03AC*/ /*GREEK SMALL LETTER ALPHA WITH TONOS*/ 0x0388, /*U+03AD*/ /*GREEK SMALL LETTER EPSILON WITH TONOS*/ 0x0389, /*U+03AE*/ /*GREEK SMALL LETTER ETA WITH TONOS*/ 0x038A, /*U+03AF*/ /*GREEK SMALL LETTER IOTA WITH TONOS*/ 0x03B0, /*U+03B0*/ /**/ 0x0391, /*U+03B1*/ /*GREEK SMALL LETTER ALPHA*/ 0x0392, /*U+03B2*/ /*GREEK SMALL LETTER BETA*/ 0x0393, /*U+03B3*/ /*GREEK SMALL LETTER GAMMA*/ 0x0394, /*U+03B4*/ /*GREEK SMALL LETTER DELTA*/ 0x0395, /*U+03B5*/ /*GREEK SMALL LETTER EPSILON*/ 0x0396, /*U+03B6*/ /*GREEK SMALL LETTER ZETA*/ 0x0397, /*U+03B7*/ /*GREEK SMALL LETTER ETA*/ 0x0398, /*U+03B8*/ /*GREEK SMALL LETTER THETA*/ 0x0399, /*U+03B9*/ /*GREEK SMALL LETTER IOTA*/ 0x039A, /*U+03BA*/ /*GREEK SMALL LETTER KAPPA*/ 0x039B, /*U+03BB*/ /*GREEK SMALL LETTER LAMDA*/ 0x039C, /*U+03BC*/ /*GREEK SMALL LETTER MU*/ 0x039D, /*U+03BD*/ /*GREEK SMALL LETTER NU*/ 0x039E, /*U+03BE*/ /*GREEK SMALL LETTER XI*/ 0x039F, /*U+03BF*/ /*GREEK SMALL LETTER OMICRON*/ 0x03A0, /*U+03C0*/ /*GREEK SMALL LETTER PI*/ 0x03A1, /*U+03C1*/ /*GREEK SMALL LETTER RHO*/ 0x03A3, /*U+03C2*/ /*GREEK SMALL LETTER FINAL SIGMA*/ 0x03A3, /*U+03C3*/ /*GREEK SMALL LETTER SIGMA*/ 0x03A4, /*U+03C4*/ /*GREEK SMALL LETTER TAU*/ 0x03A5, /*U+03C5*/ /*GREEK SMALL LETTER UPSILON*/ 0x03A6, /*U+03C6*/ /*GREEK SMALL LETTER PHI*/ 0x03A7, /*U+03C7*/ /*GREEK SMALL LETTER CHI*/ 0x03A8, /*U+03C8*/ /*GREEK SMALL LETTER PSI*/ 0x03A9, /*U+03C9*/ /*GREEK SMALL LETTER OMEGA*/ 0x03AA, /*U+03CA*/ /*GREEK SMALL LETTER IOTA WITH DIALYTIKA*/ 0x03AB, /*U+03CB*/ /*GREEK SMALL LETTER UPSILON WITH DIALYTIKA*/ 0x038C, /*U+03CC*/ /*GREEK SMALL LETTER OMICRON WITH TONOS*/ 0x038E, /*U+03CD*/ /*GREEK SMALL LETTER UPSILON WITH TONOS*/ 0x038F, /*U+03CE*/ /*GREEK SMALL LETTER OMEGA WITH TONOS*/ 0x03CF, /*U+03CF*/ /**/ 0x0392, /*U+03D0*/ /*GREEK BETA SYMBOL*/ 0x0398, /*U+03D1*/ /*GREEK THETA SYMBOL*/ 0x03D2, /*U+03D2*/ /**/ 0x03D3, /*U+03D3*/ /**/ 0x03D4, /*U+03D4*/ /**/ 0x03A6, /*U+03D5*/ /*GREEK PHI SYMBOL*/ 0x03A0, /*U+03D6*/ /*GREEK PI SYMBOL*/ 0x03CF, /*U+03D7*/ /*GREEK KAI SYMBOL*/ 0x03D8, /*U+03D8*/ /**/ 0x03D8, /*U+03D9*/ /*GREEK SMALL LETTER ARCHAIC KOPPA*/ 0x03DA, /*U+03DA*/ /**/ 0x03DA, /*U+03DB*/ /*GREEK SMALL LETTER STIGMA*/ 0x03DC, /*U+03DC*/ /**/ 0x03DC, /*U+03DD*/ /*GREEK SMALL LETTER DIGAMMA*/ 0x03DE, /*U+03DE*/ /**/ 0x03DE, /*U+03DF*/ /*GREEK SMALL LETTER KOPPA*/ 0x03E0, /*U+03E0*/ /**/ 0x03E0, /*U+03E1*/ /*GREEK SMALL LETTER SAMPI*/ 0x03E2, /*U+03E2*/ /**/ 0x03E2, /*U+03E3*/ /*COPTIC SMALL LETTER SHEI*/ 0x03E4, /*U+03E4*/ /**/ 0x03E4, /*U+03E5*/ /*COPTIC SMALL LETTER FEI*/ 0x03E6, /*U+03E6*/ /**/ 0x03E6, /*U+03E7*/ /*COPTIC SMALL LETTER KHEI*/ 0x03E8, /*U+03E8*/ /**/ 0x03E8, /*U+03E9*/ /*COPTIC SMALL LETTER HORI*/ 0x03EA, /*U+03EA*/ /**/ 0x03EA, /*U+03EB*/ /*COPTIC SMALL LETTER GANGIA*/ 0x03EC, /*U+03EC*/ /**/ 0x03EC, /*U+03ED*/ /*COPTIC SMALL LETTER SHIMA*/ 0x03EE, /*U+03EE*/ /**/ 0x03EE, /*U+03EF*/ /*COPTIC SMALL LETTER DEI*/ 0x039A, /*U+03F0*/ /*GREEK KAPPA SYMBOL*/ 0x03A1, /*U+03F1*/ /*GREEK RHO SYMBOL*/ 0x03F9, /*U+03F2*/ /*GREEK LUNATE SIGMA SYMBOL*/ 0x03F3, /*U+03F3*/ /**/ 0x03F4, /*U+03F4*/ /**/ 0x0395, /*U+03F5*/ /*GREEK LUNATE EPSILON SYMBOL*/ 0x03F6, /*U+03F6*/ /**/ 0x03F7, /*U+03F7*/ /**/ 0x03F7, /*U+03F8*/ /*GREEK SMALL LETTER SHO*/ 0x03F9, /*U+03F9*/ /**/ 0x03FA, /*U+03FA*/ /**/ 0x03FA, /*U+03FB*/ /*GREEK SMALL LETTER SAN*/ 0x03FC, /*U+03FC*/ /**/ 0x03FD, /*U+03FD*/ /**/ 0x03FE, /*U+03FE*/ /**/ 0x03FF, /*U+03FF*/ /**/ 0x0400, /*U+0400*/ /**/ 0x0401, /*U+0401*/ /**/ 0x0402, /*U+0402*/ /**/ 0x0403, /*U+0403*/ /**/ 0x0404, /*U+0404*/ /**/ 0x0405, /*U+0405*/ /**/ 0x0406, /*U+0406*/ /**/ 0x0407, /*U+0407*/ /**/ 0x0408, /*U+0408*/ /**/ 0x0409, /*U+0409*/ /**/ 0x040A, /*U+040A*/ /**/ 0x040B, /*U+040B*/ /**/ 0x040C, /*U+040C*/ /**/ 0x040D, /*U+040D*/ /**/ 0x040E, /*U+040E*/ /**/ 0x040F, /*U+040F*/ /**/ 0x0410, /*U+0410*/ /**/ 0x0411, /*U+0411*/ /**/ 0x0412, /*U+0412*/ /**/ 0x0413, /*U+0413*/ /**/ 0x0414, /*U+0414*/ /**/ 0x0415, /*U+0415*/ /**/ 0x0416, /*U+0416*/ /**/ 0x0417, /*U+0417*/ /**/ 0x0418, /*U+0418*/ /**/ 0x0419, /*U+0419*/ /**/ 0x041A, /*U+041A*/ /**/ 0x041B, /*U+041B*/ /**/ 0x041C, /*U+041C*/ /**/ 0x041D, /*U+041D*/ /**/ 0x041E, /*U+041E*/ /**/ 0x041F, /*U+041F*/ /**/ 0x0420, /*U+0420*/ /**/ 0x0421, /*U+0421*/ /**/ 0x0422, /*U+0422*/ /**/ 0x0423, /*U+0423*/ /**/ 0x0424, /*U+0424*/ /**/ 0x0425, /*U+0425*/ /**/ 0x0426, /*U+0426*/ /**/ 0x0427, /*U+0427*/ /**/ 0x0428, /*U+0428*/ /**/ 0x0429, /*U+0429*/ /**/ 0x042A, /*U+042A*/ /**/ 0x042B, /*U+042B*/ /**/ 0x042C, /*U+042C*/ /**/ 0x042D, /*U+042D*/ /**/ 0x042E, /*U+042E*/ /**/ 0x042F, /*U+042F*/ /**/ 0x0410, /*U+0430*/ /*CYRILLIC SMALL LETTER A*/ 0x0411, /*U+0431*/ /*CYRILLIC SMALL LETTER BE*/ 0x0412, /*U+0432*/ /*CYRILLIC SMALL LETTER VE*/ 0x0413, /*U+0433*/ /*CYRILLIC SMALL LETTER GHE*/ 0x0414, /*U+0434*/ /*CYRILLIC SMALL LETTER DE*/ 0x0415, /*U+0435*/ /*CYRILLIC SMALL LETTER IE*/ 0x0416, /*U+0436*/ /*CYRILLIC SMALL LETTER ZHE*/ 0x0417, /*U+0437*/ /*CYRILLIC SMALL LETTER ZE*/ 0x0418, /*U+0438*/ /*CYRILLIC SMALL LETTER I*/ 0x0419, /*U+0439*/ /*CYRILLIC SMALL LETTER SHORT I*/ 0x041A, /*U+043A*/ /*CYRILLIC SMALL LETTER KA*/ 0x041B, /*U+043B*/ /*CYRILLIC SMALL LETTER EL*/ 0x041C, /*U+043C*/ /*CYRILLIC SMALL LETTER EM*/ 0x041D, /*U+043D*/ /*CYRILLIC SMALL LETTER EN*/ 0x041E, /*U+043E*/ /*CYRILLIC SMALL LETTER O*/ 0x041F, /*U+043F*/ /*CYRILLIC SMALL LETTER PE*/ 0x0420, /*U+0440*/ /*CYRILLIC SMALL LETTER ER*/ 0x0421, /*U+0441*/ /*CYRILLIC SMALL LETTER ES*/ 0x0422, /*U+0442*/ /*CYRILLIC SMALL LETTER TE*/ 0x0423, /*U+0443*/ /*CYRILLIC SMALL LETTER U*/ 0x0424, /*U+0444*/ /*CYRILLIC SMALL LETTER EF*/ 0x0425, /*U+0445*/ /*CYRILLIC SMALL LETTER HA*/ 0x0426, /*U+0446*/ /*CYRILLIC SMALL LETTER TSE*/ 0x0427, /*U+0447*/ /*CYRILLIC SMALL LETTER CHE*/ 0x0428, /*U+0448*/ /*CYRILLIC SMALL LETTER SHA*/ 0x0429, /*U+0449*/ /*CYRILLIC SMALL LETTER SHCHA*/ 0x042A, /*U+044A*/ /*CYRILLIC SMALL LETTER HARD SIGN*/ 0x042B, /*U+044B*/ /*CYRILLIC SMALL LETTER YERU*/ 0x042C, /*U+044C*/ /*CYRILLIC SMALL LETTER SOFT SIGN*/ 0x042D, /*U+044D*/ /*CYRILLIC SMALL LETTER E*/ 0x042E, /*U+044E*/ /*CYRILLIC SMALL LETTER YU*/ 0x042F, /*U+044F*/ /*CYRILLIC SMALL LETTER YA*/ 0x0400, /*U+0450*/ /*CYRILLIC SMALL LETTER IE WITH GRAVE*/ 0x0401, /*U+0451*/ /*CYRILLIC SMALL LETTER IO*/ 0x0402, /*U+0452*/ /*CYRILLIC SMALL LETTER DJE*/ 0x0403, /*U+0453*/ /*CYRILLIC SMALL LETTER GJE*/ 0x0404, /*U+0454*/ /*CYRILLIC SMALL LETTER UKRAINIAN IE*/ 0x0405, /*U+0455*/ /*CYRILLIC SMALL LETTER DZE*/ 0x0406, /*U+0456*/ /*CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I*/ 0x0407, /*U+0457*/ /*CYRILLIC SMALL LETTER YI*/ 0x0408, /*U+0458*/ /*CYRILLIC SMALL LETTER JE*/ 0x0409, /*U+0459*/ /*CYRILLIC SMALL LETTER LJE*/ 0x040A, /*U+045A*/ /*CYRILLIC SMALL LETTER NJE*/ 0x040B, /*U+045B*/ /*CYRILLIC SMALL LETTER TSHE*/ 0x040C, /*U+045C*/ /*CYRILLIC SMALL LETTER KJE*/ 0x040D, /*U+045D*/ /*CYRILLIC SMALL LETTER I WITH GRAVE*/ 0x040E, /*U+045E*/ /*CYRILLIC SMALL LETTER SHORT U*/ 0x040F, /*U+045F*/ /*CYRILLIC SMALL LETTER DZHE*/ 0x0460, /*U+0460*/ /**/ 0x0460, /*U+0461*/ /*CYRILLIC SMALL LETTER OMEGA*/ 0x0462, /*U+0462*/ /**/ 0x0462, /*U+0463*/ /*CYRILLIC SMALL LETTER YAT*/ 0x0464, /*U+0464*/ /**/ 0x0464, /*U+0465*/ /*CYRILLIC SMALL LETTER IOTIFIED E*/ 0x0466, /*U+0466*/ /**/ 0x0466, /*U+0467*/ /*CYRILLIC SMALL LETTER LITTLE YUS*/ 0x0468, /*U+0468*/ /**/ 0x0468, /*U+0469*/ /*CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS*/ 0x046A, /*U+046A*/ /**/ 0x046A, /*U+046B*/ /*CYRILLIC SMALL LETTER BIG YUS*/ 0x046C, /*U+046C*/ /**/ 0x046C, /*U+046D*/ /*CYRILLIC SMALL LETTER IOTIFIED BIG YUS*/ 0x046E, /*U+046E*/ /**/ 0x046E, /*U+046F*/ /*CYRILLIC SMALL LETTER KSI*/ 0x0470, /*U+0470*/ /**/ 0x0470, /*U+0471*/ /*CYRILLIC SMALL LETTER PSI*/ 0x0472, /*U+0472*/ /**/ 0x0472, /*U+0473*/ /*CYRILLIC SMALL LETTER FITA*/ 0x0474, /*U+0474*/ /**/ 0x0474, /*U+0475*/ /*CYRILLIC SMALL LETTER IZHITSA*/ 0x0476, /*U+0476*/ /**/ 0x0476, /*U+0477*/ /*CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT*/ 0x0478, /*U+0478*/ /**/ 0x0478, /*U+0479*/ /*CYRILLIC SMALL LETTER UK*/ 0x047A, /*U+047A*/ /**/ 0x047A, /*U+047B*/ /*CYRILLIC SMALL LETTER ROUND OMEGA*/ 0x047C, /*U+047C*/ /**/ 0x047C, /*U+047D*/ /*CYRILLIC SMALL LETTER OMEGA WITH TITLO*/ 0x047E, /*U+047E*/ /**/ 0x047E, /*U+047F*/ /*CYRILLIC SMALL LETTER OT*/ 0x0480, /*U+0480*/ /**/ 0x0480, /*U+0481*/ /*CYRILLIC SMALL LETTER KOPPA*/ 0x0482, /*U+0482*/ /**/ 0x0483, /*U+0483*/ /**/ 0x0484, /*U+0484*/ /**/ 0x0485, /*U+0485*/ /**/ 0x0486, /*U+0486*/ /**/ 0x0487, /*U+0487*/ /**/ 0x0488, /*U+0488*/ /**/ 0x0489, /*U+0489*/ /**/ 0x048A, /*U+048A*/ /**/ 0x048A, /*U+048B*/ /*CYRILLIC SMALL LETTER SHORT I WITH TAIL*/ 0x048C, /*U+048C*/ /**/ 0x048C, /*U+048D*/ /*CYRILLIC SMALL LETTER SEMISOFT SIGN*/ 0x048E, /*U+048E*/ /**/ 0x048E, /*U+048F*/ /*CYRILLIC SMALL LETTER ER WITH TICK*/ 0x0490, /*U+0490*/ /**/ 0x0490, /*U+0491*/ /*CYRILLIC SMALL LETTER GHE WITH UPTURN*/ 0x0492, /*U+0492*/ /**/ 0x0492, /*U+0493*/ /*CYRILLIC SMALL LETTER GHE WITH STROKE*/ 0x0494, /*U+0494*/ /**/ 0x0494, /*U+0495*/ /*CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK*/ 0x0496, /*U+0496*/ /**/ 0x0496, /*U+0497*/ /*CYRILLIC SMALL LETTER ZHE WITH DESCENDER*/ 0x0498, /*U+0498*/ /**/ 0x0498, /*U+0499*/ /*CYRILLIC SMALL LETTER ZE WITH DESCENDER*/ 0x049A, /*U+049A*/ /**/ 0x049A, /*U+049B*/ /*CYRILLIC SMALL LETTER KA WITH DESCENDER*/ 0x049C, /*U+049C*/ /**/ 0x049C, /*U+049D*/ /*CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE*/ 0x049E, /*U+049E*/ /**/ 0x049E, /*U+049F*/ /*CYRILLIC SMALL LETTER KA WITH STROKE*/ 0x04A0, /*U+04A0*/ /**/ 0x04A0, /*U+04A1*/ /*CYRILLIC SMALL LETTER BASHKIR KA*/ 0x04A2, /*U+04A2*/ /**/ 0x04A2, /*U+04A3*/ /*CYRILLIC SMALL LETTER EN WITH DESCENDER*/ 0x04A4, /*U+04A4*/ /**/ 0x04A4, /*U+04A5*/ /*CYRILLIC SMALL LIGATURE EN GHE*/ 0x04A6, /*U+04A6*/ /**/ 0x04A6, /*U+04A7*/ /*CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK*/ 0x04A8, /*U+04A8*/ /**/ 0x04A8, /*U+04A9*/ /*CYRILLIC SMALL LETTER ABKHASIAN HA*/ 0x04AA, /*U+04AA*/ /**/ 0x04AA, /*U+04AB*/ /*CYRILLIC SMALL LETTER ES WITH DESCENDER*/ 0x04AC, /*U+04AC*/ /**/ 0x04AC, /*U+04AD*/ /*CYRILLIC SMALL LETTER TE WITH DESCENDER*/ 0x04AE, /*U+04AE*/ /**/ 0x04AE, /*U+04AF*/ /*CYRILLIC SMALL LETTER STRAIGHT U*/ 0x04B0, /*U+04B0*/ /**/ 0x04B0, /*U+04B1*/ /*CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE*/ 0x04B2, /*U+04B2*/ /**/ 0x04B2, /*U+04B3*/ /*CYRILLIC SMALL LETTER HA WITH DESCENDER*/ 0x04B4, /*U+04B4*/ /**/ 0x04B4, /*U+04B5*/ /*CYRILLIC SMALL LIGATURE TE TSE*/ 0x04B6, /*U+04B6*/ /**/ 0x04B6, /*U+04B7*/ /*CYRILLIC SMALL LETTER CHE WITH DESCENDER*/ 0x04B8, /*U+04B8*/ /**/ 0x04B8, /*U+04B9*/ /*CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE*/ 0x04BA, /*U+04BA*/ /**/ 0x04BA, /*U+04BB*/ /*CYRILLIC SMALL LETTER SHHA*/ 0x04BC, /*U+04BC*/ /**/ 0x04BC, /*U+04BD*/ /*CYRILLIC SMALL LETTER ABKHASIAN CHE*/ 0x04BE, /*U+04BE*/ /**/ 0x04BE, /*U+04BF*/ /*CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER*/ 0x04C0, /*U+04C0*/ /**/ 0x04C1, /*U+04C1*/ /**/ 0x04C1, /*U+04C2*/ /*CYRILLIC SMALL LETTER ZHE WITH BREVE*/ 0x04C3, /*U+04C3*/ /**/ 0x04C3, /*U+04C4*/ /*CYRILLIC SMALL LETTER KA WITH HOOK*/ 0x04C5, /*U+04C5*/ /**/ 0x04C5, /*U+04C6*/ /*CYRILLIC SMALL LETTER EL WITH TAIL*/ 0x04C7, /*U+04C7*/ /**/ 0x04C7, /*U+04C8*/ /*CYRILLIC SMALL LETTER EN WITH HOOK*/ 0x04C9, /*U+04C9*/ /**/ 0x04C9, /*U+04CA*/ /*CYRILLIC SMALL LETTER EN WITH TAIL*/ 0x04CB, /*U+04CB*/ /**/ 0x04CB, /*U+04CC*/ /*CYRILLIC SMALL LETTER KHAKASSIAN CHE*/ 0x04CD, /*U+04CD*/ /**/ 0x04CD, /*U+04CE*/ /*CYRILLIC SMALL LETTER EM WITH TAIL*/ 0x04C0, /*U+04CF*/ /*CYRILLIC SMALL LETTER PALOCHKA*/ 0x04D0, /*U+04D0*/ /**/ 0x04D0, /*U+04D1*/ /*CYRILLIC SMALL LETTER A WITH BREVE*/ 0x04D2, /*U+04D2*/ /**/ 0x04D2, /*U+04D3*/ /*CYRILLIC SMALL LETTER A WITH DIAERESIS*/ 0x04D4, /*U+04D4*/ /**/ 0x04D4, /*U+04D5*/ /*CYRILLIC SMALL LIGATURE A IE*/ 0x04D6, /*U+04D6*/ /**/ 0x04D6, /*U+04D7*/ /*CYRILLIC SMALL LETTER IE WITH BREVE*/ 0x04D8, /*U+04D8*/ /**/ 0x04D8, /*U+04D9*/ /*CYRILLIC SMALL LETTER SCHWA*/ 0x04DA, /*U+04DA*/ /**/ 0x04DA, /*U+04DB*/ /*CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS*/ 0x04DC, /*U+04DC*/ /**/ 0x04DC, /*U+04DD*/ /*CYRILLIC SMALL LETTER ZHE WITH DIAERESIS*/ 0x04DE, /*U+04DE*/ /**/ 0x04DE, /*U+04DF*/ /*CYRILLIC SMALL LETTER ZE WITH DIAERESIS*/ 0x04E0, /*U+04E0*/ /**/ 0x04E0, /*U+04E1*/ /*CYRILLIC SMALL LETTER ABKHASIAN DZE*/ 0x04E2, /*U+04E2*/ /**/ 0x04E2, /*U+04E3*/ /*CYRILLIC SMALL LETTER I WITH MACRON*/ 0x04E4, /*U+04E4*/ /**/ 0x04E4, /*U+04E5*/ /*CYRILLIC SMALL LETTER I WITH DIAERESIS*/ 0x04E6, /*U+04E6*/ /**/ 0x04E6, /*U+04E7*/ /*CYRILLIC SMALL LETTER O WITH DIAERESIS*/ 0x04E8, /*U+04E8*/ /**/ 0x04E8, /*U+04E9*/ /*CYRILLIC SMALL LETTER BARRED O*/ 0x04EA, /*U+04EA*/ /**/ 0x04EA, /*U+04EB*/ /*CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS*/ 0x04EC, /*U+04EC*/ /**/ 0x04EC, /*U+04ED*/ /*CYRILLIC SMALL LETTER E WITH DIAERESIS*/ 0x04EE, /*U+04EE*/ /**/ 0x04EE, /*U+04EF*/ /*CYRILLIC SMALL LETTER U WITH MACRON*/ 0x04F0, /*U+04F0*/ /**/ 0x04F0, /*U+04F1*/ /*CYRILLIC SMALL LETTER U WITH DIAERESIS*/ 0x04F2, /*U+04F2*/ /**/ 0x04F2, /*U+04F3*/ /*CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE*/ 0x04F4, /*U+04F4*/ /**/ 0x04F4, /*U+04F5*/ /*CYRILLIC SMALL LETTER CHE WITH DIAERESIS*/ 0x04F6, /*U+04F6*/ /**/ 0x04F6, /*U+04F7*/ /*CYRILLIC SMALL LETTER GHE WITH DESCENDER*/ 0x04F8, /*U+04F8*/ /**/ 0x04F8, /*U+04F9*/ /*CYRILLIC SMALL LETTER YERU WITH DIAERESIS*/ 0x04FA, /*U+04FA*/ /**/ 0x04FA, /*U+04FB*/ /*CYRILLIC SMALL LETTER GHE WITH STROKE AND HOOK*/ 0x04FC, /*U+04FC*/ /**/ 0x04FC, /*U+04FD*/ /*CYRILLIC SMALL LETTER HA WITH HOOK*/ 0x04FE, /*U+04FE*/ /**/ 0x04FE, /*U+04FF*/ /*CYRILLIC SMALL LETTER HA WITH STROKE*/ 0x0500, /*U+0500*/ /**/ 0x0500, /*U+0501*/ /*CYRILLIC SMALL LETTER KOMI DE*/ 0x0502, /*U+0502*/ /**/ 0x0502, /*U+0503*/ /*CYRILLIC SMALL LETTER KOMI DJE*/ 0x0504, /*U+0504*/ /**/ 0x0504, /*U+0505*/ /*CYRILLIC SMALL LETTER KOMI ZJE*/ 0x0506, /*U+0506*/ /**/ 0x0506, /*U+0507*/ /*CYRILLIC SMALL LETTER KOMI DZJE*/ 0x0508, /*U+0508*/ /**/ 0x0508, /*U+0509*/ /*CYRILLIC SMALL LETTER KOMI LJE*/ 0x050A, /*U+050A*/ /**/ 0x050A, /*U+050B*/ /*CYRILLIC SMALL LETTER KOMI NJE*/ 0x050C, /*U+050C*/ /**/ 0x050C, /*U+050D*/ /*CYRILLIC SMALL LETTER KOMI SJE*/ 0x050E, /*U+050E*/ /**/ 0x050E, /*U+050F*/ /*CYRILLIC SMALL LETTER KOMI TJE*/ 0x0510, /*U+0510*/ /**/ 0x0510, /*U+0511*/ /*CYRILLIC SMALL LETTER REVERSED ZE*/ 0x0512, /*U+0512*/ /**/ 0x0512, /*U+0513*/ /*CYRILLIC SMALL LETTER EL WITH HOOK*/ 0x0514, /*U+0514*/ /**/ 0x0514, /*U+0515*/ /*CYRILLIC SMALL LETTER LHA*/ 0x0516, /*U+0516*/ /**/ 0x0516, /*U+0517*/ /*CYRILLIC SMALL LETTER RHA*/ 0x0518, /*U+0518*/ /**/ 0x0518, /*U+0519*/ /*CYRILLIC SMALL LETTER YAE*/ 0x051A, /*U+051A*/ /**/ 0x051A, /*U+051B*/ /*CYRILLIC SMALL LETTER QA*/ 0x051C, /*U+051C*/ /**/ 0x051C, /*U+051D*/ /*CYRILLIC SMALL LETTER WE*/ 0x051E, /*U+051E*/ /**/ 0x051E, /*U+051F*/ /*CYRILLIC SMALL LETTER ALEUT KA*/ 0x0520, /*U+0520*/ /**/ 0x0520, /*U+0521*/ /*CYRILLIC SMALL LETTER EL WITH MIDDLE HOOK*/ 0x0522, /*U+0522*/ /**/ 0x0522, /*U+0523*/ /*CYRILLIC SMALL LETTER EN WITH MIDDLE HOOK*/ 0x0524, /*U+0524*/ /**/ 0x0524, /*U+0525*/ /*CYRILLIC SMALL LETTER PE WITH DESCENDER*/ 0x0526, /*U+0526*/ /**/ 0x0526, /*U+0527*/ /*CYRILLIC SMALL LETTER SHHA WITH DESCENDER*/ 0x0528, /*U+0528*/ /**/ 0x0529, /*U+0529*/ /**/ 0x052A, /*U+052A*/ /**/ 0x052B, /*U+052B*/ /**/ 0x052C, /*U+052C*/ /**/ 0x052D, /*U+052D*/ /**/ 0x052E, /*U+052E*/ /**/ 0x052F, /*U+052F*/ /**/ 0x0530, /*U+0530*/ /**/ 0x0531, /*U+0531*/ /**/ 0x0532, /*U+0532*/ /**/ 0x0533, /*U+0533*/ /**/ 0x0534, /*U+0534*/ /**/ 0x0535, /*U+0535*/ /**/ 0x0536, /*U+0536*/ /**/ 0x0537, /*U+0537*/ /**/ 0x0538, /*U+0538*/ /**/ 0x0539, /*U+0539*/ /**/ 0x053A, /*U+053A*/ /**/ 0x053B, /*U+053B*/ /**/ 0x053C, /*U+053C*/ /**/ 0x053D, /*U+053D*/ /**/ 0x053E, /*U+053E*/ /**/ 0x053F, /*U+053F*/ /**/ 0x0540, /*U+0540*/ /**/ 0x0541, /*U+0541*/ /**/ 0x0542, /*U+0542*/ /**/ 0x0543, /*U+0543*/ /**/ 0x0544, /*U+0544*/ /**/ 0x0545, /*U+0545*/ /**/ 0x0546, /*U+0546*/ /**/ 0x0547, /*U+0547*/ /**/ 0x0548, /*U+0548*/ /**/ 0x0549, /*U+0549*/ /**/ 0x054A, /*U+054A*/ /**/ 0x054B, /*U+054B*/ /**/ 0x054C, /*U+054C*/ /**/ 0x054D, /*U+054D*/ /**/ 0x054E, /*U+054E*/ /**/ 0x054F, /*U+054F*/ /**/ 0x0550, /*U+0550*/ /**/ 0x0551, /*U+0551*/ /**/ 0x0552, /*U+0552*/ /**/ 0x0553, /*U+0553*/ /**/ 0x0554, /*U+0554*/ /**/ 0x0555, /*U+0555*/ /**/ 0x0556, /*U+0556*/ /**/ 0x0557, /*U+0557*/ /**/ 0x0558, /*U+0558*/ /**/ 0x0559, /*U+0559*/ /**/ 0x055A, /*U+055A*/ /**/ 0x055B, /*U+055B*/ /**/ 0x055C, /*U+055C*/ /**/ 0x055D, /*U+055D*/ /**/ 0x055E, /*U+055E*/ /**/ 0x055F, /*U+055F*/ /**/ 0x0560, /*U+0560*/ /**/ 0x0531, /*U+0561*/ /*ARMENIAN SMALL LETTER AYB*/ 0x0532, /*U+0562*/ /*ARMENIAN SMALL LETTER BEN*/ 0x0533, /*U+0563*/ /*ARMENIAN SMALL LETTER GIM*/ 0x0534, /*U+0564*/ /*ARMENIAN SMALL LETTER DA*/ 0x0535, /*U+0565*/ /*ARMENIAN SMALL LETTER ECH*/ 0x0536, /*U+0566*/ /*ARMENIAN SMALL LETTER ZA*/ 0x0537, /*U+0567*/ /*ARMENIAN SMALL LETTER EH*/ 0x0538, /*U+0568*/ /*ARMENIAN SMALL LETTER ET*/ 0x0539, /*U+0569*/ /*ARMENIAN SMALL LETTER TO*/ 0x053A, /*U+056A*/ /*ARMENIAN SMALL LETTER ZHE*/ 0x053B, /*U+056B*/ /*ARMENIAN SMALL LETTER INI*/ 0x053C, /*U+056C*/ /*ARMENIAN SMALL LETTER LIWN*/ 0x053D, /*U+056D*/ /*ARMENIAN SMALL LETTER XEH*/ 0x053E, /*U+056E*/ /*ARMENIAN SMALL LETTER CA*/ 0x053F, /*U+056F*/ /*ARMENIAN SMALL LETTER KEN*/ 0x0540, /*U+0570*/ /*ARMENIAN SMALL LETTER HO*/ 0x0541, /*U+0571*/ /*ARMENIAN SMALL LETTER JA*/ 0x0542, /*U+0572*/ /*ARMENIAN SMALL LETTER GHAD*/ 0x0543, /*U+0573*/ /*ARMENIAN SMALL LETTER CHEH*/ 0x0544, /*U+0574*/ /*ARMENIAN SMALL LETTER MEN*/ 0x0545, /*U+0575*/ /*ARMENIAN SMALL LETTER YI*/ 0x0546, /*U+0576*/ /*ARMENIAN SMALL LETTER NOW*/ 0x0547, /*U+0577*/ /*ARMENIAN SMALL LETTER SHA*/ 0x0548, /*U+0578*/ /*ARMENIAN SMALL LETTER VO*/ 0x0549, /*U+0579*/ /*ARMENIAN SMALL LETTER CHA*/ 0x054A, /*U+057A*/ /*ARMENIAN SMALL LETTER PEH*/ 0x054B, /*U+057B*/ /*ARMENIAN SMALL LETTER JHEH*/ 0x054C, /*U+057C*/ /*ARMENIAN SMALL LETTER RA*/ 0x054D, /*U+057D*/ /*ARMENIAN SMALL LETTER SEH*/ 0x054E, /*U+057E*/ /*ARMENIAN SMALL LETTER VEW*/ 0x054F, /*U+057F*/ /*ARMENIAN SMALL LETTER TIWN*/ 0x0550, /*U+0580*/ /*ARMENIAN SMALL LETTER REH*/ 0x0551, /*U+0581*/ /*ARMENIAN SMALL LETTER CO*/ 0x0552, /*U+0582*/ /*ARMENIAN SMALL LETTER YIWN*/ 0x0553, /*U+0583*/ /*ARMENIAN SMALL LETTER PIWR*/ 0x0554, /*U+0584*/ /*ARMENIAN SMALL LETTER KEH*/ 0x0555, /*U+0585*/ /*ARMENIAN SMALL LETTER OH*/ 0x0556, /*U+0586*/ /*ARMENIAN SMALL LETTER FEH*/ 0x0587, /*U+0587*/ /**/ 0x0588, /*U+0588*/ /**/ 0x0589, /*U+0589*/ /**/ 0x058A, /*U+058A*/ /**/ 0x058B, /*U+058B*/ /**/ 0x058C, /*U+058C*/ /**/ 0x058D, /*U+058D*/ /**/ 0x058E, /*U+058E*/ /**/ 0x058F, /*U+058F*/ /**/ 0x0590, /*U+0590*/ /**/ 0x0591, /*U+0591*/ /**/ 0x0592, /*U+0592*/ /**/ 0x0593, /*U+0593*/ /**/ 0x0594, /*U+0594*/ /**/ 0x0595, /*U+0595*/ /**/ 0x0596, /*U+0596*/ /**/ 0x0597, /*U+0597*/ /**/ 0x0598, /*U+0598*/ /**/ 0x0599, /*U+0599*/ /**/ 0x059A, /*U+059A*/ /**/ 0x059B, /*U+059B*/ /**/ 0x059C, /*U+059C*/ /**/ 0x059D, /*U+059D*/ /**/ 0x059E, /*U+059E*/ /**/ 0x059F, /*U+059F*/ /**/ 0x05A0, /*U+05A0*/ /**/ 0x05A1, /*U+05A1*/ /**/ 0x05A2, /*U+05A2*/ /**/ 0x05A3, /*U+05A3*/ /**/ 0x05A4, /*U+05A4*/ /**/ 0x05A5, /*U+05A5*/ /**/ 0x05A6, /*U+05A6*/ /**/ 0x05A7, /*U+05A7*/ /**/ 0x05A8, /*U+05A8*/ /**/ 0x05A9, /*U+05A9*/ /**/ 0x05AA, /*U+05AA*/ /**/ 0x05AB, /*U+05AB*/ /**/ 0x05AC, /*U+05AC*/ /**/ 0x05AD, /*U+05AD*/ /**/ 0x05AE, /*U+05AE*/ /**/ 0x05AF, /*U+05AF*/ /**/ 0x05B0, /*U+05B0*/ /**/ 0x05B1, /*U+05B1*/ /**/ 0x05B2, /*U+05B2*/ /**/ 0x05B3, /*U+05B3*/ /**/ 0x05B4, /*U+05B4*/ /**/ 0x05B5, /*U+05B5*/ /**/ 0x05B6, /*U+05B6*/ /**/ 0x05B7, /*U+05B7*/ /**/ 0x05B8, /*U+05B8*/ /**/ 0x05B9, /*U+05B9*/ /**/ 0x05BA, /*U+05BA*/ /**/ 0x05BB, /*U+05BB*/ /**/ 0x05BC, /*U+05BC*/ /**/ 0x05BD, /*U+05BD*/ /**/ 0x05BE, /*U+05BE*/ /**/ 0x05BF, /*U+05BF*/ /**/ }; static const u_int16_t upper_table_3[64] = { 0x1D40, /*U+1D40*/ /**/ 0x1D41, /*U+1D41*/ /**/ 0x1D42, /*U+1D42*/ /**/ 0x1D43, /*U+1D43*/ /**/ 0x1D44, /*U+1D44*/ /**/ 0x1D45, /*U+1D45*/ /**/ 0x1D46, /*U+1D46*/ /**/ 0x1D47, /*U+1D47*/ /**/ 0x1D48, /*U+1D48*/ /**/ 0x1D49, /*U+1D49*/ /**/ 0x1D4A, /*U+1D4A*/ /**/ 0x1D4B, /*U+1D4B*/ /**/ 0x1D4C, /*U+1D4C*/ /**/ 0x1D4D, /*U+1D4D*/ /**/ 0x1D4E, /*U+1D4E*/ /**/ 0x1D4F, /*U+1D4F*/ /**/ 0x1D50, /*U+1D50*/ /**/ 0x1D51, /*U+1D51*/ /**/ 0x1D52, /*U+1D52*/ /**/ 0x1D53, /*U+1D53*/ /**/ 0x1D54, /*U+1D54*/ /**/ 0x1D55, /*U+1D55*/ /**/ 0x1D56, /*U+1D56*/ /**/ 0x1D57, /*U+1D57*/ /**/ 0x1D58, /*U+1D58*/ /**/ 0x1D59, /*U+1D59*/ /**/ 0x1D5A, /*U+1D5A*/ /**/ 0x1D5B, /*U+1D5B*/ /**/ 0x1D5C, /*U+1D5C*/ /**/ 0x1D5D, /*U+1D5D*/ /**/ 0x1D5E, /*U+1D5E*/ /**/ 0x1D5F, /*U+1D5F*/ /**/ 0x1D60, /*U+1D60*/ /**/ 0x1D61, /*U+1D61*/ /**/ 0x1D62, /*U+1D62*/ /**/ 0x1D63, /*U+1D63*/ /**/ 0x1D64, /*U+1D64*/ /**/ 0x1D65, /*U+1D65*/ /**/ 0x1D66, /*U+1D66*/ /**/ 0x1D67, /*U+1D67*/ /**/ 0x1D68, /*U+1D68*/ /**/ 0x1D69, /*U+1D69*/ /**/ 0x1D6A, /*U+1D6A*/ /**/ 0x1D6B, /*U+1D6B*/ /**/ 0x1D6C, /*U+1D6C*/ /**/ 0x1D6D, /*U+1D6D*/ /**/ 0x1D6E, /*U+1D6E*/ /**/ 0x1D6F, /*U+1D6F*/ /**/ 0x1D70, /*U+1D70*/ /**/ 0x1D71, /*U+1D71*/ /**/ 0x1D72, /*U+1D72*/ /**/ 0x1D73, /*U+1D73*/ /**/ 0x1D74, /*U+1D74*/ /**/ 0x1D75, /*U+1D75*/ /**/ 0x1D76, /*U+1D76*/ /**/ 0x1D77, /*U+1D77*/ /**/ 0x1D78, /*U+1D78*/ /**/ 0xA77D, /*U+1D79*/ /*LATIN SMALL LETTER INSULAR G*/ 0x1D7A, /*U+1D7A*/ /**/ 0x1D7B, /*U+1D7B*/ /**/ 0x1D7C, /*U+1D7C*/ /**/ 0x2C63, /*U+1D7D*/ /*LATIN SMALL LETTER P WITH STROKE*/ 0x1D7E, /*U+1D7E*/ /**/ 0x1D7F, /*U+1D7F*/ /**/ }; static const u_int16_t upper_table_4[512] = { 0x1E00, /*U+1E00*/ /**/ 0x1E00, /*U+1E01*/ /*LATIN SMALL LETTER A WITH RING BELOW*/ 0x1E02, /*U+1E02*/ /**/ 0x1E02, /*U+1E03*/ /*LATIN SMALL LETTER B WITH DOT ABOVE*/ 0x1E04, /*U+1E04*/ /**/ 0x1E04, /*U+1E05*/ /*LATIN SMALL LETTER B WITH DOT BELOW*/ 0x1E06, /*U+1E06*/ /**/ 0x1E06, /*U+1E07*/ /*LATIN SMALL LETTER B WITH LINE BELOW*/ 0x1E08, /*U+1E08*/ /**/ 0x1E08, /*U+1E09*/ /*LATIN SMALL LETTER C WITH CEDILLA AND ACUTE*/ 0x1E0A, /*U+1E0A*/ /**/ 0x1E0A, /*U+1E0B*/ /*LATIN SMALL LETTER D WITH DOT ABOVE*/ 0x1E0C, /*U+1E0C*/ /**/ 0x1E0C, /*U+1E0D*/ /*LATIN SMALL LETTER D WITH DOT BELOW*/ 0x1E0E, /*U+1E0E*/ /**/ 0x1E0E, /*U+1E0F*/ /*LATIN SMALL LETTER D WITH LINE BELOW*/ 0x1E10, /*U+1E10*/ /**/ 0x1E10, /*U+1E11*/ /*LATIN SMALL LETTER D WITH CEDILLA*/ 0x1E12, /*U+1E12*/ /**/ 0x1E12, /*U+1E13*/ /*LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW*/ 0x1E14, /*U+1E14*/ /**/ 0x1E14, /*U+1E15*/ /*LATIN SMALL LETTER E WITH MACRON AND GRAVE*/ 0x1E16, /*U+1E16*/ /**/ 0x1E16, /*U+1E17*/ /*LATIN SMALL LETTER E WITH MACRON AND ACUTE*/ 0x1E18, /*U+1E18*/ /**/ 0x1E18, /*U+1E19*/ /*LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW*/ 0x1E1A, /*U+1E1A*/ /**/ 0x1E1A, /*U+1E1B*/ /*LATIN SMALL LETTER E WITH TILDE BELOW*/ 0x1E1C, /*U+1E1C*/ /**/ 0x1E1C, /*U+1E1D*/ /*LATIN SMALL LETTER E WITH CEDILLA AND BREVE*/ 0x1E1E, /*U+1E1E*/ /**/ 0x1E1E, /*U+1E1F*/ /*LATIN SMALL LETTER F WITH DOT ABOVE*/ 0x1E20, /*U+1E20*/ /**/ 0x1E20, /*U+1E21*/ /*LATIN SMALL LETTER G WITH MACRON*/ 0x1E22, /*U+1E22*/ /**/ 0x1E22, /*U+1E23*/ /*LATIN SMALL LETTER H WITH DOT ABOVE*/ 0x1E24, /*U+1E24*/ /**/ 0x1E24, /*U+1E25*/ /*LATIN SMALL LETTER H WITH DOT BELOW*/ 0x1E26, /*U+1E26*/ /**/ 0x1E26, /*U+1E27*/ /*LATIN SMALL LETTER H WITH DIAERESIS*/ 0x1E28, /*U+1E28*/ /**/ 0x1E28, /*U+1E29*/ /*LATIN SMALL LETTER H WITH CEDILLA*/ 0x1E2A, /*U+1E2A*/ /**/ 0x1E2A, /*U+1E2B*/ /*LATIN SMALL LETTER H WITH BREVE BELOW*/ 0x1E2C, /*U+1E2C*/ /**/ 0x1E2C, /*U+1E2D*/ /*LATIN SMALL LETTER I WITH TILDE BELOW*/ 0x1E2E, /*U+1E2E*/ /**/ 0x1E2E, /*U+1E2F*/ /*LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE*/ 0x1E30, /*U+1E30*/ /**/ 0x1E30, /*U+1E31*/ /*LATIN SMALL LETTER K WITH ACUTE*/ 0x1E32, /*U+1E32*/ /**/ 0x1E32, /*U+1E33*/ /*LATIN SMALL LETTER K WITH DOT BELOW*/ 0x1E34, /*U+1E34*/ /**/ 0x1E34, /*U+1E35*/ /*LATIN SMALL LETTER K WITH LINE BELOW*/ 0x1E36, /*U+1E36*/ /**/ 0x1E36, /*U+1E37*/ /*LATIN SMALL LETTER L WITH DOT BELOW*/ 0x1E38, /*U+1E38*/ /**/ 0x1E38, /*U+1E39*/ /*LATIN SMALL LETTER L WITH DOT BELOW AND MACRON*/ 0x1E3A, /*U+1E3A*/ /**/ 0x1E3A, /*U+1E3B*/ /*LATIN SMALL LETTER L WITH LINE BELOW*/ 0x1E3C, /*U+1E3C*/ /**/ 0x1E3C, /*U+1E3D*/ /*LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW*/ 0x1E3E, /*U+1E3E*/ /**/ 0x1E3E, /*U+1E3F*/ /*LATIN SMALL LETTER M WITH ACUTE*/ 0x1E40, /*U+1E40*/ /**/ 0x1E40, /*U+1E41*/ /*LATIN SMALL LETTER M WITH DOT ABOVE*/ 0x1E42, /*U+1E42*/ /**/ 0x1E42, /*U+1E43*/ /*LATIN SMALL LETTER M WITH DOT BELOW*/ 0x1E44, /*U+1E44*/ /**/ 0x1E44, /*U+1E45*/ /*LATIN SMALL LETTER N WITH DOT ABOVE*/ 0x1E46, /*U+1E46*/ /**/ 0x1E46, /*U+1E47*/ /*LATIN SMALL LETTER N WITH DOT BELOW*/ 0x1E48, /*U+1E48*/ /**/ 0x1E48, /*U+1E49*/ /*LATIN SMALL LETTER N WITH LINE BELOW*/ 0x1E4A, /*U+1E4A*/ /**/ 0x1E4A, /*U+1E4B*/ /*LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW*/ 0x1E4C, /*U+1E4C*/ /**/ 0x1E4C, /*U+1E4D*/ /*LATIN SMALL LETTER O WITH TILDE AND ACUTE*/ 0x1E4E, /*U+1E4E*/ /**/ 0x1E4E, /*U+1E4F*/ /*LATIN SMALL LETTER O WITH TILDE AND DIAERESIS*/ 0x1E50, /*U+1E50*/ /**/ 0x1E50, /*U+1E51*/ /*LATIN SMALL LETTER O WITH MACRON AND GRAVE*/ 0x1E52, /*U+1E52*/ /**/ 0x1E52, /*U+1E53*/ /*LATIN SMALL LETTER O WITH MACRON AND ACUTE*/ 0x1E54, /*U+1E54*/ /**/ 0x1E54, /*U+1E55*/ /*LATIN SMALL LETTER P WITH ACUTE*/ 0x1E56, /*U+1E56*/ /**/ 0x1E56, /*U+1E57*/ /*LATIN SMALL LETTER P WITH DOT ABOVE*/ 0x1E58, /*U+1E58*/ /**/ 0x1E58, /*U+1E59*/ /*LATIN SMALL LETTER R WITH DOT ABOVE*/ 0x1E5A, /*U+1E5A*/ /**/ 0x1E5A, /*U+1E5B*/ /*LATIN SMALL LETTER R WITH DOT BELOW*/ 0x1E5C, /*U+1E5C*/ /**/ 0x1E5C, /*U+1E5D*/ /*LATIN SMALL LETTER R WITH DOT BELOW AND MACRON*/ 0x1E5E, /*U+1E5E*/ /**/ 0x1E5E, /*U+1E5F*/ /*LATIN SMALL LETTER R WITH LINE BELOW*/ 0x1E60, /*U+1E60*/ /**/ 0x1E60, /*U+1E61*/ /*LATIN SMALL LETTER S WITH DOT ABOVE*/ 0x1E62, /*U+1E62*/ /**/ 0x1E62, /*U+1E63*/ /*LATIN SMALL LETTER S WITH DOT BELOW*/ 0x1E64, /*U+1E64*/ /**/ 0x1E64, /*U+1E65*/ /*LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE*/ 0x1E66, /*U+1E66*/ /**/ 0x1E66, /*U+1E67*/ /*LATIN SMALL LETTER S WITH CARON AND DOT ABOVE*/ 0x1E68, /*U+1E68*/ /**/ 0x1E68, /*U+1E69*/ /*LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE*/ 0x1E6A, /*U+1E6A*/ /**/ 0x1E6A, /*U+1E6B*/ /*LATIN SMALL LETTER T WITH DOT ABOVE*/ 0x1E6C, /*U+1E6C*/ /**/ 0x1E6C, /*U+1E6D*/ /*LATIN SMALL LETTER T WITH DOT BELOW*/ 0x1E6E, /*U+1E6E*/ /**/ 0x1E6E, /*U+1E6F*/ /*LATIN SMALL LETTER T WITH LINE BELOW*/ 0x1E70, /*U+1E70*/ /**/ 0x1E70, /*U+1E71*/ /*LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW*/ 0x1E72, /*U+1E72*/ /**/ 0x1E72, /*U+1E73*/ /*LATIN SMALL LETTER U WITH DIAERESIS BELOW*/ 0x1E74, /*U+1E74*/ /**/ 0x1E74, /*U+1E75*/ /*LATIN SMALL LETTER U WITH TILDE BELOW*/ 0x1E76, /*U+1E76*/ /**/ 0x1E76, /*U+1E77*/ /*LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW*/ 0x1E78, /*U+1E78*/ /**/ 0x1E78, /*U+1E79*/ /*LATIN SMALL LETTER U WITH TILDE AND ACUTE*/ 0x1E7A, /*U+1E7A*/ /**/ 0x1E7A, /*U+1E7B*/ /*LATIN SMALL LETTER U WITH MACRON AND DIAERESIS*/ 0x1E7C, /*U+1E7C*/ /**/ 0x1E7C, /*U+1E7D*/ /*LATIN SMALL LETTER V WITH TILDE*/ 0x1E7E, /*U+1E7E*/ /**/ 0x1E7E, /*U+1E7F*/ /*LATIN SMALL LETTER V WITH DOT BELOW*/ 0x1E80, /*U+1E80*/ /**/ 0x1E80, /*U+1E81*/ /*LATIN SMALL LETTER W WITH GRAVE*/ 0x1E82, /*U+1E82*/ /**/ 0x1E82, /*U+1E83*/ /*LATIN SMALL LETTER W WITH ACUTE*/ 0x1E84, /*U+1E84*/ /**/ 0x1E84, /*U+1E85*/ /*LATIN SMALL LETTER W WITH DIAERESIS*/ 0x1E86, /*U+1E86*/ /**/ 0x1E86, /*U+1E87*/ /*LATIN SMALL LETTER W WITH DOT ABOVE*/ 0x1E88, /*U+1E88*/ /**/ 0x1E88, /*U+1E89*/ /*LATIN SMALL LETTER W WITH DOT BELOW*/ 0x1E8A, /*U+1E8A*/ /**/ 0x1E8A, /*U+1E8B*/ /*LATIN SMALL LETTER X WITH DOT ABOVE*/ 0x1E8C, /*U+1E8C*/ /**/ 0x1E8C, /*U+1E8D*/ /*LATIN SMALL LETTER X WITH DIAERESIS*/ 0x1E8E, /*U+1E8E*/ /**/ 0x1E8E, /*U+1E8F*/ /*LATIN SMALL LETTER Y WITH DOT ABOVE*/ 0x1E90, /*U+1E90*/ /**/ 0x1E90, /*U+1E91*/ /*LATIN SMALL LETTER Z WITH CIRCUMFLEX*/ 0x1E92, /*U+1E92*/ /**/ 0x1E92, /*U+1E93*/ /*LATIN SMALL LETTER Z WITH DOT BELOW*/ 0x1E94, /*U+1E94*/ /**/ 0x1E94, /*U+1E95*/ /*LATIN SMALL LETTER Z WITH LINE BELOW*/ 0x1E96, /*U+1E96*/ /**/ 0x1E97, /*U+1E97*/ /**/ 0x1E98, /*U+1E98*/ /**/ 0x1E99, /*U+1E99*/ /**/ 0x1E9A, /*U+1E9A*/ /**/ 0x1E60, /*U+1E9B*/ /*LATIN SMALL LETTER LONG S WITH DOT ABOVE*/ 0x1E9C, /*U+1E9C*/ /**/ 0x1E9D, /*U+1E9D*/ /**/ 0x1E9E, /*U+1E9E*/ /**/ 0x1E9F, /*U+1E9F*/ /**/ 0x1EA0, /*U+1EA0*/ /**/ 0x1EA0, /*U+1EA1*/ /*LATIN SMALL LETTER A WITH DOT BELOW*/ 0x1EA2, /*U+1EA2*/ /**/ 0x1EA2, /*U+1EA3*/ /*LATIN SMALL LETTER A WITH HOOK ABOVE*/ 0x1EA4, /*U+1EA4*/ /**/ 0x1EA4, /*U+1EA5*/ /*LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE*/ 0x1EA6, /*U+1EA6*/ /**/ 0x1EA6, /*U+1EA7*/ /*LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE*/ 0x1EA8, /*U+1EA8*/ /**/ 0x1EA8, /*U+1EA9*/ /*LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE*/ 0x1EAA, /*U+1EAA*/ /**/ 0x1EAA, /*U+1EAB*/ /*LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE*/ 0x1EAC, /*U+1EAC*/ /**/ 0x1EAC, /*U+1EAD*/ /*LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW*/ 0x1EAE, /*U+1EAE*/ /**/ 0x1EAE, /*U+1EAF*/ /*LATIN SMALL LETTER A WITH BREVE AND ACUTE*/ 0x1EB0, /*U+1EB0*/ /**/ 0x1EB0, /*U+1EB1*/ /*LATIN SMALL LETTER A WITH BREVE AND GRAVE*/ 0x1EB2, /*U+1EB2*/ /**/ 0x1EB2, /*U+1EB3*/ /*LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE*/ 0x1EB4, /*U+1EB4*/ /**/ 0x1EB4, /*U+1EB5*/ /*LATIN SMALL LETTER A WITH BREVE AND TILDE*/ 0x1EB6, /*U+1EB6*/ /**/ 0x1EB6, /*U+1EB7*/ /*LATIN SMALL LETTER A WITH BREVE AND DOT BELOW*/ 0x1EB8, /*U+1EB8*/ /**/ 0x1EB8, /*U+1EB9*/ /*LATIN SMALL LETTER E WITH DOT BELOW*/ 0x1EBA, /*U+1EBA*/ /**/ 0x1EBA, /*U+1EBB*/ /*LATIN SMALL LETTER E WITH HOOK ABOVE*/ 0x1EBC, /*U+1EBC*/ /**/ 0x1EBC, /*U+1EBD*/ /*LATIN SMALL LETTER E WITH TILDE*/ 0x1EBE, /*U+1EBE*/ /**/ 0x1EBE, /*U+1EBF*/ /*LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE*/ 0x1EC0, /*U+1EC0*/ /**/ 0x1EC0, /*U+1EC1*/ /*LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE*/ 0x1EC2, /*U+1EC2*/ /**/ 0x1EC2, /*U+1EC3*/ /*LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE*/ 0x1EC4, /*U+1EC4*/ /**/ 0x1EC4, /*U+1EC5*/ /*LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE*/ 0x1EC6, /*U+1EC6*/ /**/ 0x1EC6, /*U+1EC7*/ /*LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW*/ 0x1EC8, /*U+1EC8*/ /**/ 0x1EC8, /*U+1EC9*/ /*LATIN SMALL LETTER I WITH HOOK ABOVE*/ 0x1ECA, /*U+1ECA*/ /**/ 0x1ECA, /*U+1ECB*/ /*LATIN SMALL LETTER I WITH DOT BELOW*/ 0x1ECC, /*U+1ECC*/ /**/ 0x1ECC, /*U+1ECD*/ /*LATIN SMALL LETTER O WITH DOT BELOW*/ 0x1ECE, /*U+1ECE*/ /**/ 0x1ECE, /*U+1ECF*/ /*LATIN SMALL LETTER O WITH HOOK ABOVE*/ 0x1ED0, /*U+1ED0*/ /**/ 0x1ED0, /*U+1ED1*/ /*LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE*/ 0x1ED2, /*U+1ED2*/ /**/ 0x1ED2, /*U+1ED3*/ /*LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE*/ 0x1ED4, /*U+1ED4*/ /**/ 0x1ED4, /*U+1ED5*/ /*LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE*/ 0x1ED6, /*U+1ED6*/ /**/ 0x1ED6, /*U+1ED7*/ /*LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE*/ 0x1ED8, /*U+1ED8*/ /**/ 0x1ED8, /*U+1ED9*/ /*LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW*/ 0x1EDA, /*U+1EDA*/ /**/ 0x1EDA, /*U+1EDB*/ /*LATIN SMALL LETTER O WITH HORN AND ACUTE*/ 0x1EDC, /*U+1EDC*/ /**/ 0x1EDC, /*U+1EDD*/ /*LATIN SMALL LETTER O WITH HORN AND GRAVE*/ 0x1EDE, /*U+1EDE*/ /**/ 0x1EDE, /*U+1EDF*/ /*LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE*/ 0x1EE0, /*U+1EE0*/ /**/ 0x1EE0, /*U+1EE1*/ /*LATIN SMALL LETTER O WITH HORN AND TILDE*/ 0x1EE2, /*U+1EE2*/ /**/ 0x1EE2, /*U+1EE3*/ /*LATIN SMALL LETTER O WITH HORN AND DOT BELOW*/ 0x1EE4, /*U+1EE4*/ /**/ 0x1EE4, /*U+1EE5*/ /*LATIN SMALL LETTER U WITH DOT BELOW*/ 0x1EE6, /*U+1EE6*/ /**/ 0x1EE6, /*U+1EE7*/ /*LATIN SMALL LETTER U WITH HOOK ABOVE*/ 0x1EE8, /*U+1EE8*/ /**/ 0x1EE8, /*U+1EE9*/ /*LATIN SMALL LETTER U WITH HORN AND ACUTE*/ 0x1EEA, /*U+1EEA*/ /**/ 0x1EEA, /*U+1EEB*/ /*LATIN SMALL LETTER U WITH HORN AND GRAVE*/ 0x1EEC, /*U+1EEC*/ /**/ 0x1EEC, /*U+1EED*/ /*LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE*/ 0x1EEE, /*U+1EEE*/ /**/ 0x1EEE, /*U+1EEF*/ /*LATIN SMALL LETTER U WITH HORN AND TILDE*/ 0x1EF0, /*U+1EF0*/ /**/ 0x1EF0, /*U+1EF1*/ /*LATIN SMALL LETTER U WITH HORN AND DOT BELOW*/ 0x1EF2, /*U+1EF2*/ /**/ 0x1EF2, /*U+1EF3*/ /*LATIN SMALL LETTER Y WITH GRAVE*/ 0x1EF4, /*U+1EF4*/ /**/ 0x1EF4, /*U+1EF5*/ /*LATIN SMALL LETTER Y WITH DOT BELOW*/ 0x1EF6, /*U+1EF6*/ /**/ 0x1EF6, /*U+1EF7*/ /*LATIN SMALL LETTER Y WITH HOOK ABOVE*/ 0x1EF8, /*U+1EF8*/ /**/ 0x1EF8, /*U+1EF9*/ /*LATIN SMALL LETTER Y WITH TILDE*/ 0x1EFA, /*U+1EFA*/ /**/ 0x1EFA, /*U+1EFB*/ /*LATIN SMALL LETTER MIDDLE-WELSH LL*/ 0x1EFC, /*U+1EFC*/ /**/ 0x1EFC, /*U+1EFD*/ /*LATIN SMALL LETTER MIDDLE-WELSH V*/ 0x1EFE, /*U+1EFE*/ /**/ 0x1EFE, /*U+1EFF*/ /*LATIN SMALL LETTER Y WITH LOOP*/ 0x1F08, /*U+1F00*/ /*GREEK SMALL LETTER ALPHA WITH PSILI*/ 0x1F09, /*U+1F01*/ /*GREEK SMALL LETTER ALPHA WITH DASIA*/ 0x1F0A, /*U+1F02*/ /*GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA*/ 0x1F0B, /*U+1F03*/ /*GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA*/ 0x1F0C, /*U+1F04*/ /*GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA*/ 0x1F0D, /*U+1F05*/ /*GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA*/ 0x1F0E, /*U+1F06*/ /*GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI*/ 0x1F0F, /*U+1F07*/ /*GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI*/ 0x1F08, /*U+1F08*/ /**/ 0x1F09, /*U+1F09*/ /**/ 0x1F0A, /*U+1F0A*/ /**/ 0x1F0B, /*U+1F0B*/ /**/ 0x1F0C, /*U+1F0C*/ /**/ 0x1F0D, /*U+1F0D*/ /**/ 0x1F0E, /*U+1F0E*/ /**/ 0x1F0F, /*U+1F0F*/ /**/ 0x1F18, /*U+1F10*/ /*GREEK SMALL LETTER EPSILON WITH PSILI*/ 0x1F19, /*U+1F11*/ /*GREEK SMALL LETTER EPSILON WITH DASIA*/ 0x1F1A, /*U+1F12*/ /*GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA*/ 0x1F1B, /*U+1F13*/ /*GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA*/ 0x1F1C, /*U+1F14*/ /*GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA*/ 0x1F1D, /*U+1F15*/ /*GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA*/ 0x1F16, /*U+1F16*/ /**/ 0x1F17, /*U+1F17*/ /**/ 0x1F18, /*U+1F18*/ /**/ 0x1F19, /*U+1F19*/ /**/ 0x1F1A, /*U+1F1A*/ /**/ 0x1F1B, /*U+1F1B*/ /**/ 0x1F1C, /*U+1F1C*/ /**/ 0x1F1D, /*U+1F1D*/ /**/ 0x1F1E, /*U+1F1E*/ /**/ 0x1F1F, /*U+1F1F*/ /**/ 0x1F28, /*U+1F20*/ /*GREEK SMALL LETTER ETA WITH PSILI*/ 0x1F29, /*U+1F21*/ /*GREEK SMALL LETTER ETA WITH DASIA*/ 0x1F2A, /*U+1F22*/ /*GREEK SMALL LETTER ETA WITH PSILI AND VARIA*/ 0x1F2B, /*U+1F23*/ /*GREEK SMALL LETTER ETA WITH DASIA AND VARIA*/ 0x1F2C, /*U+1F24*/ /*GREEK SMALL LETTER ETA WITH PSILI AND OXIA*/ 0x1F2D, /*U+1F25*/ /*GREEK SMALL LETTER ETA WITH DASIA AND OXIA*/ 0x1F2E, /*U+1F26*/ /*GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI*/ 0x1F2F, /*U+1F27*/ /*GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI*/ 0x1F28, /*U+1F28*/ /**/ 0x1F29, /*U+1F29*/ /**/ 0x1F2A, /*U+1F2A*/ /**/ 0x1F2B, /*U+1F2B*/ /**/ 0x1F2C, /*U+1F2C*/ /**/ 0x1F2D, /*U+1F2D*/ /**/ 0x1F2E, /*U+1F2E*/ /**/ 0x1F2F, /*U+1F2F*/ /**/ 0x1F38, /*U+1F30*/ /*GREEK SMALL LETTER IOTA WITH PSILI*/ 0x1F39, /*U+1F31*/ /*GREEK SMALL LETTER IOTA WITH DASIA*/ 0x1F3A, /*U+1F32*/ /*GREEK SMALL LETTER IOTA WITH PSILI AND VARIA*/ 0x1F3B, /*U+1F33*/ /*GREEK SMALL LETTER IOTA WITH DASIA AND VARIA*/ 0x1F3C, /*U+1F34*/ /*GREEK SMALL LETTER IOTA WITH PSILI AND OXIA*/ 0x1F3D, /*U+1F35*/ /*GREEK SMALL LETTER IOTA WITH DASIA AND OXIA*/ 0x1F3E, /*U+1F36*/ /*GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI*/ 0x1F3F, /*U+1F37*/ /*GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI*/ 0x1F38, /*U+1F38*/ /**/ 0x1F39, /*U+1F39*/ /**/ 0x1F3A, /*U+1F3A*/ /**/ 0x1F3B, /*U+1F3B*/ /**/ 0x1F3C, /*U+1F3C*/ /**/ 0x1F3D, /*U+1F3D*/ /**/ 0x1F3E, /*U+1F3E*/ /**/ 0x1F3F, /*U+1F3F*/ /**/ 0x1F48, /*U+1F40*/ /*GREEK SMALL LETTER OMICRON WITH PSILI*/ 0x1F49, /*U+1F41*/ /*GREEK SMALL LETTER OMICRON WITH DASIA*/ 0x1F4A, /*U+1F42*/ /*GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA*/ 0x1F4B, /*U+1F43*/ /*GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA*/ 0x1F4C, /*U+1F44*/ /*GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA*/ 0x1F4D, /*U+1F45*/ /*GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA*/ 0x1F46, /*U+1F46*/ /**/ 0x1F47, /*U+1F47*/ /**/ 0x1F48, /*U+1F48*/ /**/ 0x1F49, /*U+1F49*/ /**/ 0x1F4A, /*U+1F4A*/ /**/ 0x1F4B, /*U+1F4B*/ /**/ 0x1F4C, /*U+1F4C*/ /**/ 0x1F4D, /*U+1F4D*/ /**/ 0x1F4E, /*U+1F4E*/ /**/ 0x1F4F, /*U+1F4F*/ /**/ 0x1F50, /*U+1F50*/ /**/ 0x1F59, /*U+1F51*/ /*GREEK SMALL LETTER UPSILON WITH DASIA*/ 0x1F52, /*U+1F52*/ /**/ 0x1F5B, /*U+1F53*/ /*GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA*/ 0x1F54, /*U+1F54*/ /**/ 0x1F5D, /*U+1F55*/ /*GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA*/ 0x1F56, /*U+1F56*/ /**/ 0x1F5F, /*U+1F57*/ /*GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI*/ 0x1F58, /*U+1F58*/ /**/ 0x1F59, /*U+1F59*/ /**/ 0x1F5A, /*U+1F5A*/ /**/ 0x1F5B, /*U+1F5B*/ /**/ 0x1F5C, /*U+1F5C*/ /**/ 0x1F5D, /*U+1F5D*/ /**/ 0x1F5E, /*U+1F5E*/ /**/ 0x1F5F, /*U+1F5F*/ /**/ 0x1F68, /*U+1F60*/ /*GREEK SMALL LETTER OMEGA WITH PSILI*/ 0x1F69, /*U+1F61*/ /*GREEK SMALL LETTER OMEGA WITH DASIA*/ 0x1F6A, /*U+1F62*/ /*GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA*/ 0x1F6B, /*U+1F63*/ /*GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA*/ 0x1F6C, /*U+1F64*/ /*GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA*/ 0x1F6D, /*U+1F65*/ /*GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA*/ 0x1F6E, /*U+1F66*/ /*GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI*/ 0x1F6F, /*U+1F67*/ /*GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI*/ 0x1F68, /*U+1F68*/ /**/ 0x1F69, /*U+1F69*/ /**/ 0x1F6A, /*U+1F6A*/ /**/ 0x1F6B, /*U+1F6B*/ /**/ 0x1F6C, /*U+1F6C*/ /**/ 0x1F6D, /*U+1F6D*/ /**/ 0x1F6E, /*U+1F6E*/ /**/ 0x1F6F, /*U+1F6F*/ /**/ 0x1FBA, /*U+1F70*/ /*GREEK SMALL LETTER ALPHA WITH VARIA*/ 0x1FBB, /*U+1F71*/ /*GREEK SMALL LETTER ALPHA WITH OXIA*/ 0x1FC8, /*U+1F72*/ /*GREEK SMALL LETTER EPSILON WITH VARIA*/ 0x1FC9, /*U+1F73*/ /*GREEK SMALL LETTER EPSILON WITH OXIA*/ 0x1FCA, /*U+1F74*/ /*GREEK SMALL LETTER ETA WITH VARIA*/ 0x1FCB, /*U+1F75*/ /*GREEK SMALL LETTER ETA WITH OXIA*/ 0x1FDA, /*U+1F76*/ /*GREEK SMALL LETTER IOTA WITH VARIA*/ 0x1FDB, /*U+1F77*/ /*GREEK SMALL LETTER IOTA WITH OXIA*/ 0x1FF8, /*U+1F78*/ /*GREEK SMALL LETTER OMICRON WITH VARIA*/ 0x1FF9, /*U+1F79*/ /*GREEK SMALL LETTER OMICRON WITH OXIA*/ 0x1FEA, /*U+1F7A*/ /*GREEK SMALL LETTER UPSILON WITH VARIA*/ 0x1FEB, /*U+1F7B*/ /*GREEK SMALL LETTER UPSILON WITH OXIA*/ 0x1FFA, /*U+1F7C*/ /*GREEK SMALL LETTER OMEGA WITH VARIA*/ 0x1FFB, /*U+1F7D*/ /*GREEK SMALL LETTER OMEGA WITH OXIA*/ 0x1F7E, /*U+1F7E*/ /**/ 0x1F7F, /*U+1F7F*/ /**/ 0x1F88, /*U+1F80*/ /*GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI*/ 0x1F89, /*U+1F81*/ /*GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI*/ 0x1F8A, /*U+1F82*/ /*GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI*/ 0x1F8B, /*U+1F83*/ /*GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI*/ 0x1F8C, /*U+1F84*/ /*GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI*/ 0x1F8D, /*U+1F85*/ /*GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI*/ 0x1F8E, /*U+1F86*/ /*GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI*/ 0x1F8F, /*U+1F87*/ /*GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI*/ 0x1F88, /*U+1F88*/ /**/ 0x1F89, /*U+1F89*/ /**/ 0x1F8A, /*U+1F8A*/ /**/ 0x1F8B, /*U+1F8B*/ /**/ 0x1F8C, /*U+1F8C*/ /**/ 0x1F8D, /*U+1F8D*/ /**/ 0x1F8E, /*U+1F8E*/ /**/ 0x1F8F, /*U+1F8F*/ /**/ 0x1F98, /*U+1F90*/ /*GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI*/ 0x1F99, /*U+1F91*/ /*GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI*/ 0x1F9A, /*U+1F92*/ /*GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI*/ 0x1F9B, /*U+1F93*/ /*GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI*/ 0x1F9C, /*U+1F94*/ /*GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI*/ 0x1F9D, /*U+1F95*/ /*GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI*/ 0x1F9E, /*U+1F96*/ /*GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI*/ 0x1F9F, /*U+1F97*/ /*GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI*/ 0x1F98, /*U+1F98*/ /**/ 0x1F99, /*U+1F99*/ /**/ 0x1F9A, /*U+1F9A*/ /**/ 0x1F9B, /*U+1F9B*/ /**/ 0x1F9C, /*U+1F9C*/ /**/ 0x1F9D, /*U+1F9D*/ /**/ 0x1F9E, /*U+1F9E*/ /**/ 0x1F9F, /*U+1F9F*/ /**/ 0x1FA8, /*U+1FA0*/ /*GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI*/ 0x1FA9, /*U+1FA1*/ /*GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI*/ 0x1FAA, /*U+1FA2*/ /*GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI*/ 0x1FAB, /*U+1FA3*/ /*GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI*/ 0x1FAC, /*U+1FA4*/ /*GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI*/ 0x1FAD, /*U+1FA5*/ /*GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI*/ 0x1FAE, /*U+1FA6*/ /*GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI*/ 0x1FAF, /*U+1FA7*/ /*GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI*/ 0x1FA8, /*U+1FA8*/ /**/ 0x1FA9, /*U+1FA9*/ /**/ 0x1FAA, /*U+1FAA*/ /**/ 0x1FAB, /*U+1FAB*/ /**/ 0x1FAC, /*U+1FAC*/ /**/ 0x1FAD, /*U+1FAD*/ /**/ 0x1FAE, /*U+1FAE*/ /**/ 0x1FAF, /*U+1FAF*/ /**/ 0x1FB8, /*U+1FB0*/ /*GREEK SMALL LETTER ALPHA WITH VRACHY*/ 0x1FB9, /*U+1FB1*/ /*GREEK SMALL LETTER ALPHA WITH MACRON*/ 0x1FB2, /*U+1FB2*/ /**/ 0x1FBC, /*U+1FB3*/ /*GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI*/ 0x1FB4, /*U+1FB4*/ /**/ 0x1FB5, /*U+1FB5*/ /**/ 0x1FB6, /*U+1FB6*/ /**/ 0x1FB7, /*U+1FB7*/ /**/ 0x1FB8, /*U+1FB8*/ /**/ 0x1FB9, /*U+1FB9*/ /**/ 0x1FBA, /*U+1FBA*/ /**/ 0x1FBB, /*U+1FBB*/ /**/ 0x1FBC, /*U+1FBC*/ /**/ 0x1FBD, /*U+1FBD*/ /**/ 0x0399, /*U+1FBE*/ /*GREEK PROSGEGRAMMENI*/ 0x1FBF, /*U+1FBF*/ /**/ 0x1FC0, /*U+1FC0*/ /**/ 0x1FC1, /*U+1FC1*/ /**/ 0x1FC2, /*U+1FC2*/ /**/ 0x1FCC, /*U+1FC3*/ /*GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI*/ 0x1FC4, /*U+1FC4*/ /**/ 0x1FC5, /*U+1FC5*/ /**/ 0x1FC6, /*U+1FC6*/ /**/ 0x1FC7, /*U+1FC7*/ /**/ 0x1FC8, /*U+1FC8*/ /**/ 0x1FC9, /*U+1FC9*/ /**/ 0x1FCA, /*U+1FCA*/ /**/ 0x1FCB, /*U+1FCB*/ /**/ 0x1FCC, /*U+1FCC*/ /**/ 0x1FCD, /*U+1FCD*/ /**/ 0x1FCE, /*U+1FCE*/ /**/ 0x1FCF, /*U+1FCF*/ /**/ 0x1FD8, /*U+1FD0*/ /*GREEK SMALL LETTER IOTA WITH VRACHY*/ 0x1FD9, /*U+1FD1*/ /*GREEK SMALL LETTER IOTA WITH MACRON*/ 0x1FD2, /*U+1FD2*/ /**/ 0x1FD3, /*U+1FD3*/ /**/ 0x1FD4, /*U+1FD4*/ /**/ 0x1FD5, /*U+1FD5*/ /**/ 0x1FD6, /*U+1FD6*/ /**/ 0x1FD7, /*U+1FD7*/ /**/ 0x1FD8, /*U+1FD8*/ /**/ 0x1FD9, /*U+1FD9*/ /**/ 0x1FDA, /*U+1FDA*/ /**/ 0x1FDB, /*U+1FDB*/ /**/ 0x1FDC, /*U+1FDC*/ /**/ 0x1FDD, /*U+1FDD*/ /**/ 0x1FDE, /*U+1FDE*/ /**/ 0x1FDF, /*U+1FDF*/ /**/ 0x1FE8, /*U+1FE0*/ /*GREEK SMALL LETTER UPSILON WITH VRACHY*/ 0x1FE9, /*U+1FE1*/ /*GREEK SMALL LETTER UPSILON WITH MACRON*/ 0x1FE2, /*U+1FE2*/ /**/ 0x1FE3, /*U+1FE3*/ /**/ 0x1FE4, /*U+1FE4*/ /**/ 0x1FEC, /*U+1FE5*/ /*GREEK SMALL LETTER RHO WITH DASIA*/ 0x1FE6, /*U+1FE6*/ /**/ 0x1FE7, /*U+1FE7*/ /**/ 0x1FE8, /*U+1FE8*/ /**/ 0x1FE9, /*U+1FE9*/ /**/ 0x1FEA, /*U+1FEA*/ /**/ 0x1FEB, /*U+1FEB*/ /**/ 0x1FEC, /*U+1FEC*/ /**/ 0x1FED, /*U+1FED*/ /**/ 0x1FEE, /*U+1FEE*/ /**/ 0x1FEF, /*U+1FEF*/ /**/ 0x1FF0, /*U+1FF0*/ /**/ 0x1FF1, /*U+1FF1*/ /**/ 0x1FF2, /*U+1FF2*/ /**/ 0x1FFC, /*U+1FF3*/ /*GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI*/ 0x1FF4, /*U+1FF4*/ /**/ 0x1FF5, /*U+1FF5*/ /**/ 0x1FF6, /*U+1FF6*/ /**/ 0x1FF7, /*U+1FF7*/ /**/ 0x1FF8, /*U+1FF8*/ /**/ 0x1FF9, /*U+1FF9*/ /**/ 0x1FFA, /*U+1FFA*/ /**/ 0x1FFB, /*U+1FFB*/ /**/ 0x1FFC, /*U+1FFC*/ /**/ 0x1FFD, /*U+1FFD*/ /**/ 0x1FFE, /*U+1FFE*/ /**/ 0x1FFF, /*U+1FFF*/ /**/ }; static const u_int16_t upper_table_5[128] = { 0x2140, /*U+2140*/ /**/ 0x2141, /*U+2141*/ /**/ 0x2142, /*U+2142*/ /**/ 0x2143, /*U+2143*/ /**/ 0x2144, /*U+2144*/ /**/ 0x2145, /*U+2145*/ /**/ 0x2146, /*U+2146*/ /**/ 0x2147, /*U+2147*/ /**/ 0x2148, /*U+2148*/ /**/ 0x2149, /*U+2149*/ /**/ 0x214A, /*U+214A*/ /**/ 0x214B, /*U+214B*/ /**/ 0x214C, /*U+214C*/ /**/ 0x214D, /*U+214D*/ /**/ 0x2132, /*U+214E*/ /*TURNED SMALL F*/ 0x214F, /*U+214F*/ /**/ 0x2150, /*U+2150*/ /**/ 0x2151, /*U+2151*/ /**/ 0x2152, /*U+2152*/ /**/ 0x2153, /*U+2153*/ /**/ 0x2154, /*U+2154*/ /**/ 0x2155, /*U+2155*/ /**/ 0x2156, /*U+2156*/ /**/ 0x2157, /*U+2157*/ /**/ 0x2158, /*U+2158*/ /**/ 0x2159, /*U+2159*/ /**/ 0x215A, /*U+215A*/ /**/ 0x215B, /*U+215B*/ /**/ 0x215C, /*U+215C*/ /**/ 0x215D, /*U+215D*/ /**/ 0x215E, /*U+215E*/ /**/ 0x215F, /*U+215F*/ /**/ 0x2160, /*U+2160*/ /**/ 0x2161, /*U+2161*/ /**/ 0x2162, /*U+2162*/ /**/ 0x2163, /*U+2163*/ /**/ 0x2164, /*U+2164*/ /**/ 0x2165, /*U+2165*/ /**/ 0x2166, /*U+2166*/ /**/ 0x2167, /*U+2167*/ /**/ 0x2168, /*U+2168*/ /**/ 0x2169, /*U+2169*/ /**/ 0x216A, /*U+216A*/ /**/ 0x216B, /*U+216B*/ /**/ 0x216C, /*U+216C*/ /**/ 0x216D, /*U+216D*/ /**/ 0x216E, /*U+216E*/ /**/ 0x216F, /*U+216F*/ /**/ 0x2160, /*U+2170*/ /*SMALL ROMAN NUMERAL ONE*/ 0x2161, /*U+2171*/ /*SMALL ROMAN NUMERAL TWO*/ 0x2162, /*U+2172*/ /*SMALL ROMAN NUMERAL THREE*/ 0x2163, /*U+2173*/ /*SMALL ROMAN NUMERAL FOUR*/ 0x2164, /*U+2174*/ /*SMALL ROMAN NUMERAL FIVE*/ 0x2165, /*U+2175*/ /*SMALL ROMAN NUMERAL SIX*/ 0x2166, /*U+2176*/ /*SMALL ROMAN NUMERAL SEVEN*/ 0x2167, /*U+2177*/ /*SMALL ROMAN NUMERAL EIGHT*/ 0x2168, /*U+2178*/ /*SMALL ROMAN NUMERAL NINE*/ 0x2169, /*U+2179*/ /*SMALL ROMAN NUMERAL TEN*/ 0x216A, /*U+217A*/ /*SMALL ROMAN NUMERAL ELEVEN*/ 0x216B, /*U+217B*/ /*SMALL ROMAN NUMERAL TWELVE*/ 0x216C, /*U+217C*/ /*SMALL ROMAN NUMERAL FIFTY*/ 0x216D, /*U+217D*/ /*SMALL ROMAN NUMERAL ONE HUNDRED*/ 0x216E, /*U+217E*/ /*SMALL ROMAN NUMERAL FIVE HUNDRED*/ 0x216F, /*U+217F*/ /*SMALL ROMAN NUMERAL ONE THOUSAND*/ 0x2180, /*U+2180*/ /**/ 0x2181, /*U+2181*/ /**/ 0x2182, /*U+2182*/ /**/ 0x2183, /*U+2183*/ /**/ 0x2183, /*U+2184*/ /*LATIN SMALL LETTER REVERSED C*/ 0x2185, /*U+2185*/ /**/ 0x2186, /*U+2186*/ /**/ 0x2187, /*U+2187*/ /**/ 0x2188, /*U+2188*/ /**/ 0x2189, /*U+2189*/ /**/ 0x218A, /*U+218A*/ /**/ 0x218B, /*U+218B*/ /**/ 0x218C, /*U+218C*/ /**/ 0x218D, /*U+218D*/ /**/ 0x218E, /*U+218E*/ /**/ 0x218F, /*U+218F*/ /**/ 0x2190, /*U+2190*/ /**/ 0x2191, /*U+2191*/ /**/ 0x2192, /*U+2192*/ /**/ 0x2193, /*U+2193*/ /**/ 0x2194, /*U+2194*/ /**/ 0x2195, /*U+2195*/ /**/ 0x2196, /*U+2196*/ /**/ 0x2197, /*U+2197*/ /**/ 0x2198, /*U+2198*/ /**/ 0x2199, /*U+2199*/ /**/ 0x219A, /*U+219A*/ /**/ 0x219B, /*U+219B*/ /**/ 0x219C, /*U+219C*/ /**/ 0x219D, /*U+219D*/ /**/ 0x219E, /*U+219E*/ /**/ 0x219F, /*U+219F*/ /**/ 0x21A0, /*U+21A0*/ /**/ 0x21A1, /*U+21A1*/ /**/ 0x21A2, /*U+21A2*/ /**/ 0x21A3, /*U+21A3*/ /**/ 0x21A4, /*U+21A4*/ /**/ 0x21A5, /*U+21A5*/ /**/ 0x21A6, /*U+21A6*/ /**/ 0x21A7, /*U+21A7*/ /**/ 0x21A8, /*U+21A8*/ /**/ 0x21A9, /*U+21A9*/ /**/ 0x21AA, /*U+21AA*/ /**/ 0x21AB, /*U+21AB*/ /**/ 0x21AC, /*U+21AC*/ /**/ 0x21AD, /*U+21AD*/ /**/ 0x21AE, /*U+21AE*/ /**/ 0x21AF, /*U+21AF*/ /**/ 0x21B0, /*U+21B0*/ /**/ 0x21B1, /*U+21B1*/ /**/ 0x21B2, /*U+21B2*/ /**/ 0x21B3, /*U+21B3*/ /**/ 0x21B4, /*U+21B4*/ /**/ 0x21B5, /*U+21B5*/ /**/ 0x21B6, /*U+21B6*/ /**/ 0x21B7, /*U+21B7*/ /**/ 0x21B8, /*U+21B8*/ /**/ 0x21B9, /*U+21B9*/ /**/ 0x21BA, /*U+21BA*/ /**/ 0x21BB, /*U+21BB*/ /**/ 0x21BC, /*U+21BC*/ /**/ 0x21BD, /*U+21BD*/ /**/ 0x21BE, /*U+21BE*/ /**/ 0x21BF, /*U+21BF*/ /**/ }; static const u_int16_t upper_table_6[64] = { 0x24C0, /*U+24C0*/ /**/ 0x24C1, /*U+24C1*/ /**/ 0x24C2, /*U+24C2*/ /**/ 0x24C3, /*U+24C3*/ /**/ 0x24C4, /*U+24C4*/ /**/ 0x24C5, /*U+24C5*/ /**/ 0x24C6, /*U+24C6*/ /**/ 0x24C7, /*U+24C7*/ /**/ 0x24C8, /*U+24C8*/ /**/ 0x24C9, /*U+24C9*/ /**/ 0x24CA, /*U+24CA*/ /**/ 0x24CB, /*U+24CB*/ /**/ 0x24CC, /*U+24CC*/ /**/ 0x24CD, /*U+24CD*/ /**/ 0x24CE, /*U+24CE*/ /**/ 0x24CF, /*U+24CF*/ /**/ 0x24B6, /*U+24D0*/ /*CIRCLED LATIN SMALL LETTER A*/ 0x24B7, /*U+24D1*/ /*CIRCLED LATIN SMALL LETTER B*/ 0x24B8, /*U+24D2*/ /*CIRCLED LATIN SMALL LETTER C*/ 0x24B9, /*U+24D3*/ /*CIRCLED LATIN SMALL LETTER D*/ 0x24BA, /*U+24D4*/ /*CIRCLED LATIN SMALL LETTER E*/ 0x24BB, /*U+24D5*/ /*CIRCLED LATIN SMALL LETTER F*/ 0x24BC, /*U+24D6*/ /*CIRCLED LATIN SMALL LETTER G*/ 0x24BD, /*U+24D7*/ /*CIRCLED LATIN SMALL LETTER H*/ 0x24BE, /*U+24D8*/ /*CIRCLED LATIN SMALL LETTER I*/ 0x24BF, /*U+24D9*/ /*CIRCLED LATIN SMALL LETTER J*/ 0x24C0, /*U+24DA*/ /*CIRCLED LATIN SMALL LETTER K*/ 0x24C1, /*U+24DB*/ /*CIRCLED LATIN SMALL LETTER L*/ 0x24C2, /*U+24DC*/ /*CIRCLED LATIN SMALL LETTER M*/ 0x24C3, /*U+24DD*/ /*CIRCLED LATIN SMALL LETTER N*/ 0x24C4, /*U+24DE*/ /*CIRCLED LATIN SMALL LETTER O*/ 0x24C5, /*U+24DF*/ /*CIRCLED LATIN SMALL LETTER P*/ 0x24C6, /*U+24E0*/ /*CIRCLED LATIN SMALL LETTER Q*/ 0x24C7, /*U+24E1*/ /*CIRCLED LATIN SMALL LETTER R*/ 0x24C8, /*U+24E2*/ /*CIRCLED LATIN SMALL LETTER S*/ 0x24C9, /*U+24E3*/ /*CIRCLED LATIN SMALL LETTER T*/ 0x24CA, /*U+24E4*/ /*CIRCLED LATIN SMALL LETTER U*/ 0x24CB, /*U+24E5*/ /*CIRCLED LATIN SMALL LETTER V*/ 0x24CC, /*U+24E6*/ /*CIRCLED LATIN SMALL LETTER W*/ 0x24CD, /*U+24E7*/ /*CIRCLED LATIN SMALL LETTER X*/ 0x24CE, /*U+24E8*/ /*CIRCLED LATIN SMALL LETTER Y*/ 0x24CF, /*U+24E9*/ /*CIRCLED LATIN SMALL LETTER Z*/ 0x24EA, /*U+24EA*/ /**/ 0x24EB, /*U+24EB*/ /**/ 0x24EC, /*U+24EC*/ /**/ 0x24ED, /*U+24ED*/ /**/ 0x24EE, /*U+24EE*/ /**/ 0x24EF, /*U+24EF*/ /**/ 0x24F0, /*U+24F0*/ /**/ 0x24F1, /*U+24F1*/ /**/ 0x24F2, /*U+24F2*/ /**/ 0x24F3, /*U+24F3*/ /**/ 0x24F4, /*U+24F4*/ /**/ 0x24F5, /*U+24F5*/ /**/ 0x24F6, /*U+24F6*/ /**/ 0x24F7, /*U+24F7*/ /**/ 0x24F8, /*U+24F8*/ /**/ 0x24F9, /*U+24F9*/ /**/ 0x24FA, /*U+24FA*/ /**/ 0x24FB, /*U+24FB*/ /**/ 0x24FC, /*U+24FC*/ /**/ 0x24FD, /*U+24FD*/ /**/ 0x24FE, /*U+24FE*/ /**/ 0x24FF, /*U+24FF*/ /**/ }; static const u_int16_t upper_table_7[320] = { 0x2C00, /*U+2C00*/ /**/ 0x2C01, /*U+2C01*/ /**/ 0x2C02, /*U+2C02*/ /**/ 0x2C03, /*U+2C03*/ /**/ 0x2C04, /*U+2C04*/ /**/ 0x2C05, /*U+2C05*/ /**/ 0x2C06, /*U+2C06*/ /**/ 0x2C07, /*U+2C07*/ /**/ 0x2C08, /*U+2C08*/ /**/ 0x2C09, /*U+2C09*/ /**/ 0x2C0A, /*U+2C0A*/ /**/ 0x2C0B, /*U+2C0B*/ /**/ 0x2C0C, /*U+2C0C*/ /**/ 0x2C0D, /*U+2C0D*/ /**/ 0x2C0E, /*U+2C0E*/ /**/ 0x2C0F, /*U+2C0F*/ /**/ 0x2C10, /*U+2C10*/ /**/ 0x2C11, /*U+2C11*/ /**/ 0x2C12, /*U+2C12*/ /**/ 0x2C13, /*U+2C13*/ /**/ 0x2C14, /*U+2C14*/ /**/ 0x2C15, /*U+2C15*/ /**/ 0x2C16, /*U+2C16*/ /**/ 0x2C17, /*U+2C17*/ /**/ 0x2C18, /*U+2C18*/ /**/ 0x2C19, /*U+2C19*/ /**/ 0x2C1A, /*U+2C1A*/ /**/ 0x2C1B, /*U+2C1B*/ /**/ 0x2C1C, /*U+2C1C*/ /**/ 0x2C1D, /*U+2C1D*/ /**/ 0x2C1E, /*U+2C1E*/ /**/ 0x2C1F, /*U+2C1F*/ /**/ 0x2C20, /*U+2C20*/ /**/ 0x2C21, /*U+2C21*/ /**/ 0x2C22, /*U+2C22*/ /**/ 0x2C23, /*U+2C23*/ /**/ 0x2C24, /*U+2C24*/ /**/ 0x2C25, /*U+2C25*/ /**/ 0x2C26, /*U+2C26*/ /**/ 0x2C27, /*U+2C27*/ /**/ 0x2C28, /*U+2C28*/ /**/ 0x2C29, /*U+2C29*/ /**/ 0x2C2A, /*U+2C2A*/ /**/ 0x2C2B, /*U+2C2B*/ /**/ 0x2C2C, /*U+2C2C*/ /**/ 0x2C2D, /*U+2C2D*/ /**/ 0x2C2E, /*U+2C2E*/ /**/ 0x2C2F, /*U+2C2F*/ /**/ 0x2C00, /*U+2C30*/ /*GLAGOLITIC SMALL LETTER AZU*/ 0x2C01, /*U+2C31*/ /*GLAGOLITIC SMALL LETTER BUKY*/ 0x2C02, /*U+2C32*/ /*GLAGOLITIC SMALL LETTER VEDE*/ 0x2C03, /*U+2C33*/ /*GLAGOLITIC SMALL LETTER GLAGOLI*/ 0x2C04, /*U+2C34*/ /*GLAGOLITIC SMALL LETTER DOBRO*/ 0x2C05, /*U+2C35*/ /*GLAGOLITIC SMALL LETTER YESTU*/ 0x2C06, /*U+2C36*/ /*GLAGOLITIC SMALL LETTER ZHIVETE*/ 0x2C07, /*U+2C37*/ /*GLAGOLITIC SMALL LETTER DZELO*/ 0x2C08, /*U+2C38*/ /*GLAGOLITIC SMALL LETTER ZEMLJA*/ 0x2C09, /*U+2C39*/ /*GLAGOLITIC SMALL LETTER IZHE*/ 0x2C0A, /*U+2C3A*/ /*GLAGOLITIC SMALL LETTER INITIAL IZHE*/ 0x2C0B, /*U+2C3B*/ /*GLAGOLITIC SMALL LETTER I*/ 0x2C0C, /*U+2C3C*/ /*GLAGOLITIC SMALL LETTER DJERVI*/ 0x2C0D, /*U+2C3D*/ /*GLAGOLITIC SMALL LETTER KAKO*/ 0x2C0E, /*U+2C3E*/ /*GLAGOLITIC SMALL LETTER LJUDIJE*/ 0x2C0F, /*U+2C3F*/ /*GLAGOLITIC SMALL LETTER MYSLITE*/ 0x2C10, /*U+2C40*/ /*GLAGOLITIC SMALL LETTER NASHI*/ 0x2C11, /*U+2C41*/ /*GLAGOLITIC SMALL LETTER ONU*/ 0x2C12, /*U+2C42*/ /*GLAGOLITIC SMALL LETTER POKOJI*/ 0x2C13, /*U+2C43*/ /*GLAGOLITIC SMALL LETTER RITSI*/ 0x2C14, /*U+2C44*/ /*GLAGOLITIC SMALL LETTER SLOVO*/ 0x2C15, /*U+2C45*/ /*GLAGOLITIC SMALL LETTER TVRIDO*/ 0x2C16, /*U+2C46*/ /*GLAGOLITIC SMALL LETTER UKU*/ 0x2C17, /*U+2C47*/ /*GLAGOLITIC SMALL LETTER FRITU*/ 0x2C18, /*U+2C48*/ /*GLAGOLITIC SMALL LETTER HERU*/ 0x2C19, /*U+2C49*/ /*GLAGOLITIC SMALL LETTER OTU*/ 0x2C1A, /*U+2C4A*/ /*GLAGOLITIC SMALL LETTER PE*/ 0x2C1B, /*U+2C4B*/ /*GLAGOLITIC SMALL LETTER SHTA*/ 0x2C1C, /*U+2C4C*/ /*GLAGOLITIC SMALL LETTER TSI*/ 0x2C1D, /*U+2C4D*/ /*GLAGOLITIC SMALL LETTER CHRIVI*/ 0x2C1E, /*U+2C4E*/ /*GLAGOLITIC SMALL LETTER SHA*/ 0x2C1F, /*U+2C4F*/ /*GLAGOLITIC SMALL LETTER YERU*/ 0x2C20, /*U+2C50*/ /*GLAGOLITIC SMALL LETTER YERI*/ 0x2C21, /*U+2C51*/ /*GLAGOLITIC SMALL LETTER YATI*/ 0x2C22, /*U+2C52*/ /*GLAGOLITIC SMALL LETTER SPIDERY HA*/ 0x2C23, /*U+2C53*/ /*GLAGOLITIC SMALL LETTER YU*/ 0x2C24, /*U+2C54*/ /*GLAGOLITIC SMALL LETTER SMALL YUS*/ 0x2C25, /*U+2C55*/ /*GLAGOLITIC SMALL LETTER SMALL YUS WITH TAIL*/ 0x2C26, /*U+2C56*/ /*GLAGOLITIC SMALL LETTER YO*/ 0x2C27, /*U+2C57*/ /*GLAGOLITIC SMALL LETTER IOTATED SMALL YUS*/ 0x2C28, /*U+2C58*/ /*GLAGOLITIC SMALL LETTER BIG YUS*/ 0x2C29, /*U+2C59*/ /*GLAGOLITIC SMALL LETTER IOTATED BIG YUS*/ 0x2C2A, /*U+2C5A*/ /*GLAGOLITIC SMALL LETTER FITA*/ 0x2C2B, /*U+2C5B*/ /*GLAGOLITIC SMALL LETTER IZHITSA*/ 0x2C2C, /*U+2C5C*/ /*GLAGOLITIC SMALL LETTER SHTAPIC*/ 0x2C2D, /*U+2C5D*/ /*GLAGOLITIC SMALL LETTER TROKUTASTI A*/ 0x2C2E, /*U+2C5E*/ /*GLAGOLITIC SMALL LETTER LATINATE MYSLITE*/ 0x2C5F, /*U+2C5F*/ /**/ 0x2C60, /*U+2C60*/ /**/ 0x2C60, /*U+2C61*/ /*LATIN SMALL LETTER L WITH DOUBLE BAR*/ 0x2C62, /*U+2C62*/ /**/ 0x2C63, /*U+2C63*/ /**/ 0x2C64, /*U+2C64*/ /**/ 0x023A, /*U+2C65*/ /*LATIN SMALL LETTER A WITH STROKE*/ 0x023E, /*U+2C66*/ /*LATIN SMALL LETTER T WITH DIAGONAL STROKE*/ 0x2C67, /*U+2C67*/ /**/ 0x2C67, /*U+2C68*/ /*LATIN SMALL LETTER H WITH DESCENDER*/ 0x2C69, /*U+2C69*/ /**/ 0x2C69, /*U+2C6A*/ /*LATIN SMALL LETTER K WITH DESCENDER*/ 0x2C6B, /*U+2C6B*/ /**/ 0x2C6B, /*U+2C6C*/ /*LATIN SMALL LETTER Z WITH DESCENDER*/ 0x2C6D, /*U+2C6D*/ /**/ 0x2C6E, /*U+2C6E*/ /**/ 0x2C6F, /*U+2C6F*/ /**/ 0x2C70, /*U+2C70*/ /**/ 0x2C71, /*U+2C71*/ /**/ 0x2C72, /*U+2C72*/ /**/ 0x2C72, /*U+2C73*/ /*LATIN SMALL LETTER W WITH HOOK*/ 0x2C74, /*U+2C74*/ /**/ 0x2C75, /*U+2C75*/ /**/ 0x2C75, /*U+2C76*/ /*LATIN SMALL LETTER HALF H*/ 0x2C77, /*U+2C77*/ /**/ 0x2C78, /*U+2C78*/ /**/ 0x2C79, /*U+2C79*/ /**/ 0x2C7A, /*U+2C7A*/ /**/ 0x2C7B, /*U+2C7B*/ /**/ 0x2C7C, /*U+2C7C*/ /**/ 0x2C7D, /*U+2C7D*/ /**/ 0x2C7E, /*U+2C7E*/ /**/ 0x2C7F, /*U+2C7F*/ /**/ 0x2C80, /*U+2C80*/ /**/ 0x2C80, /*U+2C81*/ /*COPTIC SMALL LETTER ALFA*/ 0x2C82, /*U+2C82*/ /**/ 0x2C82, /*U+2C83*/ /*COPTIC SMALL LETTER VIDA*/ 0x2C84, /*U+2C84*/ /**/ 0x2C84, /*U+2C85*/ /*COPTIC SMALL LETTER GAMMA*/ 0x2C86, /*U+2C86*/ /**/ 0x2C86, /*U+2C87*/ /*COPTIC SMALL LETTER DALDA*/ 0x2C88, /*U+2C88*/ /**/ 0x2C88, /*U+2C89*/ /*COPTIC SMALL LETTER EIE*/ 0x2C8A, /*U+2C8A*/ /**/ 0x2C8A, /*U+2C8B*/ /*COPTIC SMALL LETTER SOU*/ 0x2C8C, /*U+2C8C*/ /**/ 0x2C8C, /*U+2C8D*/ /*COPTIC SMALL LETTER ZATA*/ 0x2C8E, /*U+2C8E*/ /**/ 0x2C8E, /*U+2C8F*/ /*COPTIC SMALL LETTER HATE*/ 0x2C90, /*U+2C90*/ /**/ 0x2C90, /*U+2C91*/ /*COPTIC SMALL LETTER THETHE*/ 0x2C92, /*U+2C92*/ /**/ 0x2C92, /*U+2C93*/ /*COPTIC SMALL LETTER IAUDA*/ 0x2C94, /*U+2C94*/ /**/ 0x2C94, /*U+2C95*/ /*COPTIC SMALL LETTER KAPA*/ 0x2C96, /*U+2C96*/ /**/ 0x2C96, /*U+2C97*/ /*COPTIC SMALL LETTER LAULA*/ 0x2C98, /*U+2C98*/ /**/ 0x2C98, /*U+2C99*/ /*COPTIC SMALL LETTER MI*/ 0x2C9A, /*U+2C9A*/ /**/ 0x2C9A, /*U+2C9B*/ /*COPTIC SMALL LETTER NI*/ 0x2C9C, /*U+2C9C*/ /**/ 0x2C9C, /*U+2C9D*/ /*COPTIC SMALL LETTER KSI*/ 0x2C9E, /*U+2C9E*/ /**/ 0x2C9E, /*U+2C9F*/ /*COPTIC SMALL LETTER O*/ 0x2CA0, /*U+2CA0*/ /**/ 0x2CA0, /*U+2CA1*/ /*COPTIC SMALL LETTER PI*/ 0x2CA2, /*U+2CA2*/ /**/ 0x2CA2, /*U+2CA3*/ /*COPTIC SMALL LETTER RO*/ 0x2CA4, /*U+2CA4*/ /**/ 0x2CA4, /*U+2CA5*/ /*COPTIC SMALL LETTER SIMA*/ 0x2CA6, /*U+2CA6*/ /**/ 0x2CA6, /*U+2CA7*/ /*COPTIC SMALL LETTER TAU*/ 0x2CA8, /*U+2CA8*/ /**/ 0x2CA8, /*U+2CA9*/ /*COPTIC SMALL LETTER UA*/ 0x2CAA, /*U+2CAA*/ /**/ 0x2CAA, /*U+2CAB*/ /*COPTIC SMALL LETTER FI*/ 0x2CAC, /*U+2CAC*/ /**/ 0x2CAC, /*U+2CAD*/ /*COPTIC SMALL LETTER KHI*/ 0x2CAE, /*U+2CAE*/ /**/ 0x2CAE, /*U+2CAF*/ /*COPTIC SMALL LETTER PSI*/ 0x2CB0, /*U+2CB0*/ /**/ 0x2CB0, /*U+2CB1*/ /*COPTIC SMALL LETTER OOU*/ 0x2CB2, /*U+2CB2*/ /**/ 0x2CB2, /*U+2CB3*/ /*COPTIC SMALL LETTER DIALECT-P ALEF*/ 0x2CB4, /*U+2CB4*/ /**/ 0x2CB4, /*U+2CB5*/ /*COPTIC SMALL LETTER OLD COPTIC AIN*/ 0x2CB6, /*U+2CB6*/ /**/ 0x2CB6, /*U+2CB7*/ /*COPTIC SMALL LETTER CRYPTOGRAMMIC EIE*/ 0x2CB8, /*U+2CB8*/ /**/ 0x2CB8, /*U+2CB9*/ /*COPTIC SMALL LETTER DIALECT-P KAPA*/ 0x2CBA, /*U+2CBA*/ /**/ 0x2CBA, /*U+2CBB*/ /*COPTIC SMALL LETTER DIALECT-P NI*/ 0x2CBC, /*U+2CBC*/ /**/ 0x2CBC, /*U+2CBD*/ /*COPTIC SMALL LETTER CRYPTOGRAMMIC NI*/ 0x2CBE, /*U+2CBE*/ /**/ 0x2CBE, /*U+2CBF*/ /*COPTIC SMALL LETTER OLD COPTIC OOU*/ 0x2CC0, /*U+2CC0*/ /**/ 0x2CC0, /*U+2CC1*/ /*COPTIC SMALL LETTER SAMPI*/ 0x2CC2, /*U+2CC2*/ /**/ 0x2CC2, /*U+2CC3*/ /*COPTIC SMALL LETTER CROSSED SHEI*/ 0x2CC4, /*U+2CC4*/ /**/ 0x2CC4, /*U+2CC5*/ /*COPTIC SMALL LETTER OLD COPTIC SHEI*/ 0x2CC6, /*U+2CC6*/ /**/ 0x2CC6, /*U+2CC7*/ /*COPTIC SMALL LETTER OLD COPTIC ESH*/ 0x2CC8, /*U+2CC8*/ /**/ 0x2CC8, /*U+2CC9*/ /*COPTIC SMALL LETTER AKHMIMIC KHEI*/ 0x2CCA, /*U+2CCA*/ /**/ 0x2CCA, /*U+2CCB*/ /*COPTIC SMALL LETTER DIALECT-P HORI*/ 0x2CCC, /*U+2CCC*/ /**/ 0x2CCC, /*U+2CCD*/ /*COPTIC SMALL LETTER OLD COPTIC HORI*/ 0x2CCE, /*U+2CCE*/ /**/ 0x2CCE, /*U+2CCF*/ /*COPTIC SMALL LETTER OLD COPTIC HA*/ 0x2CD0, /*U+2CD0*/ /**/ 0x2CD0, /*U+2CD1*/ /*COPTIC SMALL LETTER L-SHAPED HA*/ 0x2CD2, /*U+2CD2*/ /**/ 0x2CD2, /*U+2CD3*/ /*COPTIC SMALL LETTER OLD COPTIC HEI*/ 0x2CD4, /*U+2CD4*/ /**/ 0x2CD4, /*U+2CD5*/ /*COPTIC SMALL LETTER OLD COPTIC HAT*/ 0x2CD6, /*U+2CD6*/ /**/ 0x2CD6, /*U+2CD7*/ /*COPTIC SMALL LETTER OLD COPTIC GANGIA*/ 0x2CD8, /*U+2CD8*/ /**/ 0x2CD8, /*U+2CD9*/ /*COPTIC SMALL LETTER OLD COPTIC DJA*/ 0x2CDA, /*U+2CDA*/ /**/ 0x2CDA, /*U+2CDB*/ /*COPTIC SMALL LETTER OLD COPTIC SHIMA*/ 0x2CDC, /*U+2CDC*/ /**/ 0x2CDC, /*U+2CDD*/ /*COPTIC SMALL LETTER OLD NUBIAN SHIMA*/ 0x2CDE, /*U+2CDE*/ /**/ 0x2CDE, /*U+2CDF*/ /*COPTIC SMALL LETTER OLD NUBIAN NGI*/ 0x2CE0, /*U+2CE0*/ /**/ 0x2CE0, /*U+2CE1*/ /*COPTIC SMALL LETTER OLD NUBIAN NYI*/ 0x2CE2, /*U+2CE2*/ /**/ 0x2CE2, /*U+2CE3*/ /*COPTIC SMALL LETTER OLD NUBIAN WAU*/ 0x2CE4, /*U+2CE4*/ /**/ 0x2CE5, /*U+2CE5*/ /**/ 0x2CE6, /*U+2CE6*/ /**/ 0x2CE7, /*U+2CE7*/ /**/ 0x2CE8, /*U+2CE8*/ /**/ 0x2CE9, /*U+2CE9*/ /**/ 0x2CEA, /*U+2CEA*/ /**/ 0x2CEB, /*U+2CEB*/ /**/ 0x2CEB, /*U+2CEC*/ /*COPTIC SMALL LETTER CRYPTOGRAMMIC SHEI*/ 0x2CED, /*U+2CED*/ /**/ 0x2CED, /*U+2CEE*/ /*COPTIC SMALL LETTER CRYPTOGRAMMIC GANGIA*/ 0x2CEF, /*U+2CEF*/ /**/ 0x2CF0, /*U+2CF0*/ /**/ 0x2CF1, /*U+2CF1*/ /**/ 0x2CF2, /*U+2CF2*/ /**/ 0x2CF3, /*U+2CF3*/ /**/ 0x2CF4, /*U+2CF4*/ /**/ 0x2CF5, /*U+2CF5*/ /**/ 0x2CF6, /*U+2CF6*/ /**/ 0x2CF7, /*U+2CF7*/ /**/ 0x2CF8, /*U+2CF8*/ /**/ 0x2CF9, /*U+2CF9*/ /**/ 0x2CFA, /*U+2CFA*/ /**/ 0x2CFB, /*U+2CFB*/ /**/ 0x2CFC, /*U+2CFC*/ /**/ 0x2CFD, /*U+2CFD*/ /**/ 0x2CFE, /*U+2CFE*/ /**/ 0x2CFF, /*U+2CFF*/ /**/ 0x10A0, /*U+2D00*/ /*GEORGIAN SMALL LETTER AN*/ 0x10A1, /*U+2D01*/ /*GEORGIAN SMALL LETTER BAN*/ 0x10A2, /*U+2D02*/ /*GEORGIAN SMALL LETTER GAN*/ 0x10A3, /*U+2D03*/ /*GEORGIAN SMALL LETTER DON*/ 0x10A4, /*U+2D04*/ /*GEORGIAN SMALL LETTER EN*/ 0x10A5, /*U+2D05*/ /*GEORGIAN SMALL LETTER VIN*/ 0x10A6, /*U+2D06*/ /*GEORGIAN SMALL LETTER ZEN*/ 0x10A7, /*U+2D07*/ /*GEORGIAN SMALL LETTER TAN*/ 0x10A8, /*U+2D08*/ /*GEORGIAN SMALL LETTER IN*/ 0x10A9, /*U+2D09*/ /*GEORGIAN SMALL LETTER KAN*/ 0x10AA, /*U+2D0A*/ /*GEORGIAN SMALL LETTER LAS*/ 0x10AB, /*U+2D0B*/ /*GEORGIAN SMALL LETTER MAN*/ 0x10AC, /*U+2D0C*/ /*GEORGIAN SMALL LETTER NAR*/ 0x10AD, /*U+2D0D*/ /*GEORGIAN SMALL LETTER ON*/ 0x10AE, /*U+2D0E*/ /*GEORGIAN SMALL LETTER PAR*/ 0x10AF, /*U+2D0F*/ /*GEORGIAN SMALL LETTER ZHAR*/ 0x10B0, /*U+2D10*/ /*GEORGIAN SMALL LETTER RAE*/ 0x10B1, /*U+2D11*/ /*GEORGIAN SMALL LETTER SAN*/ 0x10B2, /*U+2D12*/ /*GEORGIAN SMALL LETTER TAR*/ 0x10B3, /*U+2D13*/ /*GEORGIAN SMALL LETTER UN*/ 0x10B4, /*U+2D14*/ /*GEORGIAN SMALL LETTER PHAR*/ 0x10B5, /*U+2D15*/ /*GEORGIAN SMALL LETTER KHAR*/ 0x10B6, /*U+2D16*/ /*GEORGIAN SMALL LETTER GHAN*/ 0x10B7, /*U+2D17*/ /*GEORGIAN SMALL LETTER QAR*/ 0x10B8, /*U+2D18*/ /*GEORGIAN SMALL LETTER SHIN*/ 0x10B9, /*U+2D19*/ /*GEORGIAN SMALL LETTER CHIN*/ 0x10BA, /*U+2D1A*/ /*GEORGIAN SMALL LETTER CAN*/ 0x10BB, /*U+2D1B*/ /*GEORGIAN SMALL LETTER JIL*/ 0x10BC, /*U+2D1C*/ /*GEORGIAN SMALL LETTER CIL*/ 0x10BD, /*U+2D1D*/ /*GEORGIAN SMALL LETTER CHAR*/ 0x10BE, /*U+2D1E*/ /*GEORGIAN SMALL LETTER XAN*/ 0x10BF, /*U+2D1F*/ /*GEORGIAN SMALL LETTER JHAN*/ 0x10C0, /*U+2D20*/ /*GEORGIAN SMALL LETTER HAE*/ 0x10C1, /*U+2D21*/ /*GEORGIAN SMALL LETTER HE*/ 0x10C2, /*U+2D22*/ /*GEORGIAN SMALL LETTER HIE*/ 0x10C3, /*U+2D23*/ /*GEORGIAN SMALL LETTER WE*/ 0x10C4, /*U+2D24*/ /*GEORGIAN SMALL LETTER HAR*/ 0x10C5, /*U+2D25*/ /*GEORGIAN SMALL LETTER HOE*/ 0x2D26, /*U+2D26*/ /**/ 0x2D27, /*U+2D27*/ /**/ 0x2D28, /*U+2D28*/ /**/ 0x2D29, /*U+2D29*/ /**/ 0x2D2A, /*U+2D2A*/ /**/ 0x2D2B, /*U+2D2B*/ /**/ 0x2D2C, /*U+2D2C*/ /**/ 0x2D2D, /*U+2D2D*/ /**/ 0x2D2E, /*U+2D2E*/ /**/ 0x2D2F, /*U+2D2F*/ /**/ 0x2D30, /*U+2D30*/ /**/ 0x2D31, /*U+2D31*/ /**/ 0x2D32, /*U+2D32*/ /**/ 0x2D33, /*U+2D33*/ /**/ 0x2D34, /*U+2D34*/ /**/ 0x2D35, /*U+2D35*/ /**/ 0x2D36, /*U+2D36*/ /**/ 0x2D37, /*U+2D37*/ /**/ 0x2D38, /*U+2D38*/ /**/ 0x2D39, /*U+2D39*/ /**/ 0x2D3A, /*U+2D3A*/ /**/ 0x2D3B, /*U+2D3B*/ /**/ 0x2D3C, /*U+2D3C*/ /**/ 0x2D3D, /*U+2D3D*/ /**/ 0x2D3E, /*U+2D3E*/ /**/ 0x2D3F, /*U+2D3F*/ /**/ }; static const u_int16_t upper_table_8[128] = { 0xA640, /*U+A640*/ /**/ 0xA640, /*U+A641*/ /*CYRILLIC SMALL LETTER ZEMLYA*/ 0xA642, /*U+A642*/ /**/ 0xA642, /*U+A643*/ /*CYRILLIC SMALL LETTER DZELO*/ 0xA644, /*U+A644*/ /**/ 0xA644, /*U+A645*/ /*CYRILLIC SMALL LETTER REVERSED DZE*/ 0xA646, /*U+A646*/ /**/ 0xA646, /*U+A647*/ /*CYRILLIC SMALL LETTER IOTA*/ 0xA648, /*U+A648*/ /**/ 0xA648, /*U+A649*/ /*CYRILLIC SMALL LETTER DJERV*/ 0xA64A, /*U+A64A*/ /**/ 0xA64A, /*U+A64B*/ /*CYRILLIC SMALL LETTER MONOGRAPH UK*/ 0xA64C, /*U+A64C*/ /**/ 0xA64C, /*U+A64D*/ /*CYRILLIC SMALL LETTER BROAD OMEGA*/ 0xA64E, /*U+A64E*/ /**/ 0xA64E, /*U+A64F*/ /*CYRILLIC SMALL LETTER NEUTRAL YER*/ 0xA650, /*U+A650*/ /**/ 0xA650, /*U+A651*/ /*CYRILLIC SMALL LETTER YERU WITH BACK YER*/ 0xA652, /*U+A652*/ /**/ 0xA652, /*U+A653*/ /*CYRILLIC SMALL LETTER IOTIFIED YAT*/ 0xA654, /*U+A654*/ /**/ 0xA654, /*U+A655*/ /*CYRILLIC SMALL LETTER REVERSED YU*/ 0xA656, /*U+A656*/ /**/ 0xA656, /*U+A657*/ /*CYRILLIC SMALL LETTER IOTIFIED A*/ 0xA658, /*U+A658*/ /**/ 0xA658, /*U+A659*/ /*CYRILLIC SMALL LETTER CLOSED LITTLE YUS*/ 0xA65A, /*U+A65A*/ /**/ 0xA65A, /*U+A65B*/ /*CYRILLIC SMALL LETTER BLENDED YUS*/ 0xA65C, /*U+A65C*/ /**/ 0xA65C, /*U+A65D*/ /*CYRILLIC SMALL LETTER IOTIFIED CLOSED LITTLE YUS*/ 0xA65E, /*U+A65E*/ /**/ 0xA65E, /*U+A65F*/ /*CYRILLIC SMALL LETTER YN*/ 0xA660, /*U+A660*/ /**/ 0xA660, /*U+A661*/ /*CYRILLIC SMALL LETTER REVERSED TSE*/ 0xA662, /*U+A662*/ /**/ 0xA662, /*U+A663*/ /*CYRILLIC SMALL LETTER SOFT DE*/ 0xA664, /*U+A664*/ /**/ 0xA664, /*U+A665*/ /*CYRILLIC SMALL LETTER SOFT EL*/ 0xA666, /*U+A666*/ /**/ 0xA666, /*U+A667*/ /*CYRILLIC SMALL LETTER SOFT EM*/ 0xA668, /*U+A668*/ /**/ 0xA668, /*U+A669*/ /*CYRILLIC SMALL LETTER MONOCULAR O*/ 0xA66A, /*U+A66A*/ /**/ 0xA66A, /*U+A66B*/ /*CYRILLIC SMALL LETTER BINOCULAR O*/ 0xA66C, /*U+A66C*/ /**/ 0xA66C, /*U+A66D*/ /*CYRILLIC SMALL LETTER DOUBLE MONOCULAR O*/ 0xA66E, /*U+A66E*/ /**/ 0xA66F, /*U+A66F*/ /**/ 0xA670, /*U+A670*/ /**/ 0xA671, /*U+A671*/ /**/ 0xA672, /*U+A672*/ /**/ 0xA673, /*U+A673*/ /**/ 0xA674, /*U+A674*/ /**/ 0xA675, /*U+A675*/ /**/ 0xA676, /*U+A676*/ /**/ 0xA677, /*U+A677*/ /**/ 0xA678, /*U+A678*/ /**/ 0xA679, /*U+A679*/ /**/ 0xA67A, /*U+A67A*/ /**/ 0xA67B, /*U+A67B*/ /**/ 0xA67C, /*U+A67C*/ /**/ 0xA67D, /*U+A67D*/ /**/ 0xA67E, /*U+A67E*/ /**/ 0xA67F, /*U+A67F*/ /**/ 0xA680, /*U+A680*/ /**/ 0xA680, /*U+A681*/ /*CYRILLIC SMALL LETTER DWE*/ 0xA682, /*U+A682*/ /**/ 0xA682, /*U+A683*/ /*CYRILLIC SMALL LETTER DZWE*/ 0xA684, /*U+A684*/ /**/ 0xA684, /*U+A685*/ /*CYRILLIC SMALL LETTER ZHWE*/ 0xA686, /*U+A686*/ /**/ 0xA686, /*U+A687*/ /*CYRILLIC SMALL LETTER CCHE*/ 0xA688, /*U+A688*/ /**/ 0xA688, /*U+A689*/ /*CYRILLIC SMALL LETTER DZZE*/ 0xA68A, /*U+A68A*/ /**/ 0xA68A, /*U+A68B*/ /*CYRILLIC SMALL LETTER TE WITH MIDDLE HOOK*/ 0xA68C, /*U+A68C*/ /**/ 0xA68C, /*U+A68D*/ /*CYRILLIC SMALL LETTER TWE*/ 0xA68E, /*U+A68E*/ /**/ 0xA68E, /*U+A68F*/ /*CYRILLIC SMALL LETTER TSWE*/ 0xA690, /*U+A690*/ /**/ 0xA690, /*U+A691*/ /*CYRILLIC SMALL LETTER TSSE*/ 0xA692, /*U+A692*/ /**/ 0xA692, /*U+A693*/ /*CYRILLIC SMALL LETTER TCHE*/ 0xA694, /*U+A694*/ /**/ 0xA694, /*U+A695*/ /*CYRILLIC SMALL LETTER HWE*/ 0xA696, /*U+A696*/ /**/ 0xA696, /*U+A697*/ /*CYRILLIC SMALL LETTER SHWE*/ 0xA698, /*U+A698*/ /**/ 0xA699, /*U+A699*/ /**/ 0xA69A, /*U+A69A*/ /**/ 0xA69B, /*U+A69B*/ /**/ 0xA69C, /*U+A69C*/ /**/ 0xA69D, /*U+A69D*/ /**/ 0xA69E, /*U+A69E*/ /**/ 0xA69F, /*U+A69F*/ /**/ 0xA6A0, /*U+A6A0*/ /**/ 0xA6A1, /*U+A6A1*/ /**/ 0xA6A2, /*U+A6A2*/ /**/ 0xA6A3, /*U+A6A3*/ /**/ 0xA6A4, /*U+A6A4*/ /**/ 0xA6A5, /*U+A6A5*/ /**/ 0xA6A6, /*U+A6A6*/ /**/ 0xA6A7, /*U+A6A7*/ /**/ 0xA6A8, /*U+A6A8*/ /**/ 0xA6A9, /*U+A6A9*/ /**/ 0xA6AA, /*U+A6AA*/ /**/ 0xA6AB, /*U+A6AB*/ /**/ 0xA6AC, /*U+A6AC*/ /**/ 0xA6AD, /*U+A6AD*/ /**/ 0xA6AE, /*U+A6AE*/ /**/ 0xA6AF, /*U+A6AF*/ /**/ 0xA6B0, /*U+A6B0*/ /**/ 0xA6B1, /*U+A6B1*/ /**/ 0xA6B2, /*U+A6B2*/ /**/ 0xA6B3, /*U+A6B3*/ /**/ 0xA6B4, /*U+A6B4*/ /**/ 0xA6B5, /*U+A6B5*/ /**/ 0xA6B6, /*U+A6B6*/ /**/ 0xA6B7, /*U+A6B7*/ /**/ 0xA6B8, /*U+A6B8*/ /**/ 0xA6B9, /*U+A6B9*/ /**/ 0xA6BA, /*U+A6BA*/ /**/ 0xA6BB, /*U+A6BB*/ /**/ 0xA6BC, /*U+A6BC*/ /**/ 0xA6BD, /*U+A6BD*/ /**/ 0xA6BE, /*U+A6BE*/ /**/ 0xA6BF, /*U+A6BF*/ /**/ }; static const u_int16_t upper_table_9[192] = { 0xA700, /*U+A700*/ /**/ 0xA701, /*U+A701*/ /**/ 0xA702, /*U+A702*/ /**/ 0xA703, /*U+A703*/ /**/ 0xA704, /*U+A704*/ /**/ 0xA705, /*U+A705*/ /**/ 0xA706, /*U+A706*/ /**/ 0xA707, /*U+A707*/ /**/ 0xA708, /*U+A708*/ /**/ 0xA709, /*U+A709*/ /**/ 0xA70A, /*U+A70A*/ /**/ 0xA70B, /*U+A70B*/ /**/ 0xA70C, /*U+A70C*/ /**/ 0xA70D, /*U+A70D*/ /**/ 0xA70E, /*U+A70E*/ /**/ 0xA70F, /*U+A70F*/ /**/ 0xA710, /*U+A710*/ /**/ 0xA711, /*U+A711*/ /**/ 0xA712, /*U+A712*/ /**/ 0xA713, /*U+A713*/ /**/ 0xA714, /*U+A714*/ /**/ 0xA715, /*U+A715*/ /**/ 0xA716, /*U+A716*/ /**/ 0xA717, /*U+A717*/ /**/ 0xA718, /*U+A718*/ /**/ 0xA719, /*U+A719*/ /**/ 0xA71A, /*U+A71A*/ /**/ 0xA71B, /*U+A71B*/ /**/ 0xA71C, /*U+A71C*/ /**/ 0xA71D, /*U+A71D*/ /**/ 0xA71E, /*U+A71E*/ /**/ 0xA71F, /*U+A71F*/ /**/ 0xA720, /*U+A720*/ /**/ 0xA721, /*U+A721*/ /**/ 0xA722, /*U+A722*/ /**/ 0xA722, /*U+A723*/ /*LATIN SMALL LETTER EGYPTOLOGICAL ALEF*/ 0xA724, /*U+A724*/ /**/ 0xA724, /*U+A725*/ /*LATIN SMALL LETTER EGYPTOLOGICAL AIN*/ 0xA726, /*U+A726*/ /**/ 0xA726, /*U+A727*/ /*LATIN SMALL LETTER HENG*/ 0xA728, /*U+A728*/ /**/ 0xA728, /*U+A729*/ /*LATIN SMALL LETTER TZ*/ 0xA72A, /*U+A72A*/ /**/ 0xA72A, /*U+A72B*/ /*LATIN SMALL LETTER TRESILLO*/ 0xA72C, /*U+A72C*/ /**/ 0xA72C, /*U+A72D*/ /*LATIN SMALL LETTER CUATRILLO*/ 0xA72E, /*U+A72E*/ /**/ 0xA72E, /*U+A72F*/ /*LATIN SMALL LETTER CUATRILLO WITH COMMA*/ 0xA730, /*U+A730*/ /**/ 0xA731, /*U+A731*/ /**/ 0xA732, /*U+A732*/ /**/ 0xA732, /*U+A733*/ /*LATIN SMALL LETTER AA*/ 0xA734, /*U+A734*/ /**/ 0xA734, /*U+A735*/ /*LATIN SMALL LETTER AO*/ 0xA736, /*U+A736*/ /**/ 0xA736, /*U+A737*/ /*LATIN SMALL LETTER AU*/ 0xA738, /*U+A738*/ /**/ 0xA738, /*U+A739*/ /*LATIN SMALL LETTER AV*/ 0xA73A, /*U+A73A*/ /**/ 0xA73A, /*U+A73B*/ /*LATIN SMALL LETTER AV WITH HORIZONTAL BAR*/ 0xA73C, /*U+A73C*/ /**/ 0xA73C, /*U+A73D*/ /*LATIN SMALL LETTER AY*/ 0xA73E, /*U+A73E*/ /**/ 0xA73E, /*U+A73F*/ /*LATIN SMALL LETTER REVERSED C WITH DOT*/ 0xA740, /*U+A740*/ /**/ 0xA740, /*U+A741*/ /*LATIN SMALL LETTER K WITH STROKE*/ 0xA742, /*U+A742*/ /**/ 0xA742, /*U+A743*/ /*LATIN SMALL LETTER K WITH DIAGONAL STROKE*/ 0xA744, /*U+A744*/ /**/ 0xA744, /*U+A745*/ /*LATIN SMALL LETTER K WITH STROKE AND DIAGONAL STROKE*/ 0xA746, /*U+A746*/ /**/ 0xA746, /*U+A747*/ /*LATIN SMALL LETTER BROKEN L*/ 0xA748, /*U+A748*/ /**/ 0xA748, /*U+A749*/ /*LATIN SMALL LETTER L WITH HIGH STROKE*/ 0xA74A, /*U+A74A*/ /**/ 0xA74A, /*U+A74B*/ /*LATIN SMALL LETTER O WITH LONG STROKE OVERLAY*/ 0xA74C, /*U+A74C*/ /**/ 0xA74C, /*U+A74D*/ /*LATIN SMALL LETTER O WITH LOOP*/ 0xA74E, /*U+A74E*/ /**/ 0xA74E, /*U+A74F*/ /*LATIN SMALL LETTER OO*/ 0xA750, /*U+A750*/ /**/ 0xA750, /*U+A751*/ /*LATIN SMALL LETTER P WITH STROKE THROUGH DESCENDER*/ 0xA752, /*U+A752*/ /**/ 0xA752, /*U+A753*/ /*LATIN SMALL LETTER P WITH FLOURISH*/ 0xA754, /*U+A754*/ /**/ 0xA754, /*U+A755*/ /*LATIN SMALL LETTER P WITH SQUIRREL TAIL*/ 0xA756, /*U+A756*/ /**/ 0xA756, /*U+A757*/ /*LATIN SMALL LETTER Q WITH STROKE THROUGH DESCENDER*/ 0xA758, /*U+A758*/ /**/ 0xA758, /*U+A759*/ /*LATIN SMALL LETTER Q WITH DIAGONAL STROKE*/ 0xA75A, /*U+A75A*/ /**/ 0xA75A, /*U+A75B*/ /*LATIN SMALL LETTER R ROTUNDA*/ 0xA75C, /*U+A75C*/ /**/ 0xA75C, /*U+A75D*/ /*LATIN SMALL LETTER RUM ROTUNDA*/ 0xA75E, /*U+A75E*/ /**/ 0xA75E, /*U+A75F*/ /*LATIN SMALL LETTER V WITH DIAGONAL STROKE*/ 0xA760, /*U+A760*/ /**/ 0xA760, /*U+A761*/ /*LATIN SMALL LETTER VY*/ 0xA762, /*U+A762*/ /**/ 0xA762, /*U+A763*/ /*LATIN SMALL LETTER VISIGOTHIC Z*/ 0xA764, /*U+A764*/ /**/ 0xA764, /*U+A765*/ /*LATIN SMALL LETTER THORN WITH STROKE*/ 0xA766, /*U+A766*/ /**/ 0xA766, /*U+A767*/ /*LATIN SMALL LETTER THORN WITH STROKE THROUGH DESCENDER*/ 0xA768, /*U+A768*/ /**/ 0xA768, /*U+A769*/ /*LATIN SMALL LETTER VEND*/ 0xA76A, /*U+A76A*/ /**/ 0xA76A, /*U+A76B*/ /*LATIN SMALL LETTER ET*/ 0xA76C, /*U+A76C*/ /**/ 0xA76C, /*U+A76D*/ /*LATIN SMALL LETTER IS*/ 0xA76E, /*U+A76E*/ /**/ 0xA76E, /*U+A76F*/ /*LATIN SMALL LETTER CON*/ 0xA770, /*U+A770*/ /**/ 0xA771, /*U+A771*/ /**/ 0xA772, /*U+A772*/ /**/ 0xA773, /*U+A773*/ /**/ 0xA774, /*U+A774*/ /**/ 0xA775, /*U+A775*/ /**/ 0xA776, /*U+A776*/ /**/ 0xA777, /*U+A777*/ /**/ 0xA778, /*U+A778*/ /**/ 0xA779, /*U+A779*/ /**/ 0xA779, /*U+A77A*/ /*LATIN SMALL LETTER INSULAR D*/ 0xA77B, /*U+A77B*/ /**/ 0xA77B, /*U+A77C*/ /*LATIN SMALL LETTER INSULAR F*/ 0xA77D, /*U+A77D*/ /**/ 0xA77E, /*U+A77E*/ /**/ 0xA77E, /*U+A77F*/ /*LATIN SMALL LETTER TURNED INSULAR G*/ 0xA780, /*U+A780*/ /**/ 0xA780, /*U+A781*/ /*LATIN SMALL LETTER TURNED L*/ 0xA782, /*U+A782*/ /**/ 0xA782, /*U+A783*/ /*LATIN SMALL LETTER INSULAR R*/ 0xA784, /*U+A784*/ /**/ 0xA784, /*U+A785*/ /*LATIN SMALL LETTER INSULAR S*/ 0xA786, /*U+A786*/ /**/ 0xA786, /*U+A787*/ /*LATIN SMALL LETTER INSULAR T*/ 0xA788, /*U+A788*/ /**/ 0xA789, /*U+A789*/ /**/ 0xA78A, /*U+A78A*/ /**/ 0xA78B, /*U+A78B*/ /**/ 0xA78B, /*U+A78C*/ /*LATIN SMALL LETTER SALTILLO*/ 0xA78D, /*U+A78D*/ /**/ 0xA78E, /*U+A78E*/ /**/ 0xA78F, /*U+A78F*/ /**/ 0xA790, /*U+A790*/ /**/ 0xA790, /*U+A791*/ /*LATIN SMALL LETTER N WITH DESCENDER*/ 0xA792, /*U+A792*/ /**/ 0xA793, /*U+A793*/ /**/ 0xA794, /*U+A794*/ /**/ 0xA795, /*U+A795*/ /**/ 0xA796, /*U+A796*/ /**/ 0xA797, /*U+A797*/ /**/ 0xA798, /*U+A798*/ /**/ 0xA799, /*U+A799*/ /**/ 0xA79A, /*U+A79A*/ /**/ 0xA79B, /*U+A79B*/ /**/ 0xA79C, /*U+A79C*/ /**/ 0xA79D, /*U+A79D*/ /**/ 0xA79E, /*U+A79E*/ /**/ 0xA79F, /*U+A79F*/ /**/ 0xA7A0, /*U+A7A0*/ /**/ 0xA7A0, /*U+A7A1*/ /*LATIN SMALL LETTER G WITH OBLIQUE STROKE*/ 0xA7A2, /*U+A7A2*/ /**/ 0xA7A2, /*U+A7A3*/ /*LATIN SMALL LETTER K WITH OBLIQUE STROKE*/ 0xA7A4, /*U+A7A4*/ /**/ 0xA7A4, /*U+A7A5*/ /*LATIN SMALL LETTER N WITH OBLIQUE STROKE*/ 0xA7A6, /*U+A7A6*/ /**/ 0xA7A6, /*U+A7A7*/ /*LATIN SMALL LETTER R WITH OBLIQUE STROKE*/ 0xA7A8, /*U+A7A8*/ /**/ 0xA7A8, /*U+A7A9*/ /*LATIN SMALL LETTER S WITH OBLIQUE STROKE*/ 0xA7AA, /*U+A7AA*/ /**/ 0xA7AB, /*U+A7AB*/ /**/ 0xA7AC, /*U+A7AC*/ /**/ 0xA7AD, /*U+A7AD*/ /**/ 0xA7AE, /*U+A7AE*/ /**/ 0xA7AF, /*U+A7AF*/ /**/ 0xA7B0, /*U+A7B0*/ /**/ 0xA7B1, /*U+A7B1*/ /**/ 0xA7B2, /*U+A7B2*/ /**/ 0xA7B3, /*U+A7B3*/ /**/ 0xA7B4, /*U+A7B4*/ /**/ 0xA7B5, /*U+A7B5*/ /**/ 0xA7B6, /*U+A7B6*/ /**/ 0xA7B7, /*U+A7B7*/ /**/ 0xA7B8, /*U+A7B8*/ /**/ 0xA7B9, /*U+A7B9*/ /**/ 0xA7BA, /*U+A7BA*/ /**/ 0xA7BB, /*U+A7BB*/ /**/ 0xA7BC, /*U+A7BC*/ /**/ 0xA7BD, /*U+A7BD*/ /**/ 0xA7BE, /*U+A7BE*/ /**/ 0xA7BF, /*U+A7BF*/ /**/ }; static const u_int16_t upper_table_10[64] = { 0xFF40, /*U+FF40*/ /**/ 0xFF21, /*U+FF41*/ /*FULLWIDTH LATIN SMALL LETTER A*/ 0xFF22, /*U+FF42*/ /*FULLWIDTH LATIN SMALL LETTER B*/ 0xFF23, /*U+FF43*/ /*FULLWIDTH LATIN SMALL LETTER C*/ 0xFF24, /*U+FF44*/ /*FULLWIDTH LATIN SMALL LETTER D*/ 0xFF25, /*U+FF45*/ /*FULLWIDTH LATIN SMALL LETTER E*/ 0xFF26, /*U+FF46*/ /*FULLWIDTH LATIN SMALL LETTER F*/ 0xFF27, /*U+FF47*/ /*FULLWIDTH LATIN SMALL LETTER G*/ 0xFF28, /*U+FF48*/ /*FULLWIDTH LATIN SMALL LETTER H*/ 0xFF29, /*U+FF49*/ /*FULLWIDTH LATIN SMALL LETTER I*/ 0xFF2A, /*U+FF4A*/ /*FULLWIDTH LATIN SMALL LETTER J*/ 0xFF2B, /*U+FF4B*/ /*FULLWIDTH LATIN SMALL LETTER K*/ 0xFF2C, /*U+FF4C*/ /*FULLWIDTH LATIN SMALL LETTER L*/ 0xFF2D, /*U+FF4D*/ /*FULLWIDTH LATIN SMALL LETTER M*/ 0xFF2E, /*U+FF4E*/ /*FULLWIDTH LATIN SMALL LETTER N*/ 0xFF2F, /*U+FF4F*/ /*FULLWIDTH LATIN SMALL LETTER O*/ 0xFF30, /*U+FF50*/ /*FULLWIDTH LATIN SMALL LETTER P*/ 0xFF31, /*U+FF51*/ /*FULLWIDTH LATIN SMALL LETTER Q*/ 0xFF32, /*U+FF52*/ /*FULLWIDTH LATIN SMALL LETTER R*/ 0xFF33, /*U+FF53*/ /*FULLWIDTH LATIN SMALL LETTER S*/ 0xFF34, /*U+FF54*/ /*FULLWIDTH LATIN SMALL LETTER T*/ 0xFF35, /*U+FF55*/ /*FULLWIDTH LATIN SMALL LETTER U*/ 0xFF36, /*U+FF56*/ /*FULLWIDTH LATIN SMALL LETTER V*/ 0xFF37, /*U+FF57*/ /*FULLWIDTH LATIN SMALL LETTER W*/ 0xFF38, /*U+FF58*/ /*FULLWIDTH LATIN SMALL LETTER X*/ 0xFF39, /*U+FF59*/ /*FULLWIDTH LATIN SMALL LETTER Y*/ 0xFF3A, /*U+FF5A*/ /*FULLWIDTH LATIN SMALL LETTER Z*/ 0xFF5B, /*U+FF5B*/ /**/ 0xFF5C, /*U+FF5C*/ /**/ 0xFF5D, /*U+FF5D*/ /**/ 0xFF5E, /*U+FF5E*/ /**/ 0xFF5F, /*U+FF5F*/ /**/ 0xFF60, /*U+FF60*/ /**/ 0xFF61, /*U+FF61*/ /**/ 0xFF62, /*U+FF62*/ /**/ 0xFF63, /*U+FF63*/ /**/ 0xFF64, /*U+FF64*/ /**/ 0xFF65, /*U+FF65*/ /**/ 0xFF66, /*U+FF66*/ /**/ 0xFF67, /*U+FF67*/ /**/ 0xFF68, /*U+FF68*/ /**/ 0xFF69, /*U+FF69*/ /**/ 0xFF6A, /*U+FF6A*/ /**/ 0xFF6B, /*U+FF6B*/ /**/ 0xFF6C, /*U+FF6C*/ /**/ 0xFF6D, /*U+FF6D*/ /**/ 0xFF6E, /*U+FF6E*/ /**/ 0xFF6F, /*U+FF6F*/ /**/ 0xFF70, /*U+FF70*/ /**/ 0xFF71, /*U+FF71*/ /**/ 0xFF72, /*U+FF72*/ /**/ 0xFF73, /*U+FF73*/ /**/ 0xFF74, /*U+FF74*/ /**/ 0xFF75, /*U+FF75*/ /**/ 0xFF76, /*U+FF76*/ /**/ 0xFF77, /*U+FF77*/ /**/ 0xFF78, /*U+FF78*/ /**/ 0xFF79, /*U+FF79*/ /**/ 0xFF7A, /*U+FF7A*/ /**/ 0xFF7B, /*U+FF7B*/ /**/ 0xFF7C, /*U+FF7C*/ /**/ 0xFF7D, /*U+FF7D*/ /**/ 0xFF7E, /*U+FF7E*/ /**/ 0xFF7F, /*U+FF7F*/ /**/ }; static const u_int32_t upper_table_sp_1[128] = { 0xD801DC00, /*0xD801DC00*/ /*U+010400*/ /*U+010400*/ /**/ 0xD801DC01, /*0xD801DC01*/ /*U+010401*/ /*U+010401*/ /**/ 0xD801DC02, /*0xD801DC02*/ /*U+010402*/ /*U+010402*/ /**/ 0xD801DC03, /*0xD801DC03*/ /*U+010403*/ /*U+010403*/ /**/ 0xD801DC04, /*0xD801DC04*/ /*U+010404*/ /*U+010404*/ /**/ 0xD801DC05, /*0xD801DC05*/ /*U+010405*/ /*U+010405*/ /**/ 0xD801DC06, /*0xD801DC06*/ /*U+010406*/ /*U+010406*/ /**/ 0xD801DC07, /*0xD801DC07*/ /*U+010407*/ /*U+010407*/ /**/ 0xD801DC08, /*0xD801DC08*/ /*U+010408*/ /*U+010408*/ /**/ 0xD801DC09, /*0xD801DC09*/ /*U+010409*/ /*U+010409*/ /**/ 0xD801DC0A, /*0xD801DC0A*/ /*U+01040A*/ /*U+01040A*/ /**/ 0xD801DC0B, /*0xD801DC0B*/ /*U+01040B*/ /*U+01040B*/ /**/ 0xD801DC0C, /*0xD801DC0C*/ /*U+01040C*/ /*U+01040C*/ /**/ 0xD801DC0D, /*0xD801DC0D*/ /*U+01040D*/ /*U+01040D*/ /**/ 0xD801DC0E, /*0xD801DC0E*/ /*U+01040E*/ /*U+01040E*/ /**/ 0xD801DC0F, /*0xD801DC0F*/ /*U+01040F*/ /*U+01040F*/ /**/ 0xD801DC10, /*0xD801DC10*/ /*U+010410*/ /*U+010410*/ /**/ 0xD801DC11, /*0xD801DC11*/ /*U+010411*/ /*U+010411*/ /**/ 0xD801DC12, /*0xD801DC12*/ /*U+010412*/ /*U+010412*/ /**/ 0xD801DC13, /*0xD801DC13*/ /*U+010413*/ /*U+010413*/ /**/ 0xD801DC14, /*0xD801DC14*/ /*U+010414*/ /*U+010414*/ /**/ 0xD801DC15, /*0xD801DC15*/ /*U+010415*/ /*U+010415*/ /**/ 0xD801DC16, /*0xD801DC16*/ /*U+010416*/ /*U+010416*/ /**/ 0xD801DC17, /*0xD801DC17*/ /*U+010417*/ /*U+010417*/ /**/ 0xD801DC18, /*0xD801DC18*/ /*U+010418*/ /*U+010418*/ /**/ 0xD801DC19, /*0xD801DC19*/ /*U+010419*/ /*U+010419*/ /**/ 0xD801DC1A, /*0xD801DC1A*/ /*U+01041A*/ /*U+01041A*/ /**/ 0xD801DC1B, /*0xD801DC1B*/ /*U+01041B*/ /*U+01041B*/ /**/ 0xD801DC1C, /*0xD801DC1C*/ /*U+01041C*/ /*U+01041C*/ /**/ 0xD801DC1D, /*0xD801DC1D*/ /*U+01041D*/ /*U+01041D*/ /**/ 0xD801DC1E, /*0xD801DC1E*/ /*U+01041E*/ /*U+01041E*/ /**/ 0xD801DC1F, /*0xD801DC1F*/ /*U+01041F*/ /*U+01041F*/ /**/ 0xD801DC20, /*0xD801DC20*/ /*U+010420*/ /*U+010420*/ /**/ 0xD801DC21, /*0xD801DC21*/ /*U+010421*/ /*U+010421*/ /**/ 0xD801DC22, /*0xD801DC22*/ /*U+010422*/ /*U+010422*/ /**/ 0xD801DC23, /*0xD801DC23*/ /*U+010423*/ /*U+010423*/ /**/ 0xD801DC24, /*0xD801DC24*/ /*U+010424*/ /*U+010424*/ /**/ 0xD801DC25, /*0xD801DC25*/ /*U+010425*/ /*U+010425*/ /**/ 0xD801DC26, /*0xD801DC26*/ /*U+010426*/ /*U+010426*/ /**/ 0xD801DC27, /*0xD801DC27*/ /*U+010427*/ /*U+010427*/ /**/ 0xD801DC00, /*0xD801DC28*/ /*U+010400*/ /*U+010428*/ /*DESERET SMALL LETTER LONG I*/ 0xD801DC01, /*0xD801DC29*/ /*U+010401*/ /*U+010429*/ /*DESERET SMALL LETTER LONG E*/ 0xD801DC02, /*0xD801DC2A*/ /*U+010402*/ /*U+01042A*/ /*DESERET SMALL LETTER LONG A*/ 0xD801DC03, /*0xD801DC2B*/ /*U+010403*/ /*U+01042B*/ /*DESERET SMALL LETTER LONG AH*/ 0xD801DC04, /*0xD801DC2C*/ /*U+010404*/ /*U+01042C*/ /*DESERET SMALL LETTER LONG O*/ 0xD801DC05, /*0xD801DC2D*/ /*U+010405*/ /*U+01042D*/ /*DESERET SMALL LETTER LONG OO*/ 0xD801DC06, /*0xD801DC2E*/ /*U+010406*/ /*U+01042E*/ /*DESERET SMALL LETTER SHORT I*/ 0xD801DC07, /*0xD801DC2F*/ /*U+010407*/ /*U+01042F*/ /*DESERET SMALL LETTER SHORT E*/ 0xD801DC08, /*0xD801DC30*/ /*U+010408*/ /*U+010430*/ /*DESERET SMALL LETTER SHORT A*/ 0xD801DC09, /*0xD801DC31*/ /*U+010409*/ /*U+010431*/ /*DESERET SMALL LETTER SHORT AH*/ 0xD801DC0A, /*0xD801DC32*/ /*U+01040A*/ /*U+010432*/ /*DESERET SMALL LETTER SHORT O*/ 0xD801DC0B, /*0xD801DC33*/ /*U+01040B*/ /*U+010433*/ /*DESERET SMALL LETTER SHORT OO*/ 0xD801DC0C, /*0xD801DC34*/ /*U+01040C*/ /*U+010434*/ /*DESERET SMALL LETTER AY*/ 0xD801DC0D, /*0xD801DC35*/ /*U+01040D*/ /*U+010435*/ /*DESERET SMALL LETTER OW*/ 0xD801DC0E, /*0xD801DC36*/ /*U+01040E*/ /*U+010436*/ /*DESERET SMALL LETTER WU*/ 0xD801DC0F, /*0xD801DC37*/ /*U+01040F*/ /*U+010437*/ /*DESERET SMALL LETTER YEE*/ 0xD801DC10, /*0xD801DC38*/ /*U+010410*/ /*U+010438*/ /*DESERET SMALL LETTER H*/ 0xD801DC11, /*0xD801DC39*/ /*U+010411*/ /*U+010439*/ /*DESERET SMALL LETTER PEE*/ 0xD801DC12, /*0xD801DC3A*/ /*U+010412*/ /*U+01043A*/ /*DESERET SMALL LETTER BEE*/ 0xD801DC13, /*0xD801DC3B*/ /*U+010413*/ /*U+01043B*/ /*DESERET SMALL LETTER TEE*/ 0xD801DC14, /*0xD801DC3C*/ /*U+010414*/ /*U+01043C*/ /*DESERET SMALL LETTER DEE*/ 0xD801DC15, /*0xD801DC3D*/ /*U+010415*/ /*U+01043D*/ /*DESERET SMALL LETTER CHEE*/ 0xD801DC16, /*0xD801DC3E*/ /*U+010416*/ /*U+01043E*/ /*DESERET SMALL LETTER JEE*/ 0xD801DC17, /*0xD801DC3F*/ /*U+010417*/ /*U+01043F*/ /*DESERET SMALL LETTER KAY*/ 0xD801DC18, /*0xD801DC40*/ /*U+010418*/ /*U+010440*/ /*DESERET SMALL LETTER GAY*/ 0xD801DC19, /*0xD801DC41*/ /*U+010419*/ /*U+010441*/ /*DESERET SMALL LETTER EF*/ 0xD801DC1A, /*0xD801DC42*/ /*U+01041A*/ /*U+010442*/ /*DESERET SMALL LETTER VEE*/ 0xD801DC1B, /*0xD801DC43*/ /*U+01041B*/ /*U+010443*/ /*DESERET SMALL LETTER ETH*/ 0xD801DC1C, /*0xD801DC44*/ /*U+01041C*/ /*U+010444*/ /*DESERET SMALL LETTER THEE*/ 0xD801DC1D, /*0xD801DC45*/ /*U+01041D*/ /*U+010445*/ /*DESERET SMALL LETTER ES*/ 0xD801DC1E, /*0xD801DC46*/ /*U+01041E*/ /*U+010446*/ /*DESERET SMALL LETTER ZEE*/ 0xD801DC1F, /*0xD801DC47*/ /*U+01041F*/ /*U+010447*/ /*DESERET SMALL LETTER ESH*/ 0xD801DC20, /*0xD801DC48*/ /*U+010420*/ /*U+010448*/ /*DESERET SMALL LETTER ZHEE*/ 0xD801DC21, /*0xD801DC49*/ /*U+010421*/ /*U+010449*/ /*DESERET SMALL LETTER ER*/ 0xD801DC22, /*0xD801DC4A*/ /*U+010422*/ /*U+01044A*/ /*DESERET SMALL LETTER EL*/ 0xD801DC23, /*0xD801DC4B*/ /*U+010423*/ /*U+01044B*/ /*DESERET SMALL LETTER EM*/ 0xD801DC24, /*0xD801DC4C*/ /*U+010424*/ /*U+01044C*/ /*DESERET SMALL LETTER EN*/ 0xD801DC25, /*0xD801DC4D*/ /*U+010425*/ /*U+01044D*/ /*DESERET SMALL LETTER ENG*/ 0xD801DC26, /*0xD801DC4E*/ /*U+010426*/ /*U+01044E*/ /*DESERET SMALL LETTER OI*/ 0xD801DC27, /*0xD801DC4F*/ /*U+010427*/ /*U+01044F*/ /*DESERET SMALL LETTER EW*/ 0xD801DC50, /*0xD801DC50*/ /*U+010450*/ /*U+010450*/ /**/ 0xD801DC51, /*0xD801DC51*/ /*U+010451*/ /*U+010451*/ /**/ 0xD801DC52, /*0xD801DC52*/ /*U+010452*/ /*U+010452*/ /**/ 0xD801DC53, /*0xD801DC53*/ /*U+010453*/ /*U+010453*/ /**/ 0xD801DC54, /*0xD801DC54*/ /*U+010454*/ /*U+010454*/ /**/ 0xD801DC55, /*0xD801DC55*/ /*U+010455*/ /*U+010455*/ /**/ 0xD801DC56, /*0xD801DC56*/ /*U+010456*/ /*U+010456*/ /**/ 0xD801DC57, /*0xD801DC57*/ /*U+010457*/ /*U+010457*/ /**/ 0xD801DC58, /*0xD801DC58*/ /*U+010458*/ /*U+010458*/ /**/ 0xD801DC59, /*0xD801DC59*/ /*U+010459*/ /*U+010459*/ /**/ 0xD801DC5A, /*0xD801DC5A*/ /*U+01045A*/ /*U+01045A*/ /**/ 0xD801DC5B, /*0xD801DC5B*/ /*U+01045B*/ /*U+01045B*/ /**/ 0xD801DC5C, /*0xD801DC5C*/ /*U+01045C*/ /*U+01045C*/ /**/ 0xD801DC5D, /*0xD801DC5D*/ /*U+01045D*/ /*U+01045D*/ /**/ 0xD801DC5E, /*0xD801DC5E*/ /*U+01045E*/ /*U+01045E*/ /**/ 0xD801DC5F, /*0xD801DC5F*/ /*U+01045F*/ /*U+01045F*/ /**/ 0xD801DC60, /*0xD801DC60*/ /*U+010460*/ /*U+010460*/ /**/ 0xD801DC61, /*0xD801DC61*/ /*U+010461*/ /*U+010461*/ /**/ 0xD801DC62, /*0xD801DC62*/ /*U+010462*/ /*U+010462*/ /**/ 0xD801DC63, /*0xD801DC63*/ /*U+010463*/ /*U+010463*/ /**/ 0xD801DC64, /*0xD801DC64*/ /*U+010464*/ /*U+010464*/ /**/ 0xD801DC65, /*0xD801DC65*/ /*U+010465*/ /*U+010465*/ /**/ 0xD801DC66, /*0xD801DC66*/ /*U+010466*/ /*U+010466*/ /**/ 0xD801DC67, /*0xD801DC67*/ /*U+010467*/ /*U+010467*/ /**/ 0xD801DC68, /*0xD801DC68*/ /*U+010468*/ /*U+010468*/ /**/ 0xD801DC69, /*0xD801DC69*/ /*U+010469*/ /*U+010469*/ /**/ 0xD801DC6A, /*0xD801DC6A*/ /*U+01046A*/ /*U+01046A*/ /**/ 0xD801DC6B, /*0xD801DC6B*/ /*U+01046B*/ /*U+01046B*/ /**/ 0xD801DC6C, /*0xD801DC6C*/ /*U+01046C*/ /*U+01046C*/ /**/ 0xD801DC6D, /*0xD801DC6D*/ /*U+01046D*/ /*U+01046D*/ /**/ 0xD801DC6E, /*0xD801DC6E*/ /*U+01046E*/ /*U+01046E*/ /**/ 0xD801DC6F, /*0xD801DC6F*/ /*U+01046F*/ /*U+01046F*/ /**/ 0xD801DC70, /*0xD801DC70*/ /*U+010470*/ /*U+010470*/ /**/ 0xD801DC71, /*0xD801DC71*/ /*U+010471*/ /*U+010471*/ /**/ 0xD801DC72, /*0xD801DC72*/ /*U+010472*/ /*U+010472*/ /**/ 0xD801DC73, /*0xD801DC73*/ /*U+010473*/ /*U+010473*/ /**/ 0xD801DC74, /*0xD801DC74*/ /*U+010474*/ /*U+010474*/ /**/ 0xD801DC75, /*0xD801DC75*/ /*U+010475*/ /*U+010475*/ /**/ 0xD801DC76, /*0xD801DC76*/ /*U+010476*/ /*U+010476*/ /**/ 0xD801DC77, /*0xD801DC77*/ /*U+010477*/ /*U+010477*/ /**/ 0xD801DC78, /*0xD801DC78*/ /*U+010478*/ /*U+010478*/ /**/ 0xD801DC79, /*0xD801DC79*/ /*U+010479*/ /*U+010479*/ /**/ 0xD801DC7A, /*0xD801DC7A*/ /*U+01047A*/ /*U+01047A*/ /**/ 0xD801DC7B, /*0xD801DC7B*/ /*U+01047B*/ /*U+01047B*/ /**/ 0xD801DC7C, /*0xD801DC7C*/ /*U+01047C*/ /*U+01047C*/ /**/ 0xD801DC7D, /*0xD801DC7D*/ /*U+01047D*/ /*U+01047D*/ /**/ 0xD801DC7E, /*0xD801DC7E*/ /*U+01047E*/ /*U+01047E*/ /**/ 0xD801DC7F, /*0xD801DC7F*/ /*U+01047F*/ /*U+01047F*/ /**/ }; static const u_int16_t lower_table_1[128] = { 0x0000, /*U+0000*/ /**/ 0x0001, /*U+0001*/ /**/ 0x0002, /*U+0002*/ /**/ 0x0003, /*U+0003*/ /**/ 0x0004, /*U+0004*/ /**/ 0x0005, /*U+0005*/ /**/ 0x0006, /*U+0006*/ /**/ 0x0007, /*U+0007*/ /**/ 0x0008, /*U+0008*/ /**/ 0x0009, /*U+0009*/ /**/ 0x000A, /*U+000A*/ /**/ 0x000B, /*U+000B*/ /**/ 0x000C, /*U+000C*/ /**/ 0x000D, /*U+000D*/ /**/ 0x000E, /*U+000E*/ /**/ 0x000F, /*U+000F*/ /**/ 0x0010, /*U+0010*/ /**/ 0x0011, /*U+0011*/ /**/ 0x0012, /*U+0012*/ /**/ 0x0013, /*U+0013*/ /**/ 0x0014, /*U+0014*/ /**/ 0x0015, /*U+0015*/ /**/ 0x0016, /*U+0016*/ /**/ 0x0017, /*U+0017*/ /**/ 0x0018, /*U+0018*/ /**/ 0x0019, /*U+0019*/ /**/ 0x001A, /*U+001A*/ /**/ 0x001B, /*U+001B*/ /**/ 0x001C, /*U+001C*/ /**/ 0x001D, /*U+001D*/ /**/ 0x001E, /*U+001E*/ /**/ 0x001F, /*U+001F*/ /**/ 0x0020, /*U+0020*/ /**/ 0x0021, /*U+0021*/ /**/ 0x0022, /*U+0022*/ /**/ 0x0023, /*U+0023*/ /**/ 0x0024, /*U+0024*/ /**/ 0x0025, /*U+0025*/ /**/ 0x0026, /*U+0026*/ /**/ 0x0027, /*U+0027*/ /**/ 0x0028, /*U+0028*/ /**/ 0x0029, /*U+0029*/ /**/ 0x002A, /*U+002A*/ /**/ 0x002B, /*U+002B*/ /**/ 0x002C, /*U+002C*/ /**/ 0x002D, /*U+002D*/ /**/ 0x002E, /*U+002E*/ /**/ 0x002F, /*U+002F*/ /**/ 0x0030, /*U+0030*/ /**/ 0x0031, /*U+0031*/ /**/ 0x0032, /*U+0032*/ /**/ 0x0033, /*U+0033*/ /**/ 0x0034, /*U+0034*/ /**/ 0x0035, /*U+0035*/ /**/ 0x0036, /*U+0036*/ /**/ 0x0037, /*U+0037*/ /**/ 0x0038, /*U+0038*/ /**/ 0x0039, /*U+0039*/ /**/ 0x003A, /*U+003A*/ /**/ 0x003B, /*U+003B*/ /**/ 0x003C, /*U+003C*/ /**/ 0x003D, /*U+003D*/ /**/ 0x003E, /*U+003E*/ /**/ 0x003F, /*U+003F*/ /**/ 0x0040, /*U+0040*/ /**/ 0x0061, /*U+0041*/ /*LATIN CAPITAL LETTER A*/ 0x0062, /*U+0042*/ /*LATIN CAPITAL LETTER B*/ 0x0063, /*U+0043*/ /*LATIN CAPITAL LETTER C*/ 0x0064, /*U+0044*/ /*LATIN CAPITAL LETTER D*/ 0x0065, /*U+0045*/ /*LATIN CAPITAL LETTER E*/ 0x0066, /*U+0046*/ /*LATIN CAPITAL LETTER F*/ 0x0067, /*U+0047*/ /*LATIN CAPITAL LETTER G*/ 0x0068, /*U+0048*/ /*LATIN CAPITAL LETTER H*/ 0x0069, /*U+0049*/ /*LATIN CAPITAL LETTER I*/ 0x006A, /*U+004A*/ /*LATIN CAPITAL LETTER J*/ 0x006B, /*U+004B*/ /*LATIN CAPITAL LETTER K*/ 0x006C, /*U+004C*/ /*LATIN CAPITAL LETTER L*/ 0x006D, /*U+004D*/ /*LATIN CAPITAL LETTER M*/ 0x006E, /*U+004E*/ /*LATIN CAPITAL LETTER N*/ 0x006F, /*U+004F*/ /*LATIN CAPITAL LETTER O*/ 0x0070, /*U+0050*/ /*LATIN CAPITAL LETTER P*/ 0x0071, /*U+0051*/ /*LATIN CAPITAL LETTER Q*/ 0x0072, /*U+0052*/ /*LATIN CAPITAL LETTER R*/ 0x0073, /*U+0053*/ /*LATIN CAPITAL LETTER S*/ 0x0074, /*U+0054*/ /*LATIN CAPITAL LETTER T*/ 0x0075, /*U+0055*/ /*LATIN CAPITAL LETTER U*/ 0x0076, /*U+0056*/ /*LATIN CAPITAL LETTER V*/ 0x0077, /*U+0057*/ /*LATIN CAPITAL LETTER W*/ 0x0078, /*U+0058*/ /*LATIN CAPITAL LETTER X*/ 0x0079, /*U+0059*/ /*LATIN CAPITAL LETTER Y*/ 0x007A, /*U+005A*/ /*LATIN CAPITAL LETTER Z*/ 0x005B, /*U+005B*/ /**/ 0x005C, /*U+005C*/ /**/ 0x005D, /*U+005D*/ /**/ 0x005E, /*U+005E*/ /**/ 0x005F, /*U+005F*/ /**/ 0x0060, /*U+0060*/ /**/ 0x0061, /*U+0061*/ /**/ 0x0062, /*U+0062*/ /**/ 0x0063, /*U+0063*/ /**/ 0x0064, /*U+0064*/ /**/ 0x0065, /*U+0065*/ /**/ 0x0066, /*U+0066*/ /**/ 0x0067, /*U+0067*/ /**/ 0x0068, /*U+0068*/ /**/ 0x0069, /*U+0069*/ /**/ 0x006A, /*U+006A*/ /**/ 0x006B, /*U+006B*/ /**/ 0x006C, /*U+006C*/ /**/ 0x006D, /*U+006D*/ /**/ 0x006E, /*U+006E*/ /**/ 0x006F, /*U+006F*/ /**/ 0x0070, /*U+0070*/ /**/ 0x0071, /*U+0071*/ /**/ 0x0072, /*U+0072*/ /**/ 0x0073, /*U+0073*/ /**/ 0x0074, /*U+0074*/ /**/ 0x0075, /*U+0075*/ /**/ 0x0076, /*U+0076*/ /**/ 0x0077, /*U+0077*/ /**/ 0x0078, /*U+0078*/ /**/ 0x0079, /*U+0079*/ /**/ 0x007A, /*U+007A*/ /**/ 0x007B, /*U+007B*/ /**/ 0x007C, /*U+007C*/ /**/ 0x007D, /*U+007D*/ /**/ 0x007E, /*U+007E*/ /**/ 0x007F, /*U+007F*/ /**/ }; static const u_int16_t lower_table_2[448] = { 0x00E0, /*U+00C0*/ /*LATIN CAPITAL LETTER A WITH GRAVE*/ 0x00E1, /*U+00C1*/ /*LATIN CAPITAL LETTER A WITH ACUTE*/ 0x00E2, /*U+00C2*/ /*LATIN CAPITAL LETTER A WITH CIRCUMFLEX*/ 0x00E3, /*U+00C3*/ /*LATIN CAPITAL LETTER A WITH TILDE*/ 0x00E4, /*U+00C4*/ /*LATIN CAPITAL LETTER A WITH DIAERESIS*/ 0x00E5, /*U+00C5*/ /*LATIN CAPITAL LETTER A WITH RING ABOVE*/ 0x00E6, /*U+00C6*/ /*LATIN CAPITAL LETTER AE*/ 0x00E7, /*U+00C7*/ /*LATIN CAPITAL LETTER C WITH CEDILLA*/ 0x00E8, /*U+00C8*/ /*LATIN CAPITAL LETTER E WITH GRAVE*/ 0x00E9, /*U+00C9*/ /*LATIN CAPITAL LETTER E WITH ACUTE*/ 0x00EA, /*U+00CA*/ /*LATIN CAPITAL LETTER E WITH CIRCUMFLEX*/ 0x00EB, /*U+00CB*/ /*LATIN CAPITAL LETTER E WITH DIAERESIS*/ 0x00EC, /*U+00CC*/ /*LATIN CAPITAL LETTER I WITH GRAVE*/ 0x00ED, /*U+00CD*/ /*LATIN CAPITAL LETTER I WITH ACUTE*/ 0x00EE, /*U+00CE*/ /*LATIN CAPITAL LETTER I WITH CIRCUMFLEX*/ 0x00EF, /*U+00CF*/ /*LATIN CAPITAL LETTER I WITH DIAERESIS*/ 0x00F0, /*U+00D0*/ /*LATIN CAPITAL LETTER ETH*/ 0x00F1, /*U+00D1*/ /*LATIN CAPITAL LETTER N WITH TILDE*/ 0x00F2, /*U+00D2*/ /*LATIN CAPITAL LETTER O WITH GRAVE*/ 0x00F3, /*U+00D3*/ /*LATIN CAPITAL LETTER O WITH ACUTE*/ 0x00F4, /*U+00D4*/ /*LATIN CAPITAL LETTER O WITH CIRCUMFLEX*/ 0x00F5, /*U+00D5*/ /*LATIN CAPITAL LETTER O WITH TILDE*/ 0x00F6, /*U+00D6*/ /*LATIN CAPITAL LETTER O WITH DIAERESIS*/ 0x00D7, /*U+00D7*/ /**/ 0x00F8, /*U+00D8*/ /*LATIN CAPITAL LETTER O WITH STROKE*/ 0x00F9, /*U+00D9*/ /*LATIN CAPITAL LETTER U WITH GRAVE*/ 0x00FA, /*U+00DA*/ /*LATIN CAPITAL LETTER U WITH ACUTE*/ 0x00FB, /*U+00DB*/ /*LATIN CAPITAL LETTER U WITH CIRCUMFLEX*/ 0x00FC, /*U+00DC*/ /*LATIN CAPITAL LETTER U WITH DIAERESIS*/ 0x00FD, /*U+00DD*/ /*LATIN CAPITAL LETTER Y WITH ACUTE*/ 0x00FE, /*U+00DE*/ /*LATIN CAPITAL LETTER THORN*/ 0x00DF, /*U+00DF*/ /**/ 0x00E0, /*U+00E0*/ /**/ 0x00E1, /*U+00E1*/ /**/ 0x00E2, /*U+00E2*/ /**/ 0x00E3, /*U+00E3*/ /**/ 0x00E4, /*U+00E4*/ /**/ 0x00E5, /*U+00E5*/ /**/ 0x00E6, /*U+00E6*/ /**/ 0x00E7, /*U+00E7*/ /**/ 0x00E8, /*U+00E8*/ /**/ 0x00E9, /*U+00E9*/ /**/ 0x00EA, /*U+00EA*/ /**/ 0x00EB, /*U+00EB*/ /**/ 0x00EC, /*U+00EC*/ /**/ 0x00ED, /*U+00ED*/ /**/ 0x00EE, /*U+00EE*/ /**/ 0x00EF, /*U+00EF*/ /**/ 0x00F0, /*U+00F0*/ /**/ 0x00F1, /*U+00F1*/ /**/ 0x00F2, /*U+00F2*/ /**/ 0x00F3, /*U+00F3*/ /**/ 0x00F4, /*U+00F4*/ /**/ 0x00F5, /*U+00F5*/ /**/ 0x00F6, /*U+00F6*/ /**/ 0x00F7, /*U+00F7*/ /**/ 0x00F8, /*U+00F8*/ /**/ 0x00F9, /*U+00F9*/ /**/ 0x00FA, /*U+00FA*/ /**/ 0x00FB, /*U+00FB*/ /**/ 0x00FC, /*U+00FC*/ /**/ 0x00FD, /*U+00FD*/ /**/ 0x00FE, /*U+00FE*/ /**/ 0x00FF, /*U+00FF*/ /**/ 0x0101, /*U+0100*/ /*LATIN CAPITAL LETTER A WITH MACRON*/ 0x0101, /*U+0101*/ /**/ 0x0103, /*U+0102*/ /*LATIN CAPITAL LETTER A WITH BREVE*/ 0x0103, /*U+0103*/ /**/ 0x0105, /*U+0104*/ /*LATIN CAPITAL LETTER A WITH OGONEK*/ 0x0105, /*U+0105*/ /**/ 0x0107, /*U+0106*/ /*LATIN CAPITAL LETTER C WITH ACUTE*/ 0x0107, /*U+0107*/ /**/ 0x0109, /*U+0108*/ /*LATIN CAPITAL LETTER C WITH CIRCUMFLEX*/ 0x0109, /*U+0109*/ /**/ 0x010B, /*U+010A*/ /*LATIN CAPITAL LETTER C WITH DOT ABOVE*/ 0x010B, /*U+010B*/ /**/ 0x010D, /*U+010C*/ /*LATIN CAPITAL LETTER C WITH CARON*/ 0x010D, /*U+010D*/ /**/ 0x010F, /*U+010E*/ /*LATIN CAPITAL LETTER D WITH CARON*/ 0x010F, /*U+010F*/ /**/ 0x0111, /*U+0110*/ /*LATIN CAPITAL LETTER D WITH STROKE*/ 0x0111, /*U+0111*/ /**/ 0x0113, /*U+0112*/ /*LATIN CAPITAL LETTER E WITH MACRON*/ 0x0113, /*U+0113*/ /**/ 0x0115, /*U+0114*/ /*LATIN CAPITAL LETTER E WITH BREVE*/ 0x0115, /*U+0115*/ /**/ 0x0117, /*U+0116*/ /*LATIN CAPITAL LETTER E WITH DOT ABOVE*/ 0x0117, /*U+0117*/ /**/ 0x0119, /*U+0118*/ /*LATIN CAPITAL LETTER E WITH OGONEK*/ 0x0119, /*U+0119*/ /**/ 0x011B, /*U+011A*/ /*LATIN CAPITAL LETTER E WITH CARON*/ 0x011B, /*U+011B*/ /**/ 0x011D, /*U+011C*/ /*LATIN CAPITAL LETTER G WITH CIRCUMFLEX*/ 0x011D, /*U+011D*/ /**/ 0x011F, /*U+011E*/ /*LATIN CAPITAL LETTER G WITH BREVE*/ 0x011F, /*U+011F*/ /**/ 0x0121, /*U+0120*/ /*LATIN CAPITAL LETTER G WITH DOT ABOVE*/ 0x0121, /*U+0121*/ /**/ 0x0123, /*U+0122*/ /*LATIN CAPITAL LETTER G WITH CEDILLA*/ 0x0123, /*U+0123*/ /**/ 0x0125, /*U+0124*/ /*LATIN CAPITAL LETTER H WITH CIRCUMFLEX*/ 0x0125, /*U+0125*/ /**/ 0x0127, /*U+0126*/ /*LATIN CAPITAL LETTER H WITH STROKE*/ 0x0127, /*U+0127*/ /**/ 0x0129, /*U+0128*/ /*LATIN CAPITAL LETTER I WITH TILDE*/ 0x0129, /*U+0129*/ /**/ 0x012B, /*U+012A*/ /*LATIN CAPITAL LETTER I WITH MACRON*/ 0x012B, /*U+012B*/ /**/ 0x012D, /*U+012C*/ /*LATIN CAPITAL LETTER I WITH BREVE*/ 0x012D, /*U+012D*/ /**/ 0x012F, /*U+012E*/ /*LATIN CAPITAL LETTER I WITH OGONEK*/ 0x012F, /*U+012F*/ /**/ 0x0069, /*U+0130*/ /*LATIN CAPITAL LETTER I WITH DOT ABOVE*/ 0x0131, /*U+0131*/ /**/ 0x0133, /*U+0132*/ /*LATIN CAPITAL LIGATURE IJ*/ 0x0133, /*U+0133*/ /**/ 0x0135, /*U+0134*/ /*LATIN CAPITAL LETTER J WITH CIRCUMFLEX*/ 0x0135, /*U+0135*/ /**/ 0x0137, /*U+0136*/ /*LATIN CAPITAL LETTER K WITH CEDILLA*/ 0x0137, /*U+0137*/ /**/ 0x0138, /*U+0138*/ /**/ 0x013A, /*U+0139*/ /*LATIN CAPITAL LETTER L WITH ACUTE*/ 0x013A, /*U+013A*/ /**/ 0x013C, /*U+013B*/ /*LATIN CAPITAL LETTER L WITH CEDILLA*/ 0x013C, /*U+013C*/ /**/ 0x013E, /*U+013D*/ /*LATIN CAPITAL LETTER L WITH CARON*/ 0x013E, /*U+013E*/ /**/ 0x0140, /*U+013F*/ /*LATIN CAPITAL LETTER L WITH MIDDLE DOT*/ 0x0140, /*U+0140*/ /**/ 0x0142, /*U+0141*/ /*LATIN CAPITAL LETTER L WITH STROKE*/ 0x0142, /*U+0142*/ /**/ 0x0144, /*U+0143*/ /*LATIN CAPITAL LETTER N WITH ACUTE*/ 0x0144, /*U+0144*/ /**/ 0x0146, /*U+0145*/ /*LATIN CAPITAL LETTER N WITH CEDILLA*/ 0x0146, /*U+0146*/ /**/ 0x0148, /*U+0147*/ /*LATIN CAPITAL LETTER N WITH CARON*/ 0x0148, /*U+0148*/ /**/ 0x0149, /*U+0149*/ /**/ 0x014B, /*U+014A*/ /*LATIN CAPITAL LETTER ENG*/ 0x014B, /*U+014B*/ /**/ 0x014D, /*U+014C*/ /*LATIN CAPITAL LETTER O WITH MACRON*/ 0x014D, /*U+014D*/ /**/ 0x014F, /*U+014E*/ /*LATIN CAPITAL LETTER O WITH BREVE*/ 0x014F, /*U+014F*/ /**/ 0x0151, /*U+0150*/ /*LATIN CAPITAL LETTER O WITH DOUBLE ACUTE*/ 0x0151, /*U+0151*/ /**/ 0x0153, /*U+0152*/ /*LATIN CAPITAL LIGATURE OE*/ 0x0153, /*U+0153*/ /**/ 0x0155, /*U+0154*/ /*LATIN CAPITAL LETTER R WITH ACUTE*/ 0x0155, /*U+0155*/ /**/ 0x0157, /*U+0156*/ /*LATIN CAPITAL LETTER R WITH CEDILLA*/ 0x0157, /*U+0157*/ /**/ 0x0159, /*U+0158*/ /*LATIN CAPITAL LETTER R WITH CARON*/ 0x0159, /*U+0159*/ /**/ 0x015B, /*U+015A*/ /*LATIN CAPITAL LETTER S WITH ACUTE*/ 0x015B, /*U+015B*/ /**/ 0x015D, /*U+015C*/ /*LATIN CAPITAL LETTER S WITH CIRCUMFLEX*/ 0x015D, /*U+015D*/ /**/ 0x015F, /*U+015E*/ /*LATIN CAPITAL LETTER S WITH CEDILLA*/ 0x015F, /*U+015F*/ /**/ 0x0161, /*U+0160*/ /*LATIN CAPITAL LETTER S WITH CARON*/ 0x0161, /*U+0161*/ /**/ 0x0163, /*U+0162*/ /*LATIN CAPITAL LETTER T WITH CEDILLA*/ 0x0163, /*U+0163*/ /**/ 0x0165, /*U+0164*/ /*LATIN CAPITAL LETTER T WITH CARON*/ 0x0165, /*U+0165*/ /**/ 0x0167, /*U+0166*/ /*LATIN CAPITAL LETTER T WITH STROKE*/ 0x0167, /*U+0167*/ /**/ 0x0169, /*U+0168*/ /*LATIN CAPITAL LETTER U WITH TILDE*/ 0x0169, /*U+0169*/ /**/ 0x016B, /*U+016A*/ /*LATIN CAPITAL LETTER U WITH MACRON*/ 0x016B, /*U+016B*/ /**/ 0x016D, /*U+016C*/ /*LATIN CAPITAL LETTER U WITH BREVE*/ 0x016D, /*U+016D*/ /**/ 0x016F, /*U+016E*/ /*LATIN CAPITAL LETTER U WITH RING ABOVE*/ 0x016F, /*U+016F*/ /**/ 0x0171, /*U+0170*/ /*LATIN CAPITAL LETTER U WITH DOUBLE ACUTE*/ 0x0171, /*U+0171*/ /**/ 0x0173, /*U+0172*/ /*LATIN CAPITAL LETTER U WITH OGONEK*/ 0x0173, /*U+0173*/ /**/ 0x0175, /*U+0174*/ /*LATIN CAPITAL LETTER W WITH CIRCUMFLEX*/ 0x0175, /*U+0175*/ /**/ 0x0177, /*U+0176*/ /*LATIN CAPITAL LETTER Y WITH CIRCUMFLEX*/ 0x0177, /*U+0177*/ /**/ 0x00FF, /*U+0178*/ /*LATIN CAPITAL LETTER Y WITH DIAERESIS*/ 0x017A, /*U+0179*/ /*LATIN CAPITAL LETTER Z WITH ACUTE*/ 0x017A, /*U+017A*/ /**/ 0x017C, /*U+017B*/ /*LATIN CAPITAL LETTER Z WITH DOT ABOVE*/ 0x017C, /*U+017C*/ /**/ 0x017E, /*U+017D*/ /*LATIN CAPITAL LETTER Z WITH CARON*/ 0x017E, /*U+017E*/ /**/ 0x017F, /*U+017F*/ /**/ 0x0180, /*U+0180*/ /**/ 0x0253, /*U+0181*/ /*LATIN CAPITAL LETTER B WITH HOOK*/ 0x0183, /*U+0182*/ /*LATIN CAPITAL LETTER B WITH TOPBAR*/ 0x0183, /*U+0183*/ /**/ 0x0185, /*U+0184*/ /*LATIN CAPITAL LETTER TONE SIX*/ 0x0185, /*U+0185*/ /**/ 0x0254, /*U+0186*/ /*LATIN CAPITAL LETTER OPEN O*/ 0x0188, /*U+0187*/ /*LATIN CAPITAL LETTER C WITH HOOK*/ 0x0188, /*U+0188*/ /**/ 0x0256, /*U+0189*/ /*LATIN CAPITAL LETTER AFRICAN D*/ 0x0257, /*U+018A*/ /*LATIN CAPITAL LETTER D WITH HOOK*/ 0x018C, /*U+018B*/ /*LATIN CAPITAL LETTER D WITH TOPBAR*/ 0x018C, /*U+018C*/ /**/ 0x018D, /*U+018D*/ /**/ 0x01DD, /*U+018E*/ /*LATIN CAPITAL LETTER REVERSED E*/ 0x0259, /*U+018F*/ /*LATIN CAPITAL LETTER SCHWA*/ 0x025B, /*U+0190*/ /*LATIN CAPITAL LETTER OPEN E*/ 0x0192, /*U+0191*/ /*LATIN CAPITAL LETTER F WITH HOOK*/ 0x0192, /*U+0192*/ /**/ 0x0260, /*U+0193*/ /*LATIN CAPITAL LETTER G WITH HOOK*/ 0x0263, /*U+0194*/ /*LATIN CAPITAL LETTER GAMMA*/ 0x0195, /*U+0195*/ /**/ 0x0269, /*U+0196*/ /*LATIN CAPITAL LETTER IOTA*/ 0x0268, /*U+0197*/ /*LATIN CAPITAL LETTER I WITH STROKE*/ 0x0199, /*U+0198*/ /*LATIN CAPITAL LETTER K WITH HOOK*/ 0x0199, /*U+0199*/ /**/ 0x019A, /*U+019A*/ /**/ 0x019B, /*U+019B*/ /**/ 0x026F, /*U+019C*/ /*LATIN CAPITAL LETTER TURNED M*/ 0x0272, /*U+019D*/ /*LATIN CAPITAL LETTER N WITH LEFT HOOK*/ 0x019E, /*U+019E*/ /**/ 0x0275, /*U+019F*/ /*LATIN CAPITAL LETTER O WITH MIDDLE TILDE*/ 0x01A1, /*U+01A0*/ /*LATIN CAPITAL LETTER O WITH HORN*/ 0x01A1, /*U+01A1*/ /**/ 0x01A3, /*U+01A2*/ /*LATIN CAPITAL LETTER OI*/ 0x01A3, /*U+01A3*/ /**/ 0x01A5, /*U+01A4*/ /*LATIN CAPITAL LETTER P WITH HOOK*/ 0x01A5, /*U+01A5*/ /**/ 0x0280, /*U+01A6*/ /*LATIN LETTER YR*/ 0x01A8, /*U+01A7*/ /*LATIN CAPITAL LETTER TONE TWO*/ 0x01A8, /*U+01A8*/ /**/ 0x0283, /*U+01A9*/ /*LATIN CAPITAL LETTER ESH*/ 0x01AA, /*U+01AA*/ /**/ 0x01AB, /*U+01AB*/ /**/ 0x01AD, /*U+01AC*/ /*LATIN CAPITAL LETTER T WITH HOOK*/ 0x01AD, /*U+01AD*/ /**/ 0x0288, /*U+01AE*/ /*LATIN CAPITAL LETTER T WITH RETROFLEX HOOK*/ 0x01B0, /*U+01AF*/ /*LATIN CAPITAL LETTER U WITH HORN*/ 0x01B0, /*U+01B0*/ /**/ 0x028A, /*U+01B1*/ /*LATIN CAPITAL LETTER UPSILON*/ 0x028B, /*U+01B2*/ /*LATIN CAPITAL LETTER V WITH HOOK*/ 0x01B4, /*U+01B3*/ /*LATIN CAPITAL LETTER Y WITH HOOK*/ 0x01B4, /*U+01B4*/ /**/ 0x01B6, /*U+01B5*/ /*LATIN CAPITAL LETTER Z WITH STROKE*/ 0x01B6, /*U+01B6*/ /**/ 0x0292, /*U+01B7*/ /*LATIN CAPITAL LETTER EZH*/ 0x01B9, /*U+01B8*/ /*LATIN CAPITAL LETTER EZH REVERSED*/ 0x01B9, /*U+01B9*/ /**/ 0x01BA, /*U+01BA*/ /**/ 0x01BB, /*U+01BB*/ /**/ 0x01BD, /*U+01BC*/ /*LATIN CAPITAL LETTER TONE FIVE*/ 0x01BD, /*U+01BD*/ /**/ 0x01BE, /*U+01BE*/ /**/ 0x01BF, /*U+01BF*/ /**/ 0x01C0, /*U+01C0*/ /**/ 0x01C1, /*U+01C1*/ /**/ 0x01C2, /*U+01C2*/ /**/ 0x01C3, /*U+01C3*/ /**/ 0x01C6, /*U+01C4*/ /*LATIN CAPITAL LETTER DZ WITH CARON*/ 0x01C6, /*U+01C5*/ /*LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON*/ 0x01C6, /*U+01C6*/ /**/ 0x01C9, /*U+01C7*/ /*LATIN CAPITAL LETTER LJ*/ 0x01C9, /*U+01C8*/ /*LATIN CAPITAL LETTER L WITH SMALL LETTER J*/ 0x01C9, /*U+01C9*/ /**/ 0x01CC, /*U+01CA*/ /*LATIN CAPITAL LETTER NJ*/ 0x01CC, /*U+01CB*/ /*LATIN CAPITAL LETTER N WITH SMALL LETTER J*/ 0x01CC, /*U+01CC*/ /**/ 0x01CE, /*U+01CD*/ /*LATIN CAPITAL LETTER A WITH CARON*/ 0x01CE, /*U+01CE*/ /**/ 0x01D0, /*U+01CF*/ /*LATIN CAPITAL LETTER I WITH CARON*/ 0x01D0, /*U+01D0*/ /**/ 0x01D2, /*U+01D1*/ /*LATIN CAPITAL LETTER O WITH CARON*/ 0x01D2, /*U+01D2*/ /**/ 0x01D4, /*U+01D3*/ /*LATIN CAPITAL LETTER U WITH CARON*/ 0x01D4, /*U+01D4*/ /**/ 0x01D6, /*U+01D5*/ /*LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON*/ 0x01D6, /*U+01D6*/ /**/ 0x01D8, /*U+01D7*/ /*LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE*/ 0x01D8, /*U+01D8*/ /**/ 0x01DA, /*U+01D9*/ /*LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON*/ 0x01DA, /*U+01DA*/ /**/ 0x01DC, /*U+01DB*/ /*LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE*/ 0x01DC, /*U+01DC*/ /**/ 0x01DD, /*U+01DD*/ /**/ 0x01DF, /*U+01DE*/ /*LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON*/ 0x01DF, /*U+01DF*/ /**/ 0x01E1, /*U+01E0*/ /*LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON*/ 0x01E1, /*U+01E1*/ /**/ 0x01E3, /*U+01E2*/ /*LATIN CAPITAL LETTER AE WITH MACRON*/ 0x01E3, /*U+01E3*/ /**/ 0x01E5, /*U+01E4*/ /*LATIN CAPITAL LETTER G WITH STROKE*/ 0x01E5, /*U+01E5*/ /**/ 0x01E7, /*U+01E6*/ /*LATIN CAPITAL LETTER G WITH CARON*/ 0x01E7, /*U+01E7*/ /**/ 0x01E9, /*U+01E8*/ /*LATIN CAPITAL LETTER K WITH CARON*/ 0x01E9, /*U+01E9*/ /**/ 0x01EB, /*U+01EA*/ /*LATIN CAPITAL LETTER O WITH OGONEK*/ 0x01EB, /*U+01EB*/ /**/ 0x01ED, /*U+01EC*/ /*LATIN CAPITAL LETTER O WITH OGONEK AND MACRON*/ 0x01ED, /*U+01ED*/ /**/ 0x01EF, /*U+01EE*/ /*LATIN CAPITAL LETTER EZH WITH CARON*/ 0x01EF, /*U+01EF*/ /**/ 0x01F0, /*U+01F0*/ /**/ 0x01F3, /*U+01F1*/ /*LATIN CAPITAL LETTER DZ*/ 0x01F3, /*U+01F2*/ /*LATIN CAPITAL LETTER D WITH SMALL LETTER Z*/ 0x01F3, /*U+01F3*/ /**/ 0x01F5, /*U+01F4*/ /*LATIN CAPITAL LETTER G WITH ACUTE*/ 0x01F5, /*U+01F5*/ /**/ 0x0195, /*U+01F6*/ /*LATIN CAPITAL LETTER HWAIR*/ 0x01BF, /*U+01F7*/ /*LATIN CAPITAL LETTER WYNN*/ 0x01F9, /*U+01F8*/ /*LATIN CAPITAL LETTER N WITH GRAVE*/ 0x01F9, /*U+01F9*/ /**/ 0x01FB, /*U+01FA*/ /*LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE*/ 0x01FB, /*U+01FB*/ /**/ 0x01FD, /*U+01FC*/ /*LATIN CAPITAL LETTER AE WITH ACUTE*/ 0x01FD, /*U+01FD*/ /**/ 0x01FF, /*U+01FE*/ /*LATIN CAPITAL LETTER O WITH STROKE AND ACUTE*/ 0x01FF, /*U+01FF*/ /**/ 0x0201, /*U+0200*/ /*LATIN CAPITAL LETTER A WITH DOUBLE GRAVE*/ 0x0201, /*U+0201*/ /**/ 0x0203, /*U+0202*/ /*LATIN CAPITAL LETTER A WITH INVERTED BREVE*/ 0x0203, /*U+0203*/ /**/ 0x0205, /*U+0204*/ /*LATIN CAPITAL LETTER E WITH DOUBLE GRAVE*/ 0x0205, /*U+0205*/ /**/ 0x0207, /*U+0206*/ /*LATIN CAPITAL LETTER E WITH INVERTED BREVE*/ 0x0207, /*U+0207*/ /**/ 0x0209, /*U+0208*/ /*LATIN CAPITAL LETTER I WITH DOUBLE GRAVE*/ 0x0209, /*U+0209*/ /**/ 0x020B, /*U+020A*/ /*LATIN CAPITAL LETTER I WITH INVERTED BREVE*/ 0x020B, /*U+020B*/ /**/ 0x020D, /*U+020C*/ /*LATIN CAPITAL LETTER O WITH DOUBLE GRAVE*/ 0x020D, /*U+020D*/ /**/ 0x020F, /*U+020E*/ /*LATIN CAPITAL LETTER O WITH INVERTED BREVE*/ 0x020F, /*U+020F*/ /**/ 0x0211, /*U+0210*/ /*LATIN CAPITAL LETTER R WITH DOUBLE GRAVE*/ 0x0211, /*U+0211*/ /**/ 0x0213, /*U+0212*/ /*LATIN CAPITAL LETTER R WITH INVERTED BREVE*/ 0x0213, /*U+0213*/ /**/ 0x0215, /*U+0214*/ /*LATIN CAPITAL LETTER U WITH DOUBLE GRAVE*/ 0x0215, /*U+0215*/ /**/ 0x0217, /*U+0216*/ /*LATIN CAPITAL LETTER U WITH INVERTED BREVE*/ 0x0217, /*U+0217*/ /**/ 0x0219, /*U+0218*/ /*LATIN CAPITAL LETTER S WITH COMMA BELOW*/ 0x0219, /*U+0219*/ /**/ 0x021B, /*U+021A*/ /*LATIN CAPITAL LETTER T WITH COMMA BELOW*/ 0x021B, /*U+021B*/ /**/ 0x021D, /*U+021C*/ /*LATIN CAPITAL LETTER YOGH*/ 0x021D, /*U+021D*/ /**/ 0x021F, /*U+021E*/ /*LATIN CAPITAL LETTER H WITH CARON*/ 0x021F, /*U+021F*/ /**/ 0x019E, /*U+0220*/ /*LATIN CAPITAL LETTER N WITH LONG RIGHT LEG*/ 0x0221, /*U+0221*/ /**/ 0x0223, /*U+0222*/ /*LATIN CAPITAL LETTER OU*/ 0x0223, /*U+0223*/ /**/ 0x0225, /*U+0224*/ /*LATIN CAPITAL LETTER Z WITH HOOK*/ 0x0225, /*U+0225*/ /**/ 0x0227, /*U+0226*/ /*LATIN CAPITAL LETTER A WITH DOT ABOVE*/ 0x0227, /*U+0227*/ /**/ 0x0229, /*U+0228*/ /*LATIN CAPITAL LETTER E WITH CEDILLA*/ 0x0229, /*U+0229*/ /**/ 0x022B, /*U+022A*/ /*LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON*/ 0x022B, /*U+022B*/ /**/ 0x022D, /*U+022C*/ /*LATIN CAPITAL LETTER O WITH TILDE AND MACRON*/ 0x022D, /*U+022D*/ /**/ 0x022F, /*U+022E*/ /*LATIN CAPITAL LETTER O WITH DOT ABOVE*/ 0x022F, /*U+022F*/ /**/ 0x0231, /*U+0230*/ /*LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON*/ 0x0231, /*U+0231*/ /**/ 0x0233, /*U+0232*/ /*LATIN CAPITAL LETTER Y WITH MACRON*/ 0x0233, /*U+0233*/ /**/ 0x0234, /*U+0234*/ /**/ 0x0235, /*U+0235*/ /**/ 0x0236, /*U+0236*/ /**/ 0x0237, /*U+0237*/ /**/ 0x0238, /*U+0238*/ /**/ 0x0239, /*U+0239*/ /**/ 0x2C65, /*U+023A*/ /*LATIN CAPITAL LETTER A WITH STROKE*/ 0x023C, /*U+023B*/ /*LATIN CAPITAL LETTER C WITH STROKE*/ 0x023C, /*U+023C*/ /**/ 0x019A, /*U+023D*/ /*LATIN CAPITAL LETTER L WITH BAR*/ 0x2C66, /*U+023E*/ /*LATIN CAPITAL LETTER T WITH DIAGONAL STROKE*/ 0x023F, /*U+023F*/ /**/ 0x0240, /*U+0240*/ /**/ 0x0242, /*U+0241*/ /*LATIN CAPITAL LETTER GLOTTAL STOP*/ 0x0242, /*U+0242*/ /**/ 0x0180, /*U+0243*/ /*LATIN CAPITAL LETTER B WITH STROKE*/ 0x0289, /*U+0244*/ /*LATIN CAPITAL LETTER U BAR*/ 0x028C, /*U+0245*/ /*LATIN CAPITAL LETTER TURNED V*/ 0x0247, /*U+0246*/ /*LATIN CAPITAL LETTER E WITH STROKE*/ 0x0247, /*U+0247*/ /**/ 0x0249, /*U+0248*/ /*LATIN CAPITAL LETTER J WITH STROKE*/ 0x0249, /*U+0249*/ /**/ 0x024B, /*U+024A*/ /*LATIN CAPITAL LETTER SMALL Q WITH HOOK TAIL*/ 0x024B, /*U+024B*/ /**/ 0x024D, /*U+024C*/ /*LATIN CAPITAL LETTER R WITH STROKE*/ 0x024D, /*U+024D*/ /**/ 0x024F, /*U+024E*/ /*LATIN CAPITAL LETTER Y WITH STROKE*/ 0x024F, /*U+024F*/ /**/ 0x0250, /*U+0250*/ /**/ 0x0251, /*U+0251*/ /**/ 0x0252, /*U+0252*/ /**/ 0x0253, /*U+0253*/ /**/ 0x0254, /*U+0254*/ /**/ 0x0255, /*U+0255*/ /**/ 0x0256, /*U+0256*/ /**/ 0x0257, /*U+0257*/ /**/ 0x0258, /*U+0258*/ /**/ 0x0259, /*U+0259*/ /**/ 0x025A, /*U+025A*/ /**/ 0x025B, /*U+025B*/ /**/ 0x025C, /*U+025C*/ /**/ 0x025D, /*U+025D*/ /**/ 0x025E, /*U+025E*/ /**/ 0x025F, /*U+025F*/ /**/ 0x0260, /*U+0260*/ /**/ 0x0261, /*U+0261*/ /**/ 0x0262, /*U+0262*/ /**/ 0x0263, /*U+0263*/ /**/ 0x0264, /*U+0264*/ /**/ 0x0265, /*U+0265*/ /**/ 0x0266, /*U+0266*/ /**/ 0x0267, /*U+0267*/ /**/ 0x0268, /*U+0268*/ /**/ 0x0269, /*U+0269*/ /**/ 0x026A, /*U+026A*/ /**/ 0x026B, /*U+026B*/ /**/ 0x026C, /*U+026C*/ /**/ 0x026D, /*U+026D*/ /**/ 0x026E, /*U+026E*/ /**/ 0x026F, /*U+026F*/ /**/ 0x0270, /*U+0270*/ /**/ 0x0271, /*U+0271*/ /**/ 0x0272, /*U+0272*/ /**/ 0x0273, /*U+0273*/ /**/ 0x0274, /*U+0274*/ /**/ 0x0275, /*U+0275*/ /**/ 0x0276, /*U+0276*/ /**/ 0x0277, /*U+0277*/ /**/ 0x0278, /*U+0278*/ /**/ 0x0279, /*U+0279*/ /**/ 0x027A, /*U+027A*/ /**/ 0x027B, /*U+027B*/ /**/ 0x027C, /*U+027C*/ /**/ 0x027D, /*U+027D*/ /**/ 0x027E, /*U+027E*/ /**/ 0x027F, /*U+027F*/ /**/ }; static const u_int16_t lower_table_3[576] = { 0x0340, /*U+0340*/ /**/ 0x0341, /*U+0341*/ /**/ 0x0342, /*U+0342*/ /**/ 0x0343, /*U+0343*/ /**/ 0x0344, /*U+0344*/ /**/ 0x0345, /*U+0345*/ /**/ 0x0346, /*U+0346*/ /**/ 0x0347, /*U+0347*/ /**/ 0x0348, /*U+0348*/ /**/ 0x0349, /*U+0349*/ /**/ 0x034A, /*U+034A*/ /**/ 0x034B, /*U+034B*/ /**/ 0x034C, /*U+034C*/ /**/ 0x034D, /*U+034D*/ /**/ 0x034E, /*U+034E*/ /**/ 0x034F, /*U+034F*/ /**/ 0x0350, /*U+0350*/ /**/ 0x0351, /*U+0351*/ /**/ 0x0352, /*U+0352*/ /**/ 0x0353, /*U+0353*/ /**/ 0x0354, /*U+0354*/ /**/ 0x0355, /*U+0355*/ /**/ 0x0356, /*U+0356*/ /**/ 0x0357, /*U+0357*/ /**/ 0x0358, /*U+0358*/ /**/ 0x0359, /*U+0359*/ /**/ 0x035A, /*U+035A*/ /**/ 0x035B, /*U+035B*/ /**/ 0x035C, /*U+035C*/ /**/ 0x035D, /*U+035D*/ /**/ 0x035E, /*U+035E*/ /**/ 0x035F, /*U+035F*/ /**/ 0x0360, /*U+0360*/ /**/ 0x0361, /*U+0361*/ /**/ 0x0362, /*U+0362*/ /**/ 0x0363, /*U+0363*/ /**/ 0x0364, /*U+0364*/ /**/ 0x0365, /*U+0365*/ /**/ 0x0366, /*U+0366*/ /**/ 0x0367, /*U+0367*/ /**/ 0x0368, /*U+0368*/ /**/ 0x0369, /*U+0369*/ /**/ 0x036A, /*U+036A*/ /**/ 0x036B, /*U+036B*/ /**/ 0x036C, /*U+036C*/ /**/ 0x036D, /*U+036D*/ /**/ 0x036E, /*U+036E*/ /**/ 0x036F, /*U+036F*/ /**/ 0x0371, /*U+0370*/ /*GREEK CAPITAL LETTER HETA*/ 0x0371, /*U+0371*/ /**/ 0x0373, /*U+0372*/ /*GREEK CAPITAL LETTER ARCHAIC SAMPI*/ 0x0373, /*U+0373*/ /**/ 0x0374, /*U+0374*/ /**/ 0x0375, /*U+0375*/ /**/ 0x0377, /*U+0376*/ /*GREEK CAPITAL LETTER PAMPHYLIAN DIGAMMA*/ 0x0377, /*U+0377*/ /**/ 0x0378, /*U+0378*/ /**/ 0x0379, /*U+0379*/ /**/ 0x037A, /*U+037A*/ /**/ 0x037B, /*U+037B*/ /**/ 0x037C, /*U+037C*/ /**/ 0x037D, /*U+037D*/ /**/ 0x037E, /*U+037E*/ /**/ 0x037F, /*U+037F*/ /**/ 0x0380, /*U+0380*/ /**/ 0x0381, /*U+0381*/ /**/ 0x0382, /*U+0382*/ /**/ 0x0383, /*U+0383*/ /**/ 0x0384, /*U+0384*/ /**/ 0x0385, /*U+0385*/ /**/ 0x03AC, /*U+0386*/ /*GREEK CAPITAL LETTER ALPHA WITH TONOS*/ 0x0387, /*U+0387*/ /**/ 0x03AD, /*U+0388*/ /*GREEK CAPITAL LETTER EPSILON WITH TONOS*/ 0x03AE, /*U+0389*/ /*GREEK CAPITAL LETTER ETA WITH TONOS*/ 0x03AF, /*U+038A*/ /*GREEK CAPITAL LETTER IOTA WITH TONOS*/ 0x038B, /*U+038B*/ /**/ 0x03CC, /*U+038C*/ /*GREEK CAPITAL LETTER OMICRON WITH TONOS*/ 0x038D, /*U+038D*/ /**/ 0x03CD, /*U+038E*/ /*GREEK CAPITAL LETTER UPSILON WITH TONOS*/ 0x03CE, /*U+038F*/ /*GREEK CAPITAL LETTER OMEGA WITH TONOS*/ 0x0390, /*U+0390*/ /**/ 0x03B1, /*U+0391*/ /*GREEK CAPITAL LETTER ALPHA*/ 0x03B2, /*U+0392*/ /*GREEK CAPITAL LETTER BETA*/ 0x03B3, /*U+0393*/ /*GREEK CAPITAL LETTER GAMMA*/ 0x03B4, /*U+0394*/ /*GREEK CAPITAL LETTER DELTA*/ 0x03B5, /*U+0395*/ /*GREEK CAPITAL LETTER EPSILON*/ 0x03B6, /*U+0396*/ /*GREEK CAPITAL LETTER ZETA*/ 0x03B7, /*U+0397*/ /*GREEK CAPITAL LETTER ETA*/ 0x03B8, /*U+0398*/ /*GREEK CAPITAL LETTER THETA*/ 0x03B9, /*U+0399*/ /*GREEK CAPITAL LETTER IOTA*/ 0x03BA, /*U+039A*/ /*GREEK CAPITAL LETTER KAPPA*/ 0x03BB, /*U+039B*/ /*GREEK CAPITAL LETTER LAMDA*/ 0x03BC, /*U+039C*/ /*GREEK CAPITAL LETTER MU*/ 0x03BD, /*U+039D*/ /*GREEK CAPITAL LETTER NU*/ 0x03BE, /*U+039E*/ /*GREEK CAPITAL LETTER XI*/ 0x03BF, /*U+039F*/ /*GREEK CAPITAL LETTER OMICRON*/ 0x03C0, /*U+03A0*/ /*GREEK CAPITAL LETTER PI*/ 0x03C1, /*U+03A1*/ /*GREEK CAPITAL LETTER RHO*/ 0x03A2, /*U+03A2*/ /**/ 0x03C3, /*U+03A3*/ /*GREEK CAPITAL LETTER SIGMA*/ 0x03C4, /*U+03A4*/ /*GREEK CAPITAL LETTER TAU*/ 0x03C5, /*U+03A5*/ /*GREEK CAPITAL LETTER UPSILON*/ 0x03C6, /*U+03A6*/ /*GREEK CAPITAL LETTER PHI*/ 0x03C7, /*U+03A7*/ /*GREEK CAPITAL LETTER CHI*/ 0x03C8, /*U+03A8*/ /*GREEK CAPITAL LETTER PSI*/ 0x03C9, /*U+03A9*/ /*GREEK CAPITAL LETTER OMEGA*/ 0x03CA, /*U+03AA*/ /*GREEK CAPITAL LETTER IOTA WITH DIALYTIKA*/ 0x03CB, /*U+03AB*/ /*GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA*/ 0x03AC, /*U+03AC*/ /**/ 0x03AD, /*U+03AD*/ /**/ 0x03AE, /*U+03AE*/ /**/ 0x03AF, /*U+03AF*/ /**/ 0x03B0, /*U+03B0*/ /**/ 0x03B1, /*U+03B1*/ /**/ 0x03B2, /*U+03B2*/ /**/ 0x03B3, /*U+03B3*/ /**/ 0x03B4, /*U+03B4*/ /**/ 0x03B5, /*U+03B5*/ /**/ 0x03B6, /*U+03B6*/ /**/ 0x03B7, /*U+03B7*/ /**/ 0x03B8, /*U+03B8*/ /**/ 0x03B9, /*U+03B9*/ /**/ 0x03BA, /*U+03BA*/ /**/ 0x03BB, /*U+03BB*/ /**/ 0x03BC, /*U+03BC*/ /**/ 0x03BD, /*U+03BD*/ /**/ 0x03BE, /*U+03BE*/ /**/ 0x03BF, /*U+03BF*/ /**/ 0x03C0, /*U+03C0*/ /**/ 0x03C1, /*U+03C1*/ /**/ 0x03C2, /*U+03C2*/ /**/ 0x03C3, /*U+03C3*/ /**/ 0x03C4, /*U+03C4*/ /**/ 0x03C5, /*U+03C5*/ /**/ 0x03C6, /*U+03C6*/ /**/ 0x03C7, /*U+03C7*/ /**/ 0x03C8, /*U+03C8*/ /**/ 0x03C9, /*U+03C9*/ /**/ 0x03CA, /*U+03CA*/ /**/ 0x03CB, /*U+03CB*/ /**/ 0x03CC, /*U+03CC*/ /**/ 0x03CD, /*U+03CD*/ /**/ 0x03CE, /*U+03CE*/ /**/ 0x03D7, /*U+03CF*/ /*GREEK CAPITAL KAI SYMBOL*/ 0x03D0, /*U+03D0*/ /**/ 0x03D1, /*U+03D1*/ /**/ 0x03D2, /*U+03D2*/ /**/ 0x03D3, /*U+03D3*/ /**/ 0x03D4, /*U+03D4*/ /**/ 0x03D5, /*U+03D5*/ /**/ 0x03D6, /*U+03D6*/ /**/ 0x03D7, /*U+03D7*/ /**/ 0x03D9, /*U+03D8*/ /*GREEK LETTER ARCHAIC KOPPA*/ 0x03D9, /*U+03D9*/ /**/ 0x03DB, /*U+03DA*/ /*GREEK LETTER STIGMA*/ 0x03DB, /*U+03DB*/ /**/ 0x03DD, /*U+03DC*/ /*GREEK LETTER DIGAMMA*/ 0x03DD, /*U+03DD*/ /**/ 0x03DF, /*U+03DE*/ /*GREEK LETTER KOPPA*/ 0x03DF, /*U+03DF*/ /**/ 0x03E1, /*U+03E0*/ /*GREEK LETTER SAMPI*/ 0x03E1, /*U+03E1*/ /**/ 0x03E3, /*U+03E2*/ /*COPTIC CAPITAL LETTER SHEI*/ 0x03E3, /*U+03E3*/ /**/ 0x03E5, /*U+03E4*/ /*COPTIC CAPITAL LETTER FEI*/ 0x03E5, /*U+03E5*/ /**/ 0x03E7, /*U+03E6*/ /*COPTIC CAPITAL LETTER KHEI*/ 0x03E7, /*U+03E7*/ /**/ 0x03E9, /*U+03E8*/ /*COPTIC CAPITAL LETTER HORI*/ 0x03E9, /*U+03E9*/ /**/ 0x03EB, /*U+03EA*/ /*COPTIC CAPITAL LETTER GANGIA*/ 0x03EB, /*U+03EB*/ /**/ 0x03ED, /*U+03EC*/ /*COPTIC CAPITAL LETTER SHIMA*/ 0x03ED, /*U+03ED*/ /**/ 0x03EF, /*U+03EE*/ /*COPTIC CAPITAL LETTER DEI*/ 0x03EF, /*U+03EF*/ /**/ 0x03F0, /*U+03F0*/ /**/ 0x03F1, /*U+03F1*/ /**/ 0x03F2, /*U+03F2*/ /**/ 0x03F3, /*U+03F3*/ /**/ 0x03B8, /*U+03F4*/ /*GREEK CAPITAL THETA SYMBOL*/ 0x03F5, /*U+03F5*/ /**/ 0x03F6, /*U+03F6*/ /**/ 0x03F8, /*U+03F7*/ /*GREEK CAPITAL LETTER SHO*/ 0x03F8, /*U+03F8*/ /**/ 0x03F2, /*U+03F9*/ /*GREEK CAPITAL LUNATE SIGMA SYMBOL*/ 0x03FB, /*U+03FA*/ /*GREEK CAPITAL LETTER SAN*/ 0x03FB, /*U+03FB*/ /**/ 0x03FC, /*U+03FC*/ /**/ 0x037B, /*U+03FD*/ /*GREEK CAPITAL REVERSED LUNATE SIGMA SYMBOL*/ 0x037C, /*U+03FE*/ /*GREEK CAPITAL DOTTED LUNATE SIGMA SYMBOL*/ 0x037D, /*U+03FF*/ /*GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL*/ 0x0450, /*U+0400*/ /*CYRILLIC CAPITAL LETTER IE WITH GRAVE*/ 0x0451, /*U+0401*/ /*CYRILLIC CAPITAL LETTER IO*/ 0x0452, /*U+0402*/ /*CYRILLIC CAPITAL LETTER DJE*/ 0x0453, /*U+0403*/ /*CYRILLIC CAPITAL LETTER GJE*/ 0x0454, /*U+0404*/ /*CYRILLIC CAPITAL LETTER UKRAINIAN IE*/ 0x0455, /*U+0405*/ /*CYRILLIC CAPITAL LETTER DZE*/ 0x0456, /*U+0406*/ /*CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I*/ 0x0457, /*U+0407*/ /*CYRILLIC CAPITAL LETTER YI*/ 0x0458, /*U+0408*/ /*CYRILLIC CAPITAL LETTER JE*/ 0x0459, /*U+0409*/ /*CYRILLIC CAPITAL LETTER LJE*/ 0x045A, /*U+040A*/ /*CYRILLIC CAPITAL LETTER NJE*/ 0x045B, /*U+040B*/ /*CYRILLIC CAPITAL LETTER TSHE*/ 0x045C, /*U+040C*/ /*CYRILLIC CAPITAL LETTER KJE*/ 0x045D, /*U+040D*/ /*CYRILLIC CAPITAL LETTER I WITH GRAVE*/ 0x045E, /*U+040E*/ /*CYRILLIC CAPITAL LETTER SHORT U*/ 0x045F, /*U+040F*/ /*CYRILLIC CAPITAL LETTER DZHE*/ 0x0430, /*U+0410*/ /*CYRILLIC CAPITAL LETTER A*/ 0x0431, /*U+0411*/ /*CYRILLIC CAPITAL LETTER BE*/ 0x0432, /*U+0412*/ /*CYRILLIC CAPITAL LETTER VE*/ 0x0433, /*U+0413*/ /*CYRILLIC CAPITAL LETTER GHE*/ 0x0434, /*U+0414*/ /*CYRILLIC CAPITAL LETTER DE*/ 0x0435, /*U+0415*/ /*CYRILLIC CAPITAL LETTER IE*/ 0x0436, /*U+0416*/ /*CYRILLIC CAPITAL LETTER ZHE*/ 0x0437, /*U+0417*/ /*CYRILLIC CAPITAL LETTER ZE*/ 0x0438, /*U+0418*/ /*CYRILLIC CAPITAL LETTER I*/ 0x0439, /*U+0419*/ /*CYRILLIC CAPITAL LETTER SHORT I*/ 0x043A, /*U+041A*/ /*CYRILLIC CAPITAL LETTER KA*/ 0x043B, /*U+041B*/ /*CYRILLIC CAPITAL LETTER EL*/ 0x043C, /*U+041C*/ /*CYRILLIC CAPITAL LETTER EM*/ 0x043D, /*U+041D*/ /*CYRILLIC CAPITAL LETTER EN*/ 0x043E, /*U+041E*/ /*CYRILLIC CAPITAL LETTER O*/ 0x043F, /*U+041F*/ /*CYRILLIC CAPITAL LETTER PE*/ 0x0440, /*U+0420*/ /*CYRILLIC CAPITAL LETTER ER*/ 0x0441, /*U+0421*/ /*CYRILLIC CAPITAL LETTER ES*/ 0x0442, /*U+0422*/ /*CYRILLIC CAPITAL LETTER TE*/ 0x0443, /*U+0423*/ /*CYRILLIC CAPITAL LETTER U*/ 0x0444, /*U+0424*/ /*CYRILLIC CAPITAL LETTER EF*/ 0x0445, /*U+0425*/ /*CYRILLIC CAPITAL LETTER HA*/ 0x0446, /*U+0426*/ /*CYRILLIC CAPITAL LETTER TSE*/ 0x0447, /*U+0427*/ /*CYRILLIC CAPITAL LETTER CHE*/ 0x0448, /*U+0428*/ /*CYRILLIC CAPITAL LETTER SHA*/ 0x0449, /*U+0429*/ /*CYRILLIC CAPITAL LETTER SHCHA*/ 0x044A, /*U+042A*/ /*CYRILLIC CAPITAL LETTER HARD SIGN*/ 0x044B, /*U+042B*/ /*CYRILLIC CAPITAL LETTER YERU*/ 0x044C, /*U+042C*/ /*CYRILLIC CAPITAL LETTER SOFT SIGN*/ 0x044D, /*U+042D*/ /*CYRILLIC CAPITAL LETTER E*/ 0x044E, /*U+042E*/ /*CYRILLIC CAPITAL LETTER YU*/ 0x044F, /*U+042F*/ /*CYRILLIC CAPITAL LETTER YA*/ 0x0430, /*U+0430*/ /**/ 0x0431, /*U+0431*/ /**/ 0x0432, /*U+0432*/ /**/ 0x0433, /*U+0433*/ /**/ 0x0434, /*U+0434*/ /**/ 0x0435, /*U+0435*/ /**/ 0x0436, /*U+0436*/ /**/ 0x0437, /*U+0437*/ /**/ 0x0438, /*U+0438*/ /**/ 0x0439, /*U+0439*/ /**/ 0x043A, /*U+043A*/ /**/ 0x043B, /*U+043B*/ /**/ 0x043C, /*U+043C*/ /**/ 0x043D, /*U+043D*/ /**/ 0x043E, /*U+043E*/ /**/ 0x043F, /*U+043F*/ /**/ 0x0440, /*U+0440*/ /**/ 0x0441, /*U+0441*/ /**/ 0x0442, /*U+0442*/ /**/ 0x0443, /*U+0443*/ /**/ 0x0444, /*U+0444*/ /**/ 0x0445, /*U+0445*/ /**/ 0x0446, /*U+0446*/ /**/ 0x0447, /*U+0447*/ /**/ 0x0448, /*U+0448*/ /**/ 0x0449, /*U+0449*/ /**/ 0x044A, /*U+044A*/ /**/ 0x044B, /*U+044B*/ /**/ 0x044C, /*U+044C*/ /**/ 0x044D, /*U+044D*/ /**/ 0x044E, /*U+044E*/ /**/ 0x044F, /*U+044F*/ /**/ 0x0450, /*U+0450*/ /**/ 0x0451, /*U+0451*/ /**/ 0x0452, /*U+0452*/ /**/ 0x0453, /*U+0453*/ /**/ 0x0454, /*U+0454*/ /**/ 0x0455, /*U+0455*/ /**/ 0x0456, /*U+0456*/ /**/ 0x0457, /*U+0457*/ /**/ 0x0458, /*U+0458*/ /**/ 0x0459, /*U+0459*/ /**/ 0x045A, /*U+045A*/ /**/ 0x045B, /*U+045B*/ /**/ 0x045C, /*U+045C*/ /**/ 0x045D, /*U+045D*/ /**/ 0x045E, /*U+045E*/ /**/ 0x045F, /*U+045F*/ /**/ 0x0461, /*U+0460*/ /*CYRILLIC CAPITAL LETTER OMEGA*/ 0x0461, /*U+0461*/ /**/ 0x0463, /*U+0462*/ /*CYRILLIC CAPITAL LETTER YAT*/ 0x0463, /*U+0463*/ /**/ 0x0465, /*U+0464*/ /*CYRILLIC CAPITAL LETTER IOTIFIED E*/ 0x0465, /*U+0465*/ /**/ 0x0467, /*U+0466*/ /*CYRILLIC CAPITAL LETTER LITTLE YUS*/ 0x0467, /*U+0467*/ /**/ 0x0469, /*U+0468*/ /*CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS*/ 0x0469, /*U+0469*/ /**/ 0x046B, /*U+046A*/ /*CYRILLIC CAPITAL LETTER BIG YUS*/ 0x046B, /*U+046B*/ /**/ 0x046D, /*U+046C*/ /*CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS*/ 0x046D, /*U+046D*/ /**/ 0x046F, /*U+046E*/ /*CYRILLIC CAPITAL LETTER KSI*/ 0x046F, /*U+046F*/ /**/ 0x0471, /*U+0470*/ /*CYRILLIC CAPITAL LETTER PSI*/ 0x0471, /*U+0471*/ /**/ 0x0473, /*U+0472*/ /*CYRILLIC CAPITAL LETTER FITA*/ 0x0473, /*U+0473*/ /**/ 0x0475, /*U+0474*/ /*CYRILLIC CAPITAL LETTER IZHITSA*/ 0x0475, /*U+0475*/ /**/ 0x0477, /*U+0476*/ /*CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT*/ 0x0477, /*U+0477*/ /**/ 0x0479, /*U+0478*/ /*CYRILLIC CAPITAL LETTER UK*/ 0x0479, /*U+0479*/ /**/ 0x047B, /*U+047A*/ /*CYRILLIC CAPITAL LETTER ROUND OMEGA*/ 0x047B, /*U+047B*/ /**/ 0x047D, /*U+047C*/ /*CYRILLIC CAPITAL LETTER OMEGA WITH TITLO*/ 0x047D, /*U+047D*/ /**/ 0x047F, /*U+047E*/ /*CYRILLIC CAPITAL LETTER OT*/ 0x047F, /*U+047F*/ /**/ 0x0481, /*U+0480*/ /*CYRILLIC CAPITAL LETTER KOPPA*/ 0x0481, /*U+0481*/ /**/ 0x0482, /*U+0482*/ /**/ 0x0483, /*U+0483*/ /**/ 0x0484, /*U+0484*/ /**/ 0x0485, /*U+0485*/ /**/ 0x0486, /*U+0486*/ /**/ 0x0487, /*U+0487*/ /**/ 0x0488, /*U+0488*/ /**/ 0x0489, /*U+0489*/ /**/ 0x048B, /*U+048A*/ /*CYRILLIC CAPITAL LETTER SHORT I WITH TAIL*/ 0x048B, /*U+048B*/ /**/ 0x048D, /*U+048C*/ /*CYRILLIC CAPITAL LETTER SEMISOFT SIGN*/ 0x048D, /*U+048D*/ /**/ 0x048F, /*U+048E*/ /*CYRILLIC CAPITAL LETTER ER WITH TICK*/ 0x048F, /*U+048F*/ /**/ 0x0491, /*U+0490*/ /*CYRILLIC CAPITAL LETTER GHE WITH UPTURN*/ 0x0491, /*U+0491*/ /**/ 0x0493, /*U+0492*/ /*CYRILLIC CAPITAL LETTER GHE WITH STROKE*/ 0x0493, /*U+0493*/ /**/ 0x0495, /*U+0494*/ /*CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK*/ 0x0495, /*U+0495*/ /**/ 0x0497, /*U+0496*/ /*CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER*/ 0x0497, /*U+0497*/ /**/ 0x0499, /*U+0498*/ /*CYRILLIC CAPITAL LETTER ZE WITH DESCENDER*/ 0x0499, /*U+0499*/ /**/ 0x049B, /*U+049A*/ /*CYRILLIC CAPITAL LETTER KA WITH DESCENDER*/ 0x049B, /*U+049B*/ /**/ 0x049D, /*U+049C*/ /*CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE*/ 0x049D, /*U+049D*/ /**/ 0x049F, /*U+049E*/ /*CYRILLIC CAPITAL LETTER KA WITH STROKE*/ 0x049F, /*U+049F*/ /**/ 0x04A1, /*U+04A0*/ /*CYRILLIC CAPITAL LETTER BASHKIR KA*/ 0x04A1, /*U+04A1*/ /**/ 0x04A3, /*U+04A2*/ /*CYRILLIC CAPITAL LETTER EN WITH DESCENDER*/ 0x04A3, /*U+04A3*/ /**/ 0x04A5, /*U+04A4*/ /*CYRILLIC CAPITAL LIGATURE EN GHE*/ 0x04A5, /*U+04A5*/ /**/ 0x04A7, /*U+04A6*/ /*CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK*/ 0x04A7, /*U+04A7*/ /**/ 0x04A9, /*U+04A8*/ /*CYRILLIC CAPITAL LETTER ABKHASIAN HA*/ 0x04A9, /*U+04A9*/ /**/ 0x04AB, /*U+04AA*/ /*CYRILLIC CAPITAL LETTER ES WITH DESCENDER*/ 0x04AB, /*U+04AB*/ /**/ 0x04AD, /*U+04AC*/ /*CYRILLIC CAPITAL LETTER TE WITH DESCENDER*/ 0x04AD, /*U+04AD*/ /**/ 0x04AF, /*U+04AE*/ /*CYRILLIC CAPITAL LETTER STRAIGHT U*/ 0x04AF, /*U+04AF*/ /**/ 0x04B1, /*U+04B0*/ /*CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE*/ 0x04B1, /*U+04B1*/ /**/ 0x04B3, /*U+04B2*/ /*CYRILLIC CAPITAL LETTER HA WITH DESCENDER*/ 0x04B3, /*U+04B3*/ /**/ 0x04B5, /*U+04B4*/ /*CYRILLIC CAPITAL LIGATURE TE TSE*/ 0x04B5, /*U+04B5*/ /**/ 0x04B7, /*U+04B6*/ /*CYRILLIC CAPITAL LETTER CHE WITH DESCENDER*/ 0x04B7, /*U+04B7*/ /**/ 0x04B9, /*U+04B8*/ /*CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE*/ 0x04B9, /*U+04B9*/ /**/ 0x04BB, /*U+04BA*/ /*CYRILLIC CAPITAL LETTER SHHA*/ 0x04BB, /*U+04BB*/ /**/ 0x04BD, /*U+04BC*/ /*CYRILLIC CAPITAL LETTER ABKHASIAN CHE*/ 0x04BD, /*U+04BD*/ /**/ 0x04BF, /*U+04BE*/ /*CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER*/ 0x04BF, /*U+04BF*/ /**/ 0x04CF, /*U+04C0*/ /*CYRILLIC LETTER PALOCHKA*/ 0x04C2, /*U+04C1*/ /*CYRILLIC CAPITAL LETTER ZHE WITH BREVE*/ 0x04C2, /*U+04C2*/ /**/ 0x04C4, /*U+04C3*/ /*CYRILLIC CAPITAL LETTER KA WITH HOOK*/ 0x04C4, /*U+04C4*/ /**/ 0x04C6, /*U+04C5*/ /*CYRILLIC CAPITAL LETTER EL WITH TAIL*/ 0x04C6, /*U+04C6*/ /**/ 0x04C8, /*U+04C7*/ /*CYRILLIC CAPITAL LETTER EN WITH HOOK*/ 0x04C8, /*U+04C8*/ /**/ 0x04CA, /*U+04C9*/ /*CYRILLIC CAPITAL LETTER EN WITH TAIL*/ 0x04CA, /*U+04CA*/ /**/ 0x04CC, /*U+04CB*/ /*CYRILLIC CAPITAL LETTER KHAKASSIAN CHE*/ 0x04CC, /*U+04CC*/ /**/ 0x04CE, /*U+04CD*/ /*CYRILLIC CAPITAL LETTER EM WITH TAIL*/ 0x04CE, /*U+04CE*/ /**/ 0x04CF, /*U+04CF*/ /**/ 0x04D1, /*U+04D0*/ /*CYRILLIC CAPITAL LETTER A WITH BREVE*/ 0x04D1, /*U+04D1*/ /**/ 0x04D3, /*U+04D2*/ /*CYRILLIC CAPITAL LETTER A WITH DIAERESIS*/ 0x04D3, /*U+04D3*/ /**/ 0x04D5, /*U+04D4*/ /*CYRILLIC CAPITAL LIGATURE A IE*/ 0x04D5, /*U+04D5*/ /**/ 0x04D7, /*U+04D6*/ /*CYRILLIC CAPITAL LETTER IE WITH BREVE*/ 0x04D7, /*U+04D7*/ /**/ 0x04D9, /*U+04D8*/ /*CYRILLIC CAPITAL LETTER SCHWA*/ 0x04D9, /*U+04D9*/ /**/ 0x04DB, /*U+04DA*/ /*CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS*/ 0x04DB, /*U+04DB*/ /**/ 0x04DD, /*U+04DC*/ /*CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS*/ 0x04DD, /*U+04DD*/ /**/ 0x04DF, /*U+04DE*/ /*CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS*/ 0x04DF, /*U+04DF*/ /**/ 0x04E1, /*U+04E0*/ /*CYRILLIC CAPITAL LETTER ABKHASIAN DZE*/ 0x04E1, /*U+04E1*/ /**/ 0x04E3, /*U+04E2*/ /*CYRILLIC CAPITAL LETTER I WITH MACRON*/ 0x04E3, /*U+04E3*/ /**/ 0x04E5, /*U+04E4*/ /*CYRILLIC CAPITAL LETTER I WITH DIAERESIS*/ 0x04E5, /*U+04E5*/ /**/ 0x04E7, /*U+04E6*/ /*CYRILLIC CAPITAL LETTER O WITH DIAERESIS*/ 0x04E7, /*U+04E7*/ /**/ 0x04E9, /*U+04E8*/ /*CYRILLIC CAPITAL LETTER BARRED O*/ 0x04E9, /*U+04E9*/ /**/ 0x04EB, /*U+04EA*/ /*CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS*/ 0x04EB, /*U+04EB*/ /**/ 0x04ED, /*U+04EC*/ /*CYRILLIC CAPITAL LETTER E WITH DIAERESIS*/ 0x04ED, /*U+04ED*/ /**/ 0x04EF, /*U+04EE*/ /*CYRILLIC CAPITAL LETTER U WITH MACRON*/ 0x04EF, /*U+04EF*/ /**/ 0x04F1, /*U+04F0*/ /*CYRILLIC CAPITAL LETTER U WITH DIAERESIS*/ 0x04F1, /*U+04F1*/ /**/ 0x04F3, /*U+04F2*/ /*CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE*/ 0x04F3, /*U+04F3*/ /**/ 0x04F5, /*U+04F4*/ /*CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS*/ 0x04F5, /*U+04F5*/ /**/ 0x04F7, /*U+04F6*/ /*CYRILLIC CAPITAL LETTER GHE WITH DESCENDER*/ 0x04F7, /*U+04F7*/ /**/ 0x04F9, /*U+04F8*/ /*CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS*/ 0x04F9, /*U+04F9*/ /**/ 0x04FB, /*U+04FA*/ /*CYRILLIC CAPITAL LETTER GHE WITH STROKE AND HOOK*/ 0x04FB, /*U+04FB*/ /**/ 0x04FD, /*U+04FC*/ /*CYRILLIC CAPITAL LETTER HA WITH HOOK*/ 0x04FD, /*U+04FD*/ /**/ 0x04FF, /*U+04FE*/ /*CYRILLIC CAPITAL LETTER HA WITH STROKE*/ 0x04FF, /*U+04FF*/ /**/ 0x0501, /*U+0500*/ /*CYRILLIC CAPITAL LETTER KOMI DE*/ 0x0501, /*U+0501*/ /**/ 0x0503, /*U+0502*/ /*CYRILLIC CAPITAL LETTER KOMI DJE*/ 0x0503, /*U+0503*/ /**/ 0x0505, /*U+0504*/ /*CYRILLIC CAPITAL LETTER KOMI ZJE*/ 0x0505, /*U+0505*/ /**/ 0x0507, /*U+0506*/ /*CYRILLIC CAPITAL LETTER KOMI DZJE*/ 0x0507, /*U+0507*/ /**/ 0x0509, /*U+0508*/ /*CYRILLIC CAPITAL LETTER KOMI LJE*/ 0x0509, /*U+0509*/ /**/ 0x050B, /*U+050A*/ /*CYRILLIC CAPITAL LETTER KOMI NJE*/ 0x050B, /*U+050B*/ /**/ 0x050D, /*U+050C*/ /*CYRILLIC CAPITAL LETTER KOMI SJE*/ 0x050D, /*U+050D*/ /**/ 0x050F, /*U+050E*/ /*CYRILLIC CAPITAL LETTER KOMI TJE*/ 0x050F, /*U+050F*/ /**/ 0x0511, /*U+0510*/ /*CYRILLIC CAPITAL LETTER REVERSED ZE*/ 0x0511, /*U+0511*/ /**/ 0x0513, /*U+0512*/ /*CYRILLIC CAPITAL LETTER EL WITH HOOK*/ 0x0513, /*U+0513*/ /**/ 0x0515, /*U+0514*/ /*CYRILLIC CAPITAL LETTER LHA*/ 0x0515, /*U+0515*/ /**/ 0x0517, /*U+0516*/ /*CYRILLIC CAPITAL LETTER RHA*/ 0x0517, /*U+0517*/ /**/ 0x0519, /*U+0518*/ /*CYRILLIC CAPITAL LETTER YAE*/ 0x0519, /*U+0519*/ /**/ 0x051B, /*U+051A*/ /*CYRILLIC CAPITAL LETTER QA*/ 0x051B, /*U+051B*/ /**/ 0x051D, /*U+051C*/ /*CYRILLIC CAPITAL LETTER WE*/ 0x051D, /*U+051D*/ /**/ 0x051F, /*U+051E*/ /*CYRILLIC CAPITAL LETTER ALEUT KA*/ 0x051F, /*U+051F*/ /**/ 0x0521, /*U+0520*/ /*CYRILLIC CAPITAL LETTER EL WITH MIDDLE HOOK*/ 0x0521, /*U+0521*/ /**/ 0x0523, /*U+0522*/ /*CYRILLIC CAPITAL LETTER EN WITH MIDDLE HOOK*/ 0x0523, /*U+0523*/ /**/ 0x0525, /*U+0524*/ /*CYRILLIC CAPITAL LETTER PE WITH DESCENDER*/ 0x0525, /*U+0525*/ /**/ 0x0527, /*U+0526*/ /*CYRILLIC CAPITAL LETTER SHHA WITH DESCENDER*/ 0x0527, /*U+0527*/ /**/ 0x0528, /*U+0528*/ /**/ 0x0529, /*U+0529*/ /**/ 0x052A, /*U+052A*/ /**/ 0x052B, /*U+052B*/ /**/ 0x052C, /*U+052C*/ /**/ 0x052D, /*U+052D*/ /**/ 0x052E, /*U+052E*/ /**/ 0x052F, /*U+052F*/ /**/ 0x0530, /*U+0530*/ /**/ 0x0561, /*U+0531*/ /*ARMENIAN CAPITAL LETTER AYB*/ 0x0562, /*U+0532*/ /*ARMENIAN CAPITAL LETTER BEN*/ 0x0563, /*U+0533*/ /*ARMENIAN CAPITAL LETTER GIM*/ 0x0564, /*U+0534*/ /*ARMENIAN CAPITAL LETTER DA*/ 0x0565, /*U+0535*/ /*ARMENIAN CAPITAL LETTER ECH*/ 0x0566, /*U+0536*/ /*ARMENIAN CAPITAL LETTER ZA*/ 0x0567, /*U+0537*/ /*ARMENIAN CAPITAL LETTER EH*/ 0x0568, /*U+0538*/ /*ARMENIAN CAPITAL LETTER ET*/ 0x0569, /*U+0539*/ /*ARMENIAN CAPITAL LETTER TO*/ 0x056A, /*U+053A*/ /*ARMENIAN CAPITAL LETTER ZHE*/ 0x056B, /*U+053B*/ /*ARMENIAN CAPITAL LETTER INI*/ 0x056C, /*U+053C*/ /*ARMENIAN CAPITAL LETTER LIWN*/ 0x056D, /*U+053D*/ /*ARMENIAN CAPITAL LETTER XEH*/ 0x056E, /*U+053E*/ /*ARMENIAN CAPITAL LETTER CA*/ 0x056F, /*U+053F*/ /*ARMENIAN CAPITAL LETTER KEN*/ 0x0570, /*U+0540*/ /*ARMENIAN CAPITAL LETTER HO*/ 0x0571, /*U+0541*/ /*ARMENIAN CAPITAL LETTER JA*/ 0x0572, /*U+0542*/ /*ARMENIAN CAPITAL LETTER GHAD*/ 0x0573, /*U+0543*/ /*ARMENIAN CAPITAL LETTER CHEH*/ 0x0574, /*U+0544*/ /*ARMENIAN CAPITAL LETTER MEN*/ 0x0575, /*U+0545*/ /*ARMENIAN CAPITAL LETTER YI*/ 0x0576, /*U+0546*/ /*ARMENIAN CAPITAL LETTER NOW*/ 0x0577, /*U+0547*/ /*ARMENIAN CAPITAL LETTER SHA*/ 0x0578, /*U+0548*/ /*ARMENIAN CAPITAL LETTER VO*/ 0x0579, /*U+0549*/ /*ARMENIAN CAPITAL LETTER CHA*/ 0x057A, /*U+054A*/ /*ARMENIAN CAPITAL LETTER PEH*/ 0x057B, /*U+054B*/ /*ARMENIAN CAPITAL LETTER JHEH*/ 0x057C, /*U+054C*/ /*ARMENIAN CAPITAL LETTER RA*/ 0x057D, /*U+054D*/ /*ARMENIAN CAPITAL LETTER SEH*/ 0x057E, /*U+054E*/ /*ARMENIAN CAPITAL LETTER VEW*/ 0x057F, /*U+054F*/ /*ARMENIAN CAPITAL LETTER TIWN*/ 0x0580, /*U+0550*/ /*ARMENIAN CAPITAL LETTER REH*/ 0x0581, /*U+0551*/ /*ARMENIAN CAPITAL LETTER CO*/ 0x0582, /*U+0552*/ /*ARMENIAN CAPITAL LETTER YIWN*/ 0x0583, /*U+0553*/ /*ARMENIAN CAPITAL LETTER PIWR*/ 0x0584, /*U+0554*/ /*ARMENIAN CAPITAL LETTER KEH*/ 0x0585, /*U+0555*/ /*ARMENIAN CAPITAL LETTER OH*/ 0x0586, /*U+0556*/ /*ARMENIAN CAPITAL LETTER FEH*/ 0x0557, /*U+0557*/ /**/ 0x0558, /*U+0558*/ /**/ 0x0559, /*U+0559*/ /**/ 0x055A, /*U+055A*/ /**/ 0x055B, /*U+055B*/ /**/ 0x055C, /*U+055C*/ /**/ 0x055D, /*U+055D*/ /**/ 0x055E, /*U+055E*/ /**/ 0x055F, /*U+055F*/ /**/ 0x0560, /*U+0560*/ /**/ 0x0561, /*U+0561*/ /**/ 0x0562, /*U+0562*/ /**/ 0x0563, /*U+0563*/ /**/ 0x0564, /*U+0564*/ /**/ 0x0565, /*U+0565*/ /**/ 0x0566, /*U+0566*/ /**/ 0x0567, /*U+0567*/ /**/ 0x0568, /*U+0568*/ /**/ 0x0569, /*U+0569*/ /**/ 0x056A, /*U+056A*/ /**/ 0x056B, /*U+056B*/ /**/ 0x056C, /*U+056C*/ /**/ 0x056D, /*U+056D*/ /**/ 0x056E, /*U+056E*/ /**/ 0x056F, /*U+056F*/ /**/ 0x0570, /*U+0570*/ /**/ 0x0571, /*U+0571*/ /**/ 0x0572, /*U+0572*/ /**/ 0x0573, /*U+0573*/ /**/ 0x0574, /*U+0574*/ /**/ 0x0575, /*U+0575*/ /**/ 0x0576, /*U+0576*/ /**/ 0x0577, /*U+0577*/ /**/ 0x0578, /*U+0578*/ /**/ 0x0579, /*U+0579*/ /**/ 0x057A, /*U+057A*/ /**/ 0x057B, /*U+057B*/ /**/ 0x057C, /*U+057C*/ /**/ 0x057D, /*U+057D*/ /**/ 0x057E, /*U+057E*/ /**/ 0x057F, /*U+057F*/ /**/ }; static const u_int16_t lower_table_4[128] = { 0x1080, /*U+1080*/ /**/ 0x1081, /*U+1081*/ /**/ 0x1082, /*U+1082*/ /**/ 0x1083, /*U+1083*/ /**/ 0x1084, /*U+1084*/ /**/ 0x1085, /*U+1085*/ /**/ 0x1086, /*U+1086*/ /**/ 0x1087, /*U+1087*/ /**/ 0x1088, /*U+1088*/ /**/ 0x1089, /*U+1089*/ /**/ 0x108A, /*U+108A*/ /**/ 0x108B, /*U+108B*/ /**/ 0x108C, /*U+108C*/ /**/ 0x108D, /*U+108D*/ /**/ 0x108E, /*U+108E*/ /**/ 0x108F, /*U+108F*/ /**/ 0x1090, /*U+1090*/ /**/ 0x1091, /*U+1091*/ /**/ 0x1092, /*U+1092*/ /**/ 0x1093, /*U+1093*/ /**/ 0x1094, /*U+1094*/ /**/ 0x1095, /*U+1095*/ /**/ 0x1096, /*U+1096*/ /**/ 0x1097, /*U+1097*/ /**/ 0x1098, /*U+1098*/ /**/ 0x1099, /*U+1099*/ /**/ 0x109A, /*U+109A*/ /**/ 0x109B, /*U+109B*/ /**/ 0x109C, /*U+109C*/ /**/ 0x109D, /*U+109D*/ /**/ 0x109E, /*U+109E*/ /**/ 0x109F, /*U+109F*/ /**/ 0x2D00, /*U+10A0*/ /*GEORGIAN CAPITAL LETTER AN*/ 0x2D01, /*U+10A1*/ /*GEORGIAN CAPITAL LETTER BAN*/ 0x2D02, /*U+10A2*/ /*GEORGIAN CAPITAL LETTER GAN*/ 0x2D03, /*U+10A3*/ /*GEORGIAN CAPITAL LETTER DON*/ 0x2D04, /*U+10A4*/ /*GEORGIAN CAPITAL LETTER EN*/ 0x2D05, /*U+10A5*/ /*GEORGIAN CAPITAL LETTER VIN*/ 0x2D06, /*U+10A6*/ /*GEORGIAN CAPITAL LETTER ZEN*/ 0x2D07, /*U+10A7*/ /*GEORGIAN CAPITAL LETTER TAN*/ 0x2D08, /*U+10A8*/ /*GEORGIAN CAPITAL LETTER IN*/ 0x2D09, /*U+10A9*/ /*GEORGIAN CAPITAL LETTER KAN*/ 0x2D0A, /*U+10AA*/ /*GEORGIAN CAPITAL LETTER LAS*/ 0x2D0B, /*U+10AB*/ /*GEORGIAN CAPITAL LETTER MAN*/ 0x2D0C, /*U+10AC*/ /*GEORGIAN CAPITAL LETTER NAR*/ 0x2D0D, /*U+10AD*/ /*GEORGIAN CAPITAL LETTER ON*/ 0x2D0E, /*U+10AE*/ /*GEORGIAN CAPITAL LETTER PAR*/ 0x2D0F, /*U+10AF*/ /*GEORGIAN CAPITAL LETTER ZHAR*/ 0x2D10, /*U+10B0*/ /*GEORGIAN CAPITAL LETTER RAE*/ 0x2D11, /*U+10B1*/ /*GEORGIAN CAPITAL LETTER SAN*/ 0x2D12, /*U+10B2*/ /*GEORGIAN CAPITAL LETTER TAR*/ 0x2D13, /*U+10B3*/ /*GEORGIAN CAPITAL LETTER UN*/ 0x2D14, /*U+10B4*/ /*GEORGIAN CAPITAL LETTER PHAR*/ 0x2D15, /*U+10B5*/ /*GEORGIAN CAPITAL LETTER KHAR*/ 0x2D16, /*U+10B6*/ /*GEORGIAN CAPITAL LETTER GHAN*/ 0x2D17, /*U+10B7*/ /*GEORGIAN CAPITAL LETTER QAR*/ 0x2D18, /*U+10B8*/ /*GEORGIAN CAPITAL LETTER SHIN*/ 0x2D19, /*U+10B9*/ /*GEORGIAN CAPITAL LETTER CHIN*/ 0x2D1A, /*U+10BA*/ /*GEORGIAN CAPITAL LETTER CAN*/ 0x2D1B, /*U+10BB*/ /*GEORGIAN CAPITAL LETTER JIL*/ 0x2D1C, /*U+10BC*/ /*GEORGIAN CAPITAL LETTER CIL*/ 0x2D1D, /*U+10BD*/ /*GEORGIAN CAPITAL LETTER CHAR*/ 0x2D1E, /*U+10BE*/ /*GEORGIAN CAPITAL LETTER XAN*/ 0x2D1F, /*U+10BF*/ /*GEORGIAN CAPITAL LETTER JHAN*/ 0x2D20, /*U+10C0*/ /*GEORGIAN CAPITAL LETTER HAE*/ 0x2D21, /*U+10C1*/ /*GEORGIAN CAPITAL LETTER HE*/ 0x2D22, /*U+10C2*/ /*GEORGIAN CAPITAL LETTER HIE*/ 0x2D23, /*U+10C3*/ /*GEORGIAN CAPITAL LETTER WE*/ 0x2D24, /*U+10C4*/ /*GEORGIAN CAPITAL LETTER HAR*/ 0x2D25, /*U+10C5*/ /*GEORGIAN CAPITAL LETTER HOE*/ 0x10C6, /*U+10C6*/ /**/ 0x10C7, /*U+10C7*/ /**/ 0x10C8, /*U+10C8*/ /**/ 0x10C9, /*U+10C9*/ /**/ 0x10CA, /*U+10CA*/ /**/ 0x10CB, /*U+10CB*/ /**/ 0x10CC, /*U+10CC*/ /**/ 0x10CD, /*U+10CD*/ /**/ 0x10CE, /*U+10CE*/ /**/ 0x10CF, /*U+10CF*/ /**/ 0x10D0, /*U+10D0*/ /**/ 0x10D1, /*U+10D1*/ /**/ 0x10D2, /*U+10D2*/ /**/ 0x10D3, /*U+10D3*/ /**/ 0x10D4, /*U+10D4*/ /**/ 0x10D5, /*U+10D5*/ /**/ 0x10D6, /*U+10D6*/ /**/ 0x10D7, /*U+10D7*/ /**/ 0x10D8, /*U+10D8*/ /**/ 0x10D9, /*U+10D9*/ /**/ 0x10DA, /*U+10DA*/ /**/ 0x10DB, /*U+10DB*/ /**/ 0x10DC, /*U+10DC*/ /**/ 0x10DD, /*U+10DD*/ /**/ 0x10DE, /*U+10DE*/ /**/ 0x10DF, /*U+10DF*/ /**/ 0x10E0, /*U+10E0*/ /**/ 0x10E1, /*U+10E1*/ /**/ 0x10E2, /*U+10E2*/ /**/ 0x10E3, /*U+10E3*/ /**/ 0x10E4, /*U+10E4*/ /**/ 0x10E5, /*U+10E5*/ /**/ 0x10E6, /*U+10E6*/ /**/ 0x10E7, /*U+10E7*/ /**/ 0x10E8, /*U+10E8*/ /**/ 0x10E9, /*U+10E9*/ /**/ 0x10EA, /*U+10EA*/ /**/ 0x10EB, /*U+10EB*/ /**/ 0x10EC, /*U+10EC*/ /**/ 0x10ED, /*U+10ED*/ /**/ 0x10EE, /*U+10EE*/ /**/ 0x10EF, /*U+10EF*/ /**/ 0x10F0, /*U+10F0*/ /**/ 0x10F1, /*U+10F1*/ /**/ 0x10F2, /*U+10F2*/ /**/ 0x10F3, /*U+10F3*/ /**/ 0x10F4, /*U+10F4*/ /**/ 0x10F5, /*U+10F5*/ /**/ 0x10F6, /*U+10F6*/ /**/ 0x10F7, /*U+10F7*/ /**/ 0x10F8, /*U+10F8*/ /**/ 0x10F9, /*U+10F9*/ /**/ 0x10FA, /*U+10FA*/ /**/ 0x10FB, /*U+10FB*/ /**/ 0x10FC, /*U+10FC*/ /**/ 0x10FD, /*U+10FD*/ /**/ 0x10FE, /*U+10FE*/ /**/ 0x10FF, /*U+10FF*/ /**/ }; static const u_int16_t lower_table_5[512] = { 0x1E01, /*U+1E00*/ /*LATIN CAPITAL LETTER A WITH RING BELOW*/ 0x1E01, /*U+1E01*/ /**/ 0x1E03, /*U+1E02*/ /*LATIN CAPITAL LETTER B WITH DOT ABOVE*/ 0x1E03, /*U+1E03*/ /**/ 0x1E05, /*U+1E04*/ /*LATIN CAPITAL LETTER B WITH DOT BELOW*/ 0x1E05, /*U+1E05*/ /**/ 0x1E07, /*U+1E06*/ /*LATIN CAPITAL LETTER B WITH LINE BELOW*/ 0x1E07, /*U+1E07*/ /**/ 0x1E09, /*U+1E08*/ /*LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE*/ 0x1E09, /*U+1E09*/ /**/ 0x1E0B, /*U+1E0A*/ /*LATIN CAPITAL LETTER D WITH DOT ABOVE*/ 0x1E0B, /*U+1E0B*/ /**/ 0x1E0D, /*U+1E0C*/ /*LATIN CAPITAL LETTER D WITH DOT BELOW*/ 0x1E0D, /*U+1E0D*/ /**/ 0x1E0F, /*U+1E0E*/ /*LATIN CAPITAL LETTER D WITH LINE BELOW*/ 0x1E0F, /*U+1E0F*/ /**/ 0x1E11, /*U+1E10*/ /*LATIN CAPITAL LETTER D WITH CEDILLA*/ 0x1E11, /*U+1E11*/ /**/ 0x1E13, /*U+1E12*/ /*LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW*/ 0x1E13, /*U+1E13*/ /**/ 0x1E15, /*U+1E14*/ /*LATIN CAPITAL LETTER E WITH MACRON AND GRAVE*/ 0x1E15, /*U+1E15*/ /**/ 0x1E17, /*U+1E16*/ /*LATIN CAPITAL LETTER E WITH MACRON AND ACUTE*/ 0x1E17, /*U+1E17*/ /**/ 0x1E19, /*U+1E18*/ /*LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW*/ 0x1E19, /*U+1E19*/ /**/ 0x1E1B, /*U+1E1A*/ /*LATIN CAPITAL LETTER E WITH TILDE BELOW*/ 0x1E1B, /*U+1E1B*/ /**/ 0x1E1D, /*U+1E1C*/ /*LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE*/ 0x1E1D, /*U+1E1D*/ /**/ 0x1E1F, /*U+1E1E*/ /*LATIN CAPITAL LETTER F WITH DOT ABOVE*/ 0x1E1F, /*U+1E1F*/ /**/ 0x1E21, /*U+1E20*/ /*LATIN CAPITAL LETTER G WITH MACRON*/ 0x1E21, /*U+1E21*/ /**/ 0x1E23, /*U+1E22*/ /*LATIN CAPITAL LETTER H WITH DOT ABOVE*/ 0x1E23, /*U+1E23*/ /**/ 0x1E25, /*U+1E24*/ /*LATIN CAPITAL LETTER H WITH DOT BELOW*/ 0x1E25, /*U+1E25*/ /**/ 0x1E27, /*U+1E26*/ /*LATIN CAPITAL LETTER H WITH DIAERESIS*/ 0x1E27, /*U+1E27*/ /**/ 0x1E29, /*U+1E28*/ /*LATIN CAPITAL LETTER H WITH CEDILLA*/ 0x1E29, /*U+1E29*/ /**/ 0x1E2B, /*U+1E2A*/ /*LATIN CAPITAL LETTER H WITH BREVE BELOW*/ 0x1E2B, /*U+1E2B*/ /**/ 0x1E2D, /*U+1E2C*/ /*LATIN CAPITAL LETTER I WITH TILDE BELOW*/ 0x1E2D, /*U+1E2D*/ /**/ 0x1E2F, /*U+1E2E*/ /*LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE*/ 0x1E2F, /*U+1E2F*/ /**/ 0x1E31, /*U+1E30*/ /*LATIN CAPITAL LETTER K WITH ACUTE*/ 0x1E31, /*U+1E31*/ /**/ 0x1E33, /*U+1E32*/ /*LATIN CAPITAL LETTER K WITH DOT BELOW*/ 0x1E33, /*U+1E33*/ /**/ 0x1E35, /*U+1E34*/ /*LATIN CAPITAL LETTER K WITH LINE BELOW*/ 0x1E35, /*U+1E35*/ /**/ 0x1E37, /*U+1E36*/ /*LATIN CAPITAL LETTER L WITH DOT BELOW*/ 0x1E37, /*U+1E37*/ /**/ 0x1E39, /*U+1E38*/ /*LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON*/ 0x1E39, /*U+1E39*/ /**/ 0x1E3B, /*U+1E3A*/ /*LATIN CAPITAL LETTER L WITH LINE BELOW*/ 0x1E3B, /*U+1E3B*/ /**/ 0x1E3D, /*U+1E3C*/ /*LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW*/ 0x1E3D, /*U+1E3D*/ /**/ 0x1E3F, /*U+1E3E*/ /*LATIN CAPITAL LETTER M WITH ACUTE*/ 0x1E3F, /*U+1E3F*/ /**/ 0x1E41, /*U+1E40*/ /*LATIN CAPITAL LETTER M WITH DOT ABOVE*/ 0x1E41, /*U+1E41*/ /**/ 0x1E43, /*U+1E42*/ /*LATIN CAPITAL LETTER M WITH DOT BELOW*/ 0x1E43, /*U+1E43*/ /**/ 0x1E45, /*U+1E44*/ /*LATIN CAPITAL LETTER N WITH DOT ABOVE*/ 0x1E45, /*U+1E45*/ /**/ 0x1E47, /*U+1E46*/ /*LATIN CAPITAL LETTER N WITH DOT BELOW*/ 0x1E47, /*U+1E47*/ /**/ 0x1E49, /*U+1E48*/ /*LATIN CAPITAL LETTER N WITH LINE BELOW*/ 0x1E49, /*U+1E49*/ /**/ 0x1E4B, /*U+1E4A*/ /*LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW*/ 0x1E4B, /*U+1E4B*/ /**/ 0x1E4D, /*U+1E4C*/ /*LATIN CAPITAL LETTER O WITH TILDE AND ACUTE*/ 0x1E4D, /*U+1E4D*/ /**/ 0x1E4F, /*U+1E4E*/ /*LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS*/ 0x1E4F, /*U+1E4F*/ /**/ 0x1E51, /*U+1E50*/ /*LATIN CAPITAL LETTER O WITH MACRON AND GRAVE*/ 0x1E51, /*U+1E51*/ /**/ 0x1E53, /*U+1E52*/ /*LATIN CAPITAL LETTER O WITH MACRON AND ACUTE*/ 0x1E53, /*U+1E53*/ /**/ 0x1E55, /*U+1E54*/ /*LATIN CAPITAL LETTER P WITH ACUTE*/ 0x1E55, /*U+1E55*/ /**/ 0x1E57, /*U+1E56*/ /*LATIN CAPITAL LETTER P WITH DOT ABOVE*/ 0x1E57, /*U+1E57*/ /**/ 0x1E59, /*U+1E58*/ /*LATIN CAPITAL LETTER R WITH DOT ABOVE*/ 0x1E59, /*U+1E59*/ /**/ 0x1E5B, /*U+1E5A*/ /*LATIN CAPITAL LETTER R WITH DOT BELOW*/ 0x1E5B, /*U+1E5B*/ /**/ 0x1E5D, /*U+1E5C*/ /*LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON*/ 0x1E5D, /*U+1E5D*/ /**/ 0x1E5F, /*U+1E5E*/ /*LATIN CAPITAL LETTER R WITH LINE BELOW*/ 0x1E5F, /*U+1E5F*/ /**/ 0x1E61, /*U+1E60*/ /*LATIN CAPITAL LETTER S WITH DOT ABOVE*/ 0x1E61, /*U+1E61*/ /**/ 0x1E63, /*U+1E62*/ /*LATIN CAPITAL LETTER S WITH DOT BELOW*/ 0x1E63, /*U+1E63*/ /**/ 0x1E65, /*U+1E64*/ /*LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE*/ 0x1E65, /*U+1E65*/ /**/ 0x1E67, /*U+1E66*/ /*LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE*/ 0x1E67, /*U+1E67*/ /**/ 0x1E69, /*U+1E68*/ /*LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE*/ 0x1E69, /*U+1E69*/ /**/ 0x1E6B, /*U+1E6A*/ /*LATIN CAPITAL LETTER T WITH DOT ABOVE*/ 0x1E6B, /*U+1E6B*/ /**/ 0x1E6D, /*U+1E6C*/ /*LATIN CAPITAL LETTER T WITH DOT BELOW*/ 0x1E6D, /*U+1E6D*/ /**/ 0x1E6F, /*U+1E6E*/ /*LATIN CAPITAL LETTER T WITH LINE BELOW*/ 0x1E6F, /*U+1E6F*/ /**/ 0x1E71, /*U+1E70*/ /*LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW*/ 0x1E71, /*U+1E71*/ /**/ 0x1E73, /*U+1E72*/ /*LATIN CAPITAL LETTER U WITH DIAERESIS BELOW*/ 0x1E73, /*U+1E73*/ /**/ 0x1E75, /*U+1E74*/ /*LATIN CAPITAL LETTER U WITH TILDE BELOW*/ 0x1E75, /*U+1E75*/ /**/ 0x1E77, /*U+1E76*/ /*LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW*/ 0x1E77, /*U+1E77*/ /**/ 0x1E79, /*U+1E78*/ /*LATIN CAPITAL LETTER U WITH TILDE AND ACUTE*/ 0x1E79, /*U+1E79*/ /**/ 0x1E7B, /*U+1E7A*/ /*LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS*/ 0x1E7B, /*U+1E7B*/ /**/ 0x1E7D, /*U+1E7C*/ /*LATIN CAPITAL LETTER V WITH TILDE*/ 0x1E7D, /*U+1E7D*/ /**/ 0x1E7F, /*U+1E7E*/ /*LATIN CAPITAL LETTER V WITH DOT BELOW*/ 0x1E7F, /*U+1E7F*/ /**/ 0x1E81, /*U+1E80*/ /*LATIN CAPITAL LETTER W WITH GRAVE*/ 0x1E81, /*U+1E81*/ /**/ 0x1E83, /*U+1E82*/ /*LATIN CAPITAL LETTER W WITH ACUTE*/ 0x1E83, /*U+1E83*/ /**/ 0x1E85, /*U+1E84*/ /*LATIN CAPITAL LETTER W WITH DIAERESIS*/ 0x1E85, /*U+1E85*/ /**/ 0x1E87, /*U+1E86*/ /*LATIN CAPITAL LETTER W WITH DOT ABOVE*/ 0x1E87, /*U+1E87*/ /**/ 0x1E89, /*U+1E88*/ /*LATIN CAPITAL LETTER W WITH DOT BELOW*/ 0x1E89, /*U+1E89*/ /**/ 0x1E8B, /*U+1E8A*/ /*LATIN CAPITAL LETTER X WITH DOT ABOVE*/ 0x1E8B, /*U+1E8B*/ /**/ 0x1E8D, /*U+1E8C*/ /*LATIN CAPITAL LETTER X WITH DIAERESIS*/ 0x1E8D, /*U+1E8D*/ /**/ 0x1E8F, /*U+1E8E*/ /*LATIN CAPITAL LETTER Y WITH DOT ABOVE*/ 0x1E8F, /*U+1E8F*/ /**/ 0x1E91, /*U+1E90*/ /*LATIN CAPITAL LETTER Z WITH CIRCUMFLEX*/ 0x1E91, /*U+1E91*/ /**/ 0x1E93, /*U+1E92*/ /*LATIN CAPITAL LETTER Z WITH DOT BELOW*/ 0x1E93, /*U+1E93*/ /**/ 0x1E95, /*U+1E94*/ /*LATIN CAPITAL LETTER Z WITH LINE BELOW*/ 0x1E95, /*U+1E95*/ /**/ 0x1E96, /*U+1E96*/ /**/ 0x1E97, /*U+1E97*/ /**/ 0x1E98, /*U+1E98*/ /**/ 0x1E99, /*U+1E99*/ /**/ 0x1E9A, /*U+1E9A*/ /**/ 0x1E9B, /*U+1E9B*/ /**/ 0x1E9C, /*U+1E9C*/ /**/ 0x1E9D, /*U+1E9D*/ /**/ 0x00DF, /*U+1E9E*/ /*LATIN CAPITAL LETTER SHARP S*/ 0x1E9F, /*U+1E9F*/ /**/ 0x1EA1, /*U+1EA0*/ /*LATIN CAPITAL LETTER A WITH DOT BELOW*/ 0x1EA1, /*U+1EA1*/ /**/ 0x1EA3, /*U+1EA2*/ /*LATIN CAPITAL LETTER A WITH HOOK ABOVE*/ 0x1EA3, /*U+1EA3*/ /**/ 0x1EA5, /*U+1EA4*/ /*LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE*/ 0x1EA5, /*U+1EA5*/ /**/ 0x1EA7, /*U+1EA6*/ /*LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE*/ 0x1EA7, /*U+1EA7*/ /**/ 0x1EA9, /*U+1EA8*/ /*LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE*/ 0x1EA9, /*U+1EA9*/ /**/ 0x1EAB, /*U+1EAA*/ /*LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE*/ 0x1EAB, /*U+1EAB*/ /**/ 0x1EAD, /*U+1EAC*/ /*LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW*/ 0x1EAD, /*U+1EAD*/ /**/ 0x1EAF, /*U+1EAE*/ /*LATIN CAPITAL LETTER A WITH BREVE AND ACUTE*/ 0x1EAF, /*U+1EAF*/ /**/ 0x1EB1, /*U+1EB0*/ /*LATIN CAPITAL LETTER A WITH BREVE AND GRAVE*/ 0x1EB1, /*U+1EB1*/ /**/ 0x1EB3, /*U+1EB2*/ /*LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE*/ 0x1EB3, /*U+1EB3*/ /**/ 0x1EB5, /*U+1EB4*/ /*LATIN CAPITAL LETTER A WITH BREVE AND TILDE*/ 0x1EB5, /*U+1EB5*/ /**/ 0x1EB7, /*U+1EB6*/ /*LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW*/ 0x1EB7, /*U+1EB7*/ /**/ 0x1EB9, /*U+1EB8*/ /*LATIN CAPITAL LETTER E WITH DOT BELOW*/ 0x1EB9, /*U+1EB9*/ /**/ 0x1EBB, /*U+1EBA*/ /*LATIN CAPITAL LETTER E WITH HOOK ABOVE*/ 0x1EBB, /*U+1EBB*/ /**/ 0x1EBD, /*U+1EBC*/ /*LATIN CAPITAL LETTER E WITH TILDE*/ 0x1EBD, /*U+1EBD*/ /**/ 0x1EBF, /*U+1EBE*/ /*LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE*/ 0x1EBF, /*U+1EBF*/ /**/ 0x1EC1, /*U+1EC0*/ /*LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE*/ 0x1EC1, /*U+1EC1*/ /**/ 0x1EC3, /*U+1EC2*/ /*LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE*/ 0x1EC3, /*U+1EC3*/ /**/ 0x1EC5, /*U+1EC4*/ /*LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE*/ 0x1EC5, /*U+1EC5*/ /**/ 0x1EC7, /*U+1EC6*/ /*LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW*/ 0x1EC7, /*U+1EC7*/ /**/ 0x1EC9, /*U+1EC8*/ /*LATIN CAPITAL LETTER I WITH HOOK ABOVE*/ 0x1EC9, /*U+1EC9*/ /**/ 0x1ECB, /*U+1ECA*/ /*LATIN CAPITAL LETTER I WITH DOT BELOW*/ 0x1ECB, /*U+1ECB*/ /**/ 0x1ECD, /*U+1ECC*/ /*LATIN CAPITAL LETTER O WITH DOT BELOW*/ 0x1ECD, /*U+1ECD*/ /**/ 0x1ECF, /*U+1ECE*/ /*LATIN CAPITAL LETTER O WITH HOOK ABOVE*/ 0x1ECF, /*U+1ECF*/ /**/ 0x1ED1, /*U+1ED0*/ /*LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE*/ 0x1ED1, /*U+1ED1*/ /**/ 0x1ED3, /*U+1ED2*/ /*LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE*/ 0x1ED3, /*U+1ED3*/ /**/ 0x1ED5, /*U+1ED4*/ /*LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE*/ 0x1ED5, /*U+1ED5*/ /**/ 0x1ED7, /*U+1ED6*/ /*LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE*/ 0x1ED7, /*U+1ED7*/ /**/ 0x1ED9, /*U+1ED8*/ /*LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW*/ 0x1ED9, /*U+1ED9*/ /**/ 0x1EDB, /*U+1EDA*/ /*LATIN CAPITAL LETTER O WITH HORN AND ACUTE*/ 0x1EDB, /*U+1EDB*/ /**/ 0x1EDD, /*U+1EDC*/ /*LATIN CAPITAL LETTER O WITH HORN AND GRAVE*/ 0x1EDD, /*U+1EDD*/ /**/ 0x1EDF, /*U+1EDE*/ /*LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE*/ 0x1EDF, /*U+1EDF*/ /**/ 0x1EE1, /*U+1EE0*/ /*LATIN CAPITAL LETTER O WITH HORN AND TILDE*/ 0x1EE1, /*U+1EE1*/ /**/ 0x1EE3, /*U+1EE2*/ /*LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW*/ 0x1EE3, /*U+1EE3*/ /**/ 0x1EE5, /*U+1EE4*/ /*LATIN CAPITAL LETTER U WITH DOT BELOW*/ 0x1EE5, /*U+1EE5*/ /**/ 0x1EE7, /*U+1EE6*/ /*LATIN CAPITAL LETTER U WITH HOOK ABOVE*/ 0x1EE7, /*U+1EE7*/ /**/ 0x1EE9, /*U+1EE8*/ /*LATIN CAPITAL LETTER U WITH HORN AND ACUTE*/ 0x1EE9, /*U+1EE9*/ /**/ 0x1EEB, /*U+1EEA*/ /*LATIN CAPITAL LETTER U WITH HORN AND GRAVE*/ 0x1EEB, /*U+1EEB*/ /**/ 0x1EED, /*U+1EEC*/ /*LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE*/ 0x1EED, /*U+1EED*/ /**/ 0x1EEF, /*U+1EEE*/ /*LATIN CAPITAL LETTER U WITH HORN AND TILDE*/ 0x1EEF, /*U+1EEF*/ /**/ 0x1EF1, /*U+1EF0*/ /*LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW*/ 0x1EF1, /*U+1EF1*/ /**/ 0x1EF3, /*U+1EF2*/ /*LATIN CAPITAL LETTER Y WITH GRAVE*/ 0x1EF3, /*U+1EF3*/ /**/ 0x1EF5, /*U+1EF4*/ /*LATIN CAPITAL LETTER Y WITH DOT BELOW*/ 0x1EF5, /*U+1EF5*/ /**/ 0x1EF7, /*U+1EF6*/ /*LATIN CAPITAL LETTER Y WITH HOOK ABOVE*/ 0x1EF7, /*U+1EF7*/ /**/ 0x1EF9, /*U+1EF8*/ /*LATIN CAPITAL LETTER Y WITH TILDE*/ 0x1EF9, /*U+1EF9*/ /**/ 0x1EFB, /*U+1EFA*/ /*LATIN CAPITAL LETTER MIDDLE-WELSH LL*/ 0x1EFB, /*U+1EFB*/ /**/ 0x1EFD, /*U+1EFC*/ /*LATIN CAPITAL LETTER MIDDLE-WELSH V*/ 0x1EFD, /*U+1EFD*/ /**/ 0x1EFF, /*U+1EFE*/ /*LATIN CAPITAL LETTER Y WITH LOOP*/ 0x1EFF, /*U+1EFF*/ /**/ 0x1F00, /*U+1F00*/ /**/ 0x1F01, /*U+1F01*/ /**/ 0x1F02, /*U+1F02*/ /**/ 0x1F03, /*U+1F03*/ /**/ 0x1F04, /*U+1F04*/ /**/ 0x1F05, /*U+1F05*/ /**/ 0x1F06, /*U+1F06*/ /**/ 0x1F07, /*U+1F07*/ /**/ 0x1F00, /*U+1F08*/ /*GREEK CAPITAL LETTER ALPHA WITH PSILI*/ 0x1F01, /*U+1F09*/ /*GREEK CAPITAL LETTER ALPHA WITH DASIA*/ 0x1F02, /*U+1F0A*/ /*GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA*/ 0x1F03, /*U+1F0B*/ /*GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA*/ 0x1F04, /*U+1F0C*/ /*GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA*/ 0x1F05, /*U+1F0D*/ /*GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA*/ 0x1F06, /*U+1F0E*/ /*GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI*/ 0x1F07, /*U+1F0F*/ /*GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI*/ 0x1F10, /*U+1F10*/ /**/ 0x1F11, /*U+1F11*/ /**/ 0x1F12, /*U+1F12*/ /**/ 0x1F13, /*U+1F13*/ /**/ 0x1F14, /*U+1F14*/ /**/ 0x1F15, /*U+1F15*/ /**/ 0x1F16, /*U+1F16*/ /**/ 0x1F17, /*U+1F17*/ /**/ 0x1F10, /*U+1F18*/ /*GREEK CAPITAL LETTER EPSILON WITH PSILI*/ 0x1F11, /*U+1F19*/ /*GREEK CAPITAL LETTER EPSILON WITH DASIA*/ 0x1F12, /*U+1F1A*/ /*GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA*/ 0x1F13, /*U+1F1B*/ /*GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA*/ 0x1F14, /*U+1F1C*/ /*GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA*/ 0x1F15, /*U+1F1D*/ /*GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA*/ 0x1F1E, /*U+1F1E*/ /**/ 0x1F1F, /*U+1F1F*/ /**/ 0x1F20, /*U+1F20*/ /**/ 0x1F21, /*U+1F21*/ /**/ 0x1F22, /*U+1F22*/ /**/ 0x1F23, /*U+1F23*/ /**/ 0x1F24, /*U+1F24*/ /**/ 0x1F25, /*U+1F25*/ /**/ 0x1F26, /*U+1F26*/ /**/ 0x1F27, /*U+1F27*/ /**/ 0x1F20, /*U+1F28*/ /*GREEK CAPITAL LETTER ETA WITH PSILI*/ 0x1F21, /*U+1F29*/ /*GREEK CAPITAL LETTER ETA WITH DASIA*/ 0x1F22, /*U+1F2A*/ /*GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA*/ 0x1F23, /*U+1F2B*/ /*GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA*/ 0x1F24, /*U+1F2C*/ /*GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA*/ 0x1F25, /*U+1F2D*/ /*GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA*/ 0x1F26, /*U+1F2E*/ /*GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI*/ 0x1F27, /*U+1F2F*/ /*GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI*/ 0x1F30, /*U+1F30*/ /**/ 0x1F31, /*U+1F31*/ /**/ 0x1F32, /*U+1F32*/ /**/ 0x1F33, /*U+1F33*/ /**/ 0x1F34, /*U+1F34*/ /**/ 0x1F35, /*U+1F35*/ /**/ 0x1F36, /*U+1F36*/ /**/ 0x1F37, /*U+1F37*/ /**/ 0x1F30, /*U+1F38*/ /*GREEK CAPITAL LETTER IOTA WITH PSILI*/ 0x1F31, /*U+1F39*/ /*GREEK CAPITAL LETTER IOTA WITH DASIA*/ 0x1F32, /*U+1F3A*/ /*GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA*/ 0x1F33, /*U+1F3B*/ /*GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA*/ 0x1F34, /*U+1F3C*/ /*GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA*/ 0x1F35, /*U+1F3D*/ /*GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA*/ 0x1F36, /*U+1F3E*/ /*GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI*/ 0x1F37, /*U+1F3F*/ /*GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI*/ 0x1F40, /*U+1F40*/ /**/ 0x1F41, /*U+1F41*/ /**/ 0x1F42, /*U+1F42*/ /**/ 0x1F43, /*U+1F43*/ /**/ 0x1F44, /*U+1F44*/ /**/ 0x1F45, /*U+1F45*/ /**/ 0x1F46, /*U+1F46*/ /**/ 0x1F47, /*U+1F47*/ /**/ 0x1F40, /*U+1F48*/ /*GREEK CAPITAL LETTER OMICRON WITH PSILI*/ 0x1F41, /*U+1F49*/ /*GREEK CAPITAL LETTER OMICRON WITH DASIA*/ 0x1F42, /*U+1F4A*/ /*GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA*/ 0x1F43, /*U+1F4B*/ /*GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA*/ 0x1F44, /*U+1F4C*/ /*GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA*/ 0x1F45, /*U+1F4D*/ /*GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA*/ 0x1F4E, /*U+1F4E*/ /**/ 0x1F4F, /*U+1F4F*/ /**/ 0x1F50, /*U+1F50*/ /**/ 0x1F51, /*U+1F51*/ /**/ 0x1F52, /*U+1F52*/ /**/ 0x1F53, /*U+1F53*/ /**/ 0x1F54, /*U+1F54*/ /**/ 0x1F55, /*U+1F55*/ /**/ 0x1F56, /*U+1F56*/ /**/ 0x1F57, /*U+1F57*/ /**/ 0x1F58, /*U+1F58*/ /**/ 0x1F51, /*U+1F59*/ /*GREEK CAPITAL LETTER UPSILON WITH DASIA*/ 0x1F5A, /*U+1F5A*/ /**/ 0x1F53, /*U+1F5B*/ /*GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA*/ 0x1F5C, /*U+1F5C*/ /**/ 0x1F55, /*U+1F5D*/ /*GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA*/ 0x1F5E, /*U+1F5E*/ /**/ 0x1F57, /*U+1F5F*/ /*GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI*/ 0x1F60, /*U+1F60*/ /**/ 0x1F61, /*U+1F61*/ /**/ 0x1F62, /*U+1F62*/ /**/ 0x1F63, /*U+1F63*/ /**/ 0x1F64, /*U+1F64*/ /**/ 0x1F65, /*U+1F65*/ /**/ 0x1F66, /*U+1F66*/ /**/ 0x1F67, /*U+1F67*/ /**/ 0x1F60, /*U+1F68*/ /*GREEK CAPITAL LETTER OMEGA WITH PSILI*/ 0x1F61, /*U+1F69*/ /*GREEK CAPITAL LETTER OMEGA WITH DASIA*/ 0x1F62, /*U+1F6A*/ /*GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA*/ 0x1F63, /*U+1F6B*/ /*GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA*/ 0x1F64, /*U+1F6C*/ /*GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA*/ 0x1F65, /*U+1F6D*/ /*GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA*/ 0x1F66, /*U+1F6E*/ /*GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI*/ 0x1F67, /*U+1F6F*/ /*GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI*/ 0x1F70, /*U+1F70*/ /**/ 0x1F71, /*U+1F71*/ /**/ 0x1F72, /*U+1F72*/ /**/ 0x1F73, /*U+1F73*/ /**/ 0x1F74, /*U+1F74*/ /**/ 0x1F75, /*U+1F75*/ /**/ 0x1F76, /*U+1F76*/ /**/ 0x1F77, /*U+1F77*/ /**/ 0x1F78, /*U+1F78*/ /**/ 0x1F79, /*U+1F79*/ /**/ 0x1F7A, /*U+1F7A*/ /**/ 0x1F7B, /*U+1F7B*/ /**/ 0x1F7C, /*U+1F7C*/ /**/ 0x1F7D, /*U+1F7D*/ /**/ 0x1F7E, /*U+1F7E*/ /**/ 0x1F7F, /*U+1F7F*/ /**/ 0x1F80, /*U+1F80*/ /**/ 0x1F81, /*U+1F81*/ /**/ 0x1F82, /*U+1F82*/ /**/ 0x1F83, /*U+1F83*/ /**/ 0x1F84, /*U+1F84*/ /**/ 0x1F85, /*U+1F85*/ /**/ 0x1F86, /*U+1F86*/ /**/ 0x1F87, /*U+1F87*/ /**/ 0x1F80, /*U+1F88*/ /*GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI*/ 0x1F81, /*U+1F89*/ /*GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI*/ 0x1F82, /*U+1F8A*/ /*GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI*/ 0x1F83, /*U+1F8B*/ /*GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI*/ 0x1F84, /*U+1F8C*/ /*GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI*/ 0x1F85, /*U+1F8D*/ /*GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI*/ 0x1F86, /*U+1F8E*/ /*GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI*/ 0x1F87, /*U+1F8F*/ /*GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI*/ 0x1F90, /*U+1F90*/ /**/ 0x1F91, /*U+1F91*/ /**/ 0x1F92, /*U+1F92*/ /**/ 0x1F93, /*U+1F93*/ /**/ 0x1F94, /*U+1F94*/ /**/ 0x1F95, /*U+1F95*/ /**/ 0x1F96, /*U+1F96*/ /**/ 0x1F97, /*U+1F97*/ /**/ 0x1F90, /*U+1F98*/ /*GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI*/ 0x1F91, /*U+1F99*/ /*GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI*/ 0x1F92, /*U+1F9A*/ /*GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI*/ 0x1F93, /*U+1F9B*/ /*GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI*/ 0x1F94, /*U+1F9C*/ /*GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI*/ 0x1F95, /*U+1F9D*/ /*GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI*/ 0x1F96, /*U+1F9E*/ /*GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI*/ 0x1F97, /*U+1F9F*/ /*GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI*/ 0x1FA0, /*U+1FA0*/ /**/ 0x1FA1, /*U+1FA1*/ /**/ 0x1FA2, /*U+1FA2*/ /**/ 0x1FA3, /*U+1FA3*/ /**/ 0x1FA4, /*U+1FA4*/ /**/ 0x1FA5, /*U+1FA5*/ /**/ 0x1FA6, /*U+1FA6*/ /**/ 0x1FA7, /*U+1FA7*/ /**/ 0x1FA0, /*U+1FA8*/ /*GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI*/ 0x1FA1, /*U+1FA9*/ /*GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI*/ 0x1FA2, /*U+1FAA*/ /*GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI*/ 0x1FA3, /*U+1FAB*/ /*GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI*/ 0x1FA4, /*U+1FAC*/ /*GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI*/ 0x1FA5, /*U+1FAD*/ /*GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI*/ 0x1FA6, /*U+1FAE*/ /*GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI*/ 0x1FA7, /*U+1FAF*/ /*GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI*/ 0x1FB0, /*U+1FB0*/ /**/ 0x1FB1, /*U+1FB1*/ /**/ 0x1FB2, /*U+1FB2*/ /**/ 0x1FB3, /*U+1FB3*/ /**/ 0x1FB4, /*U+1FB4*/ /**/ 0x1FB5, /*U+1FB5*/ /**/ 0x1FB6, /*U+1FB6*/ /**/ 0x1FB7, /*U+1FB7*/ /**/ 0x1FB0, /*U+1FB8*/ /*GREEK CAPITAL LETTER ALPHA WITH VRACHY*/ 0x1FB1, /*U+1FB9*/ /*GREEK CAPITAL LETTER ALPHA WITH MACRON*/ 0x1F70, /*U+1FBA*/ /*GREEK CAPITAL LETTER ALPHA WITH VARIA*/ 0x1F71, /*U+1FBB*/ /*GREEK CAPITAL LETTER ALPHA WITH OXIA*/ 0x1FB3, /*U+1FBC*/ /*GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI*/ 0x1FBD, /*U+1FBD*/ /**/ 0x1FBE, /*U+1FBE*/ /**/ 0x1FBF, /*U+1FBF*/ /**/ 0x1FC0, /*U+1FC0*/ /**/ 0x1FC1, /*U+1FC1*/ /**/ 0x1FC2, /*U+1FC2*/ /**/ 0x1FC3, /*U+1FC3*/ /**/ 0x1FC4, /*U+1FC4*/ /**/ 0x1FC5, /*U+1FC5*/ /**/ 0x1FC6, /*U+1FC6*/ /**/ 0x1FC7, /*U+1FC7*/ /**/ 0x1F72, /*U+1FC8*/ /*GREEK CAPITAL LETTER EPSILON WITH VARIA*/ 0x1F73, /*U+1FC9*/ /*GREEK CAPITAL LETTER EPSILON WITH OXIA*/ 0x1F74, /*U+1FCA*/ /*GREEK CAPITAL LETTER ETA WITH VARIA*/ 0x1F75, /*U+1FCB*/ /*GREEK CAPITAL LETTER ETA WITH OXIA*/ 0x1FC3, /*U+1FCC*/ /*GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI*/ 0x1FCD, /*U+1FCD*/ /**/ 0x1FCE, /*U+1FCE*/ /**/ 0x1FCF, /*U+1FCF*/ /**/ 0x1FD0, /*U+1FD0*/ /**/ 0x1FD1, /*U+1FD1*/ /**/ 0x1FD2, /*U+1FD2*/ /**/ 0x1FD3, /*U+1FD3*/ /**/ 0x1FD4, /*U+1FD4*/ /**/ 0x1FD5, /*U+1FD5*/ /**/ 0x1FD6, /*U+1FD6*/ /**/ 0x1FD7, /*U+1FD7*/ /**/ 0x1FD0, /*U+1FD8*/ /*GREEK CAPITAL LETTER IOTA WITH VRACHY*/ 0x1FD1, /*U+1FD9*/ /*GREEK CAPITAL LETTER IOTA WITH MACRON*/ 0x1F76, /*U+1FDA*/ /*GREEK CAPITAL LETTER IOTA WITH VARIA*/ 0x1F77, /*U+1FDB*/ /*GREEK CAPITAL LETTER IOTA WITH OXIA*/ 0x1FDC, /*U+1FDC*/ /**/ 0x1FDD, /*U+1FDD*/ /**/ 0x1FDE, /*U+1FDE*/ /**/ 0x1FDF, /*U+1FDF*/ /**/ 0x1FE0, /*U+1FE0*/ /**/ 0x1FE1, /*U+1FE1*/ /**/ 0x1FE2, /*U+1FE2*/ /**/ 0x1FE3, /*U+1FE3*/ /**/ 0x1FE4, /*U+1FE4*/ /**/ 0x1FE5, /*U+1FE5*/ /**/ 0x1FE6, /*U+1FE6*/ /**/ 0x1FE7, /*U+1FE7*/ /**/ 0x1FE0, /*U+1FE8*/ /*GREEK CAPITAL LETTER UPSILON WITH VRACHY*/ 0x1FE1, /*U+1FE9*/ /*GREEK CAPITAL LETTER UPSILON WITH MACRON*/ 0x1F7A, /*U+1FEA*/ /*GREEK CAPITAL LETTER UPSILON WITH VARIA*/ 0x1F7B, /*U+1FEB*/ /*GREEK CAPITAL LETTER UPSILON WITH OXIA*/ 0x1FE5, /*U+1FEC*/ /*GREEK CAPITAL LETTER RHO WITH DASIA*/ 0x1FED, /*U+1FED*/ /**/ 0x1FEE, /*U+1FEE*/ /**/ 0x1FEF, /*U+1FEF*/ /**/ 0x1FF0, /*U+1FF0*/ /**/ 0x1FF1, /*U+1FF1*/ /**/ 0x1FF2, /*U+1FF2*/ /**/ 0x1FF3, /*U+1FF3*/ /**/ 0x1FF4, /*U+1FF4*/ /**/ 0x1FF5, /*U+1FF5*/ /**/ 0x1FF6, /*U+1FF6*/ /**/ 0x1FF7, /*U+1FF7*/ /**/ 0x1F78, /*U+1FF8*/ /*GREEK CAPITAL LETTER OMICRON WITH VARIA*/ 0x1F79, /*U+1FF9*/ /*GREEK CAPITAL LETTER OMICRON WITH OXIA*/ 0x1F7C, /*U+1FFA*/ /*GREEK CAPITAL LETTER OMEGA WITH VARIA*/ 0x1F7D, /*U+1FFB*/ /*GREEK CAPITAL LETTER OMEGA WITH OXIA*/ 0x1FF3, /*U+1FFC*/ /*GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI*/ 0x1FFD, /*U+1FFD*/ /**/ 0x1FFE, /*U+1FFE*/ /**/ 0x1FFF, /*U+1FFF*/ /**/ }; static const u_int16_t lower_table_6[192] = { 0x2100, /*U+2100*/ /**/ 0x2101, /*U+2101*/ /**/ 0x2102, /*U+2102*/ /**/ 0x2103, /*U+2103*/ /**/ 0x2104, /*U+2104*/ /**/ 0x2105, /*U+2105*/ /**/ 0x2106, /*U+2106*/ /**/ 0x2107, /*U+2107*/ /**/ 0x2108, /*U+2108*/ /**/ 0x2109, /*U+2109*/ /**/ 0x210A, /*U+210A*/ /**/ 0x210B, /*U+210B*/ /**/ 0x210C, /*U+210C*/ /**/ 0x210D, /*U+210D*/ /**/ 0x210E, /*U+210E*/ /**/ 0x210F, /*U+210F*/ /**/ 0x2110, /*U+2110*/ /**/ 0x2111, /*U+2111*/ /**/ 0x2112, /*U+2112*/ /**/ 0x2113, /*U+2113*/ /**/ 0x2114, /*U+2114*/ /**/ 0x2115, /*U+2115*/ /**/ 0x2116, /*U+2116*/ /**/ 0x2117, /*U+2117*/ /**/ 0x2118, /*U+2118*/ /**/ 0x2119, /*U+2119*/ /**/ 0x211A, /*U+211A*/ /**/ 0x211B, /*U+211B*/ /**/ 0x211C, /*U+211C*/ /**/ 0x211D, /*U+211D*/ /**/ 0x211E, /*U+211E*/ /**/ 0x211F, /*U+211F*/ /**/ 0x2120, /*U+2120*/ /**/ 0x2121, /*U+2121*/ /**/ 0x2122, /*U+2122*/ /**/ 0x2123, /*U+2123*/ /**/ 0x2124, /*U+2124*/ /**/ 0x2125, /*U+2125*/ /**/ 0x03C9, /*U+2126*/ /*OHM SIGN*/ 0x2127, /*U+2127*/ /**/ 0x2128, /*U+2128*/ /**/ 0x2129, /*U+2129*/ /**/ 0x006B, /*U+212A*/ /*KELVIN SIGN*/ 0x00E5, /*U+212B*/ /*ANGSTROM SIGN*/ 0x212C, /*U+212C*/ /**/ 0x212D, /*U+212D*/ /**/ 0x212E, /*U+212E*/ /**/ 0x212F, /*U+212F*/ /**/ 0x2130, /*U+2130*/ /**/ 0x2131, /*U+2131*/ /**/ 0x214E, /*U+2132*/ /*TURNED CAPITAL F*/ 0x2133, /*U+2133*/ /**/ 0x2134, /*U+2134*/ /**/ 0x2135, /*U+2135*/ /**/ 0x2136, /*U+2136*/ /**/ 0x2137, /*U+2137*/ /**/ 0x2138, /*U+2138*/ /**/ 0x2139, /*U+2139*/ /**/ 0x213A, /*U+213A*/ /**/ 0x213B, /*U+213B*/ /**/ 0x213C, /*U+213C*/ /**/ 0x213D, /*U+213D*/ /**/ 0x213E, /*U+213E*/ /**/ 0x213F, /*U+213F*/ /**/ 0x2140, /*U+2140*/ /**/ 0x2141, /*U+2141*/ /**/ 0x2142, /*U+2142*/ /**/ 0x2143, /*U+2143*/ /**/ 0x2144, /*U+2144*/ /**/ 0x2145, /*U+2145*/ /**/ 0x2146, /*U+2146*/ /**/ 0x2147, /*U+2147*/ /**/ 0x2148, /*U+2148*/ /**/ 0x2149, /*U+2149*/ /**/ 0x214A, /*U+214A*/ /**/ 0x214B, /*U+214B*/ /**/ 0x214C, /*U+214C*/ /**/ 0x214D, /*U+214D*/ /**/ 0x214E, /*U+214E*/ /**/ 0x214F, /*U+214F*/ /**/ 0x2150, /*U+2150*/ /**/ 0x2151, /*U+2151*/ /**/ 0x2152, /*U+2152*/ /**/ 0x2153, /*U+2153*/ /**/ 0x2154, /*U+2154*/ /**/ 0x2155, /*U+2155*/ /**/ 0x2156, /*U+2156*/ /**/ 0x2157, /*U+2157*/ /**/ 0x2158, /*U+2158*/ /**/ 0x2159, /*U+2159*/ /**/ 0x215A, /*U+215A*/ /**/ 0x215B, /*U+215B*/ /**/ 0x215C, /*U+215C*/ /**/ 0x215D, /*U+215D*/ /**/ 0x215E, /*U+215E*/ /**/ 0x215F, /*U+215F*/ /**/ 0x2170, /*U+2160*/ /*ROMAN NUMERAL ONE*/ 0x2171, /*U+2161*/ /*ROMAN NUMERAL TWO*/ 0x2172, /*U+2162*/ /*ROMAN NUMERAL THREE*/ 0x2173, /*U+2163*/ /*ROMAN NUMERAL FOUR*/ 0x2174, /*U+2164*/ /*ROMAN NUMERAL FIVE*/ 0x2175, /*U+2165*/ /*ROMAN NUMERAL SIX*/ 0x2176, /*U+2166*/ /*ROMAN NUMERAL SEVEN*/ 0x2177, /*U+2167*/ /*ROMAN NUMERAL EIGHT*/ 0x2178, /*U+2168*/ /*ROMAN NUMERAL NINE*/ 0x2179, /*U+2169*/ /*ROMAN NUMERAL TEN*/ 0x217A, /*U+216A*/ /*ROMAN NUMERAL ELEVEN*/ 0x217B, /*U+216B*/ /*ROMAN NUMERAL TWELVE*/ 0x217C, /*U+216C*/ /*ROMAN NUMERAL FIFTY*/ 0x217D, /*U+216D*/ /*ROMAN NUMERAL ONE HUNDRED*/ 0x217E, /*U+216E*/ /*ROMAN NUMERAL FIVE HUNDRED*/ 0x217F, /*U+216F*/ /*ROMAN NUMERAL ONE THOUSAND*/ 0x2170, /*U+2170*/ /**/ 0x2171, /*U+2171*/ /**/ 0x2172, /*U+2172*/ /**/ 0x2173, /*U+2173*/ /**/ 0x2174, /*U+2174*/ /**/ 0x2175, /*U+2175*/ /**/ 0x2176, /*U+2176*/ /**/ 0x2177, /*U+2177*/ /**/ 0x2178, /*U+2178*/ /**/ 0x2179, /*U+2179*/ /**/ 0x217A, /*U+217A*/ /**/ 0x217B, /*U+217B*/ /**/ 0x217C, /*U+217C*/ /**/ 0x217D, /*U+217D*/ /**/ 0x217E, /*U+217E*/ /**/ 0x217F, /*U+217F*/ /**/ 0x2180, /*U+2180*/ /**/ 0x2181, /*U+2181*/ /**/ 0x2182, /*U+2182*/ /**/ 0x2184, /*U+2183*/ /*ROMAN NUMERAL REVERSED ONE HUNDRED*/ 0x2184, /*U+2184*/ /**/ 0x2185, /*U+2185*/ /**/ 0x2186, /*U+2186*/ /**/ 0x2187, /*U+2187*/ /**/ 0x2188, /*U+2188*/ /**/ 0x2189, /*U+2189*/ /**/ 0x218A, /*U+218A*/ /**/ 0x218B, /*U+218B*/ /**/ 0x218C, /*U+218C*/ /**/ 0x218D, /*U+218D*/ /**/ 0x218E, /*U+218E*/ /**/ 0x218F, /*U+218F*/ /**/ 0x2190, /*U+2190*/ /**/ 0x2191, /*U+2191*/ /**/ 0x2192, /*U+2192*/ /**/ 0x2193, /*U+2193*/ /**/ 0x2194, /*U+2194*/ /**/ 0x2195, /*U+2195*/ /**/ 0x2196, /*U+2196*/ /**/ 0x2197, /*U+2197*/ /**/ 0x2198, /*U+2198*/ /**/ 0x2199, /*U+2199*/ /**/ 0x219A, /*U+219A*/ /**/ 0x219B, /*U+219B*/ /**/ 0x219C, /*U+219C*/ /**/ 0x219D, /*U+219D*/ /**/ 0x219E, /*U+219E*/ /**/ 0x219F, /*U+219F*/ /**/ 0x21A0, /*U+21A0*/ /**/ 0x21A1, /*U+21A1*/ /**/ 0x21A2, /*U+21A2*/ /**/ 0x21A3, /*U+21A3*/ /**/ 0x21A4, /*U+21A4*/ /**/ 0x21A5, /*U+21A5*/ /**/ 0x21A6, /*U+21A6*/ /**/ 0x21A7, /*U+21A7*/ /**/ 0x21A8, /*U+21A8*/ /**/ 0x21A9, /*U+21A9*/ /**/ 0x21AA, /*U+21AA*/ /**/ 0x21AB, /*U+21AB*/ /**/ 0x21AC, /*U+21AC*/ /**/ 0x21AD, /*U+21AD*/ /**/ 0x21AE, /*U+21AE*/ /**/ 0x21AF, /*U+21AF*/ /**/ 0x21B0, /*U+21B0*/ /**/ 0x21B1, /*U+21B1*/ /**/ 0x21B2, /*U+21B2*/ /**/ 0x21B3, /*U+21B3*/ /**/ 0x21B4, /*U+21B4*/ /**/ 0x21B5, /*U+21B5*/ /**/ 0x21B6, /*U+21B6*/ /**/ 0x21B7, /*U+21B7*/ /**/ 0x21B8, /*U+21B8*/ /**/ 0x21B9, /*U+21B9*/ /**/ 0x21BA, /*U+21BA*/ /**/ 0x21BB, /*U+21BB*/ /**/ 0x21BC, /*U+21BC*/ /**/ 0x21BD, /*U+21BD*/ /**/ 0x21BE, /*U+21BE*/ /**/ 0x21BF, /*U+21BF*/ /**/ }; static const u_int16_t lower_table_7[128] = { 0x2480, /*U+2480*/ /**/ 0x2481, /*U+2481*/ /**/ 0x2482, /*U+2482*/ /**/ 0x2483, /*U+2483*/ /**/ 0x2484, /*U+2484*/ /**/ 0x2485, /*U+2485*/ /**/ 0x2486, /*U+2486*/ /**/ 0x2487, /*U+2487*/ /**/ 0x2488, /*U+2488*/ /**/ 0x2489, /*U+2489*/ /**/ 0x248A, /*U+248A*/ /**/ 0x248B, /*U+248B*/ /**/ 0x248C, /*U+248C*/ /**/ 0x248D, /*U+248D*/ /**/ 0x248E, /*U+248E*/ /**/ 0x248F, /*U+248F*/ /**/ 0x2490, /*U+2490*/ /**/ 0x2491, /*U+2491*/ /**/ 0x2492, /*U+2492*/ /**/ 0x2493, /*U+2493*/ /**/ 0x2494, /*U+2494*/ /**/ 0x2495, /*U+2495*/ /**/ 0x2496, /*U+2496*/ /**/ 0x2497, /*U+2497*/ /**/ 0x2498, /*U+2498*/ /**/ 0x2499, /*U+2499*/ /**/ 0x249A, /*U+249A*/ /**/ 0x249B, /*U+249B*/ /**/ 0x249C, /*U+249C*/ /**/ 0x249D, /*U+249D*/ /**/ 0x249E, /*U+249E*/ /**/ 0x249F, /*U+249F*/ /**/ 0x24A0, /*U+24A0*/ /**/ 0x24A1, /*U+24A1*/ /**/ 0x24A2, /*U+24A2*/ /**/ 0x24A3, /*U+24A3*/ /**/ 0x24A4, /*U+24A4*/ /**/ 0x24A5, /*U+24A5*/ /**/ 0x24A6, /*U+24A6*/ /**/ 0x24A7, /*U+24A7*/ /**/ 0x24A8, /*U+24A8*/ /**/ 0x24A9, /*U+24A9*/ /**/ 0x24AA, /*U+24AA*/ /**/ 0x24AB, /*U+24AB*/ /**/ 0x24AC, /*U+24AC*/ /**/ 0x24AD, /*U+24AD*/ /**/ 0x24AE, /*U+24AE*/ /**/ 0x24AF, /*U+24AF*/ /**/ 0x24B0, /*U+24B0*/ /**/ 0x24B1, /*U+24B1*/ /**/ 0x24B2, /*U+24B2*/ /**/ 0x24B3, /*U+24B3*/ /**/ 0x24B4, /*U+24B4*/ /**/ 0x24B5, /*U+24B5*/ /**/ 0x24D0, /*U+24B6*/ /*CIRCLED LATIN CAPITAL LETTER A*/ 0x24D1, /*U+24B7*/ /*CIRCLED LATIN CAPITAL LETTER B*/ 0x24D2, /*U+24B8*/ /*CIRCLED LATIN CAPITAL LETTER C*/ 0x24D3, /*U+24B9*/ /*CIRCLED LATIN CAPITAL LETTER D*/ 0x24D4, /*U+24BA*/ /*CIRCLED LATIN CAPITAL LETTER E*/ 0x24D5, /*U+24BB*/ /*CIRCLED LATIN CAPITAL LETTER F*/ 0x24D6, /*U+24BC*/ /*CIRCLED LATIN CAPITAL LETTER G*/ 0x24D7, /*U+24BD*/ /*CIRCLED LATIN CAPITAL LETTER H*/ 0x24D8, /*U+24BE*/ /*CIRCLED LATIN CAPITAL LETTER I*/ 0x24D9, /*U+24BF*/ /*CIRCLED LATIN CAPITAL LETTER J*/ 0x24DA, /*U+24C0*/ /*CIRCLED LATIN CAPITAL LETTER K*/ 0x24DB, /*U+24C1*/ /*CIRCLED LATIN CAPITAL LETTER L*/ 0x24DC, /*U+24C2*/ /*CIRCLED LATIN CAPITAL LETTER M*/ 0x24DD, /*U+24C3*/ /*CIRCLED LATIN CAPITAL LETTER N*/ 0x24DE, /*U+24C4*/ /*CIRCLED LATIN CAPITAL LETTER O*/ 0x24DF, /*U+24C5*/ /*CIRCLED LATIN CAPITAL LETTER P*/ 0x24E0, /*U+24C6*/ /*CIRCLED LATIN CAPITAL LETTER Q*/ 0x24E1, /*U+24C7*/ /*CIRCLED LATIN CAPITAL LETTER R*/ 0x24E2, /*U+24C8*/ /*CIRCLED LATIN CAPITAL LETTER S*/ 0x24E3, /*U+24C9*/ /*CIRCLED LATIN CAPITAL LETTER T*/ 0x24E4, /*U+24CA*/ /*CIRCLED LATIN CAPITAL LETTER U*/ 0x24E5, /*U+24CB*/ /*CIRCLED LATIN CAPITAL LETTER V*/ 0x24E6, /*U+24CC*/ /*CIRCLED LATIN CAPITAL LETTER W*/ 0x24E7, /*U+24CD*/ /*CIRCLED LATIN CAPITAL LETTER X*/ 0x24E8, /*U+24CE*/ /*CIRCLED LATIN CAPITAL LETTER Y*/ 0x24E9, /*U+24CF*/ /*CIRCLED LATIN CAPITAL LETTER Z*/ 0x24D0, /*U+24D0*/ /**/ 0x24D1, /*U+24D1*/ /**/ 0x24D2, /*U+24D2*/ /**/ 0x24D3, /*U+24D3*/ /**/ 0x24D4, /*U+24D4*/ /**/ 0x24D5, /*U+24D5*/ /**/ 0x24D6, /*U+24D6*/ /**/ 0x24D7, /*U+24D7*/ /**/ 0x24D8, /*U+24D8*/ /**/ 0x24D9, /*U+24D9*/ /**/ 0x24DA, /*U+24DA*/ /**/ 0x24DB, /*U+24DB*/ /**/ 0x24DC, /*U+24DC*/ /**/ 0x24DD, /*U+24DD*/ /**/ 0x24DE, /*U+24DE*/ /**/ 0x24DF, /*U+24DF*/ /**/ 0x24E0, /*U+24E0*/ /**/ 0x24E1, /*U+24E1*/ /**/ 0x24E2, /*U+24E2*/ /**/ 0x24E3, /*U+24E3*/ /**/ 0x24E4, /*U+24E4*/ /**/ 0x24E5, /*U+24E5*/ /**/ 0x24E6, /*U+24E6*/ /**/ 0x24E7, /*U+24E7*/ /**/ 0x24E8, /*U+24E8*/ /**/ 0x24E9, /*U+24E9*/ /**/ 0x24EA, /*U+24EA*/ /**/ 0x24EB, /*U+24EB*/ /**/ 0x24EC, /*U+24EC*/ /**/ 0x24ED, /*U+24ED*/ /**/ 0x24EE, /*U+24EE*/ /**/ 0x24EF, /*U+24EF*/ /**/ 0x24F0, /*U+24F0*/ /**/ 0x24F1, /*U+24F1*/ /**/ 0x24F2, /*U+24F2*/ /**/ 0x24F3, /*U+24F3*/ /**/ 0x24F4, /*U+24F4*/ /**/ 0x24F5, /*U+24F5*/ /**/ 0x24F6, /*U+24F6*/ /**/ 0x24F7, /*U+24F7*/ /**/ 0x24F8, /*U+24F8*/ /**/ 0x24F9, /*U+24F9*/ /**/ 0x24FA, /*U+24FA*/ /**/ 0x24FB, /*U+24FB*/ /**/ 0x24FC, /*U+24FC*/ /**/ 0x24FD, /*U+24FD*/ /**/ 0x24FE, /*U+24FE*/ /**/ 0x24FF, /*U+24FF*/ /**/ }; static const u_int16_t lower_table_8[256] = { 0x2C30, /*U+2C00*/ /*GLAGOLITIC CAPITAL LETTER AZU*/ 0x2C31, /*U+2C01*/ /*GLAGOLITIC CAPITAL LETTER BUKY*/ 0x2C32, /*U+2C02*/ /*GLAGOLITIC CAPITAL LETTER VEDE*/ 0x2C33, /*U+2C03*/ /*GLAGOLITIC CAPITAL LETTER GLAGOLI*/ 0x2C34, /*U+2C04*/ /*GLAGOLITIC CAPITAL LETTER DOBRO*/ 0x2C35, /*U+2C05*/ /*GLAGOLITIC CAPITAL LETTER YESTU*/ 0x2C36, /*U+2C06*/ /*GLAGOLITIC CAPITAL LETTER ZHIVETE*/ 0x2C37, /*U+2C07*/ /*GLAGOLITIC CAPITAL LETTER DZELO*/ 0x2C38, /*U+2C08*/ /*GLAGOLITIC CAPITAL LETTER ZEMLJA*/ 0x2C39, /*U+2C09*/ /*GLAGOLITIC CAPITAL LETTER IZHE*/ 0x2C3A, /*U+2C0A*/ /*GLAGOLITIC CAPITAL LETTER INITIAL IZHE*/ 0x2C3B, /*U+2C0B*/ /*GLAGOLITIC CAPITAL LETTER I*/ 0x2C3C, /*U+2C0C*/ /*GLAGOLITIC CAPITAL LETTER DJERVI*/ 0x2C3D, /*U+2C0D*/ /*GLAGOLITIC CAPITAL LETTER KAKO*/ 0x2C3E, /*U+2C0E*/ /*GLAGOLITIC CAPITAL LETTER LJUDIJE*/ 0x2C3F, /*U+2C0F*/ /*GLAGOLITIC CAPITAL LETTER MYSLITE*/ 0x2C40, /*U+2C10*/ /*GLAGOLITIC CAPITAL LETTER NASHI*/ 0x2C41, /*U+2C11*/ /*GLAGOLITIC CAPITAL LETTER ONU*/ 0x2C42, /*U+2C12*/ /*GLAGOLITIC CAPITAL LETTER POKOJI*/ 0x2C43, /*U+2C13*/ /*GLAGOLITIC CAPITAL LETTER RITSI*/ 0x2C44, /*U+2C14*/ /*GLAGOLITIC CAPITAL LETTER SLOVO*/ 0x2C45, /*U+2C15*/ /*GLAGOLITIC CAPITAL LETTER TVRIDO*/ 0x2C46, /*U+2C16*/ /*GLAGOLITIC CAPITAL LETTER UKU*/ 0x2C47, /*U+2C17*/ /*GLAGOLITIC CAPITAL LETTER FRITU*/ 0x2C48, /*U+2C18*/ /*GLAGOLITIC CAPITAL LETTER HERU*/ 0x2C49, /*U+2C19*/ /*GLAGOLITIC CAPITAL LETTER OTU*/ 0x2C4A, /*U+2C1A*/ /*GLAGOLITIC CAPITAL LETTER PE*/ 0x2C4B, /*U+2C1B*/ /*GLAGOLITIC CAPITAL LETTER SHTA*/ 0x2C4C, /*U+2C1C*/ /*GLAGOLITIC CAPITAL LETTER TSI*/ 0x2C4D, /*U+2C1D*/ /*GLAGOLITIC CAPITAL LETTER CHRIVI*/ 0x2C4E, /*U+2C1E*/ /*GLAGOLITIC CAPITAL LETTER SHA*/ 0x2C4F, /*U+2C1F*/ /*GLAGOLITIC CAPITAL LETTER YERU*/ 0x2C50, /*U+2C20*/ /*GLAGOLITIC CAPITAL LETTER YERI*/ 0x2C51, /*U+2C21*/ /*GLAGOLITIC CAPITAL LETTER YATI*/ 0x2C52, /*U+2C22*/ /*GLAGOLITIC CAPITAL LETTER SPIDERY HA*/ 0x2C53, /*U+2C23*/ /*GLAGOLITIC CAPITAL LETTER YU*/ 0x2C54, /*U+2C24*/ /*GLAGOLITIC CAPITAL LETTER SMALL YUS*/ 0x2C55, /*U+2C25*/ /*GLAGOLITIC CAPITAL LETTER SMALL YUS WITH TAIL*/ 0x2C56, /*U+2C26*/ /*GLAGOLITIC CAPITAL LETTER YO*/ 0x2C57, /*U+2C27*/ /*GLAGOLITIC CAPITAL LETTER IOTATED SMALL YUS*/ 0x2C58, /*U+2C28*/ /*GLAGOLITIC CAPITAL LETTER BIG YUS*/ 0x2C59, /*U+2C29*/ /*GLAGOLITIC CAPITAL LETTER IOTATED BIG YUS*/ 0x2C5A, /*U+2C2A*/ /*GLAGOLITIC CAPITAL LETTER FITA*/ 0x2C5B, /*U+2C2B*/ /*GLAGOLITIC CAPITAL LETTER IZHITSA*/ 0x2C5C, /*U+2C2C*/ /*GLAGOLITIC CAPITAL LETTER SHTAPIC*/ 0x2C5D, /*U+2C2D*/ /*GLAGOLITIC CAPITAL LETTER TROKUTASTI A*/ 0x2C5E, /*U+2C2E*/ /*GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE*/ 0x2C2F, /*U+2C2F*/ /**/ 0x2C30, /*U+2C30*/ /**/ 0x2C31, /*U+2C31*/ /**/ 0x2C32, /*U+2C32*/ /**/ 0x2C33, /*U+2C33*/ /**/ 0x2C34, /*U+2C34*/ /**/ 0x2C35, /*U+2C35*/ /**/ 0x2C36, /*U+2C36*/ /**/ 0x2C37, /*U+2C37*/ /**/ 0x2C38, /*U+2C38*/ /**/ 0x2C39, /*U+2C39*/ /**/ 0x2C3A, /*U+2C3A*/ /**/ 0x2C3B, /*U+2C3B*/ /**/ 0x2C3C, /*U+2C3C*/ /**/ 0x2C3D, /*U+2C3D*/ /**/ 0x2C3E, /*U+2C3E*/ /**/ 0x2C3F, /*U+2C3F*/ /**/ 0x2C40, /*U+2C40*/ /**/ 0x2C41, /*U+2C41*/ /**/ 0x2C42, /*U+2C42*/ /**/ 0x2C43, /*U+2C43*/ /**/ 0x2C44, /*U+2C44*/ /**/ 0x2C45, /*U+2C45*/ /**/ 0x2C46, /*U+2C46*/ /**/ 0x2C47, /*U+2C47*/ /**/ 0x2C48, /*U+2C48*/ /**/ 0x2C49, /*U+2C49*/ /**/ 0x2C4A, /*U+2C4A*/ /**/ 0x2C4B, /*U+2C4B*/ /**/ 0x2C4C, /*U+2C4C*/ /**/ 0x2C4D, /*U+2C4D*/ /**/ 0x2C4E, /*U+2C4E*/ /**/ 0x2C4F, /*U+2C4F*/ /**/ 0x2C50, /*U+2C50*/ /**/ 0x2C51, /*U+2C51*/ /**/ 0x2C52, /*U+2C52*/ /**/ 0x2C53, /*U+2C53*/ /**/ 0x2C54, /*U+2C54*/ /**/ 0x2C55, /*U+2C55*/ /**/ 0x2C56, /*U+2C56*/ /**/ 0x2C57, /*U+2C57*/ /**/ 0x2C58, /*U+2C58*/ /**/ 0x2C59, /*U+2C59*/ /**/ 0x2C5A, /*U+2C5A*/ /**/ 0x2C5B, /*U+2C5B*/ /**/ 0x2C5C, /*U+2C5C*/ /**/ 0x2C5D, /*U+2C5D*/ /**/ 0x2C5E, /*U+2C5E*/ /**/ 0x2C5F, /*U+2C5F*/ /**/ 0x2C61, /*U+2C60*/ /*LATIN CAPITAL LETTER L WITH DOUBLE BAR*/ 0x2C61, /*U+2C61*/ /**/ 0x026B, /*U+2C62*/ /*LATIN CAPITAL LETTER L WITH MIDDLE TILDE*/ 0x1D7D, /*U+2C63*/ /*LATIN CAPITAL LETTER P WITH STROKE*/ 0x027D, /*U+2C64*/ /*LATIN CAPITAL LETTER R WITH TAIL*/ 0x2C65, /*U+2C65*/ /**/ 0x2C66, /*U+2C66*/ /**/ 0x2C68, /*U+2C67*/ /*LATIN CAPITAL LETTER H WITH DESCENDER*/ 0x2C68, /*U+2C68*/ /**/ 0x2C6A, /*U+2C69*/ /*LATIN CAPITAL LETTER K WITH DESCENDER*/ 0x2C6A, /*U+2C6A*/ /**/ 0x2C6C, /*U+2C6B*/ /*LATIN CAPITAL LETTER Z WITH DESCENDER*/ 0x2C6C, /*U+2C6C*/ /**/ 0x0251, /*U+2C6D*/ /*LATIN CAPITAL LETTER ALPHA*/ 0x0271, /*U+2C6E*/ /*LATIN CAPITAL LETTER M WITH HOOK*/ 0x0250, /*U+2C6F*/ /*LATIN CAPITAL LETTER TURNED A*/ 0x0252, /*U+2C70*/ /*LATIN CAPITAL LETTER TURNED ALPHA*/ 0x2C71, /*U+2C71*/ /**/ 0x2C73, /*U+2C72*/ /*LATIN CAPITAL LETTER W WITH HOOK*/ 0x2C73, /*U+2C73*/ /**/ 0x2C74, /*U+2C74*/ /**/ 0x2C76, /*U+2C75*/ /*LATIN CAPITAL LETTER HALF H*/ 0x2C76, /*U+2C76*/ /**/ 0x2C77, /*U+2C77*/ /**/ 0x2C78, /*U+2C78*/ /**/ 0x2C79, /*U+2C79*/ /**/ 0x2C7A, /*U+2C7A*/ /**/ 0x2C7B, /*U+2C7B*/ /**/ 0x2C7C, /*U+2C7C*/ /**/ 0x2C7D, /*U+2C7D*/ /**/ 0x023F, /*U+2C7E*/ /*LATIN CAPITAL LETTER S WITH SWASH TAIL*/ 0x0240, /*U+2C7F*/ /*LATIN CAPITAL LETTER Z WITH SWASH TAIL*/ 0x2C81, /*U+2C80*/ /*COPTIC CAPITAL LETTER ALFA*/ 0x2C81, /*U+2C81*/ /**/ 0x2C83, /*U+2C82*/ /*COPTIC CAPITAL LETTER VIDA*/ 0x2C83, /*U+2C83*/ /**/ 0x2C85, /*U+2C84*/ /*COPTIC CAPITAL LETTER GAMMA*/ 0x2C85, /*U+2C85*/ /**/ 0x2C87, /*U+2C86*/ /*COPTIC CAPITAL LETTER DALDA*/ 0x2C87, /*U+2C87*/ /**/ 0x2C89, /*U+2C88*/ /*COPTIC CAPITAL LETTER EIE*/ 0x2C89, /*U+2C89*/ /**/ 0x2C8B, /*U+2C8A*/ /*COPTIC CAPITAL LETTER SOU*/ 0x2C8B, /*U+2C8B*/ /**/ 0x2C8D, /*U+2C8C*/ /*COPTIC CAPITAL LETTER ZATA*/ 0x2C8D, /*U+2C8D*/ /**/ 0x2C8F, /*U+2C8E*/ /*COPTIC CAPITAL LETTER HATE*/ 0x2C8F, /*U+2C8F*/ /**/ 0x2C91, /*U+2C90*/ /*COPTIC CAPITAL LETTER THETHE*/ 0x2C91, /*U+2C91*/ /**/ 0x2C93, /*U+2C92*/ /*COPTIC CAPITAL LETTER IAUDA*/ 0x2C93, /*U+2C93*/ /**/ 0x2C95, /*U+2C94*/ /*COPTIC CAPITAL LETTER KAPA*/ 0x2C95, /*U+2C95*/ /**/ 0x2C97, /*U+2C96*/ /*COPTIC CAPITAL LETTER LAULA*/ 0x2C97, /*U+2C97*/ /**/ 0x2C99, /*U+2C98*/ /*COPTIC CAPITAL LETTER MI*/ 0x2C99, /*U+2C99*/ /**/ 0x2C9B, /*U+2C9A*/ /*COPTIC CAPITAL LETTER NI*/ 0x2C9B, /*U+2C9B*/ /**/ 0x2C9D, /*U+2C9C*/ /*COPTIC CAPITAL LETTER KSI*/ 0x2C9D, /*U+2C9D*/ /**/ 0x2C9F, /*U+2C9E*/ /*COPTIC CAPITAL LETTER O*/ 0x2C9F, /*U+2C9F*/ /**/ 0x2CA1, /*U+2CA0*/ /*COPTIC CAPITAL LETTER PI*/ 0x2CA1, /*U+2CA1*/ /**/ 0x2CA3, /*U+2CA2*/ /*COPTIC CAPITAL LETTER RO*/ 0x2CA3, /*U+2CA3*/ /**/ 0x2CA5, /*U+2CA4*/ /*COPTIC CAPITAL LETTER SIMA*/ 0x2CA5, /*U+2CA5*/ /**/ 0x2CA7, /*U+2CA6*/ /*COPTIC CAPITAL LETTER TAU*/ 0x2CA7, /*U+2CA7*/ /**/ 0x2CA9, /*U+2CA8*/ /*COPTIC CAPITAL LETTER UA*/ 0x2CA9, /*U+2CA9*/ /**/ 0x2CAB, /*U+2CAA*/ /*COPTIC CAPITAL LETTER FI*/ 0x2CAB, /*U+2CAB*/ /**/ 0x2CAD, /*U+2CAC*/ /*COPTIC CAPITAL LETTER KHI*/ 0x2CAD, /*U+2CAD*/ /**/ 0x2CAF, /*U+2CAE*/ /*COPTIC CAPITAL LETTER PSI*/ 0x2CAF, /*U+2CAF*/ /**/ 0x2CB1, /*U+2CB0*/ /*COPTIC CAPITAL LETTER OOU*/ 0x2CB1, /*U+2CB1*/ /**/ 0x2CB3, /*U+2CB2*/ /*COPTIC CAPITAL LETTER DIALECT-P ALEF*/ 0x2CB3, /*U+2CB3*/ /**/ 0x2CB5, /*U+2CB4*/ /*COPTIC CAPITAL LETTER OLD COPTIC AIN*/ 0x2CB5, /*U+2CB5*/ /**/ 0x2CB7, /*U+2CB6*/ /*COPTIC CAPITAL LETTER CRYPTOGRAMMIC EIE*/ 0x2CB7, /*U+2CB7*/ /**/ 0x2CB9, /*U+2CB8*/ /*COPTIC CAPITAL LETTER DIALECT-P KAPA*/ 0x2CB9, /*U+2CB9*/ /**/ 0x2CBB, /*U+2CBA*/ /*COPTIC CAPITAL LETTER DIALECT-P NI*/ 0x2CBB, /*U+2CBB*/ /**/ 0x2CBD, /*U+2CBC*/ /*COPTIC CAPITAL LETTER CRYPTOGRAMMIC NI*/ 0x2CBD, /*U+2CBD*/ /**/ 0x2CBF, /*U+2CBE*/ /*COPTIC CAPITAL LETTER OLD COPTIC OOU*/ 0x2CBF, /*U+2CBF*/ /**/ 0x2CC1, /*U+2CC0*/ /*COPTIC CAPITAL LETTER SAMPI*/ 0x2CC1, /*U+2CC1*/ /**/ 0x2CC3, /*U+2CC2*/ /*COPTIC CAPITAL LETTER CROSSED SHEI*/ 0x2CC3, /*U+2CC3*/ /**/ 0x2CC5, /*U+2CC4*/ /*COPTIC CAPITAL LETTER OLD COPTIC SHEI*/ 0x2CC5, /*U+2CC5*/ /**/ 0x2CC7, /*U+2CC6*/ /*COPTIC CAPITAL LETTER OLD COPTIC ESH*/ 0x2CC7, /*U+2CC7*/ /**/ 0x2CC9, /*U+2CC8*/ /*COPTIC CAPITAL LETTER AKHMIMIC KHEI*/ 0x2CC9, /*U+2CC9*/ /**/ 0x2CCB, /*U+2CCA*/ /*COPTIC CAPITAL LETTER DIALECT-P HORI*/ 0x2CCB, /*U+2CCB*/ /**/ 0x2CCD, /*U+2CCC*/ /*COPTIC CAPITAL LETTER OLD COPTIC HORI*/ 0x2CCD, /*U+2CCD*/ /**/ 0x2CCF, /*U+2CCE*/ /*COPTIC CAPITAL LETTER OLD COPTIC HA*/ 0x2CCF, /*U+2CCF*/ /**/ 0x2CD1, /*U+2CD0*/ /*COPTIC CAPITAL LETTER L-SHAPED HA*/ 0x2CD1, /*U+2CD1*/ /**/ 0x2CD3, /*U+2CD2*/ /*COPTIC CAPITAL LETTER OLD COPTIC HEI*/ 0x2CD3, /*U+2CD3*/ /**/ 0x2CD5, /*U+2CD4*/ /*COPTIC CAPITAL LETTER OLD COPTIC HAT*/ 0x2CD5, /*U+2CD5*/ /**/ 0x2CD7, /*U+2CD6*/ /*COPTIC CAPITAL LETTER OLD COPTIC GANGIA*/ 0x2CD7, /*U+2CD7*/ /**/ 0x2CD9, /*U+2CD8*/ /*COPTIC CAPITAL LETTER OLD COPTIC DJA*/ 0x2CD9, /*U+2CD9*/ /**/ 0x2CDB, /*U+2CDA*/ /*COPTIC CAPITAL LETTER OLD COPTIC SHIMA*/ 0x2CDB, /*U+2CDB*/ /**/ 0x2CDD, /*U+2CDC*/ /*COPTIC CAPITAL LETTER OLD NUBIAN SHIMA*/ 0x2CDD, /*U+2CDD*/ /**/ 0x2CDF, /*U+2CDE*/ /*COPTIC CAPITAL LETTER OLD NUBIAN NGI*/ 0x2CDF, /*U+2CDF*/ /**/ 0x2CE1, /*U+2CE0*/ /*COPTIC CAPITAL LETTER OLD NUBIAN NYI*/ 0x2CE1, /*U+2CE1*/ /**/ 0x2CE3, /*U+2CE2*/ /*COPTIC CAPITAL LETTER OLD NUBIAN WAU*/ 0x2CE3, /*U+2CE3*/ /**/ 0x2CE4, /*U+2CE4*/ /**/ 0x2CE5, /*U+2CE5*/ /**/ 0x2CE6, /*U+2CE6*/ /**/ 0x2CE7, /*U+2CE7*/ /**/ 0x2CE8, /*U+2CE8*/ /**/ 0x2CE9, /*U+2CE9*/ /**/ 0x2CEA, /*U+2CEA*/ /**/ 0x2CEC, /*U+2CEB*/ /*COPTIC CAPITAL LETTER CRYPTOGRAMMIC SHEI*/ 0x2CEC, /*U+2CEC*/ /**/ 0x2CEE, /*U+2CED*/ /*COPTIC CAPITAL LETTER CRYPTOGRAMMIC GANGIA*/ 0x2CEE, /*U+2CEE*/ /**/ 0x2CEF, /*U+2CEF*/ /**/ 0x2CF0, /*U+2CF0*/ /**/ 0x2CF1, /*U+2CF1*/ /**/ 0x2CF2, /*U+2CF2*/ /**/ 0x2CF3, /*U+2CF3*/ /**/ 0x2CF4, /*U+2CF4*/ /**/ 0x2CF5, /*U+2CF5*/ /**/ 0x2CF6, /*U+2CF6*/ /**/ 0x2CF7, /*U+2CF7*/ /**/ 0x2CF8, /*U+2CF8*/ /**/ 0x2CF9, /*U+2CF9*/ /**/ 0x2CFA, /*U+2CFA*/ /**/ 0x2CFB, /*U+2CFB*/ /**/ 0x2CFC, /*U+2CFC*/ /**/ 0x2CFD, /*U+2CFD*/ /**/ 0x2CFE, /*U+2CFE*/ /**/ 0x2CFF, /*U+2CFF*/ /**/ }; static const u_int16_t lower_table_9[128] = { 0xA641, /*U+A640*/ /*CYRILLIC CAPITAL LETTER ZEMLYA*/ 0xA641, /*U+A641*/ /**/ 0xA643, /*U+A642*/ /*CYRILLIC CAPITAL LETTER DZELO*/ 0xA643, /*U+A643*/ /**/ 0xA645, /*U+A644*/ /*CYRILLIC CAPITAL LETTER REVERSED DZE*/ 0xA645, /*U+A645*/ /**/ 0xA647, /*U+A646*/ /*CYRILLIC CAPITAL LETTER IOTA*/ 0xA647, /*U+A647*/ /**/ 0xA649, /*U+A648*/ /*CYRILLIC CAPITAL LETTER DJERV*/ 0xA649, /*U+A649*/ /**/ 0xA64B, /*U+A64A*/ /*CYRILLIC CAPITAL LETTER MONOGRAPH UK*/ 0xA64B, /*U+A64B*/ /**/ 0xA64D, /*U+A64C*/ /*CYRILLIC CAPITAL LETTER BROAD OMEGA*/ 0xA64D, /*U+A64D*/ /**/ 0xA64F, /*U+A64E*/ /*CYRILLIC CAPITAL LETTER NEUTRAL YER*/ 0xA64F, /*U+A64F*/ /**/ 0xA651, /*U+A650*/ /*CYRILLIC CAPITAL LETTER YERU WITH BACK YER*/ 0xA651, /*U+A651*/ /**/ 0xA653, /*U+A652*/ /*CYRILLIC CAPITAL LETTER IOTIFIED YAT*/ 0xA653, /*U+A653*/ /**/ 0xA655, /*U+A654*/ /*CYRILLIC CAPITAL LETTER REVERSED YU*/ 0xA655, /*U+A655*/ /**/ 0xA657, /*U+A656*/ /*CYRILLIC CAPITAL LETTER IOTIFIED A*/ 0xA657, /*U+A657*/ /**/ 0xA659, /*U+A658*/ /*CYRILLIC CAPITAL LETTER CLOSED LITTLE YUS*/ 0xA659, /*U+A659*/ /**/ 0xA65B, /*U+A65A*/ /*CYRILLIC CAPITAL LETTER BLENDED YUS*/ 0xA65B, /*U+A65B*/ /**/ 0xA65D, /*U+A65C*/ /*CYRILLIC CAPITAL LETTER IOTIFIED CLOSED LITTLE YUS*/ 0xA65D, /*U+A65D*/ /**/ 0xA65F, /*U+A65E*/ /*CYRILLIC CAPITAL LETTER YN*/ 0xA65F, /*U+A65F*/ /**/ 0xA661, /*U+A660*/ /*CYRILLIC CAPITAL LETTER REVERSED TSE*/ 0xA661, /*U+A661*/ /**/ 0xA663, /*U+A662*/ /*CYRILLIC CAPITAL LETTER SOFT DE*/ 0xA663, /*U+A663*/ /**/ 0xA665, /*U+A664*/ /*CYRILLIC CAPITAL LETTER SOFT EL*/ 0xA665, /*U+A665*/ /**/ 0xA667, /*U+A666*/ /*CYRILLIC CAPITAL LETTER SOFT EM*/ 0xA667, /*U+A667*/ /**/ 0xA669, /*U+A668*/ /*CYRILLIC CAPITAL LETTER MONOCULAR O*/ 0xA669, /*U+A669*/ /**/ 0xA66B, /*U+A66A*/ /*CYRILLIC CAPITAL LETTER BINOCULAR O*/ 0xA66B, /*U+A66B*/ /**/ 0xA66D, /*U+A66C*/ /*CYRILLIC CAPITAL LETTER DOUBLE MONOCULAR O*/ 0xA66D, /*U+A66D*/ /**/ 0xA66E, /*U+A66E*/ /**/ 0xA66F, /*U+A66F*/ /**/ 0xA670, /*U+A670*/ /**/ 0xA671, /*U+A671*/ /**/ 0xA672, /*U+A672*/ /**/ 0xA673, /*U+A673*/ /**/ 0xA674, /*U+A674*/ /**/ 0xA675, /*U+A675*/ /**/ 0xA676, /*U+A676*/ /**/ 0xA677, /*U+A677*/ /**/ 0xA678, /*U+A678*/ /**/ 0xA679, /*U+A679*/ /**/ 0xA67A, /*U+A67A*/ /**/ 0xA67B, /*U+A67B*/ /**/ 0xA67C, /*U+A67C*/ /**/ 0xA67D, /*U+A67D*/ /**/ 0xA67E, /*U+A67E*/ /**/ 0xA67F, /*U+A67F*/ /**/ 0xA681, /*U+A680*/ /*CYRILLIC CAPITAL LETTER DWE*/ 0xA681, /*U+A681*/ /**/ 0xA683, /*U+A682*/ /*CYRILLIC CAPITAL LETTER DZWE*/ 0xA683, /*U+A683*/ /**/ 0xA685, /*U+A684*/ /*CYRILLIC CAPITAL LETTER ZHWE*/ 0xA685, /*U+A685*/ /**/ 0xA687, /*U+A686*/ /*CYRILLIC CAPITAL LETTER CCHE*/ 0xA687, /*U+A687*/ /**/ 0xA689, /*U+A688*/ /*CYRILLIC CAPITAL LETTER DZZE*/ 0xA689, /*U+A689*/ /**/ 0xA68B, /*U+A68A*/ /*CYRILLIC CAPITAL LETTER TE WITH MIDDLE HOOK*/ 0xA68B, /*U+A68B*/ /**/ 0xA68D, /*U+A68C*/ /*CYRILLIC CAPITAL LETTER TWE*/ 0xA68D, /*U+A68D*/ /**/ 0xA68F, /*U+A68E*/ /*CYRILLIC CAPITAL LETTER TSWE*/ 0xA68F, /*U+A68F*/ /**/ 0xA691, /*U+A690*/ /*CYRILLIC CAPITAL LETTER TSSE*/ 0xA691, /*U+A691*/ /**/ 0xA693, /*U+A692*/ /*CYRILLIC CAPITAL LETTER TCHE*/ 0xA693, /*U+A693*/ /**/ 0xA695, /*U+A694*/ /*CYRILLIC CAPITAL LETTER HWE*/ 0xA695, /*U+A695*/ /**/ 0xA697, /*U+A696*/ /*CYRILLIC CAPITAL LETTER SHWE*/ 0xA697, /*U+A697*/ /**/ 0xA698, /*U+A698*/ /**/ 0xA699, /*U+A699*/ /**/ 0xA69A, /*U+A69A*/ /**/ 0xA69B, /*U+A69B*/ /**/ 0xA69C, /*U+A69C*/ /**/ 0xA69D, /*U+A69D*/ /**/ 0xA69E, /*U+A69E*/ /**/ 0xA69F, /*U+A69F*/ /**/ 0xA6A0, /*U+A6A0*/ /**/ 0xA6A1, /*U+A6A1*/ /**/ 0xA6A2, /*U+A6A2*/ /**/ 0xA6A3, /*U+A6A3*/ /**/ 0xA6A4, /*U+A6A4*/ /**/ 0xA6A5, /*U+A6A5*/ /**/ 0xA6A6, /*U+A6A6*/ /**/ 0xA6A7, /*U+A6A7*/ /**/ 0xA6A8, /*U+A6A8*/ /**/ 0xA6A9, /*U+A6A9*/ /**/ 0xA6AA, /*U+A6AA*/ /**/ 0xA6AB, /*U+A6AB*/ /**/ 0xA6AC, /*U+A6AC*/ /**/ 0xA6AD, /*U+A6AD*/ /**/ 0xA6AE, /*U+A6AE*/ /**/ 0xA6AF, /*U+A6AF*/ /**/ 0xA6B0, /*U+A6B0*/ /**/ 0xA6B1, /*U+A6B1*/ /**/ 0xA6B2, /*U+A6B2*/ /**/ 0xA6B3, /*U+A6B3*/ /**/ 0xA6B4, /*U+A6B4*/ /**/ 0xA6B5, /*U+A6B5*/ /**/ 0xA6B6, /*U+A6B6*/ /**/ 0xA6B7, /*U+A6B7*/ /**/ 0xA6B8, /*U+A6B8*/ /**/ 0xA6B9, /*U+A6B9*/ /**/ 0xA6BA, /*U+A6BA*/ /**/ 0xA6BB, /*U+A6BB*/ /**/ 0xA6BC, /*U+A6BC*/ /**/ 0xA6BD, /*U+A6BD*/ /**/ 0xA6BE, /*U+A6BE*/ /**/ 0xA6BF, /*U+A6BF*/ /**/ }; static const u_int16_t lower_table_10[192] = { 0xA700, /*U+A700*/ /**/ 0xA701, /*U+A701*/ /**/ 0xA702, /*U+A702*/ /**/ 0xA703, /*U+A703*/ /**/ 0xA704, /*U+A704*/ /**/ 0xA705, /*U+A705*/ /**/ 0xA706, /*U+A706*/ /**/ 0xA707, /*U+A707*/ /**/ 0xA708, /*U+A708*/ /**/ 0xA709, /*U+A709*/ /**/ 0xA70A, /*U+A70A*/ /**/ 0xA70B, /*U+A70B*/ /**/ 0xA70C, /*U+A70C*/ /**/ 0xA70D, /*U+A70D*/ /**/ 0xA70E, /*U+A70E*/ /**/ 0xA70F, /*U+A70F*/ /**/ 0xA710, /*U+A710*/ /**/ 0xA711, /*U+A711*/ /**/ 0xA712, /*U+A712*/ /**/ 0xA713, /*U+A713*/ /**/ 0xA714, /*U+A714*/ /**/ 0xA715, /*U+A715*/ /**/ 0xA716, /*U+A716*/ /**/ 0xA717, /*U+A717*/ /**/ 0xA718, /*U+A718*/ /**/ 0xA719, /*U+A719*/ /**/ 0xA71A, /*U+A71A*/ /**/ 0xA71B, /*U+A71B*/ /**/ 0xA71C, /*U+A71C*/ /**/ 0xA71D, /*U+A71D*/ /**/ 0xA71E, /*U+A71E*/ /**/ 0xA71F, /*U+A71F*/ /**/ 0xA720, /*U+A720*/ /**/ 0xA721, /*U+A721*/ /**/ 0xA723, /*U+A722*/ /*LATIN CAPITAL LETTER EGYPTOLOGICAL ALEF*/ 0xA723, /*U+A723*/ /**/ 0xA725, /*U+A724*/ /*LATIN CAPITAL LETTER EGYPTOLOGICAL AIN*/ 0xA725, /*U+A725*/ /**/ 0xA727, /*U+A726*/ /*LATIN CAPITAL LETTER HENG*/ 0xA727, /*U+A727*/ /**/ 0xA729, /*U+A728*/ /*LATIN CAPITAL LETTER TZ*/ 0xA729, /*U+A729*/ /**/ 0xA72B, /*U+A72A*/ /*LATIN CAPITAL LETTER TRESILLO*/ 0xA72B, /*U+A72B*/ /**/ 0xA72D, /*U+A72C*/ /*LATIN CAPITAL LETTER CUATRILLO*/ 0xA72D, /*U+A72D*/ /**/ 0xA72F, /*U+A72E*/ /*LATIN CAPITAL LETTER CUATRILLO WITH COMMA*/ 0xA72F, /*U+A72F*/ /**/ 0xA730, /*U+A730*/ /**/ 0xA731, /*U+A731*/ /**/ 0xA733, /*U+A732*/ /*LATIN CAPITAL LETTER AA*/ 0xA733, /*U+A733*/ /**/ 0xA735, /*U+A734*/ /*LATIN CAPITAL LETTER AO*/ 0xA735, /*U+A735*/ /**/ 0xA737, /*U+A736*/ /*LATIN CAPITAL LETTER AU*/ 0xA737, /*U+A737*/ /**/ 0xA739, /*U+A738*/ /*LATIN CAPITAL LETTER AV*/ 0xA739, /*U+A739*/ /**/ 0xA73B, /*U+A73A*/ /*LATIN CAPITAL LETTER AV WITH HORIZONTAL BAR*/ 0xA73B, /*U+A73B*/ /**/ 0xA73D, /*U+A73C*/ /*LATIN CAPITAL LETTER AY*/ 0xA73D, /*U+A73D*/ /**/ 0xA73F, /*U+A73E*/ /*LATIN CAPITAL LETTER REVERSED C WITH DOT*/ 0xA73F, /*U+A73F*/ /**/ 0xA741, /*U+A740*/ /*LATIN CAPITAL LETTER K WITH STROKE*/ 0xA741, /*U+A741*/ /**/ 0xA743, /*U+A742*/ /*LATIN CAPITAL LETTER K WITH DIAGONAL STROKE*/ 0xA743, /*U+A743*/ /**/ 0xA745, /*U+A744*/ /*LATIN CAPITAL LETTER K WITH STROKE AND DIAGONAL STROKE*/ 0xA745, /*U+A745*/ /**/ 0xA747, /*U+A746*/ /*LATIN CAPITAL LETTER BROKEN L*/ 0xA747, /*U+A747*/ /**/ 0xA749, /*U+A748*/ /*LATIN CAPITAL LETTER L WITH HIGH STROKE*/ 0xA749, /*U+A749*/ /**/ 0xA74B, /*U+A74A*/ /*LATIN CAPITAL LETTER O WITH LONG STROKE OVERLAY*/ 0xA74B, /*U+A74B*/ /**/ 0xA74D, /*U+A74C*/ /*LATIN CAPITAL LETTER O WITH LOOP*/ 0xA74D, /*U+A74D*/ /**/ 0xA74F, /*U+A74E*/ /*LATIN CAPITAL LETTER OO*/ 0xA74F, /*U+A74F*/ /**/ 0xA751, /*U+A750*/ /*LATIN CAPITAL LETTER P WITH STROKE THROUGH DESCENDER*/ 0xA751, /*U+A751*/ /**/ 0xA753, /*U+A752*/ /*LATIN CAPITAL LETTER P WITH FLOURISH*/ 0xA753, /*U+A753*/ /**/ 0xA755, /*U+A754*/ /*LATIN CAPITAL LETTER P WITH SQUIRREL TAIL*/ 0xA755, /*U+A755*/ /**/ 0xA757, /*U+A756*/ /*LATIN CAPITAL LETTER Q WITH STROKE THROUGH DESCENDER*/ 0xA757, /*U+A757*/ /**/ 0xA759, /*U+A758*/ /*LATIN CAPITAL LETTER Q WITH DIAGONAL STROKE*/ 0xA759, /*U+A759*/ /**/ 0xA75B, /*U+A75A*/ /*LATIN CAPITAL LETTER R ROTUNDA*/ 0xA75B, /*U+A75B*/ /**/ 0xA75D, /*U+A75C*/ /*LATIN CAPITAL LETTER RUM ROTUNDA*/ 0xA75D, /*U+A75D*/ /**/ 0xA75F, /*U+A75E*/ /*LATIN CAPITAL LETTER V WITH DIAGONAL STROKE*/ 0xA75F, /*U+A75F*/ /**/ 0xA761, /*U+A760*/ /*LATIN CAPITAL LETTER VY*/ 0xA761, /*U+A761*/ /**/ 0xA763, /*U+A762*/ /*LATIN CAPITAL LETTER VISIGOTHIC Z*/ 0xA763, /*U+A763*/ /**/ 0xA765, /*U+A764*/ /*LATIN CAPITAL LETTER THORN WITH STROKE*/ 0xA765, /*U+A765*/ /**/ 0xA767, /*U+A766*/ /*LATIN CAPITAL LETTER THORN WITH STROKE THROUGH DESCENDER*/ 0xA767, /*U+A767*/ /**/ 0xA769, /*U+A768*/ /*LATIN CAPITAL LETTER VEND*/ 0xA769, /*U+A769*/ /**/ 0xA76B, /*U+A76A*/ /*LATIN CAPITAL LETTER ET*/ 0xA76B, /*U+A76B*/ /**/ 0xA76D, /*U+A76C*/ /*LATIN CAPITAL LETTER IS*/ 0xA76D, /*U+A76D*/ /**/ 0xA76F, /*U+A76E*/ /*LATIN CAPITAL LETTER CON*/ 0xA76F, /*U+A76F*/ /**/ 0xA770, /*U+A770*/ /**/ 0xA771, /*U+A771*/ /**/ 0xA772, /*U+A772*/ /**/ 0xA773, /*U+A773*/ /**/ 0xA774, /*U+A774*/ /**/ 0xA775, /*U+A775*/ /**/ 0xA776, /*U+A776*/ /**/ 0xA777, /*U+A777*/ /**/ 0xA778, /*U+A778*/ /**/ 0xA77A, /*U+A779*/ /*LATIN CAPITAL LETTER INSULAR D*/ 0xA77A, /*U+A77A*/ /**/ 0xA77C, /*U+A77B*/ /*LATIN CAPITAL LETTER INSULAR F*/ 0xA77C, /*U+A77C*/ /**/ 0x1D79, /*U+A77D*/ /*LATIN CAPITAL LETTER INSULAR G*/ 0xA77F, /*U+A77E*/ /*LATIN CAPITAL LETTER TURNED INSULAR G*/ 0xA77F, /*U+A77F*/ /**/ 0xA781, /*U+A780*/ /*LATIN CAPITAL LETTER TURNED L*/ 0xA781, /*U+A781*/ /**/ 0xA783, /*U+A782*/ /*LATIN CAPITAL LETTER INSULAR R*/ 0xA783, /*U+A783*/ /**/ 0xA785, /*U+A784*/ /*LATIN CAPITAL LETTER INSULAR S*/ 0xA785, /*U+A785*/ /**/ 0xA787, /*U+A786*/ /*LATIN CAPITAL LETTER INSULAR T*/ 0xA787, /*U+A787*/ /**/ 0xA788, /*U+A788*/ /**/ 0xA789, /*U+A789*/ /**/ 0xA78A, /*U+A78A*/ /**/ 0xA78C, /*U+A78B*/ /*LATIN CAPITAL LETTER SALTILLO*/ 0xA78C, /*U+A78C*/ /**/ 0x0265, /*U+A78D*/ /*LATIN CAPITAL LETTER TURNED H*/ 0xA78E, /*U+A78E*/ /**/ 0xA78F, /*U+A78F*/ /**/ 0xA791, /*U+A790*/ /*LATIN CAPITAL LETTER N WITH DESCENDER*/ 0xA791, /*U+A791*/ /**/ 0xA792, /*U+A792*/ /**/ 0xA793, /*U+A793*/ /**/ 0xA794, /*U+A794*/ /**/ 0xA795, /*U+A795*/ /**/ 0xA796, /*U+A796*/ /**/ 0xA797, /*U+A797*/ /**/ 0xA798, /*U+A798*/ /**/ 0xA799, /*U+A799*/ /**/ 0xA79A, /*U+A79A*/ /**/ 0xA79B, /*U+A79B*/ /**/ 0xA79C, /*U+A79C*/ /**/ 0xA79D, /*U+A79D*/ /**/ 0xA79E, /*U+A79E*/ /**/ 0xA79F, /*U+A79F*/ /**/ 0xA7A1, /*U+A7A0*/ /*LATIN CAPITAL LETTER G WITH OBLIQUE STROKE*/ 0xA7A1, /*U+A7A1*/ /**/ 0xA7A3, /*U+A7A2*/ /*LATIN CAPITAL LETTER K WITH OBLIQUE STROKE*/ 0xA7A3, /*U+A7A3*/ /**/ 0xA7A5, /*U+A7A4*/ /*LATIN CAPITAL LETTER N WITH OBLIQUE STROKE*/ 0xA7A5, /*U+A7A5*/ /**/ 0xA7A7, /*U+A7A6*/ /*LATIN CAPITAL LETTER R WITH OBLIQUE STROKE*/ 0xA7A7, /*U+A7A7*/ /**/ 0xA7A9, /*U+A7A8*/ /*LATIN CAPITAL LETTER S WITH OBLIQUE STROKE*/ 0xA7A9, /*U+A7A9*/ /**/ 0xA7AA, /*U+A7AA*/ /**/ 0xA7AB, /*U+A7AB*/ /**/ 0xA7AC, /*U+A7AC*/ /**/ 0xA7AD, /*U+A7AD*/ /**/ 0xA7AE, /*U+A7AE*/ /**/ 0xA7AF, /*U+A7AF*/ /**/ 0xA7B0, /*U+A7B0*/ /**/ 0xA7B1, /*U+A7B1*/ /**/ 0xA7B2, /*U+A7B2*/ /**/ 0xA7B3, /*U+A7B3*/ /**/ 0xA7B4, /*U+A7B4*/ /**/ 0xA7B5, /*U+A7B5*/ /**/ 0xA7B6, /*U+A7B6*/ /**/ 0xA7B7, /*U+A7B7*/ /**/ 0xA7B8, /*U+A7B8*/ /**/ 0xA7B9, /*U+A7B9*/ /**/ 0xA7BA, /*U+A7BA*/ /**/ 0xA7BB, /*U+A7BB*/ /**/ 0xA7BC, /*U+A7BC*/ /**/ 0xA7BD, /*U+A7BD*/ /**/ 0xA7BE, /*U+A7BE*/ /**/ 0xA7BF, /*U+A7BF*/ /**/ }; static const u_int16_t lower_table_11[64] = { 0xFF00, /*U+FF00*/ /**/ 0xFF01, /*U+FF01*/ /**/ 0xFF02, /*U+FF02*/ /**/ 0xFF03, /*U+FF03*/ /**/ 0xFF04, /*U+FF04*/ /**/ 0xFF05, /*U+FF05*/ /**/ 0xFF06, /*U+FF06*/ /**/ 0xFF07, /*U+FF07*/ /**/ 0xFF08, /*U+FF08*/ /**/ 0xFF09, /*U+FF09*/ /**/ 0xFF0A, /*U+FF0A*/ /**/ 0xFF0B, /*U+FF0B*/ /**/ 0xFF0C, /*U+FF0C*/ /**/ 0xFF0D, /*U+FF0D*/ /**/ 0xFF0E, /*U+FF0E*/ /**/ 0xFF0F, /*U+FF0F*/ /**/ 0xFF10, /*U+FF10*/ /**/ 0xFF11, /*U+FF11*/ /**/ 0xFF12, /*U+FF12*/ /**/ 0xFF13, /*U+FF13*/ /**/ 0xFF14, /*U+FF14*/ /**/ 0xFF15, /*U+FF15*/ /**/ 0xFF16, /*U+FF16*/ /**/ 0xFF17, /*U+FF17*/ /**/ 0xFF18, /*U+FF18*/ /**/ 0xFF19, /*U+FF19*/ /**/ 0xFF1A, /*U+FF1A*/ /**/ 0xFF1B, /*U+FF1B*/ /**/ 0xFF1C, /*U+FF1C*/ /**/ 0xFF1D, /*U+FF1D*/ /**/ 0xFF1E, /*U+FF1E*/ /**/ 0xFF1F, /*U+FF1F*/ /**/ 0xFF20, /*U+FF20*/ /**/ 0xFF41, /*U+FF21*/ /*FULLWIDTH LATIN CAPITAL LETTER A*/ 0xFF42, /*U+FF22*/ /*FULLWIDTH LATIN CAPITAL LETTER B*/ 0xFF43, /*U+FF23*/ /*FULLWIDTH LATIN CAPITAL LETTER C*/ 0xFF44, /*U+FF24*/ /*FULLWIDTH LATIN CAPITAL LETTER D*/ 0xFF45, /*U+FF25*/ /*FULLWIDTH LATIN CAPITAL LETTER E*/ 0xFF46, /*U+FF26*/ /*FULLWIDTH LATIN CAPITAL LETTER F*/ 0xFF47, /*U+FF27*/ /*FULLWIDTH LATIN CAPITAL LETTER G*/ 0xFF48, /*U+FF28*/ /*FULLWIDTH LATIN CAPITAL LETTER H*/ 0xFF49, /*U+FF29*/ /*FULLWIDTH LATIN CAPITAL LETTER I*/ 0xFF4A, /*U+FF2A*/ /*FULLWIDTH LATIN CAPITAL LETTER J*/ 0xFF4B, /*U+FF2B*/ /*FULLWIDTH LATIN CAPITAL LETTER K*/ 0xFF4C, /*U+FF2C*/ /*FULLWIDTH LATIN CAPITAL LETTER L*/ 0xFF4D, /*U+FF2D*/ /*FULLWIDTH LATIN CAPITAL LETTER M*/ 0xFF4E, /*U+FF2E*/ /*FULLWIDTH LATIN CAPITAL LETTER N*/ 0xFF4F, /*U+FF2F*/ /*FULLWIDTH LATIN CAPITAL LETTER O*/ 0xFF50, /*U+FF30*/ /*FULLWIDTH LATIN CAPITAL LETTER P*/ 0xFF51, /*U+FF31*/ /*FULLWIDTH LATIN CAPITAL LETTER Q*/ 0xFF52, /*U+FF32*/ /*FULLWIDTH LATIN CAPITAL LETTER R*/ 0xFF53, /*U+FF33*/ /*FULLWIDTH LATIN CAPITAL LETTER S*/ 0xFF54, /*U+FF34*/ /*FULLWIDTH LATIN CAPITAL LETTER T*/ 0xFF55, /*U+FF35*/ /*FULLWIDTH LATIN CAPITAL LETTER U*/ 0xFF56, /*U+FF36*/ /*FULLWIDTH LATIN CAPITAL LETTER V*/ 0xFF57, /*U+FF37*/ /*FULLWIDTH LATIN CAPITAL LETTER W*/ 0xFF58, /*U+FF38*/ /*FULLWIDTH LATIN CAPITAL LETTER X*/ 0xFF59, /*U+FF39*/ /*FULLWIDTH LATIN CAPITAL LETTER Y*/ 0xFF5A, /*U+FF3A*/ /*FULLWIDTH LATIN CAPITAL LETTER Z*/ 0xFF3B, /*U+FF3B*/ /**/ 0xFF3C, /*U+FF3C*/ /**/ 0xFF3D, /*U+FF3D*/ /**/ 0xFF3E, /*U+FF3E*/ /**/ 0xFF3F, /*U+FF3F*/ /**/ }; static const u_int32_t lower_table_sp_1[64] = { 0xD801DC28, /*0xD801DC00*/ /*U+010428*/ /*U+010400*/ /*DESERET CAPITAL LETTER LONG I*/ 0xD801DC29, /*0xD801DC01*/ /*U+010429*/ /*U+010401*/ /*DESERET CAPITAL LETTER LONG E*/ 0xD801DC2A, /*0xD801DC02*/ /*U+01042A*/ /*U+010402*/ /*DESERET CAPITAL LETTER LONG A*/ 0xD801DC2B, /*0xD801DC03*/ /*U+01042B*/ /*U+010403*/ /*DESERET CAPITAL LETTER LONG AH*/ 0xD801DC2C, /*0xD801DC04*/ /*U+01042C*/ /*U+010404*/ /*DESERET CAPITAL LETTER LONG O*/ 0xD801DC2D, /*0xD801DC05*/ /*U+01042D*/ /*U+010405*/ /*DESERET CAPITAL LETTER LONG OO*/ 0xD801DC2E, /*0xD801DC06*/ /*U+01042E*/ /*U+010406*/ /*DESERET CAPITAL LETTER SHORT I*/ 0xD801DC2F, /*0xD801DC07*/ /*U+01042F*/ /*U+010407*/ /*DESERET CAPITAL LETTER SHORT E*/ 0xD801DC30, /*0xD801DC08*/ /*U+010430*/ /*U+010408*/ /*DESERET CAPITAL LETTER SHORT A*/ 0xD801DC31, /*0xD801DC09*/ /*U+010431*/ /*U+010409*/ /*DESERET CAPITAL LETTER SHORT AH*/ 0xD801DC32, /*0xD801DC0A*/ /*U+010432*/ /*U+01040A*/ /*DESERET CAPITAL LETTER SHORT O*/ 0xD801DC33, /*0xD801DC0B*/ /*U+010433*/ /*U+01040B*/ /*DESERET CAPITAL LETTER SHORT OO*/ 0xD801DC34, /*0xD801DC0C*/ /*U+010434*/ /*U+01040C*/ /*DESERET CAPITAL LETTER AY*/ 0xD801DC35, /*0xD801DC0D*/ /*U+010435*/ /*U+01040D*/ /*DESERET CAPITAL LETTER OW*/ 0xD801DC36, /*0xD801DC0E*/ /*U+010436*/ /*U+01040E*/ /*DESERET CAPITAL LETTER WU*/ 0xD801DC37, /*0xD801DC0F*/ /*U+010437*/ /*U+01040F*/ /*DESERET CAPITAL LETTER YEE*/ 0xD801DC38, /*0xD801DC10*/ /*U+010438*/ /*U+010410*/ /*DESERET CAPITAL LETTER H*/ 0xD801DC39, /*0xD801DC11*/ /*U+010439*/ /*U+010411*/ /*DESERET CAPITAL LETTER PEE*/ 0xD801DC3A, /*0xD801DC12*/ /*U+01043A*/ /*U+010412*/ /*DESERET CAPITAL LETTER BEE*/ 0xD801DC3B, /*0xD801DC13*/ /*U+01043B*/ /*U+010413*/ /*DESERET CAPITAL LETTER TEE*/ 0xD801DC3C, /*0xD801DC14*/ /*U+01043C*/ /*U+010414*/ /*DESERET CAPITAL LETTER DEE*/ 0xD801DC3D, /*0xD801DC15*/ /*U+01043D*/ /*U+010415*/ /*DESERET CAPITAL LETTER CHEE*/ 0xD801DC3E, /*0xD801DC16*/ /*U+01043E*/ /*U+010416*/ /*DESERET CAPITAL LETTER JEE*/ 0xD801DC3F, /*0xD801DC17*/ /*U+01043F*/ /*U+010417*/ /*DESERET CAPITAL LETTER KAY*/ 0xD801DC40, /*0xD801DC18*/ /*U+010440*/ /*U+010418*/ /*DESERET CAPITAL LETTER GAY*/ 0xD801DC41, /*0xD801DC19*/ /*U+010441*/ /*U+010419*/ /*DESERET CAPITAL LETTER EF*/ 0xD801DC42, /*0xD801DC1A*/ /*U+010442*/ /*U+01041A*/ /*DESERET CAPITAL LETTER VEE*/ 0xD801DC43, /*0xD801DC1B*/ /*U+010443*/ /*U+01041B*/ /*DESERET CAPITAL LETTER ETH*/ 0xD801DC44, /*0xD801DC1C*/ /*U+010444*/ /*U+01041C*/ /*DESERET CAPITAL LETTER THEE*/ 0xD801DC45, /*0xD801DC1D*/ /*U+010445*/ /*U+01041D*/ /*DESERET CAPITAL LETTER ES*/ 0xD801DC46, /*0xD801DC1E*/ /*U+010446*/ /*U+01041E*/ /*DESERET CAPITAL LETTER ZEE*/ 0xD801DC47, /*0xD801DC1F*/ /*U+010447*/ /*U+01041F*/ /*DESERET CAPITAL LETTER ESH*/ 0xD801DC48, /*0xD801DC20*/ /*U+010448*/ /*U+010420*/ /*DESERET CAPITAL LETTER ZHEE*/ 0xD801DC49, /*0xD801DC21*/ /*U+010449*/ /*U+010421*/ /*DESERET CAPITAL LETTER ER*/ 0xD801DC4A, /*0xD801DC22*/ /*U+01044A*/ /*U+010422*/ /*DESERET CAPITAL LETTER EL*/ 0xD801DC4B, /*0xD801DC23*/ /*U+01044B*/ /*U+010423*/ /*DESERET CAPITAL LETTER EM*/ 0xD801DC4C, /*0xD801DC24*/ /*U+01044C*/ /*U+010424*/ /*DESERET CAPITAL LETTER EN*/ 0xD801DC4D, /*0xD801DC25*/ /*U+01044D*/ /*U+010425*/ /*DESERET CAPITAL LETTER ENG*/ 0xD801DC4E, /*0xD801DC26*/ /*U+01044E*/ /*U+010426*/ /*DESERET CAPITAL LETTER OI*/ 0xD801DC4F, /*0xD801DC27*/ /*U+01044F*/ /*U+010427*/ /*DESERET CAPITAL LETTER EW*/ 0xD801DC28, /*0xD801DC28*/ /*U+010428*/ /*U+010428*/ /**/ 0xD801DC29, /*0xD801DC29*/ /*U+010429*/ /*U+010429*/ /**/ 0xD801DC2A, /*0xD801DC2A*/ /*U+01042A*/ /*U+01042A*/ /**/ 0xD801DC2B, /*0xD801DC2B*/ /*U+01042B*/ /*U+01042B*/ /**/ 0xD801DC2C, /*0xD801DC2C*/ /*U+01042C*/ /*U+01042C*/ /**/ 0xD801DC2D, /*0xD801DC2D*/ /*U+01042D*/ /*U+01042D*/ /**/ 0xD801DC2E, /*0xD801DC2E*/ /*U+01042E*/ /*U+01042E*/ /**/ 0xD801DC2F, /*0xD801DC2F*/ /*U+01042F*/ /*U+01042F*/ /**/ 0xD801DC30, /*0xD801DC30*/ /*U+010430*/ /*U+010430*/ /**/ 0xD801DC31, /*0xD801DC31*/ /*U+010431*/ /*U+010431*/ /**/ 0xD801DC32, /*0xD801DC32*/ /*U+010432*/ /*U+010432*/ /**/ 0xD801DC33, /*0xD801DC33*/ /*U+010433*/ /*U+010433*/ /**/ 0xD801DC34, /*0xD801DC34*/ /*U+010434*/ /*U+010434*/ /**/ 0xD801DC35, /*0xD801DC35*/ /*U+010435*/ /*U+010435*/ /**/ 0xD801DC36, /*0xD801DC36*/ /*U+010436*/ /*U+010436*/ /**/ 0xD801DC37, /*0xD801DC37*/ /*U+010437*/ /*U+010437*/ /**/ 0xD801DC38, /*0xD801DC38*/ /*U+010438*/ /*U+010438*/ /**/ 0xD801DC39, /*0xD801DC39*/ /*U+010439*/ /*U+010439*/ /**/ 0xD801DC3A, /*0xD801DC3A*/ /*U+01043A*/ /*U+01043A*/ /**/ 0xD801DC3B, /*0xD801DC3B*/ /*U+01043B*/ /*U+01043B*/ /**/ 0xD801DC3C, /*0xD801DC3C*/ /*U+01043C*/ /*U+01043C*/ /**/ 0xD801DC3D, /*0xD801DC3D*/ /*U+01043D*/ /*U+01043D*/ /**/ 0xD801DC3E, /*0xD801DC3E*/ /*U+01043E*/ /*U+01043E*/ /**/ 0xD801DC3F, /*0xD801DC3F*/ /*U+01043F*/ /*U+01043F*/ /**/ }; /* EOF */ netatalk-2.2.2/libatalk/unicode/iconv.c0000644000175200017500000002566511655731127014764 00000000000000/* Unix SMB/CIFS implementation. minimal iconv implementation Copyright (C) Andrew Tridgell 2001 Copyright (C) Jelmer Vernooij 2002,2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. From samba 3.0 beta and GNU libiconv-1.8 It's bad but most of the time we can't use libc iconv service: - it doesn't round trip for most encoding - it doesn't know about Apple extension */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #ifdef HAVE_USABLE_ICONV #include #endif #include #include #include #include "byteorder.h" /** * @file * * @brief Samba wrapper/stub for iconv character set conversion. * * iconv is the XPG2 interface for converting between character * encodings. This file provides a Samba wrapper around it, and also * a simple reimplementation that is used if the system does not * implement iconv. * * Samba only works with encodings that are supersets of ASCII: ascii * characters like whitespace can be tested for directly, multibyte * sequences start with a byte with the high bit set, and strings are * terminated by a nul byte. * * Note that the only function provided by iconv is conversion between * characters. It doesn't directly support operations like * uppercasing or comparison. We have to convert to UCS-2 and compare * there. * * @sa Samba Developers Guide **/ #define CHARSET_WIDECHAR 32 #ifdef HAVE_USABLE_ICONV #ifdef HAVE_UCS2INTERNAL #define UCS2ICONV "UCS-2-INTERNAL" #else /* !HAVE_UCS2INTERNAL */ #if BYTE_ORDER==LITTLE_ENDIAN #define UCS2ICONV "UCS-2LE" #else /* !LITTLE_ENDIAN */ #define UCS2ICONV "UCS-2BE" #endif /* BYTE_ORDER */ #endif /* HAVE_UCS2INTERNAL */ #else /* !HAVE_USABLE_ICONV */ #define UCS2ICONV "UCS-2" #endif /* HAVE_USABLE_ICONV */ static size_t ascii_pull(void *,char **, size_t *, char **, size_t *); static size_t ascii_push(void *,char **, size_t *, char **, size_t *); static size_t iconv_copy(void *,char **, size_t *, char **, size_t *); extern struct charset_functions charset_mac_roman; extern struct charset_functions charset_mac_hebrew; extern struct charset_functions charset_mac_centraleurope; extern struct charset_functions charset_mac_cyrillic; extern struct charset_functions charset_mac_greek; extern struct charset_functions charset_mac_turkish; extern struct charset_functions charset_utf8; extern struct charset_functions charset_utf8_mac; #ifdef HAVE_USABLE_ICONV extern struct charset_functions charset_mac_japanese; extern struct charset_functions charset_mac_chinese_trad; extern struct charset_functions charset_mac_korean; extern struct charset_functions charset_mac_chinese_simp; #endif static struct charset_functions builtin_functions[] = { {"UCS-2", 0, iconv_copy, iconv_copy, CHARSET_WIDECHAR | CHARSET_PRECOMPOSED, NULL, NULL, NULL}, {"ASCII", 0, ascii_pull, ascii_push, CHARSET_MULTIBYTE | CHARSET_PRECOMPOSED, NULL, NULL, NULL}, {NULL, 0, NULL, NULL, 0, NULL, NULL, NULL} }; #define DLIST_ADD(list, p) \ { \ if (!(list)) { \ (list) = (p); \ (p)->next = (p)->prev = NULL; \ } else { \ (list)->prev = (p); \ (p)->next = (list); \ (p)->prev = NULL; \ (list) = (p); \ }\ } static struct charset_functions *charsets = NULL; struct charset_functions *find_charset_functions(const char *name) { struct charset_functions *c = charsets; while(c) { if (strcasecmp(name, c->name) == 0) { return c; } c = c->next; } return NULL; } int atalk_register_charset(struct charset_functions *funcs) { if (!funcs) { return -1; } /* Check whether we already have this charset... */ if (find_charset_functions(funcs->name)) { LOG (log_debug, logtype_default, "Duplicate charset %s, not registering", funcs->name); return -2; } funcs->next = funcs->prev = NULL; DLIST_ADD(charsets, funcs); return 0; } static void lazy_initialize_iconv(void) { static int initialized = 0; int i; if (!initialized) { initialized = 1; for(i = 0; builtin_functions[i].name; i++) atalk_register_charset(&builtin_functions[i]); /* register additional charsets */ atalk_register_charset(&charset_utf8); atalk_register_charset(&charset_utf8_mac); atalk_register_charset(&charset_mac_roman); atalk_register_charset(&charset_mac_hebrew); atalk_register_charset(&charset_mac_greek); atalk_register_charset(&charset_mac_turkish); atalk_register_charset(&charset_mac_centraleurope); atalk_register_charset(&charset_mac_cyrillic); #ifdef HAVE_USABLE_ICONV atalk_register_charset(&charset_mac_japanese); atalk_register_charset(&charset_mac_chinese_trad); atalk_register_charset(&charset_mac_korean); atalk_register_charset(&charset_mac_chinese_simp); #endif } } /* if there was an error then reset the internal state, this ensures that we don't have a shift state remaining for character sets like SJIS */ static size_t sys_iconv(void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { #ifdef HAVE_USABLE_ICONV size_t ret = iconv((iconv_t)cd, (ICONV_CONST char**)inbuf, inbytesleft, outbuf, outbytesleft); if (ret == (size_t)-1) iconv(cd, NULL, NULL, NULL, NULL); return ret; #else errno = EINVAL; return -1; #endif } /** * This is a simple portable iconv() implementaion. * * It only knows about a very small number of character sets - just * enough that netatalk works on systems that don't have iconv. **/ size_t atalk_iconv(atalk_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { char cvtbuf[2048]; char *bufp = cvtbuf; size_t bufsize; /* in many cases we can go direct */ if (cd->direct) { return cd->direct(cd->cd_direct, (char **)inbuf, inbytesleft, outbuf, outbytesleft); } /* otherwise we have to do it chunks at a time */ while (*inbytesleft > 0) { bufp = cvtbuf; bufsize = sizeof(cvtbuf); if (cd->pull(cd->cd_pull, (char **)inbuf, inbytesleft, &bufp, &bufsize) == (size_t)-1 && errno != E2BIG) { return -1; } bufp = cvtbuf; bufsize = sizeof(cvtbuf) - bufsize; if (cd->push(cd->cd_push, &bufp, &bufsize, outbuf, outbytesleft) == (size_t)-1) { return -1; } } return 0; } /* simple iconv_open() wrapper */ atalk_iconv_t atalk_iconv_open(const char *tocode, const char *fromcode) { atalk_iconv_t ret; struct charset_functions *from, *to; lazy_initialize_iconv(); from = charsets; to = charsets; ret = (atalk_iconv_t)malloc(sizeof(*ret)); if (!ret) { errno = ENOMEM; return (atalk_iconv_t)-1; } memset(ret, 0, sizeof(*ret)); ret->from_name = strdup(fromcode); ret->to_name = strdup(tocode); /* check for the simplest null conversion */ if (strcasecmp(fromcode, tocode) == 0) { ret->direct = iconv_copy; return ret; } /* check if we have a builtin function for this conversion */ from = find_charset_functions(fromcode); if (from) ret->pull = from->pull; to = find_charset_functions(tocode); if (to) ret->push = to->push; /* check if we can use iconv for this conversion */ #ifdef HAVE_USABLE_ICONV if (!from || (from->flags & CHARSET_ICONV)) { ret->cd_pull = iconv_open(UCS2ICONV, from && from->iname ? from->iname : fromcode); if (ret->cd_pull != (iconv_t)-1) { if (!ret->pull) ret->pull = sys_iconv; } else ret->pull = NULL; } if (ret->pull) { if (!to || (to->flags & CHARSET_ICONV)) { ret->cd_push = iconv_open(to && to->iname ? to->iname : tocode, UCS2ICONV); if (ret->cd_push != (iconv_t)-1) { if (!ret->push) ret->push = sys_iconv; } else ret->push = NULL; } if (!ret->push && ret->cd_pull) iconv_close((iconv_t)ret->cd_pull); } #endif if (!ret->push || !ret->pull) { SAFE_FREE(ret->from_name); SAFE_FREE(ret->to_name); SAFE_FREE(ret); errno = EINVAL; return (atalk_iconv_t)-1; } /* check for conversion to/from ucs2 */ if (strcasecmp(fromcode, "UCS-2") == 0) { ret->direct = ret->push; ret->cd_direct = ret->cd_push; ret->cd_push = NULL; } if (strcasecmp(tocode, "UCS-2") == 0) { ret->direct = ret->pull; ret->cd_direct = ret->cd_pull; ret->cd_pull = NULL; } return ret; } /* simple iconv_close() wrapper */ int atalk_iconv_close (atalk_iconv_t cd) { #ifdef HAVE_USABLE_ICONV if (cd->cd_direct) iconv_close((iconv_t)cd->cd_direct); if (cd->cd_pull) iconv_close((iconv_t)cd->cd_pull); if (cd->cd_push) iconv_close((iconv_t)cd->cd_push); #endif SAFE_FREE(cd->from_name); SAFE_FREE(cd->to_name); memset(cd, 0, sizeof(*cd)); SAFE_FREE(cd); return 0; } /************************************************************************ the following functions implement the builtin character sets in Netatalk *************************************************************************/ static size_t ascii_pull(void *cd _U_, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { ucs2_t curchar; while (*inbytesleft >= 1 && *outbytesleft >= 2) { if ((unsigned char)(*inbuf)[0] < 0x80) { curchar = (ucs2_t) (*inbuf)[0]; SSVAL((*outbuf),0,curchar); } else { errno = EILSEQ; return -1; } (*inbytesleft) -= 1; (*outbytesleft) -= 2; (*inbuf) += 1; (*outbuf) += 2; } if (*inbytesleft > 0) { errno = E2BIG; return -1; } return 0; } static size_t ascii_push(void *cd _U_, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { int ir_count=0; ucs2_t curchar; while (*inbytesleft >= 2 && *outbytesleft >= 1) { curchar = SVAL((*inbuf), 0); if (curchar < 0x0080) { (*outbuf)[0] = curchar; } else { errno = EILSEQ; return -1; } (*inbytesleft) -= 2; (*outbytesleft) -= 1; (*inbuf) += 2; (*outbuf) += 1; } if (*inbytesleft == 1) { errno = EINVAL; return -1; } if (*inbytesleft > 1) { errno = E2BIG; return -1; } return ir_count; } static size_t iconv_copy(void *cd _U_, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { int n; n = MIN(*inbytesleft, *outbytesleft); memmove(*outbuf, *inbuf, n); (*inbytesleft) -= n; (*outbytesleft) -= n; (*inbuf) += n; (*outbuf) += n; if (*inbytesleft > 0) { errno = E2BIG; return -1; } return 0; } /* ------------------------ */ netatalk-2.2.2/libatalk/unicode/precompose.h0000644000175200017500000055253011655731245016024 00000000000000/* DO NOT EDIT BY HAND!!! */ /* This file is generated by */ /* contrib/shell_utils/make-precompose.h.pl UnicodeData.txt */ /* UnicodeData.txt is got from */ /* http://www.unicode.org/Public/UNIDATA/UnicodeData.txt */ #define SBASE 0xAC00 #define LBASE 0x1100 #define VBASE 0x1161 #define TBASE 0x11A7 #define LCOUNT 19 #define VCOUNT 21 #define TCOUNT 28 #define NCOUNT 588 /* (VCOUNT * TCOUNT) */ #define SCOUNT 11172 /* (LCOUNT * NCOUNT) */ #define PRECOMP_COUNT 955 #define DECOMP_COUNT 955 #define MAXCOMBLEN 3 #define PRECOMP_SP_COUNT 16 #define DECOMP_SP_COUNT 16 #define MAXCOMBSPLEN 4 #define COMBBUFLEN 4 /* max(MAXCOMBLEN,MAXCOMBSPLEN) */ static const struct { unsigned int replacement; unsigned int base; unsigned int comb; } precompositions[] = { /*{ 0x0000226E, 0x0000003C, 0x00000338 },*/ /* NOT LESS-THAN */ /*{ 0x00002260, 0x0000003D, 0x00000338 },*/ /* NOT EQUAL TO */ /*{ 0x0000226F, 0x0000003E, 0x00000338 },*/ /* NOT GREATER-THAN */ { 0x000000C0, 0x00000041, 0x00000300 }, /* LATIN CAPITAL LETTER A WITH GRAVE */ { 0x000000C1, 0x00000041, 0x00000301 }, /* LATIN CAPITAL LETTER A WITH ACUTE */ { 0x000000C2, 0x00000041, 0x00000302 }, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ { 0x000000C3, 0x00000041, 0x00000303 }, /* LATIN CAPITAL LETTER A WITH TILDE */ { 0x00000100, 0x00000041, 0x00000304 }, /* LATIN CAPITAL LETTER A WITH MACRON */ { 0x00000102, 0x00000041, 0x00000306 }, /* LATIN CAPITAL LETTER A WITH BREVE */ { 0x00000226, 0x00000041, 0x00000307 }, /* LATIN CAPITAL LETTER A WITH DOT ABOVE */ { 0x000000C4, 0x00000041, 0x00000308 }, /* LATIN CAPITAL LETTER A WITH DIAERESIS */ { 0x00001EA2, 0x00000041, 0x00000309 }, /* LATIN CAPITAL LETTER A WITH HOOK ABOVE */ { 0x000000C5, 0x00000041, 0x0000030A }, /* LATIN CAPITAL LETTER A WITH RING ABOVE */ { 0x000001CD, 0x00000041, 0x0000030C }, /* LATIN CAPITAL LETTER A WITH CARON */ { 0x00000200, 0x00000041, 0x0000030F }, /* LATIN CAPITAL LETTER A WITH DOUBLE GRAVE */ { 0x00000202, 0x00000041, 0x00000311 }, /* LATIN CAPITAL LETTER A WITH INVERTED BREVE */ { 0x00001EA0, 0x00000041, 0x00000323 }, /* LATIN CAPITAL LETTER A WITH DOT BELOW */ { 0x00001E00, 0x00000041, 0x00000325 }, /* LATIN CAPITAL LETTER A WITH RING BELOW */ { 0x00000104, 0x00000041, 0x00000328 }, /* LATIN CAPITAL LETTER A WITH OGONEK */ { 0x00001E02, 0x00000042, 0x00000307 }, /* LATIN CAPITAL LETTER B WITH DOT ABOVE */ { 0x00001E04, 0x00000042, 0x00000323 }, /* LATIN CAPITAL LETTER B WITH DOT BELOW */ { 0x00001E06, 0x00000042, 0x00000331 }, /* LATIN CAPITAL LETTER B WITH LINE BELOW */ { 0x00000106, 0x00000043, 0x00000301 }, /* LATIN CAPITAL LETTER C WITH ACUTE */ { 0x00000108, 0x00000043, 0x00000302 }, /* LATIN CAPITAL LETTER C WITH CIRCUMFLEX */ { 0x0000010A, 0x00000043, 0x00000307 }, /* LATIN CAPITAL LETTER C WITH DOT ABOVE */ { 0x0000010C, 0x00000043, 0x0000030C }, /* LATIN CAPITAL LETTER C WITH CARON */ { 0x000000C7, 0x00000043, 0x00000327 }, /* LATIN CAPITAL LETTER C WITH CEDILLA */ { 0x00001E0A, 0x00000044, 0x00000307 }, /* LATIN CAPITAL LETTER D WITH DOT ABOVE */ { 0x0000010E, 0x00000044, 0x0000030C }, /* LATIN CAPITAL LETTER D WITH CARON */ { 0x00001E0C, 0x00000044, 0x00000323 }, /* LATIN CAPITAL LETTER D WITH DOT BELOW */ { 0x00001E10, 0x00000044, 0x00000327 }, /* LATIN CAPITAL LETTER D WITH CEDILLA */ { 0x00001E12, 0x00000044, 0x0000032D }, /* LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW */ { 0x00001E0E, 0x00000044, 0x00000331 }, /* LATIN CAPITAL LETTER D WITH LINE BELOW */ { 0x000000C8, 0x00000045, 0x00000300 }, /* LATIN CAPITAL LETTER E WITH GRAVE */ { 0x000000C9, 0x00000045, 0x00000301 }, /* LATIN CAPITAL LETTER E WITH ACUTE */ { 0x000000CA, 0x00000045, 0x00000302 }, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ { 0x00001EBC, 0x00000045, 0x00000303 }, /* LATIN CAPITAL LETTER E WITH TILDE */ { 0x00000112, 0x00000045, 0x00000304 }, /* LATIN CAPITAL LETTER E WITH MACRON */ { 0x00000114, 0x00000045, 0x00000306 }, /* LATIN CAPITAL LETTER E WITH BREVE */ { 0x00000116, 0x00000045, 0x00000307 }, /* LATIN CAPITAL LETTER E WITH DOT ABOVE */ { 0x000000CB, 0x00000045, 0x00000308 }, /* LATIN CAPITAL LETTER E WITH DIAERESIS */ { 0x00001EBA, 0x00000045, 0x00000309 }, /* LATIN CAPITAL LETTER E WITH HOOK ABOVE */ { 0x0000011A, 0x00000045, 0x0000030C }, /* LATIN CAPITAL LETTER E WITH CARON */ { 0x00000204, 0x00000045, 0x0000030F }, /* LATIN CAPITAL LETTER E WITH DOUBLE GRAVE */ { 0x00000206, 0x00000045, 0x00000311 }, /* LATIN CAPITAL LETTER E WITH INVERTED BREVE */ { 0x00001EB8, 0x00000045, 0x00000323 }, /* LATIN CAPITAL LETTER E WITH DOT BELOW */ { 0x00000228, 0x00000045, 0x00000327 }, /* LATIN CAPITAL LETTER E WITH CEDILLA */ { 0x00000118, 0x00000045, 0x00000328 }, /* LATIN CAPITAL LETTER E WITH OGONEK */ { 0x00001E18, 0x00000045, 0x0000032D }, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW */ { 0x00001E1A, 0x00000045, 0x00000330 }, /* LATIN CAPITAL LETTER E WITH TILDE BELOW */ { 0x00001E1E, 0x00000046, 0x00000307 }, /* LATIN CAPITAL LETTER F WITH DOT ABOVE */ { 0x000001F4, 0x00000047, 0x00000301 }, /* LATIN CAPITAL LETTER G WITH ACUTE */ { 0x0000011C, 0x00000047, 0x00000302 }, /* LATIN CAPITAL LETTER G WITH CIRCUMFLEX */ { 0x00001E20, 0x00000047, 0x00000304 }, /* LATIN CAPITAL LETTER G WITH MACRON */ { 0x0000011E, 0x00000047, 0x00000306 }, /* LATIN CAPITAL LETTER G WITH BREVE */ { 0x00000120, 0x00000047, 0x00000307 }, /* LATIN CAPITAL LETTER G WITH DOT ABOVE */ { 0x000001E6, 0x00000047, 0x0000030C }, /* LATIN CAPITAL LETTER G WITH CARON */ { 0x00000122, 0x00000047, 0x00000327 }, /* LATIN CAPITAL LETTER G WITH CEDILLA */ { 0x00000124, 0x00000048, 0x00000302 }, /* LATIN CAPITAL LETTER H WITH CIRCUMFLEX */ { 0x00001E22, 0x00000048, 0x00000307 }, /* LATIN CAPITAL LETTER H WITH DOT ABOVE */ { 0x00001E26, 0x00000048, 0x00000308 }, /* LATIN CAPITAL LETTER H WITH DIAERESIS */ { 0x0000021E, 0x00000048, 0x0000030C }, /* LATIN CAPITAL LETTER H WITH CARON */ { 0x00001E24, 0x00000048, 0x00000323 }, /* LATIN CAPITAL LETTER H WITH DOT BELOW */ { 0x00001E28, 0x00000048, 0x00000327 }, /* LATIN CAPITAL LETTER H WITH CEDILLA */ { 0x00001E2A, 0x00000048, 0x0000032E }, /* LATIN CAPITAL LETTER H WITH BREVE BELOW */ { 0x000000CC, 0x00000049, 0x00000300 }, /* LATIN CAPITAL LETTER I WITH GRAVE */ { 0x000000CD, 0x00000049, 0x00000301 }, /* LATIN CAPITAL LETTER I WITH ACUTE */ { 0x000000CE, 0x00000049, 0x00000302 }, /* LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ { 0x00000128, 0x00000049, 0x00000303 }, /* LATIN CAPITAL LETTER I WITH TILDE */ { 0x0000012A, 0x00000049, 0x00000304 }, /* LATIN CAPITAL LETTER I WITH MACRON */ { 0x0000012C, 0x00000049, 0x00000306 }, /* LATIN CAPITAL LETTER I WITH BREVE */ { 0x00000130, 0x00000049, 0x00000307 }, /* LATIN CAPITAL LETTER I WITH DOT ABOVE */ { 0x000000CF, 0x00000049, 0x00000308 }, /* LATIN CAPITAL LETTER I WITH DIAERESIS */ { 0x00001EC8, 0x00000049, 0x00000309 }, /* LATIN CAPITAL LETTER I WITH HOOK ABOVE */ { 0x000001CF, 0x00000049, 0x0000030C }, /* LATIN CAPITAL LETTER I WITH CARON */ { 0x00000208, 0x00000049, 0x0000030F }, /* LATIN CAPITAL LETTER I WITH DOUBLE GRAVE */ { 0x0000020A, 0x00000049, 0x00000311 }, /* LATIN CAPITAL LETTER I WITH INVERTED BREVE */ { 0x00001ECA, 0x00000049, 0x00000323 }, /* LATIN CAPITAL LETTER I WITH DOT BELOW */ { 0x0000012E, 0x00000049, 0x00000328 }, /* LATIN CAPITAL LETTER I WITH OGONEK */ { 0x00001E2C, 0x00000049, 0x00000330 }, /* LATIN CAPITAL LETTER I WITH TILDE BELOW */ { 0x00000134, 0x0000004A, 0x00000302 }, /* LATIN CAPITAL LETTER J WITH CIRCUMFLEX */ { 0x00001E30, 0x0000004B, 0x00000301 }, /* LATIN CAPITAL LETTER K WITH ACUTE */ { 0x000001E8, 0x0000004B, 0x0000030C }, /* LATIN CAPITAL LETTER K WITH CARON */ { 0x00001E32, 0x0000004B, 0x00000323 }, /* LATIN CAPITAL LETTER K WITH DOT BELOW */ { 0x00000136, 0x0000004B, 0x00000327 }, /* LATIN CAPITAL LETTER K WITH CEDILLA */ { 0x00001E34, 0x0000004B, 0x00000331 }, /* LATIN CAPITAL LETTER K WITH LINE BELOW */ { 0x00000139, 0x0000004C, 0x00000301 }, /* LATIN CAPITAL LETTER L WITH ACUTE */ { 0x0000013D, 0x0000004C, 0x0000030C }, /* LATIN CAPITAL LETTER L WITH CARON */ { 0x00001E36, 0x0000004C, 0x00000323 }, /* LATIN CAPITAL LETTER L WITH DOT BELOW */ { 0x0000013B, 0x0000004C, 0x00000327 }, /* LATIN CAPITAL LETTER L WITH CEDILLA */ { 0x00001E3C, 0x0000004C, 0x0000032D }, /* LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW */ { 0x00001E3A, 0x0000004C, 0x00000331 }, /* LATIN CAPITAL LETTER L WITH LINE BELOW */ { 0x00001E3E, 0x0000004D, 0x00000301 }, /* LATIN CAPITAL LETTER M WITH ACUTE */ { 0x00001E40, 0x0000004D, 0x00000307 }, /* LATIN CAPITAL LETTER M WITH DOT ABOVE */ { 0x00001E42, 0x0000004D, 0x00000323 }, /* LATIN CAPITAL LETTER M WITH DOT BELOW */ { 0x000001F8, 0x0000004E, 0x00000300 }, /* LATIN CAPITAL LETTER N WITH GRAVE */ { 0x00000143, 0x0000004E, 0x00000301 }, /* LATIN CAPITAL LETTER N WITH ACUTE */ { 0x000000D1, 0x0000004E, 0x00000303 }, /* LATIN CAPITAL LETTER N WITH TILDE */ { 0x00001E44, 0x0000004E, 0x00000307 }, /* LATIN CAPITAL LETTER N WITH DOT ABOVE */ { 0x00000147, 0x0000004E, 0x0000030C }, /* LATIN CAPITAL LETTER N WITH CARON */ { 0x00001E46, 0x0000004E, 0x00000323 }, /* LATIN CAPITAL LETTER N WITH DOT BELOW */ { 0x00000145, 0x0000004E, 0x00000327 }, /* LATIN CAPITAL LETTER N WITH CEDILLA */ { 0x00001E4A, 0x0000004E, 0x0000032D }, /* LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW */ { 0x00001E48, 0x0000004E, 0x00000331 }, /* LATIN CAPITAL LETTER N WITH LINE BELOW */ { 0x000000D2, 0x0000004F, 0x00000300 }, /* LATIN CAPITAL LETTER O WITH GRAVE */ { 0x000000D3, 0x0000004F, 0x00000301 }, /* LATIN CAPITAL LETTER O WITH ACUTE */ { 0x000000D4, 0x0000004F, 0x00000302 }, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ { 0x000000D5, 0x0000004F, 0x00000303 }, /* LATIN CAPITAL LETTER O WITH TILDE */ { 0x0000014C, 0x0000004F, 0x00000304 }, /* LATIN CAPITAL LETTER O WITH MACRON */ { 0x0000014E, 0x0000004F, 0x00000306 }, /* LATIN CAPITAL LETTER O WITH BREVE */ { 0x0000022E, 0x0000004F, 0x00000307 }, /* LATIN CAPITAL LETTER O WITH DOT ABOVE */ { 0x000000D6, 0x0000004F, 0x00000308 }, /* LATIN CAPITAL LETTER O WITH DIAERESIS */ { 0x00001ECE, 0x0000004F, 0x00000309 }, /* LATIN CAPITAL LETTER O WITH HOOK ABOVE */ { 0x00000150, 0x0000004F, 0x0000030B }, /* LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */ { 0x000001D1, 0x0000004F, 0x0000030C }, /* LATIN CAPITAL LETTER O WITH CARON */ { 0x0000020C, 0x0000004F, 0x0000030F }, /* LATIN CAPITAL LETTER O WITH DOUBLE GRAVE */ { 0x0000020E, 0x0000004F, 0x00000311 }, /* LATIN CAPITAL LETTER O WITH INVERTED BREVE */ { 0x000001A0, 0x0000004F, 0x0000031B }, /* LATIN CAPITAL LETTER O WITH HORN */ { 0x00001ECC, 0x0000004F, 0x00000323 }, /* LATIN CAPITAL LETTER O WITH DOT BELOW */ { 0x000001EA, 0x0000004F, 0x00000328 }, /* LATIN CAPITAL LETTER O WITH OGONEK */ { 0x00001E54, 0x00000050, 0x00000301 }, /* LATIN CAPITAL LETTER P WITH ACUTE */ { 0x00001E56, 0x00000050, 0x00000307 }, /* LATIN CAPITAL LETTER P WITH DOT ABOVE */ { 0x00000154, 0x00000052, 0x00000301 }, /* LATIN CAPITAL LETTER R WITH ACUTE */ { 0x00001E58, 0x00000052, 0x00000307 }, /* LATIN CAPITAL LETTER R WITH DOT ABOVE */ { 0x00000158, 0x00000052, 0x0000030C }, /* LATIN CAPITAL LETTER R WITH CARON */ { 0x00000210, 0x00000052, 0x0000030F }, /* LATIN CAPITAL LETTER R WITH DOUBLE GRAVE */ { 0x00000212, 0x00000052, 0x00000311 }, /* LATIN CAPITAL LETTER R WITH INVERTED BREVE */ { 0x00001E5A, 0x00000052, 0x00000323 }, /* LATIN CAPITAL LETTER R WITH DOT BELOW */ { 0x00000156, 0x00000052, 0x00000327 }, /* LATIN CAPITAL LETTER R WITH CEDILLA */ { 0x00001E5E, 0x00000052, 0x00000331 }, /* LATIN CAPITAL LETTER R WITH LINE BELOW */ { 0x0000015A, 0x00000053, 0x00000301 }, /* LATIN CAPITAL LETTER S WITH ACUTE */ { 0x0000015C, 0x00000053, 0x00000302 }, /* LATIN CAPITAL LETTER S WITH CIRCUMFLEX */ { 0x00001E60, 0x00000053, 0x00000307 }, /* LATIN CAPITAL LETTER S WITH DOT ABOVE */ { 0x00000160, 0x00000053, 0x0000030C }, /* LATIN CAPITAL LETTER S WITH CARON */ { 0x00001E62, 0x00000053, 0x00000323 }, /* LATIN CAPITAL LETTER S WITH DOT BELOW */ { 0x00000218, 0x00000053, 0x00000326 }, /* LATIN CAPITAL LETTER S WITH COMMA BELOW */ { 0x0000015E, 0x00000053, 0x00000327 }, /* LATIN CAPITAL LETTER S WITH CEDILLA */ { 0x00001E6A, 0x00000054, 0x00000307 }, /* LATIN CAPITAL LETTER T WITH DOT ABOVE */ { 0x00000164, 0x00000054, 0x0000030C }, /* LATIN CAPITAL LETTER T WITH CARON */ { 0x00001E6C, 0x00000054, 0x00000323 }, /* LATIN CAPITAL LETTER T WITH DOT BELOW */ { 0x0000021A, 0x00000054, 0x00000326 }, /* LATIN CAPITAL LETTER T WITH COMMA BELOW */ { 0x00000162, 0x00000054, 0x00000327 }, /* LATIN CAPITAL LETTER T WITH CEDILLA */ { 0x00001E70, 0x00000054, 0x0000032D }, /* LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW */ { 0x00001E6E, 0x00000054, 0x00000331 }, /* LATIN CAPITAL LETTER T WITH LINE BELOW */ { 0x000000D9, 0x00000055, 0x00000300 }, /* LATIN CAPITAL LETTER U WITH GRAVE */ { 0x000000DA, 0x00000055, 0x00000301 }, /* LATIN CAPITAL LETTER U WITH ACUTE */ { 0x000000DB, 0x00000055, 0x00000302 }, /* LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ { 0x00000168, 0x00000055, 0x00000303 }, /* LATIN CAPITAL LETTER U WITH TILDE */ { 0x0000016A, 0x00000055, 0x00000304 }, /* LATIN CAPITAL LETTER U WITH MACRON */ { 0x0000016C, 0x00000055, 0x00000306 }, /* LATIN CAPITAL LETTER U WITH BREVE */ { 0x000000DC, 0x00000055, 0x00000308 }, /* LATIN CAPITAL LETTER U WITH DIAERESIS */ { 0x00001EE6, 0x00000055, 0x00000309 }, /* LATIN CAPITAL LETTER U WITH HOOK ABOVE */ { 0x0000016E, 0x00000055, 0x0000030A }, /* LATIN CAPITAL LETTER U WITH RING ABOVE */ { 0x00000170, 0x00000055, 0x0000030B }, /* LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */ { 0x000001D3, 0x00000055, 0x0000030C }, /* LATIN CAPITAL LETTER U WITH CARON */ { 0x00000214, 0x00000055, 0x0000030F }, /* LATIN CAPITAL LETTER U WITH DOUBLE GRAVE */ { 0x00000216, 0x00000055, 0x00000311 }, /* LATIN CAPITAL LETTER U WITH INVERTED BREVE */ { 0x000001AF, 0x00000055, 0x0000031B }, /* LATIN CAPITAL LETTER U WITH HORN */ { 0x00001EE4, 0x00000055, 0x00000323 }, /* LATIN CAPITAL LETTER U WITH DOT BELOW */ { 0x00001E72, 0x00000055, 0x00000324 }, /* LATIN CAPITAL LETTER U WITH DIAERESIS BELOW */ { 0x00000172, 0x00000055, 0x00000328 }, /* LATIN CAPITAL LETTER U WITH OGONEK */ { 0x00001E76, 0x00000055, 0x0000032D }, /* LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW */ { 0x00001E74, 0x00000055, 0x00000330 }, /* LATIN CAPITAL LETTER U WITH TILDE BELOW */ { 0x00001E7C, 0x00000056, 0x00000303 }, /* LATIN CAPITAL LETTER V WITH TILDE */ { 0x00001E7E, 0x00000056, 0x00000323 }, /* LATIN CAPITAL LETTER V WITH DOT BELOW */ { 0x00001E80, 0x00000057, 0x00000300 }, /* LATIN CAPITAL LETTER W WITH GRAVE */ { 0x00001E82, 0x00000057, 0x00000301 }, /* LATIN CAPITAL LETTER W WITH ACUTE */ { 0x00000174, 0x00000057, 0x00000302 }, /* LATIN CAPITAL LETTER W WITH CIRCUMFLEX */ { 0x00001E86, 0x00000057, 0x00000307 }, /* LATIN CAPITAL LETTER W WITH DOT ABOVE */ { 0x00001E84, 0x00000057, 0x00000308 }, /* LATIN CAPITAL LETTER W WITH DIAERESIS */ { 0x00001E88, 0x00000057, 0x00000323 }, /* LATIN CAPITAL LETTER W WITH DOT BELOW */ { 0x00001E8A, 0x00000058, 0x00000307 }, /* LATIN CAPITAL LETTER X WITH DOT ABOVE */ { 0x00001E8C, 0x00000058, 0x00000308 }, /* LATIN CAPITAL LETTER X WITH DIAERESIS */ { 0x00001EF2, 0x00000059, 0x00000300 }, /* LATIN CAPITAL LETTER Y WITH GRAVE */ { 0x000000DD, 0x00000059, 0x00000301 }, /* LATIN CAPITAL LETTER Y WITH ACUTE */ { 0x00000176, 0x00000059, 0x00000302 }, /* LATIN CAPITAL LETTER Y WITH CIRCUMFLEX */ { 0x00001EF8, 0x00000059, 0x00000303 }, /* LATIN CAPITAL LETTER Y WITH TILDE */ { 0x00000232, 0x00000059, 0x00000304 }, /* LATIN CAPITAL LETTER Y WITH MACRON */ { 0x00001E8E, 0x00000059, 0x00000307 }, /* LATIN CAPITAL LETTER Y WITH DOT ABOVE */ { 0x00000178, 0x00000059, 0x00000308 }, /* LATIN CAPITAL LETTER Y WITH DIAERESIS */ { 0x00001EF6, 0x00000059, 0x00000309 }, /* LATIN CAPITAL LETTER Y WITH HOOK ABOVE */ { 0x00001EF4, 0x00000059, 0x00000323 }, /* LATIN CAPITAL LETTER Y WITH DOT BELOW */ { 0x00000179, 0x0000005A, 0x00000301 }, /* LATIN CAPITAL LETTER Z WITH ACUTE */ { 0x00001E90, 0x0000005A, 0x00000302 }, /* LATIN CAPITAL LETTER Z WITH CIRCUMFLEX */ { 0x0000017B, 0x0000005A, 0x00000307 }, /* LATIN CAPITAL LETTER Z WITH DOT ABOVE */ { 0x0000017D, 0x0000005A, 0x0000030C }, /* LATIN CAPITAL LETTER Z WITH CARON */ { 0x00001E92, 0x0000005A, 0x00000323 }, /* LATIN CAPITAL LETTER Z WITH DOT BELOW */ { 0x00001E94, 0x0000005A, 0x00000331 }, /* LATIN CAPITAL LETTER Z WITH LINE BELOW */ { 0x000000E0, 0x00000061, 0x00000300 }, /* LATIN SMALL LETTER A WITH GRAVE */ { 0x000000E1, 0x00000061, 0x00000301 }, /* LATIN SMALL LETTER A WITH ACUTE */ { 0x000000E2, 0x00000061, 0x00000302 }, /* LATIN SMALL LETTER A WITH CIRCUMFLEX */ { 0x000000E3, 0x00000061, 0x00000303 }, /* LATIN SMALL LETTER A WITH TILDE */ { 0x00000101, 0x00000061, 0x00000304 }, /* LATIN SMALL LETTER A WITH MACRON */ { 0x00000103, 0x00000061, 0x00000306 }, /* LATIN SMALL LETTER A WITH BREVE */ { 0x00000227, 0x00000061, 0x00000307 }, /* LATIN SMALL LETTER A WITH DOT ABOVE */ { 0x000000E4, 0x00000061, 0x00000308 }, /* LATIN SMALL LETTER A WITH DIAERESIS */ { 0x00001EA3, 0x00000061, 0x00000309 }, /* LATIN SMALL LETTER A WITH HOOK ABOVE */ { 0x000000E5, 0x00000061, 0x0000030A }, /* LATIN SMALL LETTER A WITH RING ABOVE */ { 0x000001CE, 0x00000061, 0x0000030C }, /* LATIN SMALL LETTER A WITH CARON */ { 0x00000201, 0x00000061, 0x0000030F }, /* LATIN SMALL LETTER A WITH DOUBLE GRAVE */ { 0x00000203, 0x00000061, 0x00000311 }, /* LATIN SMALL LETTER A WITH INVERTED BREVE */ { 0x00001EA1, 0x00000061, 0x00000323 }, /* LATIN SMALL LETTER A WITH DOT BELOW */ { 0x00001E01, 0x00000061, 0x00000325 }, /* LATIN SMALL LETTER A WITH RING BELOW */ { 0x00000105, 0x00000061, 0x00000328 }, /* LATIN SMALL LETTER A WITH OGONEK */ { 0x00001E03, 0x00000062, 0x00000307 }, /* LATIN SMALL LETTER B WITH DOT ABOVE */ { 0x00001E05, 0x00000062, 0x00000323 }, /* LATIN SMALL LETTER B WITH DOT BELOW */ { 0x00001E07, 0x00000062, 0x00000331 }, /* LATIN SMALL LETTER B WITH LINE BELOW */ { 0x00000107, 0x00000063, 0x00000301 }, /* LATIN SMALL LETTER C WITH ACUTE */ { 0x00000109, 0x00000063, 0x00000302 }, /* LATIN SMALL LETTER C WITH CIRCUMFLEX */ { 0x0000010B, 0x00000063, 0x00000307 }, /* LATIN SMALL LETTER C WITH DOT ABOVE */ { 0x0000010D, 0x00000063, 0x0000030C }, /* LATIN SMALL LETTER C WITH CARON */ { 0x000000E7, 0x00000063, 0x00000327 }, /* LATIN SMALL LETTER C WITH CEDILLA */ { 0x00001E0B, 0x00000064, 0x00000307 }, /* LATIN SMALL LETTER D WITH DOT ABOVE */ { 0x0000010F, 0x00000064, 0x0000030C }, /* LATIN SMALL LETTER D WITH CARON */ { 0x00001E0D, 0x00000064, 0x00000323 }, /* LATIN SMALL LETTER D WITH DOT BELOW */ { 0x00001E11, 0x00000064, 0x00000327 }, /* LATIN SMALL LETTER D WITH CEDILLA */ { 0x00001E13, 0x00000064, 0x0000032D }, /* LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW */ { 0x00001E0F, 0x00000064, 0x00000331 }, /* LATIN SMALL LETTER D WITH LINE BELOW */ { 0x000000E8, 0x00000065, 0x00000300 }, /* LATIN SMALL LETTER E WITH GRAVE */ { 0x000000E9, 0x00000065, 0x00000301 }, /* LATIN SMALL LETTER E WITH ACUTE */ { 0x000000EA, 0x00000065, 0x00000302 }, /* LATIN SMALL LETTER E WITH CIRCUMFLEX */ { 0x00001EBD, 0x00000065, 0x00000303 }, /* LATIN SMALL LETTER E WITH TILDE */ { 0x00000113, 0x00000065, 0x00000304 }, /* LATIN SMALL LETTER E WITH MACRON */ { 0x00000115, 0x00000065, 0x00000306 }, /* LATIN SMALL LETTER E WITH BREVE */ { 0x00000117, 0x00000065, 0x00000307 }, /* LATIN SMALL LETTER E WITH DOT ABOVE */ { 0x000000EB, 0x00000065, 0x00000308 }, /* LATIN SMALL LETTER E WITH DIAERESIS */ { 0x00001EBB, 0x00000065, 0x00000309 }, /* LATIN SMALL LETTER E WITH HOOK ABOVE */ { 0x0000011B, 0x00000065, 0x0000030C }, /* LATIN SMALL LETTER E WITH CARON */ { 0x00000205, 0x00000065, 0x0000030F }, /* LATIN SMALL LETTER E WITH DOUBLE GRAVE */ { 0x00000207, 0x00000065, 0x00000311 }, /* LATIN SMALL LETTER E WITH INVERTED BREVE */ { 0x00001EB9, 0x00000065, 0x00000323 }, /* LATIN SMALL LETTER E WITH DOT BELOW */ { 0x00000229, 0x00000065, 0x00000327 }, /* LATIN SMALL LETTER E WITH CEDILLA */ { 0x00000119, 0x00000065, 0x00000328 }, /* LATIN SMALL LETTER E WITH OGONEK */ { 0x00001E19, 0x00000065, 0x0000032D }, /* LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW */ { 0x00001E1B, 0x00000065, 0x00000330 }, /* LATIN SMALL LETTER E WITH TILDE BELOW */ { 0x00001E1F, 0x00000066, 0x00000307 }, /* LATIN SMALL LETTER F WITH DOT ABOVE */ { 0x000001F5, 0x00000067, 0x00000301 }, /* LATIN SMALL LETTER G WITH ACUTE */ { 0x0000011D, 0x00000067, 0x00000302 }, /* LATIN SMALL LETTER G WITH CIRCUMFLEX */ { 0x00001E21, 0x00000067, 0x00000304 }, /* LATIN SMALL LETTER G WITH MACRON */ { 0x0000011F, 0x00000067, 0x00000306 }, /* LATIN SMALL LETTER G WITH BREVE */ { 0x00000121, 0x00000067, 0x00000307 }, /* LATIN SMALL LETTER G WITH DOT ABOVE */ { 0x000001E7, 0x00000067, 0x0000030C }, /* LATIN SMALL LETTER G WITH CARON */ { 0x00000123, 0x00000067, 0x00000327 }, /* LATIN SMALL LETTER G WITH CEDILLA */ { 0x00000125, 0x00000068, 0x00000302 }, /* LATIN SMALL LETTER H WITH CIRCUMFLEX */ { 0x00001E23, 0x00000068, 0x00000307 }, /* LATIN SMALL LETTER H WITH DOT ABOVE */ { 0x00001E27, 0x00000068, 0x00000308 }, /* LATIN SMALL LETTER H WITH DIAERESIS */ { 0x0000021F, 0x00000068, 0x0000030C }, /* LATIN SMALL LETTER H WITH CARON */ { 0x00001E25, 0x00000068, 0x00000323 }, /* LATIN SMALL LETTER H WITH DOT BELOW */ { 0x00001E29, 0x00000068, 0x00000327 }, /* LATIN SMALL LETTER H WITH CEDILLA */ { 0x00001E2B, 0x00000068, 0x0000032E }, /* LATIN SMALL LETTER H WITH BREVE BELOW */ { 0x00001E96, 0x00000068, 0x00000331 }, /* LATIN SMALL LETTER H WITH LINE BELOW */ { 0x000000EC, 0x00000069, 0x00000300 }, /* LATIN SMALL LETTER I WITH GRAVE */ { 0x000000ED, 0x00000069, 0x00000301 }, /* LATIN SMALL LETTER I WITH ACUTE */ { 0x000000EE, 0x00000069, 0x00000302 }, /* LATIN SMALL LETTER I WITH CIRCUMFLEX */ { 0x00000129, 0x00000069, 0x00000303 }, /* LATIN SMALL LETTER I WITH TILDE */ { 0x0000012B, 0x00000069, 0x00000304 }, /* LATIN SMALL LETTER I WITH MACRON */ { 0x0000012D, 0x00000069, 0x00000306 }, /* LATIN SMALL LETTER I WITH BREVE */ { 0x000000EF, 0x00000069, 0x00000308 }, /* LATIN SMALL LETTER I WITH DIAERESIS */ { 0x00001EC9, 0x00000069, 0x00000309 }, /* LATIN SMALL LETTER I WITH HOOK ABOVE */ { 0x000001D0, 0x00000069, 0x0000030C }, /* LATIN SMALL LETTER I WITH CARON */ { 0x00000209, 0x00000069, 0x0000030F }, /* LATIN SMALL LETTER I WITH DOUBLE GRAVE */ { 0x0000020B, 0x00000069, 0x00000311 }, /* LATIN SMALL LETTER I WITH INVERTED BREVE */ { 0x00001ECB, 0x00000069, 0x00000323 }, /* LATIN SMALL LETTER I WITH DOT BELOW */ { 0x0000012F, 0x00000069, 0x00000328 }, /* LATIN SMALL LETTER I WITH OGONEK */ { 0x00001E2D, 0x00000069, 0x00000330 }, /* LATIN SMALL LETTER I WITH TILDE BELOW */ { 0x00000135, 0x0000006A, 0x00000302 }, /* LATIN SMALL LETTER J WITH CIRCUMFLEX */ { 0x000001F0, 0x0000006A, 0x0000030C }, /* LATIN SMALL LETTER J WITH CARON */ { 0x00001E31, 0x0000006B, 0x00000301 }, /* LATIN SMALL LETTER K WITH ACUTE */ { 0x000001E9, 0x0000006B, 0x0000030C }, /* LATIN SMALL LETTER K WITH CARON */ { 0x00001E33, 0x0000006B, 0x00000323 }, /* LATIN SMALL LETTER K WITH DOT BELOW */ { 0x00000137, 0x0000006B, 0x00000327 }, /* LATIN SMALL LETTER K WITH CEDILLA */ { 0x00001E35, 0x0000006B, 0x00000331 }, /* LATIN SMALL LETTER K WITH LINE BELOW */ { 0x0000013A, 0x0000006C, 0x00000301 }, /* LATIN SMALL LETTER L WITH ACUTE */ { 0x0000013E, 0x0000006C, 0x0000030C }, /* LATIN SMALL LETTER L WITH CARON */ { 0x00001E37, 0x0000006C, 0x00000323 }, /* LATIN SMALL LETTER L WITH DOT BELOW */ { 0x0000013C, 0x0000006C, 0x00000327 }, /* LATIN SMALL LETTER L WITH CEDILLA */ { 0x00001E3D, 0x0000006C, 0x0000032D }, /* LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW */ { 0x00001E3B, 0x0000006C, 0x00000331 }, /* LATIN SMALL LETTER L WITH LINE BELOW */ { 0x00001E3F, 0x0000006D, 0x00000301 }, /* LATIN SMALL LETTER M WITH ACUTE */ { 0x00001E41, 0x0000006D, 0x00000307 }, /* LATIN SMALL LETTER M WITH DOT ABOVE */ { 0x00001E43, 0x0000006D, 0x00000323 }, /* LATIN SMALL LETTER M WITH DOT BELOW */ { 0x000001F9, 0x0000006E, 0x00000300 }, /* LATIN SMALL LETTER N WITH GRAVE */ { 0x00000144, 0x0000006E, 0x00000301 }, /* LATIN SMALL LETTER N WITH ACUTE */ { 0x000000F1, 0x0000006E, 0x00000303 }, /* LATIN SMALL LETTER N WITH TILDE */ { 0x00001E45, 0x0000006E, 0x00000307 }, /* LATIN SMALL LETTER N WITH DOT ABOVE */ { 0x00000148, 0x0000006E, 0x0000030C }, /* LATIN SMALL LETTER N WITH CARON */ { 0x00001E47, 0x0000006E, 0x00000323 }, /* LATIN SMALL LETTER N WITH DOT BELOW */ { 0x00000146, 0x0000006E, 0x00000327 }, /* LATIN SMALL LETTER N WITH CEDILLA */ { 0x00001E4B, 0x0000006E, 0x0000032D }, /* LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW */ { 0x00001E49, 0x0000006E, 0x00000331 }, /* LATIN SMALL LETTER N WITH LINE BELOW */ { 0x000000F2, 0x0000006F, 0x00000300 }, /* LATIN SMALL LETTER O WITH GRAVE */ { 0x000000F3, 0x0000006F, 0x00000301 }, /* LATIN SMALL LETTER O WITH ACUTE */ { 0x000000F4, 0x0000006F, 0x00000302 }, /* LATIN SMALL LETTER O WITH CIRCUMFLEX */ { 0x000000F5, 0x0000006F, 0x00000303 }, /* LATIN SMALL LETTER O WITH TILDE */ { 0x0000014D, 0x0000006F, 0x00000304 }, /* LATIN SMALL LETTER O WITH MACRON */ { 0x0000014F, 0x0000006F, 0x00000306 }, /* LATIN SMALL LETTER O WITH BREVE */ { 0x0000022F, 0x0000006F, 0x00000307 }, /* LATIN SMALL LETTER O WITH DOT ABOVE */ { 0x000000F6, 0x0000006F, 0x00000308 }, /* LATIN SMALL LETTER O WITH DIAERESIS */ { 0x00001ECF, 0x0000006F, 0x00000309 }, /* LATIN SMALL LETTER O WITH HOOK ABOVE */ { 0x00000151, 0x0000006F, 0x0000030B }, /* LATIN SMALL LETTER O WITH DOUBLE ACUTE */ { 0x000001D2, 0x0000006F, 0x0000030C }, /* LATIN SMALL LETTER O WITH CARON */ { 0x0000020D, 0x0000006F, 0x0000030F }, /* LATIN SMALL LETTER O WITH DOUBLE GRAVE */ { 0x0000020F, 0x0000006F, 0x00000311 }, /* LATIN SMALL LETTER O WITH INVERTED BREVE */ { 0x000001A1, 0x0000006F, 0x0000031B }, /* LATIN SMALL LETTER O WITH HORN */ { 0x00001ECD, 0x0000006F, 0x00000323 }, /* LATIN SMALL LETTER O WITH DOT BELOW */ { 0x000001EB, 0x0000006F, 0x00000328 }, /* LATIN SMALL LETTER O WITH OGONEK */ { 0x00001E55, 0x00000070, 0x00000301 }, /* LATIN SMALL LETTER P WITH ACUTE */ { 0x00001E57, 0x00000070, 0x00000307 }, /* LATIN SMALL LETTER P WITH DOT ABOVE */ { 0x00000155, 0x00000072, 0x00000301 }, /* LATIN SMALL LETTER R WITH ACUTE */ { 0x00001E59, 0x00000072, 0x00000307 }, /* LATIN SMALL LETTER R WITH DOT ABOVE */ { 0x00000159, 0x00000072, 0x0000030C }, /* LATIN SMALL LETTER R WITH CARON */ { 0x00000211, 0x00000072, 0x0000030F }, /* LATIN SMALL LETTER R WITH DOUBLE GRAVE */ { 0x00000213, 0x00000072, 0x00000311 }, /* LATIN SMALL LETTER R WITH INVERTED BREVE */ { 0x00001E5B, 0x00000072, 0x00000323 }, /* LATIN SMALL LETTER R WITH DOT BELOW */ { 0x00000157, 0x00000072, 0x00000327 }, /* LATIN SMALL LETTER R WITH CEDILLA */ { 0x00001E5F, 0x00000072, 0x00000331 }, /* LATIN SMALL LETTER R WITH LINE BELOW */ { 0x0000015B, 0x00000073, 0x00000301 }, /* LATIN SMALL LETTER S WITH ACUTE */ { 0x0000015D, 0x00000073, 0x00000302 }, /* LATIN SMALL LETTER S WITH CIRCUMFLEX */ { 0x00001E61, 0x00000073, 0x00000307 }, /* LATIN SMALL LETTER S WITH DOT ABOVE */ { 0x00000161, 0x00000073, 0x0000030C }, /* LATIN SMALL LETTER S WITH CARON */ { 0x00001E63, 0x00000073, 0x00000323 }, /* LATIN SMALL LETTER S WITH DOT BELOW */ { 0x00000219, 0x00000073, 0x00000326 }, /* LATIN SMALL LETTER S WITH COMMA BELOW */ { 0x0000015F, 0x00000073, 0x00000327 }, /* LATIN SMALL LETTER S WITH CEDILLA */ { 0x00001E6B, 0x00000074, 0x00000307 }, /* LATIN SMALL LETTER T WITH DOT ABOVE */ { 0x00001E97, 0x00000074, 0x00000308 }, /* LATIN SMALL LETTER T WITH DIAERESIS */ { 0x00000165, 0x00000074, 0x0000030C }, /* LATIN SMALL LETTER T WITH CARON */ { 0x00001E6D, 0x00000074, 0x00000323 }, /* LATIN SMALL LETTER T WITH DOT BELOW */ { 0x0000021B, 0x00000074, 0x00000326 }, /* LATIN SMALL LETTER T WITH COMMA BELOW */ { 0x00000163, 0x00000074, 0x00000327 }, /* LATIN SMALL LETTER T WITH CEDILLA */ { 0x00001E71, 0x00000074, 0x0000032D }, /* LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW */ { 0x00001E6F, 0x00000074, 0x00000331 }, /* LATIN SMALL LETTER T WITH LINE BELOW */ { 0x000000F9, 0x00000075, 0x00000300 }, /* LATIN SMALL LETTER U WITH GRAVE */ { 0x000000FA, 0x00000075, 0x00000301 }, /* LATIN SMALL LETTER U WITH ACUTE */ { 0x000000FB, 0x00000075, 0x00000302 }, /* LATIN SMALL LETTER U WITH CIRCUMFLEX */ { 0x00000169, 0x00000075, 0x00000303 }, /* LATIN SMALL LETTER U WITH TILDE */ { 0x0000016B, 0x00000075, 0x00000304 }, /* LATIN SMALL LETTER U WITH MACRON */ { 0x0000016D, 0x00000075, 0x00000306 }, /* LATIN SMALL LETTER U WITH BREVE */ { 0x000000FC, 0x00000075, 0x00000308 }, /* LATIN SMALL LETTER U WITH DIAERESIS */ { 0x00001EE7, 0x00000075, 0x00000309 }, /* LATIN SMALL LETTER U WITH HOOK ABOVE */ { 0x0000016F, 0x00000075, 0x0000030A }, /* LATIN SMALL LETTER U WITH RING ABOVE */ { 0x00000171, 0x00000075, 0x0000030B }, /* LATIN SMALL LETTER U WITH DOUBLE ACUTE */ { 0x000001D4, 0x00000075, 0x0000030C }, /* LATIN SMALL LETTER U WITH CARON */ { 0x00000215, 0x00000075, 0x0000030F }, /* LATIN SMALL LETTER U WITH DOUBLE GRAVE */ { 0x00000217, 0x00000075, 0x00000311 }, /* LATIN SMALL LETTER U WITH INVERTED BREVE */ { 0x000001B0, 0x00000075, 0x0000031B }, /* LATIN SMALL LETTER U WITH HORN */ { 0x00001EE5, 0x00000075, 0x00000323 }, /* LATIN SMALL LETTER U WITH DOT BELOW */ { 0x00001E73, 0x00000075, 0x00000324 }, /* LATIN SMALL LETTER U WITH DIAERESIS BELOW */ { 0x00000173, 0x00000075, 0x00000328 }, /* LATIN SMALL LETTER U WITH OGONEK */ { 0x00001E77, 0x00000075, 0x0000032D }, /* LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW */ { 0x00001E75, 0x00000075, 0x00000330 }, /* LATIN SMALL LETTER U WITH TILDE BELOW */ { 0x00001E7D, 0x00000076, 0x00000303 }, /* LATIN SMALL LETTER V WITH TILDE */ { 0x00001E7F, 0x00000076, 0x00000323 }, /* LATIN SMALL LETTER V WITH DOT BELOW */ { 0x00001E81, 0x00000077, 0x00000300 }, /* LATIN SMALL LETTER W WITH GRAVE */ { 0x00001E83, 0x00000077, 0x00000301 }, /* LATIN SMALL LETTER W WITH ACUTE */ { 0x00000175, 0x00000077, 0x00000302 }, /* LATIN SMALL LETTER W WITH CIRCUMFLEX */ { 0x00001E87, 0x00000077, 0x00000307 }, /* LATIN SMALL LETTER W WITH DOT ABOVE */ { 0x00001E85, 0x00000077, 0x00000308 }, /* LATIN SMALL LETTER W WITH DIAERESIS */ { 0x00001E98, 0x00000077, 0x0000030A }, /* LATIN SMALL LETTER W WITH RING ABOVE */ { 0x00001E89, 0x00000077, 0x00000323 }, /* LATIN SMALL LETTER W WITH DOT BELOW */ { 0x00001E8B, 0x00000078, 0x00000307 }, /* LATIN SMALL LETTER X WITH DOT ABOVE */ { 0x00001E8D, 0x00000078, 0x00000308 }, /* LATIN SMALL LETTER X WITH DIAERESIS */ { 0x00001EF3, 0x00000079, 0x00000300 }, /* LATIN SMALL LETTER Y WITH GRAVE */ { 0x000000FD, 0x00000079, 0x00000301 }, /* LATIN SMALL LETTER Y WITH ACUTE */ { 0x00000177, 0x00000079, 0x00000302 }, /* LATIN SMALL LETTER Y WITH CIRCUMFLEX */ { 0x00001EF9, 0x00000079, 0x00000303 }, /* LATIN SMALL LETTER Y WITH TILDE */ { 0x00000233, 0x00000079, 0x00000304 }, /* LATIN SMALL LETTER Y WITH MACRON */ { 0x00001E8F, 0x00000079, 0x00000307 }, /* LATIN SMALL LETTER Y WITH DOT ABOVE */ { 0x000000FF, 0x00000079, 0x00000308 }, /* LATIN SMALL LETTER Y WITH DIAERESIS */ { 0x00001EF7, 0x00000079, 0x00000309 }, /* LATIN SMALL LETTER Y WITH HOOK ABOVE */ { 0x00001E99, 0x00000079, 0x0000030A }, /* LATIN SMALL LETTER Y WITH RING ABOVE */ { 0x00001EF5, 0x00000079, 0x00000323 }, /* LATIN SMALL LETTER Y WITH DOT BELOW */ { 0x0000017A, 0x0000007A, 0x00000301 }, /* LATIN SMALL LETTER Z WITH ACUTE */ { 0x00001E91, 0x0000007A, 0x00000302 }, /* LATIN SMALL LETTER Z WITH CIRCUMFLEX */ { 0x0000017C, 0x0000007A, 0x00000307 }, /* LATIN SMALL LETTER Z WITH DOT ABOVE */ { 0x0000017E, 0x0000007A, 0x0000030C }, /* LATIN SMALL LETTER Z WITH CARON */ { 0x00001E93, 0x0000007A, 0x00000323 }, /* LATIN SMALL LETTER Z WITH DOT BELOW */ { 0x00001E95, 0x0000007A, 0x00000331 }, /* LATIN SMALL LETTER Z WITH LINE BELOW */ { 0x00001FED, 0x000000A8, 0x00000300 }, /* GREEK DIALYTIKA AND VARIA */ { 0x00000385, 0x000000A8, 0x00000301 }, /* GREEK DIALYTIKA TONOS */ { 0x00001FC1, 0x000000A8, 0x00000342 }, /* GREEK DIALYTIKA AND PERISPOMENI */ { 0x00001EA6, 0x000000C2, 0x00000300 }, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE */ { 0x00001EA4, 0x000000C2, 0x00000301 }, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE */ { 0x00001EAA, 0x000000C2, 0x00000303 }, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE */ { 0x00001EA8, 0x000000C2, 0x00000309 }, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE */ { 0x000001DE, 0x000000C4, 0x00000304 }, /* LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON */ { 0x000001FA, 0x000000C5, 0x00000301 }, /* LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE */ { 0x000001FC, 0x000000C6, 0x00000301 }, /* LATIN CAPITAL LETTER AE WITH ACUTE */ { 0x000001E2, 0x000000C6, 0x00000304 }, /* LATIN CAPITAL LETTER AE WITH MACRON */ { 0x00001E08, 0x000000C7, 0x00000301 }, /* LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE */ { 0x00001EC0, 0x000000CA, 0x00000300 }, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE */ { 0x00001EBE, 0x000000CA, 0x00000301 }, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE */ { 0x00001EC4, 0x000000CA, 0x00000303 }, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE */ { 0x00001EC2, 0x000000CA, 0x00000309 }, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE */ { 0x00001E2E, 0x000000CF, 0x00000301 }, /* LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE */ { 0x00001ED2, 0x000000D4, 0x00000300 }, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE */ { 0x00001ED0, 0x000000D4, 0x00000301 }, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE */ { 0x00001ED6, 0x000000D4, 0x00000303 }, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE */ { 0x00001ED4, 0x000000D4, 0x00000309 }, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE */ { 0x00001E4C, 0x000000D5, 0x00000301 }, /* LATIN CAPITAL LETTER O WITH TILDE AND ACUTE */ { 0x0000022C, 0x000000D5, 0x00000304 }, /* LATIN CAPITAL LETTER O WITH TILDE AND MACRON */ { 0x00001E4E, 0x000000D5, 0x00000308 }, /* LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS */ { 0x0000022A, 0x000000D6, 0x00000304 }, /* LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON */ { 0x000001FE, 0x000000D8, 0x00000301 }, /* LATIN CAPITAL LETTER O WITH STROKE AND ACUTE */ { 0x000001DB, 0x000000DC, 0x00000300 }, /* LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE */ { 0x000001D7, 0x000000DC, 0x00000301 }, /* LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE */ { 0x000001D5, 0x000000DC, 0x00000304 }, /* LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON */ { 0x000001D9, 0x000000DC, 0x0000030C }, /* LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON */ { 0x00001EA7, 0x000000E2, 0x00000300 }, /* LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE */ { 0x00001EA5, 0x000000E2, 0x00000301 }, /* LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE */ { 0x00001EAB, 0x000000E2, 0x00000303 }, /* LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE */ { 0x00001EA9, 0x000000E2, 0x00000309 }, /* LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE */ { 0x000001DF, 0x000000E4, 0x00000304 }, /* LATIN SMALL LETTER A WITH DIAERESIS AND MACRON */ { 0x000001FB, 0x000000E5, 0x00000301 }, /* LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE */ { 0x000001FD, 0x000000E6, 0x00000301 }, /* LATIN SMALL LETTER AE WITH ACUTE */ { 0x000001E3, 0x000000E6, 0x00000304 }, /* LATIN SMALL LETTER AE WITH MACRON */ { 0x00001E09, 0x000000E7, 0x00000301 }, /* LATIN SMALL LETTER C WITH CEDILLA AND ACUTE */ { 0x00001EC1, 0x000000EA, 0x00000300 }, /* LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE */ { 0x00001EBF, 0x000000EA, 0x00000301 }, /* LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE */ { 0x00001EC5, 0x000000EA, 0x00000303 }, /* LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE */ { 0x00001EC3, 0x000000EA, 0x00000309 }, /* LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE */ { 0x00001E2F, 0x000000EF, 0x00000301 }, /* LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE */ { 0x00001ED3, 0x000000F4, 0x00000300 }, /* LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE */ { 0x00001ED1, 0x000000F4, 0x00000301 }, /* LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE */ { 0x00001ED7, 0x000000F4, 0x00000303 }, /* LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE */ { 0x00001ED5, 0x000000F4, 0x00000309 }, /* LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE */ { 0x00001E4D, 0x000000F5, 0x00000301 }, /* LATIN SMALL LETTER O WITH TILDE AND ACUTE */ { 0x0000022D, 0x000000F5, 0x00000304 }, /* LATIN SMALL LETTER O WITH TILDE AND MACRON */ { 0x00001E4F, 0x000000F5, 0x00000308 }, /* LATIN SMALL LETTER O WITH TILDE AND DIAERESIS */ { 0x0000022B, 0x000000F6, 0x00000304 }, /* LATIN SMALL LETTER O WITH DIAERESIS AND MACRON */ { 0x000001FF, 0x000000F8, 0x00000301 }, /* LATIN SMALL LETTER O WITH STROKE AND ACUTE */ { 0x000001DC, 0x000000FC, 0x00000300 }, /* LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE */ { 0x000001D8, 0x000000FC, 0x00000301 }, /* LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE */ { 0x000001D6, 0x000000FC, 0x00000304 }, /* LATIN SMALL LETTER U WITH DIAERESIS AND MACRON */ { 0x000001DA, 0x000000FC, 0x0000030C }, /* LATIN SMALL LETTER U WITH DIAERESIS AND CARON */ { 0x00001EB0, 0x00000102, 0x00000300 }, /* LATIN CAPITAL LETTER A WITH BREVE AND GRAVE */ { 0x00001EAE, 0x00000102, 0x00000301 }, /* LATIN CAPITAL LETTER A WITH BREVE AND ACUTE */ { 0x00001EB4, 0x00000102, 0x00000303 }, /* LATIN CAPITAL LETTER A WITH BREVE AND TILDE */ { 0x00001EB2, 0x00000102, 0x00000309 }, /* LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE */ { 0x00001EB1, 0x00000103, 0x00000300 }, /* LATIN SMALL LETTER A WITH BREVE AND GRAVE */ { 0x00001EAF, 0x00000103, 0x00000301 }, /* LATIN SMALL LETTER A WITH BREVE AND ACUTE */ { 0x00001EB5, 0x00000103, 0x00000303 }, /* LATIN SMALL LETTER A WITH BREVE AND TILDE */ { 0x00001EB3, 0x00000103, 0x00000309 }, /* LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE */ { 0x00001E14, 0x00000112, 0x00000300 }, /* LATIN CAPITAL LETTER E WITH MACRON AND GRAVE */ { 0x00001E16, 0x00000112, 0x00000301 }, /* LATIN CAPITAL LETTER E WITH MACRON AND ACUTE */ { 0x00001E15, 0x00000113, 0x00000300 }, /* LATIN SMALL LETTER E WITH MACRON AND GRAVE */ { 0x00001E17, 0x00000113, 0x00000301 }, /* LATIN SMALL LETTER E WITH MACRON AND ACUTE */ { 0x00001E50, 0x0000014C, 0x00000300 }, /* LATIN CAPITAL LETTER O WITH MACRON AND GRAVE */ { 0x00001E52, 0x0000014C, 0x00000301 }, /* LATIN CAPITAL LETTER O WITH MACRON AND ACUTE */ { 0x00001E51, 0x0000014D, 0x00000300 }, /* LATIN SMALL LETTER O WITH MACRON AND GRAVE */ { 0x00001E53, 0x0000014D, 0x00000301 }, /* LATIN SMALL LETTER O WITH MACRON AND ACUTE */ { 0x00001E64, 0x0000015A, 0x00000307 }, /* LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE */ { 0x00001E65, 0x0000015B, 0x00000307 }, /* LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE */ { 0x00001E66, 0x00000160, 0x00000307 }, /* LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE */ { 0x00001E67, 0x00000161, 0x00000307 }, /* LATIN SMALL LETTER S WITH CARON AND DOT ABOVE */ { 0x00001E78, 0x00000168, 0x00000301 }, /* LATIN CAPITAL LETTER U WITH TILDE AND ACUTE */ { 0x00001E79, 0x00000169, 0x00000301 }, /* LATIN SMALL LETTER U WITH TILDE AND ACUTE */ { 0x00001E7A, 0x0000016A, 0x00000308 }, /* LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS */ { 0x00001E7B, 0x0000016B, 0x00000308 }, /* LATIN SMALL LETTER U WITH MACRON AND DIAERESIS */ { 0x00001E9B, 0x0000017F, 0x00000307 }, /* LATIN SMALL LETTER LONG S WITH DOT ABOVE */ { 0x00001EDC, 0x000001A0, 0x00000300 }, /* LATIN CAPITAL LETTER O WITH HORN AND GRAVE */ { 0x00001EDA, 0x000001A0, 0x00000301 }, /* LATIN CAPITAL LETTER O WITH HORN AND ACUTE */ { 0x00001EE0, 0x000001A0, 0x00000303 }, /* LATIN CAPITAL LETTER O WITH HORN AND TILDE */ { 0x00001EDE, 0x000001A0, 0x00000309 }, /* LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE */ { 0x00001EE2, 0x000001A0, 0x00000323 }, /* LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW */ { 0x00001EDD, 0x000001A1, 0x00000300 }, /* LATIN SMALL LETTER O WITH HORN AND GRAVE */ { 0x00001EDB, 0x000001A1, 0x00000301 }, /* LATIN SMALL LETTER O WITH HORN AND ACUTE */ { 0x00001EE1, 0x000001A1, 0x00000303 }, /* LATIN SMALL LETTER O WITH HORN AND TILDE */ { 0x00001EDF, 0x000001A1, 0x00000309 }, /* LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE */ { 0x00001EE3, 0x000001A1, 0x00000323 }, /* LATIN SMALL LETTER O WITH HORN AND DOT BELOW */ { 0x00001EEA, 0x000001AF, 0x00000300 }, /* LATIN CAPITAL LETTER U WITH HORN AND GRAVE */ { 0x00001EE8, 0x000001AF, 0x00000301 }, /* LATIN CAPITAL LETTER U WITH HORN AND ACUTE */ { 0x00001EEE, 0x000001AF, 0x00000303 }, /* LATIN CAPITAL LETTER U WITH HORN AND TILDE */ { 0x00001EEC, 0x000001AF, 0x00000309 }, /* LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE */ { 0x00001EF0, 0x000001AF, 0x00000323 }, /* LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW */ { 0x00001EEB, 0x000001B0, 0x00000300 }, /* LATIN SMALL LETTER U WITH HORN AND GRAVE */ { 0x00001EE9, 0x000001B0, 0x00000301 }, /* LATIN SMALL LETTER U WITH HORN AND ACUTE */ { 0x00001EEF, 0x000001B0, 0x00000303 }, /* LATIN SMALL LETTER U WITH HORN AND TILDE */ { 0x00001EED, 0x000001B0, 0x00000309 }, /* LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE */ { 0x00001EF1, 0x000001B0, 0x00000323 }, /* LATIN SMALL LETTER U WITH HORN AND DOT BELOW */ { 0x000001EE, 0x000001B7, 0x0000030C }, /* LATIN CAPITAL LETTER EZH WITH CARON */ { 0x000001EC, 0x000001EA, 0x00000304 }, /* LATIN CAPITAL LETTER O WITH OGONEK AND MACRON */ { 0x000001ED, 0x000001EB, 0x00000304 }, /* LATIN SMALL LETTER O WITH OGONEK AND MACRON */ { 0x000001E0, 0x00000226, 0x00000304 }, /* LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON */ { 0x000001E1, 0x00000227, 0x00000304 }, /* LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON */ { 0x00001E1C, 0x00000228, 0x00000306 }, /* LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE */ { 0x00001E1D, 0x00000229, 0x00000306 }, /* LATIN SMALL LETTER E WITH CEDILLA AND BREVE */ { 0x00000230, 0x0000022E, 0x00000304 }, /* LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON */ { 0x00000231, 0x0000022F, 0x00000304 }, /* LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON */ { 0x000001EF, 0x00000292, 0x0000030C }, /* LATIN SMALL LETTER EZH WITH CARON */ { 0x00000344, 0x00000308, 0x00000301 }, /* COMBINING GREEK DIALYTIKA TONOS */ { 0x00001FBA, 0x00000391, 0x00000300 }, /* GREEK CAPITAL LETTER ALPHA WITH VARIA */ { 0x00000386, 0x00000391, 0x00000301 }, /* GREEK CAPITAL LETTER ALPHA WITH TONOS */ { 0x00001FB9, 0x00000391, 0x00000304 }, /* GREEK CAPITAL LETTER ALPHA WITH MACRON */ { 0x00001FB8, 0x00000391, 0x00000306 }, /* GREEK CAPITAL LETTER ALPHA WITH VRACHY */ { 0x00001F08, 0x00000391, 0x00000313 }, /* GREEK CAPITAL LETTER ALPHA WITH PSILI */ { 0x00001F09, 0x00000391, 0x00000314 }, /* GREEK CAPITAL LETTER ALPHA WITH DASIA */ { 0x00001FBC, 0x00000391, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI */ { 0x00001FC8, 0x00000395, 0x00000300 }, /* GREEK CAPITAL LETTER EPSILON WITH VARIA */ { 0x00000388, 0x00000395, 0x00000301 }, /* GREEK CAPITAL LETTER EPSILON WITH TONOS */ { 0x00001F18, 0x00000395, 0x00000313 }, /* GREEK CAPITAL LETTER EPSILON WITH PSILI */ { 0x00001F19, 0x00000395, 0x00000314 }, /* GREEK CAPITAL LETTER EPSILON WITH DASIA */ { 0x00001FCA, 0x00000397, 0x00000300 }, /* GREEK CAPITAL LETTER ETA WITH VARIA */ { 0x00000389, 0x00000397, 0x00000301 }, /* GREEK CAPITAL LETTER ETA WITH TONOS */ { 0x00001F28, 0x00000397, 0x00000313 }, /* GREEK CAPITAL LETTER ETA WITH PSILI */ { 0x00001F29, 0x00000397, 0x00000314 }, /* GREEK CAPITAL LETTER ETA WITH DASIA */ { 0x00001FCC, 0x00000397, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI */ { 0x00001FDA, 0x00000399, 0x00000300 }, /* GREEK CAPITAL LETTER IOTA WITH VARIA */ { 0x0000038A, 0x00000399, 0x00000301 }, /* GREEK CAPITAL LETTER IOTA WITH TONOS */ { 0x00001FD9, 0x00000399, 0x00000304 }, /* GREEK CAPITAL LETTER IOTA WITH MACRON */ { 0x00001FD8, 0x00000399, 0x00000306 }, /* GREEK CAPITAL LETTER IOTA WITH VRACHY */ { 0x000003AA, 0x00000399, 0x00000308 }, /* GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */ { 0x00001F38, 0x00000399, 0x00000313 }, /* GREEK CAPITAL LETTER IOTA WITH PSILI */ { 0x00001F39, 0x00000399, 0x00000314 }, /* GREEK CAPITAL LETTER IOTA WITH DASIA */ { 0x00001FF8, 0x0000039F, 0x00000300 }, /* GREEK CAPITAL LETTER OMICRON WITH VARIA */ { 0x0000038C, 0x0000039F, 0x00000301 }, /* GREEK CAPITAL LETTER OMICRON WITH TONOS */ { 0x00001F48, 0x0000039F, 0x00000313 }, /* GREEK CAPITAL LETTER OMICRON WITH PSILI */ { 0x00001F49, 0x0000039F, 0x00000314 }, /* GREEK CAPITAL LETTER OMICRON WITH DASIA */ { 0x00001FEC, 0x000003A1, 0x00000314 }, /* GREEK CAPITAL LETTER RHO WITH DASIA */ { 0x00001FEA, 0x000003A5, 0x00000300 }, /* GREEK CAPITAL LETTER UPSILON WITH VARIA */ { 0x0000038E, 0x000003A5, 0x00000301 }, /* GREEK CAPITAL LETTER UPSILON WITH TONOS */ { 0x00001FE9, 0x000003A5, 0x00000304 }, /* GREEK CAPITAL LETTER UPSILON WITH MACRON */ { 0x00001FE8, 0x000003A5, 0x00000306 }, /* GREEK CAPITAL LETTER UPSILON WITH VRACHY */ { 0x000003AB, 0x000003A5, 0x00000308 }, /* GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */ { 0x00001F59, 0x000003A5, 0x00000314 }, /* GREEK CAPITAL LETTER UPSILON WITH DASIA */ { 0x00001FFA, 0x000003A9, 0x00000300 }, /* GREEK CAPITAL LETTER OMEGA WITH VARIA */ { 0x0000038F, 0x000003A9, 0x00000301 }, /* GREEK CAPITAL LETTER OMEGA WITH TONOS */ { 0x00001F68, 0x000003A9, 0x00000313 }, /* GREEK CAPITAL LETTER OMEGA WITH PSILI */ { 0x00001F69, 0x000003A9, 0x00000314 }, /* GREEK CAPITAL LETTER OMEGA WITH DASIA */ { 0x00001FFC, 0x000003A9, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI */ { 0x00001FB4, 0x000003AC, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI */ { 0x00001FC4, 0x000003AE, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI */ { 0x00001F70, 0x000003B1, 0x00000300 }, /* GREEK SMALL LETTER ALPHA WITH VARIA */ { 0x000003AC, 0x000003B1, 0x00000301 }, /* GREEK SMALL LETTER ALPHA WITH TONOS */ { 0x00001FB1, 0x000003B1, 0x00000304 }, /* GREEK SMALL LETTER ALPHA WITH MACRON */ { 0x00001FB0, 0x000003B1, 0x00000306 }, /* GREEK SMALL LETTER ALPHA WITH VRACHY */ { 0x00001F00, 0x000003B1, 0x00000313 }, /* GREEK SMALL LETTER ALPHA WITH PSILI */ { 0x00001F01, 0x000003B1, 0x00000314 }, /* GREEK SMALL LETTER ALPHA WITH DASIA */ { 0x00001FB6, 0x000003B1, 0x00000342 }, /* GREEK SMALL LETTER ALPHA WITH PERISPOMENI */ { 0x00001FB3, 0x000003B1, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI */ { 0x00001F72, 0x000003B5, 0x00000300 }, /* GREEK SMALL LETTER EPSILON WITH VARIA */ { 0x000003AD, 0x000003B5, 0x00000301 }, /* GREEK SMALL LETTER EPSILON WITH TONOS */ { 0x00001F10, 0x000003B5, 0x00000313 }, /* GREEK SMALL LETTER EPSILON WITH PSILI */ { 0x00001F11, 0x000003B5, 0x00000314 }, /* GREEK SMALL LETTER EPSILON WITH DASIA */ { 0x00001F74, 0x000003B7, 0x00000300 }, /* GREEK SMALL LETTER ETA WITH VARIA */ { 0x000003AE, 0x000003B7, 0x00000301 }, /* GREEK SMALL LETTER ETA WITH TONOS */ { 0x00001F20, 0x000003B7, 0x00000313 }, /* GREEK SMALL LETTER ETA WITH PSILI */ { 0x00001F21, 0x000003B7, 0x00000314 }, /* GREEK SMALL LETTER ETA WITH DASIA */ { 0x00001FC6, 0x000003B7, 0x00000342 }, /* GREEK SMALL LETTER ETA WITH PERISPOMENI */ { 0x00001FC3, 0x000003B7, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI */ { 0x00001F76, 0x000003B9, 0x00000300 }, /* GREEK SMALL LETTER IOTA WITH VARIA */ { 0x000003AF, 0x000003B9, 0x00000301 }, /* GREEK SMALL LETTER IOTA WITH TONOS */ { 0x00001FD1, 0x000003B9, 0x00000304 }, /* GREEK SMALL LETTER IOTA WITH MACRON */ { 0x00001FD0, 0x000003B9, 0x00000306 }, /* GREEK SMALL LETTER IOTA WITH VRACHY */ { 0x000003CA, 0x000003B9, 0x00000308 }, /* GREEK SMALL LETTER IOTA WITH DIALYTIKA */ { 0x00001F30, 0x000003B9, 0x00000313 }, /* GREEK SMALL LETTER IOTA WITH PSILI */ { 0x00001F31, 0x000003B9, 0x00000314 }, /* GREEK SMALL LETTER IOTA WITH DASIA */ { 0x00001FD6, 0x000003B9, 0x00000342 }, /* GREEK SMALL LETTER IOTA WITH PERISPOMENI */ { 0x00001F78, 0x000003BF, 0x00000300 }, /* GREEK SMALL LETTER OMICRON WITH VARIA */ { 0x000003CC, 0x000003BF, 0x00000301 }, /* GREEK SMALL LETTER OMICRON WITH TONOS */ { 0x00001F40, 0x000003BF, 0x00000313 }, /* GREEK SMALL LETTER OMICRON WITH PSILI */ { 0x00001F41, 0x000003BF, 0x00000314 }, /* GREEK SMALL LETTER OMICRON WITH DASIA */ { 0x00001FE4, 0x000003C1, 0x00000313 }, /* GREEK SMALL LETTER RHO WITH PSILI */ { 0x00001FE5, 0x000003C1, 0x00000314 }, /* GREEK SMALL LETTER RHO WITH DASIA */ { 0x00001F7A, 0x000003C5, 0x00000300 }, /* GREEK SMALL LETTER UPSILON WITH VARIA */ { 0x000003CD, 0x000003C5, 0x00000301 }, /* GREEK SMALL LETTER UPSILON WITH TONOS */ { 0x00001FE1, 0x000003C5, 0x00000304 }, /* GREEK SMALL LETTER UPSILON WITH MACRON */ { 0x00001FE0, 0x000003C5, 0x00000306 }, /* GREEK SMALL LETTER UPSILON WITH VRACHY */ { 0x000003CB, 0x000003C5, 0x00000308 }, /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA */ { 0x00001F50, 0x000003C5, 0x00000313 }, /* GREEK SMALL LETTER UPSILON WITH PSILI */ { 0x00001F51, 0x000003C5, 0x00000314 }, /* GREEK SMALL LETTER UPSILON WITH DASIA */ { 0x00001FE6, 0x000003C5, 0x00000342 }, /* GREEK SMALL LETTER UPSILON WITH PERISPOMENI */ { 0x00001F7C, 0x000003C9, 0x00000300 }, /* GREEK SMALL LETTER OMEGA WITH VARIA */ { 0x000003CE, 0x000003C9, 0x00000301 }, /* GREEK SMALL LETTER OMEGA WITH TONOS */ { 0x00001F60, 0x000003C9, 0x00000313 }, /* GREEK SMALL LETTER OMEGA WITH PSILI */ { 0x00001F61, 0x000003C9, 0x00000314 }, /* GREEK SMALL LETTER OMEGA WITH DASIA */ { 0x00001FF6, 0x000003C9, 0x00000342 }, /* GREEK SMALL LETTER OMEGA WITH PERISPOMENI */ { 0x00001FF3, 0x000003C9, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI */ { 0x00001FD2, 0x000003CA, 0x00000300 }, /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA */ { 0x00000390, 0x000003CA, 0x00000301 }, /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */ { 0x00001FD7, 0x000003CA, 0x00000342 }, /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI */ { 0x00001FE2, 0x000003CB, 0x00000300 }, /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA */ { 0x000003B0, 0x000003CB, 0x00000301 }, /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */ { 0x00001FE7, 0x000003CB, 0x00000342 }, /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI */ { 0x00001FF4, 0x000003CE, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI */ { 0x000003D3, 0x000003D2, 0x00000301 }, /* GREEK UPSILON WITH ACUTE AND HOOK SYMBOL */ { 0x000003D4, 0x000003D2, 0x00000308 }, /* GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL */ { 0x00000407, 0x00000406, 0x00000308 }, /* CYRILLIC CAPITAL LETTER YI */ { 0x000004D0, 0x00000410, 0x00000306 }, /* CYRILLIC CAPITAL LETTER A WITH BREVE */ { 0x000004D2, 0x00000410, 0x00000308 }, /* CYRILLIC CAPITAL LETTER A WITH DIAERESIS */ { 0x00000403, 0x00000413, 0x00000301 }, /* CYRILLIC CAPITAL LETTER GJE */ { 0x00000400, 0x00000415, 0x00000300 }, /* CYRILLIC CAPITAL LETTER IE WITH GRAVE */ { 0x000004D6, 0x00000415, 0x00000306 }, /* CYRILLIC CAPITAL LETTER IE WITH BREVE */ { 0x00000401, 0x00000415, 0x00000308 }, /* CYRILLIC CAPITAL LETTER IO */ { 0x000004C1, 0x00000416, 0x00000306 }, /* CYRILLIC CAPITAL LETTER ZHE WITH BREVE */ { 0x000004DC, 0x00000416, 0x00000308 }, /* CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS */ { 0x000004DE, 0x00000417, 0x00000308 }, /* CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS */ { 0x0000040D, 0x00000418, 0x00000300 }, /* CYRILLIC CAPITAL LETTER I WITH GRAVE */ { 0x000004E2, 0x00000418, 0x00000304 }, /* CYRILLIC CAPITAL LETTER I WITH MACRON */ { 0x00000419, 0x00000418, 0x00000306 }, /* CYRILLIC CAPITAL LETTER SHORT I */ { 0x000004E4, 0x00000418, 0x00000308 }, /* CYRILLIC CAPITAL LETTER I WITH DIAERESIS */ { 0x0000040C, 0x0000041A, 0x00000301 }, /* CYRILLIC CAPITAL LETTER KJE */ { 0x000004E6, 0x0000041E, 0x00000308 }, /* CYRILLIC CAPITAL LETTER O WITH DIAERESIS */ { 0x000004EE, 0x00000423, 0x00000304 }, /* CYRILLIC CAPITAL LETTER U WITH MACRON */ { 0x0000040E, 0x00000423, 0x00000306 }, /* CYRILLIC CAPITAL LETTER SHORT U */ { 0x000004F0, 0x00000423, 0x00000308 }, /* CYRILLIC CAPITAL LETTER U WITH DIAERESIS */ { 0x000004F2, 0x00000423, 0x0000030B }, /* CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE */ { 0x000004F4, 0x00000427, 0x00000308 }, /* CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS */ { 0x000004F8, 0x0000042B, 0x00000308 }, /* CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS */ { 0x000004EC, 0x0000042D, 0x00000308 }, /* CYRILLIC CAPITAL LETTER E WITH DIAERESIS */ { 0x000004D1, 0x00000430, 0x00000306 }, /* CYRILLIC SMALL LETTER A WITH BREVE */ { 0x000004D3, 0x00000430, 0x00000308 }, /* CYRILLIC SMALL LETTER A WITH DIAERESIS */ { 0x00000453, 0x00000433, 0x00000301 }, /* CYRILLIC SMALL LETTER GJE */ { 0x00000450, 0x00000435, 0x00000300 }, /* CYRILLIC SMALL LETTER IE WITH GRAVE */ { 0x000004D7, 0x00000435, 0x00000306 }, /* CYRILLIC SMALL LETTER IE WITH BREVE */ { 0x00000451, 0x00000435, 0x00000308 }, /* CYRILLIC SMALL LETTER IO */ { 0x000004C2, 0x00000436, 0x00000306 }, /* CYRILLIC SMALL LETTER ZHE WITH BREVE */ { 0x000004DD, 0x00000436, 0x00000308 }, /* CYRILLIC SMALL LETTER ZHE WITH DIAERESIS */ { 0x000004DF, 0x00000437, 0x00000308 }, /* CYRILLIC SMALL LETTER ZE WITH DIAERESIS */ { 0x0000045D, 0x00000438, 0x00000300 }, /* CYRILLIC SMALL LETTER I WITH GRAVE */ { 0x000004E3, 0x00000438, 0x00000304 }, /* CYRILLIC SMALL LETTER I WITH MACRON */ { 0x00000439, 0x00000438, 0x00000306 }, /* CYRILLIC SMALL LETTER SHORT I */ { 0x000004E5, 0x00000438, 0x00000308 }, /* CYRILLIC SMALL LETTER I WITH DIAERESIS */ { 0x0000045C, 0x0000043A, 0x00000301 }, /* CYRILLIC SMALL LETTER KJE */ { 0x000004E7, 0x0000043E, 0x00000308 }, /* CYRILLIC SMALL LETTER O WITH DIAERESIS */ { 0x000004EF, 0x00000443, 0x00000304 }, /* CYRILLIC SMALL LETTER U WITH MACRON */ { 0x0000045E, 0x00000443, 0x00000306 }, /* CYRILLIC SMALL LETTER SHORT U */ { 0x000004F1, 0x00000443, 0x00000308 }, /* CYRILLIC SMALL LETTER U WITH DIAERESIS */ { 0x000004F3, 0x00000443, 0x0000030B }, /* CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE */ { 0x000004F5, 0x00000447, 0x00000308 }, /* CYRILLIC SMALL LETTER CHE WITH DIAERESIS */ { 0x000004F9, 0x0000044B, 0x00000308 }, /* CYRILLIC SMALL LETTER YERU WITH DIAERESIS */ { 0x000004ED, 0x0000044D, 0x00000308 }, /* CYRILLIC SMALL LETTER E WITH DIAERESIS */ { 0x00000457, 0x00000456, 0x00000308 }, /* CYRILLIC SMALL LETTER YI */ { 0x00000476, 0x00000474, 0x0000030F }, /* CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT */ { 0x00000477, 0x00000475, 0x0000030F }, /* CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT */ { 0x000004DA, 0x000004D8, 0x00000308 }, /* CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS */ { 0x000004DB, 0x000004D9, 0x00000308 }, /* CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS */ { 0x000004EA, 0x000004E8, 0x00000308 }, /* CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS */ { 0x000004EB, 0x000004E9, 0x00000308 }, /* CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS */ { 0x0000FB2E, 0x000005D0, 0x000005B7 }, /* HEBREW LETTER ALEF WITH PATAH */ { 0x0000FB2F, 0x000005D0, 0x000005B8 }, /* HEBREW LETTER ALEF WITH QAMATS */ { 0x0000FB30, 0x000005D0, 0x000005BC }, /* HEBREW LETTER ALEF WITH MAPIQ */ { 0x0000FB31, 0x000005D1, 0x000005BC }, /* HEBREW LETTER BET WITH DAGESH */ { 0x0000FB4C, 0x000005D1, 0x000005BF }, /* HEBREW LETTER BET WITH RAFE */ { 0x0000FB32, 0x000005D2, 0x000005BC }, /* HEBREW LETTER GIMEL WITH DAGESH */ { 0x0000FB33, 0x000005D3, 0x000005BC }, /* HEBREW LETTER DALET WITH DAGESH */ { 0x0000FB34, 0x000005D4, 0x000005BC }, /* HEBREW LETTER HE WITH MAPIQ */ { 0x0000FB4B, 0x000005D5, 0x000005B9 }, /* HEBREW LETTER VAV WITH HOLAM */ { 0x0000FB35, 0x000005D5, 0x000005BC }, /* HEBREW LETTER VAV WITH DAGESH */ { 0x0000FB36, 0x000005D6, 0x000005BC }, /* HEBREW LETTER ZAYIN WITH DAGESH */ { 0x0000FB38, 0x000005D8, 0x000005BC }, /* HEBREW LETTER TET WITH DAGESH */ { 0x0000FB1D, 0x000005D9, 0x000005B4 }, /* HEBREW LETTER YOD WITH HIRIQ */ { 0x0000FB39, 0x000005D9, 0x000005BC }, /* HEBREW LETTER YOD WITH DAGESH */ { 0x0000FB3A, 0x000005DA, 0x000005BC }, /* HEBREW LETTER FINAL KAF WITH DAGESH */ { 0x0000FB3B, 0x000005DB, 0x000005BC }, /* HEBREW LETTER KAF WITH DAGESH */ { 0x0000FB4D, 0x000005DB, 0x000005BF }, /* HEBREW LETTER KAF WITH RAFE */ { 0x0000FB3C, 0x000005DC, 0x000005BC }, /* HEBREW LETTER LAMED WITH DAGESH */ { 0x0000FB3E, 0x000005DE, 0x000005BC }, /* HEBREW LETTER MEM WITH DAGESH */ { 0x0000FB40, 0x000005E0, 0x000005BC }, /* HEBREW LETTER NUN WITH DAGESH */ { 0x0000FB41, 0x000005E1, 0x000005BC }, /* HEBREW LETTER SAMEKH WITH DAGESH */ { 0x0000FB43, 0x000005E3, 0x000005BC }, /* HEBREW LETTER FINAL PE WITH DAGESH */ { 0x0000FB44, 0x000005E4, 0x000005BC }, /* HEBREW LETTER PE WITH DAGESH */ { 0x0000FB4E, 0x000005E4, 0x000005BF }, /* HEBREW LETTER PE WITH RAFE */ { 0x0000FB46, 0x000005E6, 0x000005BC }, /* HEBREW LETTER TSADI WITH DAGESH */ { 0x0000FB47, 0x000005E7, 0x000005BC }, /* HEBREW LETTER QOF WITH DAGESH */ { 0x0000FB48, 0x000005E8, 0x000005BC }, /* HEBREW LETTER RESH WITH DAGESH */ { 0x0000FB49, 0x000005E9, 0x000005BC }, /* HEBREW LETTER SHIN WITH DAGESH */ { 0x0000FB2A, 0x000005E9, 0x000005C1 }, /* HEBREW LETTER SHIN WITH SHIN DOT */ { 0x0000FB2B, 0x000005E9, 0x000005C2 }, /* HEBREW LETTER SHIN WITH SIN DOT */ { 0x0000FB4A, 0x000005EA, 0x000005BC }, /* HEBREW LETTER TAV WITH DAGESH */ { 0x0000FB1F, 0x000005F2, 0x000005B7 }, /* HEBREW LIGATURE YIDDISH YOD YOD PATAH */ { 0x00000622, 0x00000627, 0x00000653 }, /* ARABIC LETTER ALEF WITH MADDA ABOVE */ { 0x00000623, 0x00000627, 0x00000654 }, /* ARABIC LETTER ALEF WITH HAMZA ABOVE */ { 0x00000625, 0x00000627, 0x00000655 }, /* ARABIC LETTER ALEF WITH HAMZA BELOW */ { 0x00000624, 0x00000648, 0x00000654 }, /* ARABIC LETTER WAW WITH HAMZA ABOVE */ { 0x00000626, 0x0000064A, 0x00000654 }, /* ARABIC LETTER YEH WITH HAMZA ABOVE */ { 0x000006C2, 0x000006C1, 0x00000654 }, /* ARABIC LETTER HEH GOAL WITH HAMZA ABOVE */ { 0x000006D3, 0x000006D2, 0x00000654 }, /* ARABIC LETTER YEH BARREE WITH HAMZA ABOVE */ { 0x000006C0, 0x000006D5, 0x00000654 }, /* ARABIC LETTER HEH WITH YEH ABOVE */ { 0x00000958, 0x00000915, 0x0000093C }, /* DEVANAGARI LETTER QA */ { 0x00000959, 0x00000916, 0x0000093C }, /* DEVANAGARI LETTER KHHA */ { 0x0000095A, 0x00000917, 0x0000093C }, /* DEVANAGARI LETTER GHHA */ { 0x0000095B, 0x0000091C, 0x0000093C }, /* DEVANAGARI LETTER ZA */ { 0x0000095C, 0x00000921, 0x0000093C }, /* DEVANAGARI LETTER DDDHA */ { 0x0000095D, 0x00000922, 0x0000093C }, /* DEVANAGARI LETTER RHA */ { 0x00000929, 0x00000928, 0x0000093C }, /* DEVANAGARI LETTER NNNA */ { 0x0000095E, 0x0000092B, 0x0000093C }, /* DEVANAGARI LETTER FA */ { 0x0000095F, 0x0000092F, 0x0000093C }, /* DEVANAGARI LETTER YYA */ { 0x00000931, 0x00000930, 0x0000093C }, /* DEVANAGARI LETTER RRA */ { 0x00000934, 0x00000933, 0x0000093C }, /* DEVANAGARI LETTER LLLA */ { 0x000009DC, 0x000009A1, 0x000009BC }, /* BENGALI LETTER RRA */ { 0x000009DD, 0x000009A2, 0x000009BC }, /* BENGALI LETTER RHA */ { 0x000009DF, 0x000009AF, 0x000009BC }, /* BENGALI LETTER YYA */ { 0x000009CB, 0x000009C7, 0x000009BE }, /* BENGALI VOWEL SIGN O */ { 0x000009CC, 0x000009C7, 0x000009D7 }, /* BENGALI VOWEL SIGN AU */ { 0x00000A59, 0x00000A16, 0x00000A3C }, /* GURMUKHI LETTER KHHA */ { 0x00000A5A, 0x00000A17, 0x00000A3C }, /* GURMUKHI LETTER GHHA */ { 0x00000A5B, 0x00000A1C, 0x00000A3C }, /* GURMUKHI LETTER ZA */ { 0x00000A5E, 0x00000A2B, 0x00000A3C }, /* GURMUKHI LETTER FA */ { 0x00000A33, 0x00000A32, 0x00000A3C }, /* GURMUKHI LETTER LLA */ { 0x00000A36, 0x00000A38, 0x00000A3C }, /* GURMUKHI LETTER SHA */ { 0x00000B5C, 0x00000B21, 0x00000B3C }, /* ORIYA LETTER RRA */ { 0x00000B5D, 0x00000B22, 0x00000B3C }, /* ORIYA LETTER RHA */ { 0x00000B4B, 0x00000B47, 0x00000B3E }, /* ORIYA VOWEL SIGN O */ { 0x00000B48, 0x00000B47, 0x00000B56 }, /* ORIYA VOWEL SIGN AI */ { 0x00000B4C, 0x00000B47, 0x00000B57 }, /* ORIYA VOWEL SIGN AU */ { 0x00000B94, 0x00000B92, 0x00000BD7 }, /* TAMIL LETTER AU */ { 0x00000BCA, 0x00000BC6, 0x00000BBE }, /* TAMIL VOWEL SIGN O */ { 0x00000BCC, 0x00000BC6, 0x00000BD7 }, /* TAMIL VOWEL SIGN AU */ { 0x00000BCB, 0x00000BC7, 0x00000BBE }, /* TAMIL VOWEL SIGN OO */ { 0x00000C48, 0x00000C46, 0x00000C56 }, /* TELUGU VOWEL SIGN AI */ { 0x00000CC0, 0x00000CBF, 0x00000CD5 }, /* KANNADA VOWEL SIGN II */ { 0x00000CCA, 0x00000CC6, 0x00000CC2 }, /* KANNADA VOWEL SIGN O */ { 0x00000CC7, 0x00000CC6, 0x00000CD5 }, /* KANNADA VOWEL SIGN EE */ { 0x00000CC8, 0x00000CC6, 0x00000CD6 }, /* KANNADA VOWEL SIGN AI */ { 0x00000CCB, 0x00000CCA, 0x00000CD5 }, /* KANNADA VOWEL SIGN OO */ { 0x00000D4A, 0x00000D46, 0x00000D3E }, /* MALAYALAM VOWEL SIGN O */ { 0x00000D4C, 0x00000D46, 0x00000D57 }, /* MALAYALAM VOWEL SIGN AU */ { 0x00000D4B, 0x00000D47, 0x00000D3E }, /* MALAYALAM VOWEL SIGN OO */ { 0x00000DDA, 0x00000DD9, 0x00000DCA }, /* SINHALA VOWEL SIGN DIGA KOMBUVA */ { 0x00000DDC, 0x00000DD9, 0x00000DCF }, /* SINHALA VOWEL SIGN KOMBUVA HAA AELA-PILLA */ { 0x00000DDE, 0x00000DD9, 0x00000DDF }, /* SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA */ { 0x00000DDD, 0x00000DDC, 0x00000DCA }, /* SINHALA VOWEL SIGN KOMBUVA HAA DIGA AELA-PILLA */ { 0x00000F69, 0x00000F40, 0x00000FB5 }, /* TIBETAN LETTER KSSA */ { 0x00000F43, 0x00000F42, 0x00000FB7 }, /* TIBETAN LETTER GHA */ { 0x00000F4D, 0x00000F4C, 0x00000FB7 }, /* TIBETAN LETTER DDHA */ { 0x00000F52, 0x00000F51, 0x00000FB7 }, /* TIBETAN LETTER DHA */ { 0x00000F57, 0x00000F56, 0x00000FB7 }, /* TIBETAN LETTER BHA */ { 0x00000F5C, 0x00000F5B, 0x00000FB7 }, /* TIBETAN LETTER DZHA */ { 0x00000F73, 0x00000F71, 0x00000F72 }, /* TIBETAN VOWEL SIGN II */ { 0x00000F75, 0x00000F71, 0x00000F74 }, /* TIBETAN VOWEL SIGN UU */ { 0x00000F81, 0x00000F71, 0x00000F80 }, /* TIBETAN VOWEL SIGN REVERSED II */ { 0x00000FB9, 0x00000F90, 0x00000FB5 }, /* TIBETAN SUBJOINED LETTER KSSA */ { 0x00000F93, 0x00000F92, 0x00000FB7 }, /* TIBETAN SUBJOINED LETTER GHA */ { 0x00000F9D, 0x00000F9C, 0x00000FB7 }, /* TIBETAN SUBJOINED LETTER DDHA */ { 0x00000FA2, 0x00000FA1, 0x00000FB7 }, /* TIBETAN SUBJOINED LETTER DHA */ { 0x00000FA7, 0x00000FA6, 0x00000FB7 }, /* TIBETAN SUBJOINED LETTER BHA */ { 0x00000FAC, 0x00000FAB, 0x00000FB7 }, /* TIBETAN SUBJOINED LETTER DZHA */ { 0x00000F76, 0x00000FB2, 0x00000F80 }, /* TIBETAN VOWEL SIGN VOCALIC R */ { 0x00000F78, 0x00000FB3, 0x00000F80 }, /* TIBETAN VOWEL SIGN VOCALIC L */ { 0x00001026, 0x00001025, 0x0000102E }, /* MYANMAR LETTER UU */ { 0x00001B06, 0x00001B05, 0x00001B35 }, /* BALINESE LETTER AKARA TEDUNG */ { 0x00001B08, 0x00001B07, 0x00001B35 }, /* BALINESE LETTER IKARA TEDUNG */ { 0x00001B0A, 0x00001B09, 0x00001B35 }, /* BALINESE LETTER UKARA TEDUNG */ { 0x00001B0C, 0x00001B0B, 0x00001B35 }, /* BALINESE LETTER RA REPA TEDUNG */ { 0x00001B0E, 0x00001B0D, 0x00001B35 }, /* BALINESE LETTER LA LENGA TEDUNG */ { 0x00001B12, 0x00001B11, 0x00001B35 }, /* BALINESE LETTER OKARA TEDUNG */ { 0x00001B3B, 0x00001B3A, 0x00001B35 }, /* BALINESE VOWEL SIGN RA REPA TEDUNG */ { 0x00001B3D, 0x00001B3C, 0x00001B35 }, /* BALINESE VOWEL SIGN LA LENGA TEDUNG */ { 0x00001B40, 0x00001B3E, 0x00001B35 }, /* BALINESE VOWEL SIGN TALING TEDUNG */ { 0x00001B41, 0x00001B3F, 0x00001B35 }, /* BALINESE VOWEL SIGN TALING REPA TEDUNG */ { 0x00001B43, 0x00001B42, 0x00001B35 }, /* BALINESE VOWEL SIGN PEPET TEDUNG */ { 0x00001E38, 0x00001E36, 0x00000304 }, /* LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON */ { 0x00001E39, 0x00001E37, 0x00000304 }, /* LATIN SMALL LETTER L WITH DOT BELOW AND MACRON */ { 0x00001E5C, 0x00001E5A, 0x00000304 }, /* LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON */ { 0x00001E5D, 0x00001E5B, 0x00000304 }, /* LATIN SMALL LETTER R WITH DOT BELOW AND MACRON */ { 0x00001E68, 0x00001E62, 0x00000307 }, /* LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE */ { 0x00001E69, 0x00001E63, 0x00000307 }, /* LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE */ { 0x00001EAC, 0x00001EA0, 0x00000302 }, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW */ { 0x00001EB6, 0x00001EA0, 0x00000306 }, /* LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW */ { 0x00001EAD, 0x00001EA1, 0x00000302 }, /* LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW */ { 0x00001EB7, 0x00001EA1, 0x00000306 }, /* LATIN SMALL LETTER A WITH BREVE AND DOT BELOW */ { 0x00001EC6, 0x00001EB8, 0x00000302 }, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW */ { 0x00001EC7, 0x00001EB9, 0x00000302 }, /* LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW */ { 0x00001ED8, 0x00001ECC, 0x00000302 }, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW */ { 0x00001ED9, 0x00001ECD, 0x00000302 }, /* LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW */ { 0x00001F02, 0x00001F00, 0x00000300 }, /* GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA */ { 0x00001F04, 0x00001F00, 0x00000301 }, /* GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA */ { 0x00001F06, 0x00001F00, 0x00000342 }, /* GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI */ { 0x00001F80, 0x00001F00, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI */ { 0x00001F03, 0x00001F01, 0x00000300 }, /* GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA */ { 0x00001F05, 0x00001F01, 0x00000301 }, /* GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA */ { 0x00001F07, 0x00001F01, 0x00000342 }, /* GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI */ { 0x00001F81, 0x00001F01, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI */ { 0x00001F82, 0x00001F02, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI */ { 0x00001F83, 0x00001F03, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI */ { 0x00001F84, 0x00001F04, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI */ { 0x00001F85, 0x00001F05, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI */ { 0x00001F86, 0x00001F06, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001F87, 0x00001F07, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001F0A, 0x00001F08, 0x00000300 }, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA */ { 0x00001F0C, 0x00001F08, 0x00000301 }, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA */ { 0x00001F0E, 0x00001F08, 0x00000342 }, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI */ { 0x00001F88, 0x00001F08, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI */ { 0x00001F0B, 0x00001F09, 0x00000300 }, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA */ { 0x00001F0D, 0x00001F09, 0x00000301 }, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA */ { 0x00001F0F, 0x00001F09, 0x00000342 }, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI */ { 0x00001F89, 0x00001F09, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI */ { 0x00001F8A, 0x00001F0A, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI */ { 0x00001F8B, 0x00001F0B, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI */ { 0x00001F8C, 0x00001F0C, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI */ { 0x00001F8D, 0x00001F0D, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI */ { 0x00001F8E, 0x00001F0E, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */ { 0x00001F8F, 0x00001F0F, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */ { 0x00001F12, 0x00001F10, 0x00000300 }, /* GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA */ { 0x00001F14, 0x00001F10, 0x00000301 }, /* GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA */ { 0x00001F13, 0x00001F11, 0x00000300 }, /* GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA */ { 0x00001F15, 0x00001F11, 0x00000301 }, /* GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA */ { 0x00001F1A, 0x00001F18, 0x00000300 }, /* GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA */ { 0x00001F1C, 0x00001F18, 0x00000301 }, /* GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA */ { 0x00001F1B, 0x00001F19, 0x00000300 }, /* GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA */ { 0x00001F1D, 0x00001F19, 0x00000301 }, /* GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA */ { 0x00001F22, 0x00001F20, 0x00000300 }, /* GREEK SMALL LETTER ETA WITH PSILI AND VARIA */ { 0x00001F24, 0x00001F20, 0x00000301 }, /* GREEK SMALL LETTER ETA WITH PSILI AND OXIA */ { 0x00001F26, 0x00001F20, 0x00000342 }, /* GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI */ { 0x00001F90, 0x00001F20, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI */ { 0x00001F23, 0x00001F21, 0x00000300 }, /* GREEK SMALL LETTER ETA WITH DASIA AND VARIA */ { 0x00001F25, 0x00001F21, 0x00000301 }, /* GREEK SMALL LETTER ETA WITH DASIA AND OXIA */ { 0x00001F27, 0x00001F21, 0x00000342 }, /* GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI */ { 0x00001F91, 0x00001F21, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI */ { 0x00001F92, 0x00001F22, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI */ { 0x00001F93, 0x00001F23, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI */ { 0x00001F94, 0x00001F24, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI */ { 0x00001F95, 0x00001F25, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI */ { 0x00001F96, 0x00001F26, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001F97, 0x00001F27, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001F2A, 0x00001F28, 0x00000300 }, /* GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA */ { 0x00001F2C, 0x00001F28, 0x00000301 }, /* GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA */ { 0x00001F2E, 0x00001F28, 0x00000342 }, /* GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI */ { 0x00001F98, 0x00001F28, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI */ { 0x00001F2B, 0x00001F29, 0x00000300 }, /* GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA */ { 0x00001F2D, 0x00001F29, 0x00000301 }, /* GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA */ { 0x00001F2F, 0x00001F29, 0x00000342 }, /* GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI */ { 0x00001F99, 0x00001F29, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI */ { 0x00001F9A, 0x00001F2A, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI */ { 0x00001F9B, 0x00001F2B, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI */ { 0x00001F9C, 0x00001F2C, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI */ { 0x00001F9D, 0x00001F2D, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI */ { 0x00001F9E, 0x00001F2E, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */ { 0x00001F9F, 0x00001F2F, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */ { 0x00001F32, 0x00001F30, 0x00000300 }, /* GREEK SMALL LETTER IOTA WITH PSILI AND VARIA */ { 0x00001F34, 0x00001F30, 0x00000301 }, /* GREEK SMALL LETTER IOTA WITH PSILI AND OXIA */ { 0x00001F36, 0x00001F30, 0x00000342 }, /* GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI */ { 0x00001F33, 0x00001F31, 0x00000300 }, /* GREEK SMALL LETTER IOTA WITH DASIA AND VARIA */ { 0x00001F35, 0x00001F31, 0x00000301 }, /* GREEK SMALL LETTER IOTA WITH DASIA AND OXIA */ { 0x00001F37, 0x00001F31, 0x00000342 }, /* GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI */ { 0x00001F3A, 0x00001F38, 0x00000300 }, /* GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA */ { 0x00001F3C, 0x00001F38, 0x00000301 }, /* GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA */ { 0x00001F3E, 0x00001F38, 0x00000342 }, /* GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI */ { 0x00001F3B, 0x00001F39, 0x00000300 }, /* GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA */ { 0x00001F3D, 0x00001F39, 0x00000301 }, /* GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA */ { 0x00001F3F, 0x00001F39, 0x00000342 }, /* GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI */ { 0x00001F42, 0x00001F40, 0x00000300 }, /* GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA */ { 0x00001F44, 0x00001F40, 0x00000301 }, /* GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA */ { 0x00001F43, 0x00001F41, 0x00000300 }, /* GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA */ { 0x00001F45, 0x00001F41, 0x00000301 }, /* GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA */ { 0x00001F4A, 0x00001F48, 0x00000300 }, /* GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA */ { 0x00001F4C, 0x00001F48, 0x00000301 }, /* GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA */ { 0x00001F4B, 0x00001F49, 0x00000300 }, /* GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA */ { 0x00001F4D, 0x00001F49, 0x00000301 }, /* GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA */ { 0x00001F52, 0x00001F50, 0x00000300 }, /* GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA */ { 0x00001F54, 0x00001F50, 0x00000301 }, /* GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA */ { 0x00001F56, 0x00001F50, 0x00000342 }, /* GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI */ { 0x00001F53, 0x00001F51, 0x00000300 }, /* GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA */ { 0x00001F55, 0x00001F51, 0x00000301 }, /* GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA */ { 0x00001F57, 0x00001F51, 0x00000342 }, /* GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI */ { 0x00001F5B, 0x00001F59, 0x00000300 }, /* GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA */ { 0x00001F5D, 0x00001F59, 0x00000301 }, /* GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA */ { 0x00001F5F, 0x00001F59, 0x00000342 }, /* GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI */ { 0x00001F62, 0x00001F60, 0x00000300 }, /* GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA */ { 0x00001F64, 0x00001F60, 0x00000301 }, /* GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA */ { 0x00001F66, 0x00001F60, 0x00000342 }, /* GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI */ { 0x00001FA0, 0x00001F60, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI */ { 0x00001F63, 0x00001F61, 0x00000300 }, /* GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA */ { 0x00001F65, 0x00001F61, 0x00000301 }, /* GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA */ { 0x00001F67, 0x00001F61, 0x00000342 }, /* GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI */ { 0x00001FA1, 0x00001F61, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI */ { 0x00001FA2, 0x00001F62, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI */ { 0x00001FA3, 0x00001F63, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI */ { 0x00001FA4, 0x00001F64, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI */ { 0x00001FA5, 0x00001F65, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI */ { 0x00001FA6, 0x00001F66, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001FA7, 0x00001F67, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001F6A, 0x00001F68, 0x00000300 }, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA */ { 0x00001F6C, 0x00001F68, 0x00000301 }, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA */ { 0x00001F6E, 0x00001F68, 0x00000342 }, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI */ { 0x00001FA8, 0x00001F68, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI */ { 0x00001F6B, 0x00001F69, 0x00000300 }, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA */ { 0x00001F6D, 0x00001F69, 0x00000301 }, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA */ { 0x00001F6F, 0x00001F69, 0x00000342 }, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI */ { 0x00001FA9, 0x00001F69, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI */ { 0x00001FAA, 0x00001F6A, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI */ { 0x00001FAB, 0x00001F6B, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI */ { 0x00001FAC, 0x00001F6C, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI */ { 0x00001FAD, 0x00001F6D, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI */ { 0x00001FAE, 0x00001F6E, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */ { 0x00001FAF, 0x00001F6F, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */ { 0x00001FB2, 0x00001F70, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI */ { 0x00001FC2, 0x00001F74, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI */ { 0x00001FF2, 0x00001F7C, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI */ { 0x00001FB7, 0x00001FB6, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001FCD, 0x00001FBF, 0x00000300 }, /* GREEK PSILI AND VARIA */ { 0x00001FCE, 0x00001FBF, 0x00000301 }, /* GREEK PSILI AND OXIA */ { 0x00001FCF, 0x00001FBF, 0x00000342 }, /* GREEK PSILI AND PERISPOMENI */ { 0x00001FC7, 0x00001FC6, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001FF7, 0x00001FF6, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001FDD, 0x00001FFE, 0x00000300 }, /* GREEK DASIA AND VARIA */ { 0x00001FDE, 0x00001FFE, 0x00000301 }, /* GREEK DASIA AND OXIA */ { 0x00001FDF, 0x00001FFE, 0x00000342 }, /* GREEK DASIA AND PERISPOMENI */ /*{ 0x0000219A, 0x00002190, 0x00000338 },*/ /* LEFTWARDS ARROW WITH STROKE */ /*{ 0x0000219B, 0x00002192, 0x00000338 },*/ /* RIGHTWARDS ARROW WITH STROKE */ /*{ 0x000021AE, 0x00002194, 0x00000338 },*/ /* LEFT RIGHT ARROW WITH STROKE */ /*{ 0x000021CD, 0x000021D0, 0x00000338 },*/ /* LEFTWARDS DOUBLE ARROW WITH STROKE */ /*{ 0x000021CF, 0x000021D2, 0x00000338 },*/ /* RIGHTWARDS DOUBLE ARROW WITH STROKE */ /*{ 0x000021CE, 0x000021D4, 0x00000338 },*/ /* LEFT RIGHT DOUBLE ARROW WITH STROKE */ /*{ 0x00002204, 0x00002203, 0x00000338 },*/ /* THERE DOES NOT EXIST */ /*{ 0x00002209, 0x00002208, 0x00000338 },*/ /* NOT AN ELEMENT OF */ /*{ 0x0000220C, 0x0000220B, 0x00000338 },*/ /* DOES NOT CONTAIN AS MEMBER */ /*{ 0x00002224, 0x00002223, 0x00000338 },*/ /* DOES NOT DIVIDE */ /*{ 0x00002226, 0x00002225, 0x00000338 },*/ /* NOT PARALLEL TO */ /*{ 0x00002241, 0x0000223C, 0x00000338 },*/ /* NOT TILDE */ /*{ 0x00002244, 0x00002243, 0x00000338 },*/ /* NOT ASYMPTOTICALLY EQUAL TO */ /*{ 0x00002247, 0x00002245, 0x00000338 },*/ /* NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO */ /*{ 0x00002249, 0x00002248, 0x00000338 },*/ /* NOT ALMOST EQUAL TO */ /*{ 0x0000226D, 0x0000224D, 0x00000338 },*/ /* NOT EQUIVALENT TO */ /*{ 0x00002262, 0x00002261, 0x00000338 },*/ /* NOT IDENTICAL TO */ /*{ 0x00002270, 0x00002264, 0x00000338 },*/ /* NEITHER LESS-THAN NOR EQUAL TO */ /*{ 0x00002271, 0x00002265, 0x00000338 },*/ /* NEITHER GREATER-THAN NOR EQUAL TO */ /*{ 0x00002274, 0x00002272, 0x00000338 },*/ /* NEITHER LESS-THAN NOR EQUIVALENT TO */ /*{ 0x00002275, 0x00002273, 0x00000338 },*/ /* NEITHER GREATER-THAN NOR EQUIVALENT TO */ /*{ 0x00002278, 0x00002276, 0x00000338 },*/ /* NEITHER LESS-THAN NOR GREATER-THAN */ /*{ 0x00002279, 0x00002277, 0x00000338 },*/ /* NEITHER GREATER-THAN NOR LESS-THAN */ /*{ 0x00002280, 0x0000227A, 0x00000338 },*/ /* DOES NOT PRECEDE */ /*{ 0x00002281, 0x0000227B, 0x00000338 },*/ /* DOES NOT SUCCEED */ /*{ 0x000022E0, 0x0000227C, 0x00000338 },*/ /* DOES NOT PRECEDE OR EQUAL */ /*{ 0x000022E1, 0x0000227D, 0x00000338 },*/ /* DOES NOT SUCCEED OR EQUAL */ /*{ 0x00002284, 0x00002282, 0x00000338 },*/ /* NOT A SUBSET OF */ /*{ 0x00002285, 0x00002283, 0x00000338 },*/ /* NOT A SUPERSET OF */ /*{ 0x00002288, 0x00002286, 0x00000338 },*/ /* NEITHER A SUBSET OF NOR EQUAL TO */ /*{ 0x00002289, 0x00002287, 0x00000338 },*/ /* NEITHER A SUPERSET OF NOR EQUAL TO */ /*{ 0x000022E2, 0x00002291, 0x00000338 },*/ /* NOT SQUARE IMAGE OF OR EQUAL TO */ /*{ 0x000022E3, 0x00002292, 0x00000338 },*/ /* NOT SQUARE ORIGINAL OF OR EQUAL TO */ /*{ 0x000022AC, 0x000022A2, 0x00000338 },*/ /* DOES NOT PROVE */ /*{ 0x000022AD, 0x000022A8, 0x00000338 },*/ /* NOT TRUE */ /*{ 0x000022AE, 0x000022A9, 0x00000338 },*/ /* DOES NOT FORCE */ /*{ 0x000022AF, 0x000022AB, 0x00000338 },*/ /* NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE */ /*{ 0x000022EA, 0x000022B2, 0x00000338 },*/ /* NOT NORMAL SUBGROUP OF */ /*{ 0x000022EB, 0x000022B3, 0x00000338 },*/ /* DOES NOT CONTAIN AS NORMAL SUBGROUP */ /*{ 0x000022EC, 0x000022B4, 0x00000338 },*/ /* NOT NORMAL SUBGROUP OF OR EQUAL TO */ /*{ 0x000022ED, 0x000022B5, 0x00000338 },*/ /* DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL */ /*{ 0x00002ADC, 0x00002ADD, 0x00000338 },*/ /* FORKING */ { 0x00003094, 0x00003046, 0x00003099 }, /* HIRAGANA LETTER VU */ { 0x0000304C, 0x0000304B, 0x00003099 }, /* HIRAGANA LETTER GA */ { 0x0000304E, 0x0000304D, 0x00003099 }, /* HIRAGANA LETTER GI */ { 0x00003050, 0x0000304F, 0x00003099 }, /* HIRAGANA LETTER GU */ { 0x00003052, 0x00003051, 0x00003099 }, /* HIRAGANA LETTER GE */ { 0x00003054, 0x00003053, 0x00003099 }, /* HIRAGANA LETTER GO */ { 0x00003056, 0x00003055, 0x00003099 }, /* HIRAGANA LETTER ZA */ { 0x00003058, 0x00003057, 0x00003099 }, /* HIRAGANA LETTER ZI */ { 0x0000305A, 0x00003059, 0x00003099 }, /* HIRAGANA LETTER ZU */ { 0x0000305C, 0x0000305B, 0x00003099 }, /* HIRAGANA LETTER ZE */ { 0x0000305E, 0x0000305D, 0x00003099 }, /* HIRAGANA LETTER ZO */ { 0x00003060, 0x0000305F, 0x00003099 }, /* HIRAGANA LETTER DA */ { 0x00003062, 0x00003061, 0x00003099 }, /* HIRAGANA LETTER DI */ { 0x00003065, 0x00003064, 0x00003099 }, /* HIRAGANA LETTER DU */ { 0x00003067, 0x00003066, 0x00003099 }, /* HIRAGANA LETTER DE */ { 0x00003069, 0x00003068, 0x00003099 }, /* HIRAGANA LETTER DO */ { 0x00003070, 0x0000306F, 0x00003099 }, /* HIRAGANA LETTER BA */ { 0x00003071, 0x0000306F, 0x0000309A }, /* HIRAGANA LETTER PA */ { 0x00003073, 0x00003072, 0x00003099 }, /* HIRAGANA LETTER BI */ { 0x00003074, 0x00003072, 0x0000309A }, /* HIRAGANA LETTER PI */ { 0x00003076, 0x00003075, 0x00003099 }, /* HIRAGANA LETTER BU */ { 0x00003077, 0x00003075, 0x0000309A }, /* HIRAGANA LETTER PU */ { 0x00003079, 0x00003078, 0x00003099 }, /* HIRAGANA LETTER BE */ { 0x0000307A, 0x00003078, 0x0000309A }, /* HIRAGANA LETTER PE */ { 0x0000307C, 0x0000307B, 0x00003099 }, /* HIRAGANA LETTER BO */ { 0x0000307D, 0x0000307B, 0x0000309A }, /* HIRAGANA LETTER PO */ { 0x0000309E, 0x0000309D, 0x00003099 }, /* HIRAGANA VOICED ITERATION MARK */ { 0x000030F4, 0x000030A6, 0x00003099 }, /* KATAKANA LETTER VU */ { 0x000030AC, 0x000030AB, 0x00003099 }, /* KATAKANA LETTER GA */ { 0x000030AE, 0x000030AD, 0x00003099 }, /* KATAKANA LETTER GI */ { 0x000030B0, 0x000030AF, 0x00003099 }, /* KATAKANA LETTER GU */ { 0x000030B2, 0x000030B1, 0x00003099 }, /* KATAKANA LETTER GE */ { 0x000030B4, 0x000030B3, 0x00003099 }, /* KATAKANA LETTER GO */ { 0x000030B6, 0x000030B5, 0x00003099 }, /* KATAKANA LETTER ZA */ { 0x000030B8, 0x000030B7, 0x00003099 }, /* KATAKANA LETTER ZI */ { 0x000030BA, 0x000030B9, 0x00003099 }, /* KATAKANA LETTER ZU */ { 0x000030BC, 0x000030BB, 0x00003099 }, /* KATAKANA LETTER ZE */ { 0x000030BE, 0x000030BD, 0x00003099 }, /* KATAKANA LETTER ZO */ { 0x000030C0, 0x000030BF, 0x00003099 }, /* KATAKANA LETTER DA */ { 0x000030C2, 0x000030C1, 0x00003099 }, /* KATAKANA LETTER DI */ { 0x000030C5, 0x000030C4, 0x00003099 }, /* KATAKANA LETTER DU */ { 0x000030C7, 0x000030C6, 0x00003099 }, /* KATAKANA LETTER DE */ { 0x000030C9, 0x000030C8, 0x00003099 }, /* KATAKANA LETTER DO */ { 0x000030D0, 0x000030CF, 0x00003099 }, /* KATAKANA LETTER BA */ { 0x000030D1, 0x000030CF, 0x0000309A }, /* KATAKANA LETTER PA */ { 0x000030D3, 0x000030D2, 0x00003099 }, /* KATAKANA LETTER BI */ { 0x000030D4, 0x000030D2, 0x0000309A }, /* KATAKANA LETTER PI */ { 0x000030D6, 0x000030D5, 0x00003099 }, /* KATAKANA LETTER BU */ { 0x000030D7, 0x000030D5, 0x0000309A }, /* KATAKANA LETTER PU */ { 0x000030D9, 0x000030D8, 0x00003099 }, /* KATAKANA LETTER BE */ { 0x000030DA, 0x000030D8, 0x0000309A }, /* KATAKANA LETTER PE */ { 0x000030DC, 0x000030DB, 0x00003099 }, /* KATAKANA LETTER BO */ { 0x000030DD, 0x000030DB, 0x0000309A }, /* KATAKANA LETTER PO */ { 0x000030F7, 0x000030EF, 0x00003099 }, /* KATAKANA LETTER VA */ { 0x000030F8, 0x000030F0, 0x00003099 }, /* KATAKANA LETTER VI */ { 0x000030F9, 0x000030F1, 0x00003099 }, /* KATAKANA LETTER VE */ { 0x000030FA, 0x000030F2, 0x00003099 }, /* KATAKANA LETTER VO */ { 0x000030FE, 0x000030FD, 0x00003099 }, /* KATAKANA VOICED ITERATION MARK */ { 0x0000FB2C, 0x0000FB49, 0x000005C1 }, /* HEBREW LETTER SHIN WITH DAGESH AND SHIN DOT */ { 0x0000FB2D, 0x0000FB49, 0x000005C2 }, /* HEBREW LETTER SHIN WITH DAGESH AND SIN DOT */ /*{ 0x0001109A, 0x00011099, 0x000110BA },*/ /* KAITHI LETTER DDDHA */ /*{ 0x0001109C, 0x0001109B, 0x000110BA },*/ /* KAITHI LETTER RHA */ /*{ 0x000110AB, 0x000110A5, 0x000110BA },*/ /* KAITHI LETTER VA */ /*{ 0x0001D15E, 0x0001D157, 0x0001D165 },*/ /* MUSICAL SYMBOL HALF NOTE */ /*{ 0x0001D15F, 0x0001D158, 0x0001D165 },*/ /* MUSICAL SYMBOL QUARTER NOTE */ /*{ 0x0001D160, 0x0001D15F, 0x0001D16E },*/ /* MUSICAL SYMBOL EIGHTH NOTE */ /*{ 0x0001D161, 0x0001D15F, 0x0001D16F },*/ /* MUSICAL SYMBOL SIXTEENTH NOTE */ /*{ 0x0001D162, 0x0001D15F, 0x0001D170 },*/ /* MUSICAL SYMBOL THIRTY-SECOND NOTE */ /*{ 0x0001D163, 0x0001D15F, 0x0001D171 },*/ /* MUSICAL SYMBOL SIXTY-FOURTH NOTE */ /*{ 0x0001D164, 0x0001D15F, 0x0001D172 },*/ /* MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH NOTE */ /*{ 0x0001D1BB, 0x0001D1B9, 0x0001D165 },*/ /* MUSICAL SYMBOL MINIMA */ /*{ 0x0001D1BC, 0x0001D1BA, 0x0001D165 },*/ /* MUSICAL SYMBOL MINIMA BLACK */ /*{ 0x0001D1BD, 0x0001D1BB, 0x0001D16E },*/ /* MUSICAL SYMBOL SEMIMINIMA WHITE */ /*{ 0x0001D1BF, 0x0001D1BB, 0x0001D16F },*/ /* MUSICAL SYMBOL FUSA WHITE */ /*{ 0x0001D1BE, 0x0001D1BC, 0x0001D16E },*/ /* MUSICAL SYMBOL SEMIMINIMA BLACK */ /*{ 0x0001D1C0, 0x0001D1BC, 0x0001D16F },*/ /* MUSICAL SYMBOL FUSA BLACK */ }; static const struct { unsigned int replacement; unsigned int base; unsigned int comb; } decompositions[] = { { 0x000000C0, 0x00000041, 0x00000300 }, /* LATIN CAPITAL LETTER A WITH GRAVE */ { 0x000000C1, 0x00000041, 0x00000301 }, /* LATIN CAPITAL LETTER A WITH ACUTE */ { 0x000000C2, 0x00000041, 0x00000302 }, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ { 0x000000C3, 0x00000041, 0x00000303 }, /* LATIN CAPITAL LETTER A WITH TILDE */ { 0x000000C4, 0x00000041, 0x00000308 }, /* LATIN CAPITAL LETTER A WITH DIAERESIS */ { 0x000000C5, 0x00000041, 0x0000030A }, /* LATIN CAPITAL LETTER A WITH RING ABOVE */ { 0x000000C7, 0x00000043, 0x00000327 }, /* LATIN CAPITAL LETTER C WITH CEDILLA */ { 0x000000C8, 0x00000045, 0x00000300 }, /* LATIN CAPITAL LETTER E WITH GRAVE */ { 0x000000C9, 0x00000045, 0x00000301 }, /* LATIN CAPITAL LETTER E WITH ACUTE */ { 0x000000CA, 0x00000045, 0x00000302 }, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ { 0x000000CB, 0x00000045, 0x00000308 }, /* LATIN CAPITAL LETTER E WITH DIAERESIS */ { 0x000000CC, 0x00000049, 0x00000300 }, /* LATIN CAPITAL LETTER I WITH GRAVE */ { 0x000000CD, 0x00000049, 0x00000301 }, /* LATIN CAPITAL LETTER I WITH ACUTE */ { 0x000000CE, 0x00000049, 0x00000302 }, /* LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ { 0x000000CF, 0x00000049, 0x00000308 }, /* LATIN CAPITAL LETTER I WITH DIAERESIS */ { 0x000000D1, 0x0000004E, 0x00000303 }, /* LATIN CAPITAL LETTER N WITH TILDE */ { 0x000000D2, 0x0000004F, 0x00000300 }, /* LATIN CAPITAL LETTER O WITH GRAVE */ { 0x000000D3, 0x0000004F, 0x00000301 }, /* LATIN CAPITAL LETTER O WITH ACUTE */ { 0x000000D4, 0x0000004F, 0x00000302 }, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ { 0x000000D5, 0x0000004F, 0x00000303 }, /* LATIN CAPITAL LETTER O WITH TILDE */ { 0x000000D6, 0x0000004F, 0x00000308 }, /* LATIN CAPITAL LETTER O WITH DIAERESIS */ { 0x000000D9, 0x00000055, 0x00000300 }, /* LATIN CAPITAL LETTER U WITH GRAVE */ { 0x000000DA, 0x00000055, 0x00000301 }, /* LATIN CAPITAL LETTER U WITH ACUTE */ { 0x000000DB, 0x00000055, 0x00000302 }, /* LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ { 0x000000DC, 0x00000055, 0x00000308 }, /* LATIN CAPITAL LETTER U WITH DIAERESIS */ { 0x000000DD, 0x00000059, 0x00000301 }, /* LATIN CAPITAL LETTER Y WITH ACUTE */ { 0x000000E0, 0x00000061, 0x00000300 }, /* LATIN SMALL LETTER A WITH GRAVE */ { 0x000000E1, 0x00000061, 0x00000301 }, /* LATIN SMALL LETTER A WITH ACUTE */ { 0x000000E2, 0x00000061, 0x00000302 }, /* LATIN SMALL LETTER A WITH CIRCUMFLEX */ { 0x000000E3, 0x00000061, 0x00000303 }, /* LATIN SMALL LETTER A WITH TILDE */ { 0x000000E4, 0x00000061, 0x00000308 }, /* LATIN SMALL LETTER A WITH DIAERESIS */ { 0x000000E5, 0x00000061, 0x0000030A }, /* LATIN SMALL LETTER A WITH RING ABOVE */ { 0x000000E7, 0x00000063, 0x00000327 }, /* LATIN SMALL LETTER C WITH CEDILLA */ { 0x000000E8, 0x00000065, 0x00000300 }, /* LATIN SMALL LETTER E WITH GRAVE */ { 0x000000E9, 0x00000065, 0x00000301 }, /* LATIN SMALL LETTER E WITH ACUTE */ { 0x000000EA, 0x00000065, 0x00000302 }, /* LATIN SMALL LETTER E WITH CIRCUMFLEX */ { 0x000000EB, 0x00000065, 0x00000308 }, /* LATIN SMALL LETTER E WITH DIAERESIS */ { 0x000000EC, 0x00000069, 0x00000300 }, /* LATIN SMALL LETTER I WITH GRAVE */ { 0x000000ED, 0x00000069, 0x00000301 }, /* LATIN SMALL LETTER I WITH ACUTE */ { 0x000000EE, 0x00000069, 0x00000302 }, /* LATIN SMALL LETTER I WITH CIRCUMFLEX */ { 0x000000EF, 0x00000069, 0x00000308 }, /* LATIN SMALL LETTER I WITH DIAERESIS */ { 0x000000F1, 0x0000006E, 0x00000303 }, /* LATIN SMALL LETTER N WITH TILDE */ { 0x000000F2, 0x0000006F, 0x00000300 }, /* LATIN SMALL LETTER O WITH GRAVE */ { 0x000000F3, 0x0000006F, 0x00000301 }, /* LATIN SMALL LETTER O WITH ACUTE */ { 0x000000F4, 0x0000006F, 0x00000302 }, /* LATIN SMALL LETTER O WITH CIRCUMFLEX */ { 0x000000F5, 0x0000006F, 0x00000303 }, /* LATIN SMALL LETTER O WITH TILDE */ { 0x000000F6, 0x0000006F, 0x00000308 }, /* LATIN SMALL LETTER O WITH DIAERESIS */ { 0x000000F9, 0x00000075, 0x00000300 }, /* LATIN SMALL LETTER U WITH GRAVE */ { 0x000000FA, 0x00000075, 0x00000301 }, /* LATIN SMALL LETTER U WITH ACUTE */ { 0x000000FB, 0x00000075, 0x00000302 }, /* LATIN SMALL LETTER U WITH CIRCUMFLEX */ { 0x000000FC, 0x00000075, 0x00000308 }, /* LATIN SMALL LETTER U WITH DIAERESIS */ { 0x000000FD, 0x00000079, 0x00000301 }, /* LATIN SMALL LETTER Y WITH ACUTE */ { 0x000000FF, 0x00000079, 0x00000308 }, /* LATIN SMALL LETTER Y WITH DIAERESIS */ { 0x00000100, 0x00000041, 0x00000304 }, /* LATIN CAPITAL LETTER A WITH MACRON */ { 0x00000101, 0x00000061, 0x00000304 }, /* LATIN SMALL LETTER A WITH MACRON */ { 0x00000102, 0x00000041, 0x00000306 }, /* LATIN CAPITAL LETTER A WITH BREVE */ { 0x00000103, 0x00000061, 0x00000306 }, /* LATIN SMALL LETTER A WITH BREVE */ { 0x00000104, 0x00000041, 0x00000328 }, /* LATIN CAPITAL LETTER A WITH OGONEK */ { 0x00000105, 0x00000061, 0x00000328 }, /* LATIN SMALL LETTER A WITH OGONEK */ { 0x00000106, 0x00000043, 0x00000301 }, /* LATIN CAPITAL LETTER C WITH ACUTE */ { 0x00000107, 0x00000063, 0x00000301 }, /* LATIN SMALL LETTER C WITH ACUTE */ { 0x00000108, 0x00000043, 0x00000302 }, /* LATIN CAPITAL LETTER C WITH CIRCUMFLEX */ { 0x00000109, 0x00000063, 0x00000302 }, /* LATIN SMALL LETTER C WITH CIRCUMFLEX */ { 0x0000010A, 0x00000043, 0x00000307 }, /* LATIN CAPITAL LETTER C WITH DOT ABOVE */ { 0x0000010B, 0x00000063, 0x00000307 }, /* LATIN SMALL LETTER C WITH DOT ABOVE */ { 0x0000010C, 0x00000043, 0x0000030C }, /* LATIN CAPITAL LETTER C WITH CARON */ { 0x0000010D, 0x00000063, 0x0000030C }, /* LATIN SMALL LETTER C WITH CARON */ { 0x0000010E, 0x00000044, 0x0000030C }, /* LATIN CAPITAL LETTER D WITH CARON */ { 0x0000010F, 0x00000064, 0x0000030C }, /* LATIN SMALL LETTER D WITH CARON */ { 0x00000112, 0x00000045, 0x00000304 }, /* LATIN CAPITAL LETTER E WITH MACRON */ { 0x00000113, 0x00000065, 0x00000304 }, /* LATIN SMALL LETTER E WITH MACRON */ { 0x00000114, 0x00000045, 0x00000306 }, /* LATIN CAPITAL LETTER E WITH BREVE */ { 0x00000115, 0x00000065, 0x00000306 }, /* LATIN SMALL LETTER E WITH BREVE */ { 0x00000116, 0x00000045, 0x00000307 }, /* LATIN CAPITAL LETTER E WITH DOT ABOVE */ { 0x00000117, 0x00000065, 0x00000307 }, /* LATIN SMALL LETTER E WITH DOT ABOVE */ { 0x00000118, 0x00000045, 0x00000328 }, /* LATIN CAPITAL LETTER E WITH OGONEK */ { 0x00000119, 0x00000065, 0x00000328 }, /* LATIN SMALL LETTER E WITH OGONEK */ { 0x0000011A, 0x00000045, 0x0000030C }, /* LATIN CAPITAL LETTER E WITH CARON */ { 0x0000011B, 0x00000065, 0x0000030C }, /* LATIN SMALL LETTER E WITH CARON */ { 0x0000011C, 0x00000047, 0x00000302 }, /* LATIN CAPITAL LETTER G WITH CIRCUMFLEX */ { 0x0000011D, 0x00000067, 0x00000302 }, /* LATIN SMALL LETTER G WITH CIRCUMFLEX */ { 0x0000011E, 0x00000047, 0x00000306 }, /* LATIN CAPITAL LETTER G WITH BREVE */ { 0x0000011F, 0x00000067, 0x00000306 }, /* LATIN SMALL LETTER G WITH BREVE */ { 0x00000120, 0x00000047, 0x00000307 }, /* LATIN CAPITAL LETTER G WITH DOT ABOVE */ { 0x00000121, 0x00000067, 0x00000307 }, /* LATIN SMALL LETTER G WITH DOT ABOVE */ { 0x00000122, 0x00000047, 0x00000327 }, /* LATIN CAPITAL LETTER G WITH CEDILLA */ { 0x00000123, 0x00000067, 0x00000327 }, /* LATIN SMALL LETTER G WITH CEDILLA */ { 0x00000124, 0x00000048, 0x00000302 }, /* LATIN CAPITAL LETTER H WITH CIRCUMFLEX */ { 0x00000125, 0x00000068, 0x00000302 }, /* LATIN SMALL LETTER H WITH CIRCUMFLEX */ { 0x00000128, 0x00000049, 0x00000303 }, /* LATIN CAPITAL LETTER I WITH TILDE */ { 0x00000129, 0x00000069, 0x00000303 }, /* LATIN SMALL LETTER I WITH TILDE */ { 0x0000012A, 0x00000049, 0x00000304 }, /* LATIN CAPITAL LETTER I WITH MACRON */ { 0x0000012B, 0x00000069, 0x00000304 }, /* LATIN SMALL LETTER I WITH MACRON */ { 0x0000012C, 0x00000049, 0x00000306 }, /* LATIN CAPITAL LETTER I WITH BREVE */ { 0x0000012D, 0x00000069, 0x00000306 }, /* LATIN SMALL LETTER I WITH BREVE */ { 0x0000012E, 0x00000049, 0x00000328 }, /* LATIN CAPITAL LETTER I WITH OGONEK */ { 0x0000012F, 0x00000069, 0x00000328 }, /* LATIN SMALL LETTER I WITH OGONEK */ { 0x00000130, 0x00000049, 0x00000307 }, /* LATIN CAPITAL LETTER I WITH DOT ABOVE */ { 0x00000134, 0x0000004A, 0x00000302 }, /* LATIN CAPITAL LETTER J WITH CIRCUMFLEX */ { 0x00000135, 0x0000006A, 0x00000302 }, /* LATIN SMALL LETTER J WITH CIRCUMFLEX */ { 0x00000136, 0x0000004B, 0x00000327 }, /* LATIN CAPITAL LETTER K WITH CEDILLA */ { 0x00000137, 0x0000006B, 0x00000327 }, /* LATIN SMALL LETTER K WITH CEDILLA */ { 0x00000139, 0x0000004C, 0x00000301 }, /* LATIN CAPITAL LETTER L WITH ACUTE */ { 0x0000013A, 0x0000006C, 0x00000301 }, /* LATIN SMALL LETTER L WITH ACUTE */ { 0x0000013B, 0x0000004C, 0x00000327 }, /* LATIN CAPITAL LETTER L WITH CEDILLA */ { 0x0000013C, 0x0000006C, 0x00000327 }, /* LATIN SMALL LETTER L WITH CEDILLA */ { 0x0000013D, 0x0000004C, 0x0000030C }, /* LATIN CAPITAL LETTER L WITH CARON */ { 0x0000013E, 0x0000006C, 0x0000030C }, /* LATIN SMALL LETTER L WITH CARON */ { 0x00000143, 0x0000004E, 0x00000301 }, /* LATIN CAPITAL LETTER N WITH ACUTE */ { 0x00000144, 0x0000006E, 0x00000301 }, /* LATIN SMALL LETTER N WITH ACUTE */ { 0x00000145, 0x0000004E, 0x00000327 }, /* LATIN CAPITAL LETTER N WITH CEDILLA */ { 0x00000146, 0x0000006E, 0x00000327 }, /* LATIN SMALL LETTER N WITH CEDILLA */ { 0x00000147, 0x0000004E, 0x0000030C }, /* LATIN CAPITAL LETTER N WITH CARON */ { 0x00000148, 0x0000006E, 0x0000030C }, /* LATIN SMALL LETTER N WITH CARON */ { 0x0000014C, 0x0000004F, 0x00000304 }, /* LATIN CAPITAL LETTER O WITH MACRON */ { 0x0000014D, 0x0000006F, 0x00000304 }, /* LATIN SMALL LETTER O WITH MACRON */ { 0x0000014E, 0x0000004F, 0x00000306 }, /* LATIN CAPITAL LETTER O WITH BREVE */ { 0x0000014F, 0x0000006F, 0x00000306 }, /* LATIN SMALL LETTER O WITH BREVE */ { 0x00000150, 0x0000004F, 0x0000030B }, /* LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */ { 0x00000151, 0x0000006F, 0x0000030B }, /* LATIN SMALL LETTER O WITH DOUBLE ACUTE */ { 0x00000154, 0x00000052, 0x00000301 }, /* LATIN CAPITAL LETTER R WITH ACUTE */ { 0x00000155, 0x00000072, 0x00000301 }, /* LATIN SMALL LETTER R WITH ACUTE */ { 0x00000156, 0x00000052, 0x00000327 }, /* LATIN CAPITAL LETTER R WITH CEDILLA */ { 0x00000157, 0x00000072, 0x00000327 }, /* LATIN SMALL LETTER R WITH CEDILLA */ { 0x00000158, 0x00000052, 0x0000030C }, /* LATIN CAPITAL LETTER R WITH CARON */ { 0x00000159, 0x00000072, 0x0000030C }, /* LATIN SMALL LETTER R WITH CARON */ { 0x0000015A, 0x00000053, 0x00000301 }, /* LATIN CAPITAL LETTER S WITH ACUTE */ { 0x0000015B, 0x00000073, 0x00000301 }, /* LATIN SMALL LETTER S WITH ACUTE */ { 0x0000015C, 0x00000053, 0x00000302 }, /* LATIN CAPITAL LETTER S WITH CIRCUMFLEX */ { 0x0000015D, 0x00000073, 0x00000302 }, /* LATIN SMALL LETTER S WITH CIRCUMFLEX */ { 0x0000015E, 0x00000053, 0x00000327 }, /* LATIN CAPITAL LETTER S WITH CEDILLA */ { 0x0000015F, 0x00000073, 0x00000327 }, /* LATIN SMALL LETTER S WITH CEDILLA */ { 0x00000160, 0x00000053, 0x0000030C }, /* LATIN CAPITAL LETTER S WITH CARON */ { 0x00000161, 0x00000073, 0x0000030C }, /* LATIN SMALL LETTER S WITH CARON */ { 0x00000162, 0x00000054, 0x00000327 }, /* LATIN CAPITAL LETTER T WITH CEDILLA */ { 0x00000163, 0x00000074, 0x00000327 }, /* LATIN SMALL LETTER T WITH CEDILLA */ { 0x00000164, 0x00000054, 0x0000030C }, /* LATIN CAPITAL LETTER T WITH CARON */ { 0x00000165, 0x00000074, 0x0000030C }, /* LATIN SMALL LETTER T WITH CARON */ { 0x00000168, 0x00000055, 0x00000303 }, /* LATIN CAPITAL LETTER U WITH TILDE */ { 0x00000169, 0x00000075, 0x00000303 }, /* LATIN SMALL LETTER U WITH TILDE */ { 0x0000016A, 0x00000055, 0x00000304 }, /* LATIN CAPITAL LETTER U WITH MACRON */ { 0x0000016B, 0x00000075, 0x00000304 }, /* LATIN SMALL LETTER U WITH MACRON */ { 0x0000016C, 0x00000055, 0x00000306 }, /* LATIN CAPITAL LETTER U WITH BREVE */ { 0x0000016D, 0x00000075, 0x00000306 }, /* LATIN SMALL LETTER U WITH BREVE */ { 0x0000016E, 0x00000055, 0x0000030A }, /* LATIN CAPITAL LETTER U WITH RING ABOVE */ { 0x0000016F, 0x00000075, 0x0000030A }, /* LATIN SMALL LETTER U WITH RING ABOVE */ { 0x00000170, 0x00000055, 0x0000030B }, /* LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */ { 0x00000171, 0x00000075, 0x0000030B }, /* LATIN SMALL LETTER U WITH DOUBLE ACUTE */ { 0x00000172, 0x00000055, 0x00000328 }, /* LATIN CAPITAL LETTER U WITH OGONEK */ { 0x00000173, 0x00000075, 0x00000328 }, /* LATIN SMALL LETTER U WITH OGONEK */ { 0x00000174, 0x00000057, 0x00000302 }, /* LATIN CAPITAL LETTER W WITH CIRCUMFLEX */ { 0x00000175, 0x00000077, 0x00000302 }, /* LATIN SMALL LETTER W WITH CIRCUMFLEX */ { 0x00000176, 0x00000059, 0x00000302 }, /* LATIN CAPITAL LETTER Y WITH CIRCUMFLEX */ { 0x00000177, 0x00000079, 0x00000302 }, /* LATIN SMALL LETTER Y WITH CIRCUMFLEX */ { 0x00000178, 0x00000059, 0x00000308 }, /* LATIN CAPITAL LETTER Y WITH DIAERESIS */ { 0x00000179, 0x0000005A, 0x00000301 }, /* LATIN CAPITAL LETTER Z WITH ACUTE */ { 0x0000017A, 0x0000007A, 0x00000301 }, /* LATIN SMALL LETTER Z WITH ACUTE */ { 0x0000017B, 0x0000005A, 0x00000307 }, /* LATIN CAPITAL LETTER Z WITH DOT ABOVE */ { 0x0000017C, 0x0000007A, 0x00000307 }, /* LATIN SMALL LETTER Z WITH DOT ABOVE */ { 0x0000017D, 0x0000005A, 0x0000030C }, /* LATIN CAPITAL LETTER Z WITH CARON */ { 0x0000017E, 0x0000007A, 0x0000030C }, /* LATIN SMALL LETTER Z WITH CARON */ { 0x000001A0, 0x0000004F, 0x0000031B }, /* LATIN CAPITAL LETTER O WITH HORN */ { 0x000001A1, 0x0000006F, 0x0000031B }, /* LATIN SMALL LETTER O WITH HORN */ { 0x000001AF, 0x00000055, 0x0000031B }, /* LATIN CAPITAL LETTER U WITH HORN */ { 0x000001B0, 0x00000075, 0x0000031B }, /* LATIN SMALL LETTER U WITH HORN */ { 0x000001CD, 0x00000041, 0x0000030C }, /* LATIN CAPITAL LETTER A WITH CARON */ { 0x000001CE, 0x00000061, 0x0000030C }, /* LATIN SMALL LETTER A WITH CARON */ { 0x000001CF, 0x00000049, 0x0000030C }, /* LATIN CAPITAL LETTER I WITH CARON */ { 0x000001D0, 0x00000069, 0x0000030C }, /* LATIN SMALL LETTER I WITH CARON */ { 0x000001D1, 0x0000004F, 0x0000030C }, /* LATIN CAPITAL LETTER O WITH CARON */ { 0x000001D2, 0x0000006F, 0x0000030C }, /* LATIN SMALL LETTER O WITH CARON */ { 0x000001D3, 0x00000055, 0x0000030C }, /* LATIN CAPITAL LETTER U WITH CARON */ { 0x000001D4, 0x00000075, 0x0000030C }, /* LATIN SMALL LETTER U WITH CARON */ { 0x000001D5, 0x000000DC, 0x00000304 }, /* LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON */ { 0x000001D6, 0x000000FC, 0x00000304 }, /* LATIN SMALL LETTER U WITH DIAERESIS AND MACRON */ { 0x000001D7, 0x000000DC, 0x00000301 }, /* LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE */ { 0x000001D8, 0x000000FC, 0x00000301 }, /* LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE */ { 0x000001D9, 0x000000DC, 0x0000030C }, /* LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON */ { 0x000001DA, 0x000000FC, 0x0000030C }, /* LATIN SMALL LETTER U WITH DIAERESIS AND CARON */ { 0x000001DB, 0x000000DC, 0x00000300 }, /* LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE */ { 0x000001DC, 0x000000FC, 0x00000300 }, /* LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE */ { 0x000001DE, 0x000000C4, 0x00000304 }, /* LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON */ { 0x000001DF, 0x000000E4, 0x00000304 }, /* LATIN SMALL LETTER A WITH DIAERESIS AND MACRON */ { 0x000001E0, 0x00000226, 0x00000304 }, /* LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON */ { 0x000001E1, 0x00000227, 0x00000304 }, /* LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON */ { 0x000001E2, 0x000000C6, 0x00000304 }, /* LATIN CAPITAL LETTER AE WITH MACRON */ { 0x000001E3, 0x000000E6, 0x00000304 }, /* LATIN SMALL LETTER AE WITH MACRON */ { 0x000001E6, 0x00000047, 0x0000030C }, /* LATIN CAPITAL LETTER G WITH CARON */ { 0x000001E7, 0x00000067, 0x0000030C }, /* LATIN SMALL LETTER G WITH CARON */ { 0x000001E8, 0x0000004B, 0x0000030C }, /* LATIN CAPITAL LETTER K WITH CARON */ { 0x000001E9, 0x0000006B, 0x0000030C }, /* LATIN SMALL LETTER K WITH CARON */ { 0x000001EA, 0x0000004F, 0x00000328 }, /* LATIN CAPITAL LETTER O WITH OGONEK */ { 0x000001EB, 0x0000006F, 0x00000328 }, /* LATIN SMALL LETTER O WITH OGONEK */ { 0x000001EC, 0x000001EA, 0x00000304 }, /* LATIN CAPITAL LETTER O WITH OGONEK AND MACRON */ { 0x000001ED, 0x000001EB, 0x00000304 }, /* LATIN SMALL LETTER O WITH OGONEK AND MACRON */ { 0x000001EE, 0x000001B7, 0x0000030C }, /* LATIN CAPITAL LETTER EZH WITH CARON */ { 0x000001EF, 0x00000292, 0x0000030C }, /* LATIN SMALL LETTER EZH WITH CARON */ { 0x000001F0, 0x0000006A, 0x0000030C }, /* LATIN SMALL LETTER J WITH CARON */ { 0x000001F4, 0x00000047, 0x00000301 }, /* LATIN CAPITAL LETTER G WITH ACUTE */ { 0x000001F5, 0x00000067, 0x00000301 }, /* LATIN SMALL LETTER G WITH ACUTE */ { 0x000001F8, 0x0000004E, 0x00000300 }, /* LATIN CAPITAL LETTER N WITH GRAVE */ { 0x000001F9, 0x0000006E, 0x00000300 }, /* LATIN SMALL LETTER N WITH GRAVE */ { 0x000001FA, 0x000000C5, 0x00000301 }, /* LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE */ { 0x000001FB, 0x000000E5, 0x00000301 }, /* LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE */ { 0x000001FC, 0x000000C6, 0x00000301 }, /* LATIN CAPITAL LETTER AE WITH ACUTE */ { 0x000001FD, 0x000000E6, 0x00000301 }, /* LATIN SMALL LETTER AE WITH ACUTE */ { 0x000001FE, 0x000000D8, 0x00000301 }, /* LATIN CAPITAL LETTER O WITH STROKE AND ACUTE */ { 0x000001FF, 0x000000F8, 0x00000301 }, /* LATIN SMALL LETTER O WITH STROKE AND ACUTE */ { 0x00000200, 0x00000041, 0x0000030F }, /* LATIN CAPITAL LETTER A WITH DOUBLE GRAVE */ { 0x00000201, 0x00000061, 0x0000030F }, /* LATIN SMALL LETTER A WITH DOUBLE GRAVE */ { 0x00000202, 0x00000041, 0x00000311 }, /* LATIN CAPITAL LETTER A WITH INVERTED BREVE */ { 0x00000203, 0x00000061, 0x00000311 }, /* LATIN SMALL LETTER A WITH INVERTED BREVE */ { 0x00000204, 0x00000045, 0x0000030F }, /* LATIN CAPITAL LETTER E WITH DOUBLE GRAVE */ { 0x00000205, 0x00000065, 0x0000030F }, /* LATIN SMALL LETTER E WITH DOUBLE GRAVE */ { 0x00000206, 0x00000045, 0x00000311 }, /* LATIN CAPITAL LETTER E WITH INVERTED BREVE */ { 0x00000207, 0x00000065, 0x00000311 }, /* LATIN SMALL LETTER E WITH INVERTED BREVE */ { 0x00000208, 0x00000049, 0x0000030F }, /* LATIN CAPITAL LETTER I WITH DOUBLE GRAVE */ { 0x00000209, 0x00000069, 0x0000030F }, /* LATIN SMALL LETTER I WITH DOUBLE GRAVE */ { 0x0000020A, 0x00000049, 0x00000311 }, /* LATIN CAPITAL LETTER I WITH INVERTED BREVE */ { 0x0000020B, 0x00000069, 0x00000311 }, /* LATIN SMALL LETTER I WITH INVERTED BREVE */ { 0x0000020C, 0x0000004F, 0x0000030F }, /* LATIN CAPITAL LETTER O WITH DOUBLE GRAVE */ { 0x0000020D, 0x0000006F, 0x0000030F }, /* LATIN SMALL LETTER O WITH DOUBLE GRAVE */ { 0x0000020E, 0x0000004F, 0x00000311 }, /* LATIN CAPITAL LETTER O WITH INVERTED BREVE */ { 0x0000020F, 0x0000006F, 0x00000311 }, /* LATIN SMALL LETTER O WITH INVERTED BREVE */ { 0x00000210, 0x00000052, 0x0000030F }, /* LATIN CAPITAL LETTER R WITH DOUBLE GRAVE */ { 0x00000211, 0x00000072, 0x0000030F }, /* LATIN SMALL LETTER R WITH DOUBLE GRAVE */ { 0x00000212, 0x00000052, 0x00000311 }, /* LATIN CAPITAL LETTER R WITH INVERTED BREVE */ { 0x00000213, 0x00000072, 0x00000311 }, /* LATIN SMALL LETTER R WITH INVERTED BREVE */ { 0x00000214, 0x00000055, 0x0000030F }, /* LATIN CAPITAL LETTER U WITH DOUBLE GRAVE */ { 0x00000215, 0x00000075, 0x0000030F }, /* LATIN SMALL LETTER U WITH DOUBLE GRAVE */ { 0x00000216, 0x00000055, 0x00000311 }, /* LATIN CAPITAL LETTER U WITH INVERTED BREVE */ { 0x00000217, 0x00000075, 0x00000311 }, /* LATIN SMALL LETTER U WITH INVERTED BREVE */ { 0x00000218, 0x00000053, 0x00000326 }, /* LATIN CAPITAL LETTER S WITH COMMA BELOW */ { 0x00000219, 0x00000073, 0x00000326 }, /* LATIN SMALL LETTER S WITH COMMA BELOW */ { 0x0000021A, 0x00000054, 0x00000326 }, /* LATIN CAPITAL LETTER T WITH COMMA BELOW */ { 0x0000021B, 0x00000074, 0x00000326 }, /* LATIN SMALL LETTER T WITH COMMA BELOW */ { 0x0000021E, 0x00000048, 0x0000030C }, /* LATIN CAPITAL LETTER H WITH CARON */ { 0x0000021F, 0x00000068, 0x0000030C }, /* LATIN SMALL LETTER H WITH CARON */ { 0x00000226, 0x00000041, 0x00000307 }, /* LATIN CAPITAL LETTER A WITH DOT ABOVE */ { 0x00000227, 0x00000061, 0x00000307 }, /* LATIN SMALL LETTER A WITH DOT ABOVE */ { 0x00000228, 0x00000045, 0x00000327 }, /* LATIN CAPITAL LETTER E WITH CEDILLA */ { 0x00000229, 0x00000065, 0x00000327 }, /* LATIN SMALL LETTER E WITH CEDILLA */ { 0x0000022A, 0x000000D6, 0x00000304 }, /* LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON */ { 0x0000022B, 0x000000F6, 0x00000304 }, /* LATIN SMALL LETTER O WITH DIAERESIS AND MACRON */ { 0x0000022C, 0x000000D5, 0x00000304 }, /* LATIN CAPITAL LETTER O WITH TILDE AND MACRON */ { 0x0000022D, 0x000000F5, 0x00000304 }, /* LATIN SMALL LETTER O WITH TILDE AND MACRON */ { 0x0000022E, 0x0000004F, 0x00000307 }, /* LATIN CAPITAL LETTER O WITH DOT ABOVE */ { 0x0000022F, 0x0000006F, 0x00000307 }, /* LATIN SMALL LETTER O WITH DOT ABOVE */ { 0x00000230, 0x0000022E, 0x00000304 }, /* LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON */ { 0x00000231, 0x0000022F, 0x00000304 }, /* LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON */ { 0x00000232, 0x00000059, 0x00000304 }, /* LATIN CAPITAL LETTER Y WITH MACRON */ { 0x00000233, 0x00000079, 0x00000304 }, /* LATIN SMALL LETTER Y WITH MACRON */ { 0x00000344, 0x00000308, 0x00000301 }, /* COMBINING GREEK DIALYTIKA TONOS */ { 0x00000385, 0x000000A8, 0x00000301 }, /* GREEK DIALYTIKA TONOS */ { 0x00000386, 0x00000391, 0x00000301 }, /* GREEK CAPITAL LETTER ALPHA WITH TONOS */ { 0x00000388, 0x00000395, 0x00000301 }, /* GREEK CAPITAL LETTER EPSILON WITH TONOS */ { 0x00000389, 0x00000397, 0x00000301 }, /* GREEK CAPITAL LETTER ETA WITH TONOS */ { 0x0000038A, 0x00000399, 0x00000301 }, /* GREEK CAPITAL LETTER IOTA WITH TONOS */ { 0x0000038C, 0x0000039F, 0x00000301 }, /* GREEK CAPITAL LETTER OMICRON WITH TONOS */ { 0x0000038E, 0x000003A5, 0x00000301 }, /* GREEK CAPITAL LETTER UPSILON WITH TONOS */ { 0x0000038F, 0x000003A9, 0x00000301 }, /* GREEK CAPITAL LETTER OMEGA WITH TONOS */ { 0x00000390, 0x000003CA, 0x00000301 }, /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */ { 0x000003AA, 0x00000399, 0x00000308 }, /* GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */ { 0x000003AB, 0x000003A5, 0x00000308 }, /* GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */ { 0x000003AC, 0x000003B1, 0x00000301 }, /* GREEK SMALL LETTER ALPHA WITH TONOS */ { 0x000003AD, 0x000003B5, 0x00000301 }, /* GREEK SMALL LETTER EPSILON WITH TONOS */ { 0x000003AE, 0x000003B7, 0x00000301 }, /* GREEK SMALL LETTER ETA WITH TONOS */ { 0x000003AF, 0x000003B9, 0x00000301 }, /* GREEK SMALL LETTER IOTA WITH TONOS */ { 0x000003B0, 0x000003CB, 0x00000301 }, /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */ { 0x000003CA, 0x000003B9, 0x00000308 }, /* GREEK SMALL LETTER IOTA WITH DIALYTIKA */ { 0x000003CB, 0x000003C5, 0x00000308 }, /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA */ { 0x000003CC, 0x000003BF, 0x00000301 }, /* GREEK SMALL LETTER OMICRON WITH TONOS */ { 0x000003CD, 0x000003C5, 0x00000301 }, /* GREEK SMALL LETTER UPSILON WITH TONOS */ { 0x000003CE, 0x000003C9, 0x00000301 }, /* GREEK SMALL LETTER OMEGA WITH TONOS */ { 0x000003D3, 0x000003D2, 0x00000301 }, /* GREEK UPSILON WITH ACUTE AND HOOK SYMBOL */ { 0x000003D4, 0x000003D2, 0x00000308 }, /* GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL */ { 0x00000400, 0x00000415, 0x00000300 }, /* CYRILLIC CAPITAL LETTER IE WITH GRAVE */ { 0x00000401, 0x00000415, 0x00000308 }, /* CYRILLIC CAPITAL LETTER IO */ { 0x00000403, 0x00000413, 0x00000301 }, /* CYRILLIC CAPITAL LETTER GJE */ { 0x00000407, 0x00000406, 0x00000308 }, /* CYRILLIC CAPITAL LETTER YI */ { 0x0000040C, 0x0000041A, 0x00000301 }, /* CYRILLIC CAPITAL LETTER KJE */ { 0x0000040D, 0x00000418, 0x00000300 }, /* CYRILLIC CAPITAL LETTER I WITH GRAVE */ { 0x0000040E, 0x00000423, 0x00000306 }, /* CYRILLIC CAPITAL LETTER SHORT U */ { 0x00000419, 0x00000418, 0x00000306 }, /* CYRILLIC CAPITAL LETTER SHORT I */ { 0x00000439, 0x00000438, 0x00000306 }, /* CYRILLIC SMALL LETTER SHORT I */ { 0x00000450, 0x00000435, 0x00000300 }, /* CYRILLIC SMALL LETTER IE WITH GRAVE */ { 0x00000451, 0x00000435, 0x00000308 }, /* CYRILLIC SMALL LETTER IO */ { 0x00000453, 0x00000433, 0x00000301 }, /* CYRILLIC SMALL LETTER GJE */ { 0x00000457, 0x00000456, 0x00000308 }, /* CYRILLIC SMALL LETTER YI */ { 0x0000045C, 0x0000043A, 0x00000301 }, /* CYRILLIC SMALL LETTER KJE */ { 0x0000045D, 0x00000438, 0x00000300 }, /* CYRILLIC SMALL LETTER I WITH GRAVE */ { 0x0000045E, 0x00000443, 0x00000306 }, /* CYRILLIC SMALL LETTER SHORT U */ { 0x00000476, 0x00000474, 0x0000030F }, /* CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT */ { 0x00000477, 0x00000475, 0x0000030F }, /* CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT */ { 0x000004C1, 0x00000416, 0x00000306 }, /* CYRILLIC CAPITAL LETTER ZHE WITH BREVE */ { 0x000004C2, 0x00000436, 0x00000306 }, /* CYRILLIC SMALL LETTER ZHE WITH BREVE */ { 0x000004D0, 0x00000410, 0x00000306 }, /* CYRILLIC CAPITAL LETTER A WITH BREVE */ { 0x000004D1, 0x00000430, 0x00000306 }, /* CYRILLIC SMALL LETTER A WITH BREVE */ { 0x000004D2, 0x00000410, 0x00000308 }, /* CYRILLIC CAPITAL LETTER A WITH DIAERESIS */ { 0x000004D3, 0x00000430, 0x00000308 }, /* CYRILLIC SMALL LETTER A WITH DIAERESIS */ { 0x000004D6, 0x00000415, 0x00000306 }, /* CYRILLIC CAPITAL LETTER IE WITH BREVE */ { 0x000004D7, 0x00000435, 0x00000306 }, /* CYRILLIC SMALL LETTER IE WITH BREVE */ { 0x000004DA, 0x000004D8, 0x00000308 }, /* CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS */ { 0x000004DB, 0x000004D9, 0x00000308 }, /* CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS */ { 0x000004DC, 0x00000416, 0x00000308 }, /* CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS */ { 0x000004DD, 0x00000436, 0x00000308 }, /* CYRILLIC SMALL LETTER ZHE WITH DIAERESIS */ { 0x000004DE, 0x00000417, 0x00000308 }, /* CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS */ { 0x000004DF, 0x00000437, 0x00000308 }, /* CYRILLIC SMALL LETTER ZE WITH DIAERESIS */ { 0x000004E2, 0x00000418, 0x00000304 }, /* CYRILLIC CAPITAL LETTER I WITH MACRON */ { 0x000004E3, 0x00000438, 0x00000304 }, /* CYRILLIC SMALL LETTER I WITH MACRON */ { 0x000004E4, 0x00000418, 0x00000308 }, /* CYRILLIC CAPITAL LETTER I WITH DIAERESIS */ { 0x000004E5, 0x00000438, 0x00000308 }, /* CYRILLIC SMALL LETTER I WITH DIAERESIS */ { 0x000004E6, 0x0000041E, 0x00000308 }, /* CYRILLIC CAPITAL LETTER O WITH DIAERESIS */ { 0x000004E7, 0x0000043E, 0x00000308 }, /* CYRILLIC SMALL LETTER O WITH DIAERESIS */ { 0x000004EA, 0x000004E8, 0x00000308 }, /* CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS */ { 0x000004EB, 0x000004E9, 0x00000308 }, /* CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS */ { 0x000004EC, 0x0000042D, 0x00000308 }, /* CYRILLIC CAPITAL LETTER E WITH DIAERESIS */ { 0x000004ED, 0x0000044D, 0x00000308 }, /* CYRILLIC SMALL LETTER E WITH DIAERESIS */ { 0x000004EE, 0x00000423, 0x00000304 }, /* CYRILLIC CAPITAL LETTER U WITH MACRON */ { 0x000004EF, 0x00000443, 0x00000304 }, /* CYRILLIC SMALL LETTER U WITH MACRON */ { 0x000004F0, 0x00000423, 0x00000308 }, /* CYRILLIC CAPITAL LETTER U WITH DIAERESIS */ { 0x000004F1, 0x00000443, 0x00000308 }, /* CYRILLIC SMALL LETTER U WITH DIAERESIS */ { 0x000004F2, 0x00000423, 0x0000030B }, /* CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE */ { 0x000004F3, 0x00000443, 0x0000030B }, /* CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE */ { 0x000004F4, 0x00000427, 0x00000308 }, /* CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS */ { 0x000004F5, 0x00000447, 0x00000308 }, /* CYRILLIC SMALL LETTER CHE WITH DIAERESIS */ { 0x000004F8, 0x0000042B, 0x00000308 }, /* CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS */ { 0x000004F9, 0x0000044B, 0x00000308 }, /* CYRILLIC SMALL LETTER YERU WITH DIAERESIS */ { 0x00000622, 0x00000627, 0x00000653 }, /* ARABIC LETTER ALEF WITH MADDA ABOVE */ { 0x00000623, 0x00000627, 0x00000654 }, /* ARABIC LETTER ALEF WITH HAMZA ABOVE */ { 0x00000624, 0x00000648, 0x00000654 }, /* ARABIC LETTER WAW WITH HAMZA ABOVE */ { 0x00000625, 0x00000627, 0x00000655 }, /* ARABIC LETTER ALEF WITH HAMZA BELOW */ { 0x00000626, 0x0000064A, 0x00000654 }, /* ARABIC LETTER YEH WITH HAMZA ABOVE */ { 0x000006C0, 0x000006D5, 0x00000654 }, /* ARABIC LETTER HEH WITH YEH ABOVE */ { 0x000006C2, 0x000006C1, 0x00000654 }, /* ARABIC LETTER HEH GOAL WITH HAMZA ABOVE */ { 0x000006D3, 0x000006D2, 0x00000654 }, /* ARABIC LETTER YEH BARREE WITH HAMZA ABOVE */ { 0x00000929, 0x00000928, 0x0000093C }, /* DEVANAGARI LETTER NNNA */ { 0x00000931, 0x00000930, 0x0000093C }, /* DEVANAGARI LETTER RRA */ { 0x00000934, 0x00000933, 0x0000093C }, /* DEVANAGARI LETTER LLLA */ { 0x00000958, 0x00000915, 0x0000093C }, /* DEVANAGARI LETTER QA */ { 0x00000959, 0x00000916, 0x0000093C }, /* DEVANAGARI LETTER KHHA */ { 0x0000095A, 0x00000917, 0x0000093C }, /* DEVANAGARI LETTER GHHA */ { 0x0000095B, 0x0000091C, 0x0000093C }, /* DEVANAGARI LETTER ZA */ { 0x0000095C, 0x00000921, 0x0000093C }, /* DEVANAGARI LETTER DDDHA */ { 0x0000095D, 0x00000922, 0x0000093C }, /* DEVANAGARI LETTER RHA */ { 0x0000095E, 0x0000092B, 0x0000093C }, /* DEVANAGARI LETTER FA */ { 0x0000095F, 0x0000092F, 0x0000093C }, /* DEVANAGARI LETTER YYA */ { 0x000009CB, 0x000009C7, 0x000009BE }, /* BENGALI VOWEL SIGN O */ { 0x000009CC, 0x000009C7, 0x000009D7 }, /* BENGALI VOWEL SIGN AU */ { 0x000009DC, 0x000009A1, 0x000009BC }, /* BENGALI LETTER RRA */ { 0x000009DD, 0x000009A2, 0x000009BC }, /* BENGALI LETTER RHA */ { 0x000009DF, 0x000009AF, 0x000009BC }, /* BENGALI LETTER YYA */ { 0x00000A33, 0x00000A32, 0x00000A3C }, /* GURMUKHI LETTER LLA */ { 0x00000A36, 0x00000A38, 0x00000A3C }, /* GURMUKHI LETTER SHA */ { 0x00000A59, 0x00000A16, 0x00000A3C }, /* GURMUKHI LETTER KHHA */ { 0x00000A5A, 0x00000A17, 0x00000A3C }, /* GURMUKHI LETTER GHHA */ { 0x00000A5B, 0x00000A1C, 0x00000A3C }, /* GURMUKHI LETTER ZA */ { 0x00000A5E, 0x00000A2B, 0x00000A3C }, /* GURMUKHI LETTER FA */ { 0x00000B48, 0x00000B47, 0x00000B56 }, /* ORIYA VOWEL SIGN AI */ { 0x00000B4B, 0x00000B47, 0x00000B3E }, /* ORIYA VOWEL SIGN O */ { 0x00000B4C, 0x00000B47, 0x00000B57 }, /* ORIYA VOWEL SIGN AU */ { 0x00000B5C, 0x00000B21, 0x00000B3C }, /* ORIYA LETTER RRA */ { 0x00000B5D, 0x00000B22, 0x00000B3C }, /* ORIYA LETTER RHA */ { 0x00000B94, 0x00000B92, 0x00000BD7 }, /* TAMIL LETTER AU */ { 0x00000BCA, 0x00000BC6, 0x00000BBE }, /* TAMIL VOWEL SIGN O */ { 0x00000BCB, 0x00000BC7, 0x00000BBE }, /* TAMIL VOWEL SIGN OO */ { 0x00000BCC, 0x00000BC6, 0x00000BD7 }, /* TAMIL VOWEL SIGN AU */ { 0x00000C48, 0x00000C46, 0x00000C56 }, /* TELUGU VOWEL SIGN AI */ { 0x00000CC0, 0x00000CBF, 0x00000CD5 }, /* KANNADA VOWEL SIGN II */ { 0x00000CC7, 0x00000CC6, 0x00000CD5 }, /* KANNADA VOWEL SIGN EE */ { 0x00000CC8, 0x00000CC6, 0x00000CD6 }, /* KANNADA VOWEL SIGN AI */ { 0x00000CCA, 0x00000CC6, 0x00000CC2 }, /* KANNADA VOWEL SIGN O */ { 0x00000CCB, 0x00000CCA, 0x00000CD5 }, /* KANNADA VOWEL SIGN OO */ { 0x00000D4A, 0x00000D46, 0x00000D3E }, /* MALAYALAM VOWEL SIGN O */ { 0x00000D4B, 0x00000D47, 0x00000D3E }, /* MALAYALAM VOWEL SIGN OO */ { 0x00000D4C, 0x00000D46, 0x00000D57 }, /* MALAYALAM VOWEL SIGN AU */ { 0x00000DDA, 0x00000DD9, 0x00000DCA }, /* SINHALA VOWEL SIGN DIGA KOMBUVA */ { 0x00000DDC, 0x00000DD9, 0x00000DCF }, /* SINHALA VOWEL SIGN KOMBUVA HAA AELA-PILLA */ { 0x00000DDD, 0x00000DDC, 0x00000DCA }, /* SINHALA VOWEL SIGN KOMBUVA HAA DIGA AELA-PILLA */ { 0x00000DDE, 0x00000DD9, 0x00000DDF }, /* SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA */ { 0x00000F43, 0x00000F42, 0x00000FB7 }, /* TIBETAN LETTER GHA */ { 0x00000F4D, 0x00000F4C, 0x00000FB7 }, /* TIBETAN LETTER DDHA */ { 0x00000F52, 0x00000F51, 0x00000FB7 }, /* TIBETAN LETTER DHA */ { 0x00000F57, 0x00000F56, 0x00000FB7 }, /* TIBETAN LETTER BHA */ { 0x00000F5C, 0x00000F5B, 0x00000FB7 }, /* TIBETAN LETTER DZHA */ { 0x00000F69, 0x00000F40, 0x00000FB5 }, /* TIBETAN LETTER KSSA */ { 0x00000F73, 0x00000F71, 0x00000F72 }, /* TIBETAN VOWEL SIGN II */ { 0x00000F75, 0x00000F71, 0x00000F74 }, /* TIBETAN VOWEL SIGN UU */ { 0x00000F76, 0x00000FB2, 0x00000F80 }, /* TIBETAN VOWEL SIGN VOCALIC R */ { 0x00000F78, 0x00000FB3, 0x00000F80 }, /* TIBETAN VOWEL SIGN VOCALIC L */ { 0x00000F81, 0x00000F71, 0x00000F80 }, /* TIBETAN VOWEL SIGN REVERSED II */ { 0x00000F93, 0x00000F92, 0x00000FB7 }, /* TIBETAN SUBJOINED LETTER GHA */ { 0x00000F9D, 0x00000F9C, 0x00000FB7 }, /* TIBETAN SUBJOINED LETTER DDHA */ { 0x00000FA2, 0x00000FA1, 0x00000FB7 }, /* TIBETAN SUBJOINED LETTER DHA */ { 0x00000FA7, 0x00000FA6, 0x00000FB7 }, /* TIBETAN SUBJOINED LETTER BHA */ { 0x00000FAC, 0x00000FAB, 0x00000FB7 }, /* TIBETAN SUBJOINED LETTER DZHA */ { 0x00000FB9, 0x00000F90, 0x00000FB5 }, /* TIBETAN SUBJOINED LETTER KSSA */ { 0x00001026, 0x00001025, 0x0000102E }, /* MYANMAR LETTER UU */ { 0x00001B06, 0x00001B05, 0x00001B35 }, /* BALINESE LETTER AKARA TEDUNG */ { 0x00001B08, 0x00001B07, 0x00001B35 }, /* BALINESE LETTER IKARA TEDUNG */ { 0x00001B0A, 0x00001B09, 0x00001B35 }, /* BALINESE LETTER UKARA TEDUNG */ { 0x00001B0C, 0x00001B0B, 0x00001B35 }, /* BALINESE LETTER RA REPA TEDUNG */ { 0x00001B0E, 0x00001B0D, 0x00001B35 }, /* BALINESE LETTER LA LENGA TEDUNG */ { 0x00001B12, 0x00001B11, 0x00001B35 }, /* BALINESE LETTER OKARA TEDUNG */ { 0x00001B3B, 0x00001B3A, 0x00001B35 }, /* BALINESE VOWEL SIGN RA REPA TEDUNG */ { 0x00001B3D, 0x00001B3C, 0x00001B35 }, /* BALINESE VOWEL SIGN LA LENGA TEDUNG */ { 0x00001B40, 0x00001B3E, 0x00001B35 }, /* BALINESE VOWEL SIGN TALING TEDUNG */ { 0x00001B41, 0x00001B3F, 0x00001B35 }, /* BALINESE VOWEL SIGN TALING REPA TEDUNG */ { 0x00001B43, 0x00001B42, 0x00001B35 }, /* BALINESE VOWEL SIGN PEPET TEDUNG */ { 0x00001E00, 0x00000041, 0x00000325 }, /* LATIN CAPITAL LETTER A WITH RING BELOW */ { 0x00001E01, 0x00000061, 0x00000325 }, /* LATIN SMALL LETTER A WITH RING BELOW */ { 0x00001E02, 0x00000042, 0x00000307 }, /* LATIN CAPITAL LETTER B WITH DOT ABOVE */ { 0x00001E03, 0x00000062, 0x00000307 }, /* LATIN SMALL LETTER B WITH DOT ABOVE */ { 0x00001E04, 0x00000042, 0x00000323 }, /* LATIN CAPITAL LETTER B WITH DOT BELOW */ { 0x00001E05, 0x00000062, 0x00000323 }, /* LATIN SMALL LETTER B WITH DOT BELOW */ { 0x00001E06, 0x00000042, 0x00000331 }, /* LATIN CAPITAL LETTER B WITH LINE BELOW */ { 0x00001E07, 0x00000062, 0x00000331 }, /* LATIN SMALL LETTER B WITH LINE BELOW */ { 0x00001E08, 0x000000C7, 0x00000301 }, /* LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE */ { 0x00001E09, 0x000000E7, 0x00000301 }, /* LATIN SMALL LETTER C WITH CEDILLA AND ACUTE */ { 0x00001E0A, 0x00000044, 0x00000307 }, /* LATIN CAPITAL LETTER D WITH DOT ABOVE */ { 0x00001E0B, 0x00000064, 0x00000307 }, /* LATIN SMALL LETTER D WITH DOT ABOVE */ { 0x00001E0C, 0x00000044, 0x00000323 }, /* LATIN CAPITAL LETTER D WITH DOT BELOW */ { 0x00001E0D, 0x00000064, 0x00000323 }, /* LATIN SMALL LETTER D WITH DOT BELOW */ { 0x00001E0E, 0x00000044, 0x00000331 }, /* LATIN CAPITAL LETTER D WITH LINE BELOW */ { 0x00001E0F, 0x00000064, 0x00000331 }, /* LATIN SMALL LETTER D WITH LINE BELOW */ { 0x00001E10, 0x00000044, 0x00000327 }, /* LATIN CAPITAL LETTER D WITH CEDILLA */ { 0x00001E11, 0x00000064, 0x00000327 }, /* LATIN SMALL LETTER D WITH CEDILLA */ { 0x00001E12, 0x00000044, 0x0000032D }, /* LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW */ { 0x00001E13, 0x00000064, 0x0000032D }, /* LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW */ { 0x00001E14, 0x00000112, 0x00000300 }, /* LATIN CAPITAL LETTER E WITH MACRON AND GRAVE */ { 0x00001E15, 0x00000113, 0x00000300 }, /* LATIN SMALL LETTER E WITH MACRON AND GRAVE */ { 0x00001E16, 0x00000112, 0x00000301 }, /* LATIN CAPITAL LETTER E WITH MACRON AND ACUTE */ { 0x00001E17, 0x00000113, 0x00000301 }, /* LATIN SMALL LETTER E WITH MACRON AND ACUTE */ { 0x00001E18, 0x00000045, 0x0000032D }, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW */ { 0x00001E19, 0x00000065, 0x0000032D }, /* LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW */ { 0x00001E1A, 0x00000045, 0x00000330 }, /* LATIN CAPITAL LETTER E WITH TILDE BELOW */ { 0x00001E1B, 0x00000065, 0x00000330 }, /* LATIN SMALL LETTER E WITH TILDE BELOW */ { 0x00001E1C, 0x00000228, 0x00000306 }, /* LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE */ { 0x00001E1D, 0x00000229, 0x00000306 }, /* LATIN SMALL LETTER E WITH CEDILLA AND BREVE */ { 0x00001E1E, 0x00000046, 0x00000307 }, /* LATIN CAPITAL LETTER F WITH DOT ABOVE */ { 0x00001E1F, 0x00000066, 0x00000307 }, /* LATIN SMALL LETTER F WITH DOT ABOVE */ { 0x00001E20, 0x00000047, 0x00000304 }, /* LATIN CAPITAL LETTER G WITH MACRON */ { 0x00001E21, 0x00000067, 0x00000304 }, /* LATIN SMALL LETTER G WITH MACRON */ { 0x00001E22, 0x00000048, 0x00000307 }, /* LATIN CAPITAL LETTER H WITH DOT ABOVE */ { 0x00001E23, 0x00000068, 0x00000307 }, /* LATIN SMALL LETTER H WITH DOT ABOVE */ { 0x00001E24, 0x00000048, 0x00000323 }, /* LATIN CAPITAL LETTER H WITH DOT BELOW */ { 0x00001E25, 0x00000068, 0x00000323 }, /* LATIN SMALL LETTER H WITH DOT BELOW */ { 0x00001E26, 0x00000048, 0x00000308 }, /* LATIN CAPITAL LETTER H WITH DIAERESIS */ { 0x00001E27, 0x00000068, 0x00000308 }, /* LATIN SMALL LETTER H WITH DIAERESIS */ { 0x00001E28, 0x00000048, 0x00000327 }, /* LATIN CAPITAL LETTER H WITH CEDILLA */ { 0x00001E29, 0x00000068, 0x00000327 }, /* LATIN SMALL LETTER H WITH CEDILLA */ { 0x00001E2A, 0x00000048, 0x0000032E }, /* LATIN CAPITAL LETTER H WITH BREVE BELOW */ { 0x00001E2B, 0x00000068, 0x0000032E }, /* LATIN SMALL LETTER H WITH BREVE BELOW */ { 0x00001E2C, 0x00000049, 0x00000330 }, /* LATIN CAPITAL LETTER I WITH TILDE BELOW */ { 0x00001E2D, 0x00000069, 0x00000330 }, /* LATIN SMALL LETTER I WITH TILDE BELOW */ { 0x00001E2E, 0x000000CF, 0x00000301 }, /* LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE */ { 0x00001E2F, 0x000000EF, 0x00000301 }, /* LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE */ { 0x00001E30, 0x0000004B, 0x00000301 }, /* LATIN CAPITAL LETTER K WITH ACUTE */ { 0x00001E31, 0x0000006B, 0x00000301 }, /* LATIN SMALL LETTER K WITH ACUTE */ { 0x00001E32, 0x0000004B, 0x00000323 }, /* LATIN CAPITAL LETTER K WITH DOT BELOW */ { 0x00001E33, 0x0000006B, 0x00000323 }, /* LATIN SMALL LETTER K WITH DOT BELOW */ { 0x00001E34, 0x0000004B, 0x00000331 }, /* LATIN CAPITAL LETTER K WITH LINE BELOW */ { 0x00001E35, 0x0000006B, 0x00000331 }, /* LATIN SMALL LETTER K WITH LINE BELOW */ { 0x00001E36, 0x0000004C, 0x00000323 }, /* LATIN CAPITAL LETTER L WITH DOT BELOW */ { 0x00001E37, 0x0000006C, 0x00000323 }, /* LATIN SMALL LETTER L WITH DOT BELOW */ { 0x00001E38, 0x00001E36, 0x00000304 }, /* LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON */ { 0x00001E39, 0x00001E37, 0x00000304 }, /* LATIN SMALL LETTER L WITH DOT BELOW AND MACRON */ { 0x00001E3A, 0x0000004C, 0x00000331 }, /* LATIN CAPITAL LETTER L WITH LINE BELOW */ { 0x00001E3B, 0x0000006C, 0x00000331 }, /* LATIN SMALL LETTER L WITH LINE BELOW */ { 0x00001E3C, 0x0000004C, 0x0000032D }, /* LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW */ { 0x00001E3D, 0x0000006C, 0x0000032D }, /* LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW */ { 0x00001E3E, 0x0000004D, 0x00000301 }, /* LATIN CAPITAL LETTER M WITH ACUTE */ { 0x00001E3F, 0x0000006D, 0x00000301 }, /* LATIN SMALL LETTER M WITH ACUTE */ { 0x00001E40, 0x0000004D, 0x00000307 }, /* LATIN CAPITAL LETTER M WITH DOT ABOVE */ { 0x00001E41, 0x0000006D, 0x00000307 }, /* LATIN SMALL LETTER M WITH DOT ABOVE */ { 0x00001E42, 0x0000004D, 0x00000323 }, /* LATIN CAPITAL LETTER M WITH DOT BELOW */ { 0x00001E43, 0x0000006D, 0x00000323 }, /* LATIN SMALL LETTER M WITH DOT BELOW */ { 0x00001E44, 0x0000004E, 0x00000307 }, /* LATIN CAPITAL LETTER N WITH DOT ABOVE */ { 0x00001E45, 0x0000006E, 0x00000307 }, /* LATIN SMALL LETTER N WITH DOT ABOVE */ { 0x00001E46, 0x0000004E, 0x00000323 }, /* LATIN CAPITAL LETTER N WITH DOT BELOW */ { 0x00001E47, 0x0000006E, 0x00000323 }, /* LATIN SMALL LETTER N WITH DOT BELOW */ { 0x00001E48, 0x0000004E, 0x00000331 }, /* LATIN CAPITAL LETTER N WITH LINE BELOW */ { 0x00001E49, 0x0000006E, 0x00000331 }, /* LATIN SMALL LETTER N WITH LINE BELOW */ { 0x00001E4A, 0x0000004E, 0x0000032D }, /* LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW */ { 0x00001E4B, 0x0000006E, 0x0000032D }, /* LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW */ { 0x00001E4C, 0x000000D5, 0x00000301 }, /* LATIN CAPITAL LETTER O WITH TILDE AND ACUTE */ { 0x00001E4D, 0x000000F5, 0x00000301 }, /* LATIN SMALL LETTER O WITH TILDE AND ACUTE */ { 0x00001E4E, 0x000000D5, 0x00000308 }, /* LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS */ { 0x00001E4F, 0x000000F5, 0x00000308 }, /* LATIN SMALL LETTER O WITH TILDE AND DIAERESIS */ { 0x00001E50, 0x0000014C, 0x00000300 }, /* LATIN CAPITAL LETTER O WITH MACRON AND GRAVE */ { 0x00001E51, 0x0000014D, 0x00000300 }, /* LATIN SMALL LETTER O WITH MACRON AND GRAVE */ { 0x00001E52, 0x0000014C, 0x00000301 }, /* LATIN CAPITAL LETTER O WITH MACRON AND ACUTE */ { 0x00001E53, 0x0000014D, 0x00000301 }, /* LATIN SMALL LETTER O WITH MACRON AND ACUTE */ { 0x00001E54, 0x00000050, 0x00000301 }, /* LATIN CAPITAL LETTER P WITH ACUTE */ { 0x00001E55, 0x00000070, 0x00000301 }, /* LATIN SMALL LETTER P WITH ACUTE */ { 0x00001E56, 0x00000050, 0x00000307 }, /* LATIN CAPITAL LETTER P WITH DOT ABOVE */ { 0x00001E57, 0x00000070, 0x00000307 }, /* LATIN SMALL LETTER P WITH DOT ABOVE */ { 0x00001E58, 0x00000052, 0x00000307 }, /* LATIN CAPITAL LETTER R WITH DOT ABOVE */ { 0x00001E59, 0x00000072, 0x00000307 }, /* LATIN SMALL LETTER R WITH DOT ABOVE */ { 0x00001E5A, 0x00000052, 0x00000323 }, /* LATIN CAPITAL LETTER R WITH DOT BELOW */ { 0x00001E5B, 0x00000072, 0x00000323 }, /* LATIN SMALL LETTER R WITH DOT BELOW */ { 0x00001E5C, 0x00001E5A, 0x00000304 }, /* LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON */ { 0x00001E5D, 0x00001E5B, 0x00000304 }, /* LATIN SMALL LETTER R WITH DOT BELOW AND MACRON */ { 0x00001E5E, 0x00000052, 0x00000331 }, /* LATIN CAPITAL LETTER R WITH LINE BELOW */ { 0x00001E5F, 0x00000072, 0x00000331 }, /* LATIN SMALL LETTER R WITH LINE BELOW */ { 0x00001E60, 0x00000053, 0x00000307 }, /* LATIN CAPITAL LETTER S WITH DOT ABOVE */ { 0x00001E61, 0x00000073, 0x00000307 }, /* LATIN SMALL LETTER S WITH DOT ABOVE */ { 0x00001E62, 0x00000053, 0x00000323 }, /* LATIN CAPITAL LETTER S WITH DOT BELOW */ { 0x00001E63, 0x00000073, 0x00000323 }, /* LATIN SMALL LETTER S WITH DOT BELOW */ { 0x00001E64, 0x0000015A, 0x00000307 }, /* LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE */ { 0x00001E65, 0x0000015B, 0x00000307 }, /* LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE */ { 0x00001E66, 0x00000160, 0x00000307 }, /* LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE */ { 0x00001E67, 0x00000161, 0x00000307 }, /* LATIN SMALL LETTER S WITH CARON AND DOT ABOVE */ { 0x00001E68, 0x00001E62, 0x00000307 }, /* LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE */ { 0x00001E69, 0x00001E63, 0x00000307 }, /* LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE */ { 0x00001E6A, 0x00000054, 0x00000307 }, /* LATIN CAPITAL LETTER T WITH DOT ABOVE */ { 0x00001E6B, 0x00000074, 0x00000307 }, /* LATIN SMALL LETTER T WITH DOT ABOVE */ { 0x00001E6C, 0x00000054, 0x00000323 }, /* LATIN CAPITAL LETTER T WITH DOT BELOW */ { 0x00001E6D, 0x00000074, 0x00000323 }, /* LATIN SMALL LETTER T WITH DOT BELOW */ { 0x00001E6E, 0x00000054, 0x00000331 }, /* LATIN CAPITAL LETTER T WITH LINE BELOW */ { 0x00001E6F, 0x00000074, 0x00000331 }, /* LATIN SMALL LETTER T WITH LINE BELOW */ { 0x00001E70, 0x00000054, 0x0000032D }, /* LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW */ { 0x00001E71, 0x00000074, 0x0000032D }, /* LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW */ { 0x00001E72, 0x00000055, 0x00000324 }, /* LATIN CAPITAL LETTER U WITH DIAERESIS BELOW */ { 0x00001E73, 0x00000075, 0x00000324 }, /* LATIN SMALL LETTER U WITH DIAERESIS BELOW */ { 0x00001E74, 0x00000055, 0x00000330 }, /* LATIN CAPITAL LETTER U WITH TILDE BELOW */ { 0x00001E75, 0x00000075, 0x00000330 }, /* LATIN SMALL LETTER U WITH TILDE BELOW */ { 0x00001E76, 0x00000055, 0x0000032D }, /* LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW */ { 0x00001E77, 0x00000075, 0x0000032D }, /* LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW */ { 0x00001E78, 0x00000168, 0x00000301 }, /* LATIN CAPITAL LETTER U WITH TILDE AND ACUTE */ { 0x00001E79, 0x00000169, 0x00000301 }, /* LATIN SMALL LETTER U WITH TILDE AND ACUTE */ { 0x00001E7A, 0x0000016A, 0x00000308 }, /* LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS */ { 0x00001E7B, 0x0000016B, 0x00000308 }, /* LATIN SMALL LETTER U WITH MACRON AND DIAERESIS */ { 0x00001E7C, 0x00000056, 0x00000303 }, /* LATIN CAPITAL LETTER V WITH TILDE */ { 0x00001E7D, 0x00000076, 0x00000303 }, /* LATIN SMALL LETTER V WITH TILDE */ { 0x00001E7E, 0x00000056, 0x00000323 }, /* LATIN CAPITAL LETTER V WITH DOT BELOW */ { 0x00001E7F, 0x00000076, 0x00000323 }, /* LATIN SMALL LETTER V WITH DOT BELOW */ { 0x00001E80, 0x00000057, 0x00000300 }, /* LATIN CAPITAL LETTER W WITH GRAVE */ { 0x00001E81, 0x00000077, 0x00000300 }, /* LATIN SMALL LETTER W WITH GRAVE */ { 0x00001E82, 0x00000057, 0x00000301 }, /* LATIN CAPITAL LETTER W WITH ACUTE */ { 0x00001E83, 0x00000077, 0x00000301 }, /* LATIN SMALL LETTER W WITH ACUTE */ { 0x00001E84, 0x00000057, 0x00000308 }, /* LATIN CAPITAL LETTER W WITH DIAERESIS */ { 0x00001E85, 0x00000077, 0x00000308 }, /* LATIN SMALL LETTER W WITH DIAERESIS */ { 0x00001E86, 0x00000057, 0x00000307 }, /* LATIN CAPITAL LETTER W WITH DOT ABOVE */ { 0x00001E87, 0x00000077, 0x00000307 }, /* LATIN SMALL LETTER W WITH DOT ABOVE */ { 0x00001E88, 0x00000057, 0x00000323 }, /* LATIN CAPITAL LETTER W WITH DOT BELOW */ { 0x00001E89, 0x00000077, 0x00000323 }, /* LATIN SMALL LETTER W WITH DOT BELOW */ { 0x00001E8A, 0x00000058, 0x00000307 }, /* LATIN CAPITAL LETTER X WITH DOT ABOVE */ { 0x00001E8B, 0x00000078, 0x00000307 }, /* LATIN SMALL LETTER X WITH DOT ABOVE */ { 0x00001E8C, 0x00000058, 0x00000308 }, /* LATIN CAPITAL LETTER X WITH DIAERESIS */ { 0x00001E8D, 0x00000078, 0x00000308 }, /* LATIN SMALL LETTER X WITH DIAERESIS */ { 0x00001E8E, 0x00000059, 0x00000307 }, /* LATIN CAPITAL LETTER Y WITH DOT ABOVE */ { 0x00001E8F, 0x00000079, 0x00000307 }, /* LATIN SMALL LETTER Y WITH DOT ABOVE */ { 0x00001E90, 0x0000005A, 0x00000302 }, /* LATIN CAPITAL LETTER Z WITH CIRCUMFLEX */ { 0x00001E91, 0x0000007A, 0x00000302 }, /* LATIN SMALL LETTER Z WITH CIRCUMFLEX */ { 0x00001E92, 0x0000005A, 0x00000323 }, /* LATIN CAPITAL LETTER Z WITH DOT BELOW */ { 0x00001E93, 0x0000007A, 0x00000323 }, /* LATIN SMALL LETTER Z WITH DOT BELOW */ { 0x00001E94, 0x0000005A, 0x00000331 }, /* LATIN CAPITAL LETTER Z WITH LINE BELOW */ { 0x00001E95, 0x0000007A, 0x00000331 }, /* LATIN SMALL LETTER Z WITH LINE BELOW */ { 0x00001E96, 0x00000068, 0x00000331 }, /* LATIN SMALL LETTER H WITH LINE BELOW */ { 0x00001E97, 0x00000074, 0x00000308 }, /* LATIN SMALL LETTER T WITH DIAERESIS */ { 0x00001E98, 0x00000077, 0x0000030A }, /* LATIN SMALL LETTER W WITH RING ABOVE */ { 0x00001E99, 0x00000079, 0x0000030A }, /* LATIN SMALL LETTER Y WITH RING ABOVE */ { 0x00001E9B, 0x0000017F, 0x00000307 }, /* LATIN SMALL LETTER LONG S WITH DOT ABOVE */ { 0x00001EA0, 0x00000041, 0x00000323 }, /* LATIN CAPITAL LETTER A WITH DOT BELOW */ { 0x00001EA1, 0x00000061, 0x00000323 }, /* LATIN SMALL LETTER A WITH DOT BELOW */ { 0x00001EA2, 0x00000041, 0x00000309 }, /* LATIN CAPITAL LETTER A WITH HOOK ABOVE */ { 0x00001EA3, 0x00000061, 0x00000309 }, /* LATIN SMALL LETTER A WITH HOOK ABOVE */ { 0x00001EA4, 0x000000C2, 0x00000301 }, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE */ { 0x00001EA5, 0x000000E2, 0x00000301 }, /* LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE */ { 0x00001EA6, 0x000000C2, 0x00000300 }, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE */ { 0x00001EA7, 0x000000E2, 0x00000300 }, /* LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE */ { 0x00001EA8, 0x000000C2, 0x00000309 }, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE */ { 0x00001EA9, 0x000000E2, 0x00000309 }, /* LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE */ { 0x00001EAA, 0x000000C2, 0x00000303 }, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE */ { 0x00001EAB, 0x000000E2, 0x00000303 }, /* LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE */ { 0x00001EAC, 0x00001EA0, 0x00000302 }, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW */ { 0x00001EAD, 0x00001EA1, 0x00000302 }, /* LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW */ { 0x00001EAE, 0x00000102, 0x00000301 }, /* LATIN CAPITAL LETTER A WITH BREVE AND ACUTE */ { 0x00001EAF, 0x00000103, 0x00000301 }, /* LATIN SMALL LETTER A WITH BREVE AND ACUTE */ { 0x00001EB0, 0x00000102, 0x00000300 }, /* LATIN CAPITAL LETTER A WITH BREVE AND GRAVE */ { 0x00001EB1, 0x00000103, 0x00000300 }, /* LATIN SMALL LETTER A WITH BREVE AND GRAVE */ { 0x00001EB2, 0x00000102, 0x00000309 }, /* LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE */ { 0x00001EB3, 0x00000103, 0x00000309 }, /* LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE */ { 0x00001EB4, 0x00000102, 0x00000303 }, /* LATIN CAPITAL LETTER A WITH BREVE AND TILDE */ { 0x00001EB5, 0x00000103, 0x00000303 }, /* LATIN SMALL LETTER A WITH BREVE AND TILDE */ { 0x00001EB6, 0x00001EA0, 0x00000306 }, /* LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW */ { 0x00001EB7, 0x00001EA1, 0x00000306 }, /* LATIN SMALL LETTER A WITH BREVE AND DOT BELOW */ { 0x00001EB8, 0x00000045, 0x00000323 }, /* LATIN CAPITAL LETTER E WITH DOT BELOW */ { 0x00001EB9, 0x00000065, 0x00000323 }, /* LATIN SMALL LETTER E WITH DOT BELOW */ { 0x00001EBA, 0x00000045, 0x00000309 }, /* LATIN CAPITAL LETTER E WITH HOOK ABOVE */ { 0x00001EBB, 0x00000065, 0x00000309 }, /* LATIN SMALL LETTER E WITH HOOK ABOVE */ { 0x00001EBC, 0x00000045, 0x00000303 }, /* LATIN CAPITAL LETTER E WITH TILDE */ { 0x00001EBD, 0x00000065, 0x00000303 }, /* LATIN SMALL LETTER E WITH TILDE */ { 0x00001EBE, 0x000000CA, 0x00000301 }, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE */ { 0x00001EBF, 0x000000EA, 0x00000301 }, /* LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE */ { 0x00001EC0, 0x000000CA, 0x00000300 }, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE */ { 0x00001EC1, 0x000000EA, 0x00000300 }, /* LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE */ { 0x00001EC2, 0x000000CA, 0x00000309 }, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE */ { 0x00001EC3, 0x000000EA, 0x00000309 }, /* LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE */ { 0x00001EC4, 0x000000CA, 0x00000303 }, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE */ { 0x00001EC5, 0x000000EA, 0x00000303 }, /* LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE */ { 0x00001EC6, 0x00001EB8, 0x00000302 }, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW */ { 0x00001EC7, 0x00001EB9, 0x00000302 }, /* LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW */ { 0x00001EC8, 0x00000049, 0x00000309 }, /* LATIN CAPITAL LETTER I WITH HOOK ABOVE */ { 0x00001EC9, 0x00000069, 0x00000309 }, /* LATIN SMALL LETTER I WITH HOOK ABOVE */ { 0x00001ECA, 0x00000049, 0x00000323 }, /* LATIN CAPITAL LETTER I WITH DOT BELOW */ { 0x00001ECB, 0x00000069, 0x00000323 }, /* LATIN SMALL LETTER I WITH DOT BELOW */ { 0x00001ECC, 0x0000004F, 0x00000323 }, /* LATIN CAPITAL LETTER O WITH DOT BELOW */ { 0x00001ECD, 0x0000006F, 0x00000323 }, /* LATIN SMALL LETTER O WITH DOT BELOW */ { 0x00001ECE, 0x0000004F, 0x00000309 }, /* LATIN CAPITAL LETTER O WITH HOOK ABOVE */ { 0x00001ECF, 0x0000006F, 0x00000309 }, /* LATIN SMALL LETTER O WITH HOOK ABOVE */ { 0x00001ED0, 0x000000D4, 0x00000301 }, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE */ { 0x00001ED1, 0x000000F4, 0x00000301 }, /* LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE */ { 0x00001ED2, 0x000000D4, 0x00000300 }, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE */ { 0x00001ED3, 0x000000F4, 0x00000300 }, /* LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE */ { 0x00001ED4, 0x000000D4, 0x00000309 }, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE */ { 0x00001ED5, 0x000000F4, 0x00000309 }, /* LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE */ { 0x00001ED6, 0x000000D4, 0x00000303 }, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE */ { 0x00001ED7, 0x000000F4, 0x00000303 }, /* LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE */ { 0x00001ED8, 0x00001ECC, 0x00000302 }, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW */ { 0x00001ED9, 0x00001ECD, 0x00000302 }, /* LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW */ { 0x00001EDA, 0x000001A0, 0x00000301 }, /* LATIN CAPITAL LETTER O WITH HORN AND ACUTE */ { 0x00001EDB, 0x000001A1, 0x00000301 }, /* LATIN SMALL LETTER O WITH HORN AND ACUTE */ { 0x00001EDC, 0x000001A0, 0x00000300 }, /* LATIN CAPITAL LETTER O WITH HORN AND GRAVE */ { 0x00001EDD, 0x000001A1, 0x00000300 }, /* LATIN SMALL LETTER O WITH HORN AND GRAVE */ { 0x00001EDE, 0x000001A0, 0x00000309 }, /* LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE */ { 0x00001EDF, 0x000001A1, 0x00000309 }, /* LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE */ { 0x00001EE0, 0x000001A0, 0x00000303 }, /* LATIN CAPITAL LETTER O WITH HORN AND TILDE */ { 0x00001EE1, 0x000001A1, 0x00000303 }, /* LATIN SMALL LETTER O WITH HORN AND TILDE */ { 0x00001EE2, 0x000001A0, 0x00000323 }, /* LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW */ { 0x00001EE3, 0x000001A1, 0x00000323 }, /* LATIN SMALL LETTER O WITH HORN AND DOT BELOW */ { 0x00001EE4, 0x00000055, 0x00000323 }, /* LATIN CAPITAL LETTER U WITH DOT BELOW */ { 0x00001EE5, 0x00000075, 0x00000323 }, /* LATIN SMALL LETTER U WITH DOT BELOW */ { 0x00001EE6, 0x00000055, 0x00000309 }, /* LATIN CAPITAL LETTER U WITH HOOK ABOVE */ { 0x00001EE7, 0x00000075, 0x00000309 }, /* LATIN SMALL LETTER U WITH HOOK ABOVE */ { 0x00001EE8, 0x000001AF, 0x00000301 }, /* LATIN CAPITAL LETTER U WITH HORN AND ACUTE */ { 0x00001EE9, 0x000001B0, 0x00000301 }, /* LATIN SMALL LETTER U WITH HORN AND ACUTE */ { 0x00001EEA, 0x000001AF, 0x00000300 }, /* LATIN CAPITAL LETTER U WITH HORN AND GRAVE */ { 0x00001EEB, 0x000001B0, 0x00000300 }, /* LATIN SMALL LETTER U WITH HORN AND GRAVE */ { 0x00001EEC, 0x000001AF, 0x00000309 }, /* LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE */ { 0x00001EED, 0x000001B0, 0x00000309 }, /* LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE */ { 0x00001EEE, 0x000001AF, 0x00000303 }, /* LATIN CAPITAL LETTER U WITH HORN AND TILDE */ { 0x00001EEF, 0x000001B0, 0x00000303 }, /* LATIN SMALL LETTER U WITH HORN AND TILDE */ { 0x00001EF0, 0x000001AF, 0x00000323 }, /* LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW */ { 0x00001EF1, 0x000001B0, 0x00000323 }, /* LATIN SMALL LETTER U WITH HORN AND DOT BELOW */ { 0x00001EF2, 0x00000059, 0x00000300 }, /* LATIN CAPITAL LETTER Y WITH GRAVE */ { 0x00001EF3, 0x00000079, 0x00000300 }, /* LATIN SMALL LETTER Y WITH GRAVE */ { 0x00001EF4, 0x00000059, 0x00000323 }, /* LATIN CAPITAL LETTER Y WITH DOT BELOW */ { 0x00001EF5, 0x00000079, 0x00000323 }, /* LATIN SMALL LETTER Y WITH DOT BELOW */ { 0x00001EF6, 0x00000059, 0x00000309 }, /* LATIN CAPITAL LETTER Y WITH HOOK ABOVE */ { 0x00001EF7, 0x00000079, 0x00000309 }, /* LATIN SMALL LETTER Y WITH HOOK ABOVE */ { 0x00001EF8, 0x00000059, 0x00000303 }, /* LATIN CAPITAL LETTER Y WITH TILDE */ { 0x00001EF9, 0x00000079, 0x00000303 }, /* LATIN SMALL LETTER Y WITH TILDE */ { 0x00001F00, 0x000003B1, 0x00000313 }, /* GREEK SMALL LETTER ALPHA WITH PSILI */ { 0x00001F01, 0x000003B1, 0x00000314 }, /* GREEK SMALL LETTER ALPHA WITH DASIA */ { 0x00001F02, 0x00001F00, 0x00000300 }, /* GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA */ { 0x00001F03, 0x00001F01, 0x00000300 }, /* GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA */ { 0x00001F04, 0x00001F00, 0x00000301 }, /* GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA */ { 0x00001F05, 0x00001F01, 0x00000301 }, /* GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA */ { 0x00001F06, 0x00001F00, 0x00000342 }, /* GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI */ { 0x00001F07, 0x00001F01, 0x00000342 }, /* GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI */ { 0x00001F08, 0x00000391, 0x00000313 }, /* GREEK CAPITAL LETTER ALPHA WITH PSILI */ { 0x00001F09, 0x00000391, 0x00000314 }, /* GREEK CAPITAL LETTER ALPHA WITH DASIA */ { 0x00001F0A, 0x00001F08, 0x00000300 }, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA */ { 0x00001F0B, 0x00001F09, 0x00000300 }, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA */ { 0x00001F0C, 0x00001F08, 0x00000301 }, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA */ { 0x00001F0D, 0x00001F09, 0x00000301 }, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA */ { 0x00001F0E, 0x00001F08, 0x00000342 }, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI */ { 0x00001F0F, 0x00001F09, 0x00000342 }, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI */ { 0x00001F10, 0x000003B5, 0x00000313 }, /* GREEK SMALL LETTER EPSILON WITH PSILI */ { 0x00001F11, 0x000003B5, 0x00000314 }, /* GREEK SMALL LETTER EPSILON WITH DASIA */ { 0x00001F12, 0x00001F10, 0x00000300 }, /* GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA */ { 0x00001F13, 0x00001F11, 0x00000300 }, /* GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA */ { 0x00001F14, 0x00001F10, 0x00000301 }, /* GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA */ { 0x00001F15, 0x00001F11, 0x00000301 }, /* GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA */ { 0x00001F18, 0x00000395, 0x00000313 }, /* GREEK CAPITAL LETTER EPSILON WITH PSILI */ { 0x00001F19, 0x00000395, 0x00000314 }, /* GREEK CAPITAL LETTER EPSILON WITH DASIA */ { 0x00001F1A, 0x00001F18, 0x00000300 }, /* GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA */ { 0x00001F1B, 0x00001F19, 0x00000300 }, /* GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA */ { 0x00001F1C, 0x00001F18, 0x00000301 }, /* GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA */ { 0x00001F1D, 0x00001F19, 0x00000301 }, /* GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA */ { 0x00001F20, 0x000003B7, 0x00000313 }, /* GREEK SMALL LETTER ETA WITH PSILI */ { 0x00001F21, 0x000003B7, 0x00000314 }, /* GREEK SMALL LETTER ETA WITH DASIA */ { 0x00001F22, 0x00001F20, 0x00000300 }, /* GREEK SMALL LETTER ETA WITH PSILI AND VARIA */ { 0x00001F23, 0x00001F21, 0x00000300 }, /* GREEK SMALL LETTER ETA WITH DASIA AND VARIA */ { 0x00001F24, 0x00001F20, 0x00000301 }, /* GREEK SMALL LETTER ETA WITH PSILI AND OXIA */ { 0x00001F25, 0x00001F21, 0x00000301 }, /* GREEK SMALL LETTER ETA WITH DASIA AND OXIA */ { 0x00001F26, 0x00001F20, 0x00000342 }, /* GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI */ { 0x00001F27, 0x00001F21, 0x00000342 }, /* GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI */ { 0x00001F28, 0x00000397, 0x00000313 }, /* GREEK CAPITAL LETTER ETA WITH PSILI */ { 0x00001F29, 0x00000397, 0x00000314 }, /* GREEK CAPITAL LETTER ETA WITH DASIA */ { 0x00001F2A, 0x00001F28, 0x00000300 }, /* GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA */ { 0x00001F2B, 0x00001F29, 0x00000300 }, /* GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA */ { 0x00001F2C, 0x00001F28, 0x00000301 }, /* GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA */ { 0x00001F2D, 0x00001F29, 0x00000301 }, /* GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA */ { 0x00001F2E, 0x00001F28, 0x00000342 }, /* GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI */ { 0x00001F2F, 0x00001F29, 0x00000342 }, /* GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI */ { 0x00001F30, 0x000003B9, 0x00000313 }, /* GREEK SMALL LETTER IOTA WITH PSILI */ { 0x00001F31, 0x000003B9, 0x00000314 }, /* GREEK SMALL LETTER IOTA WITH DASIA */ { 0x00001F32, 0x00001F30, 0x00000300 }, /* GREEK SMALL LETTER IOTA WITH PSILI AND VARIA */ { 0x00001F33, 0x00001F31, 0x00000300 }, /* GREEK SMALL LETTER IOTA WITH DASIA AND VARIA */ { 0x00001F34, 0x00001F30, 0x00000301 }, /* GREEK SMALL LETTER IOTA WITH PSILI AND OXIA */ { 0x00001F35, 0x00001F31, 0x00000301 }, /* GREEK SMALL LETTER IOTA WITH DASIA AND OXIA */ { 0x00001F36, 0x00001F30, 0x00000342 }, /* GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI */ { 0x00001F37, 0x00001F31, 0x00000342 }, /* GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI */ { 0x00001F38, 0x00000399, 0x00000313 }, /* GREEK CAPITAL LETTER IOTA WITH PSILI */ { 0x00001F39, 0x00000399, 0x00000314 }, /* GREEK CAPITAL LETTER IOTA WITH DASIA */ { 0x00001F3A, 0x00001F38, 0x00000300 }, /* GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA */ { 0x00001F3B, 0x00001F39, 0x00000300 }, /* GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA */ { 0x00001F3C, 0x00001F38, 0x00000301 }, /* GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA */ { 0x00001F3D, 0x00001F39, 0x00000301 }, /* GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA */ { 0x00001F3E, 0x00001F38, 0x00000342 }, /* GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI */ { 0x00001F3F, 0x00001F39, 0x00000342 }, /* GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI */ { 0x00001F40, 0x000003BF, 0x00000313 }, /* GREEK SMALL LETTER OMICRON WITH PSILI */ { 0x00001F41, 0x000003BF, 0x00000314 }, /* GREEK SMALL LETTER OMICRON WITH DASIA */ { 0x00001F42, 0x00001F40, 0x00000300 }, /* GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA */ { 0x00001F43, 0x00001F41, 0x00000300 }, /* GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA */ { 0x00001F44, 0x00001F40, 0x00000301 }, /* GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA */ { 0x00001F45, 0x00001F41, 0x00000301 }, /* GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA */ { 0x00001F48, 0x0000039F, 0x00000313 }, /* GREEK CAPITAL LETTER OMICRON WITH PSILI */ { 0x00001F49, 0x0000039F, 0x00000314 }, /* GREEK CAPITAL LETTER OMICRON WITH DASIA */ { 0x00001F4A, 0x00001F48, 0x00000300 }, /* GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA */ { 0x00001F4B, 0x00001F49, 0x00000300 }, /* GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA */ { 0x00001F4C, 0x00001F48, 0x00000301 }, /* GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA */ { 0x00001F4D, 0x00001F49, 0x00000301 }, /* GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA */ { 0x00001F50, 0x000003C5, 0x00000313 }, /* GREEK SMALL LETTER UPSILON WITH PSILI */ { 0x00001F51, 0x000003C5, 0x00000314 }, /* GREEK SMALL LETTER UPSILON WITH DASIA */ { 0x00001F52, 0x00001F50, 0x00000300 }, /* GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA */ { 0x00001F53, 0x00001F51, 0x00000300 }, /* GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA */ { 0x00001F54, 0x00001F50, 0x00000301 }, /* GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA */ { 0x00001F55, 0x00001F51, 0x00000301 }, /* GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA */ { 0x00001F56, 0x00001F50, 0x00000342 }, /* GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI */ { 0x00001F57, 0x00001F51, 0x00000342 }, /* GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI */ { 0x00001F59, 0x000003A5, 0x00000314 }, /* GREEK CAPITAL LETTER UPSILON WITH DASIA */ { 0x00001F5B, 0x00001F59, 0x00000300 }, /* GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA */ { 0x00001F5D, 0x00001F59, 0x00000301 }, /* GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA */ { 0x00001F5F, 0x00001F59, 0x00000342 }, /* GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI */ { 0x00001F60, 0x000003C9, 0x00000313 }, /* GREEK SMALL LETTER OMEGA WITH PSILI */ { 0x00001F61, 0x000003C9, 0x00000314 }, /* GREEK SMALL LETTER OMEGA WITH DASIA */ { 0x00001F62, 0x00001F60, 0x00000300 }, /* GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA */ { 0x00001F63, 0x00001F61, 0x00000300 }, /* GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA */ { 0x00001F64, 0x00001F60, 0x00000301 }, /* GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA */ { 0x00001F65, 0x00001F61, 0x00000301 }, /* GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA */ { 0x00001F66, 0x00001F60, 0x00000342 }, /* GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI */ { 0x00001F67, 0x00001F61, 0x00000342 }, /* GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI */ { 0x00001F68, 0x000003A9, 0x00000313 }, /* GREEK CAPITAL LETTER OMEGA WITH PSILI */ { 0x00001F69, 0x000003A9, 0x00000314 }, /* GREEK CAPITAL LETTER OMEGA WITH DASIA */ { 0x00001F6A, 0x00001F68, 0x00000300 }, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA */ { 0x00001F6B, 0x00001F69, 0x00000300 }, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA */ { 0x00001F6C, 0x00001F68, 0x00000301 }, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA */ { 0x00001F6D, 0x00001F69, 0x00000301 }, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA */ { 0x00001F6E, 0x00001F68, 0x00000342 }, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI */ { 0x00001F6F, 0x00001F69, 0x00000342 }, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI */ { 0x00001F70, 0x000003B1, 0x00000300 }, /* GREEK SMALL LETTER ALPHA WITH VARIA */ { 0x00001F72, 0x000003B5, 0x00000300 }, /* GREEK SMALL LETTER EPSILON WITH VARIA */ { 0x00001F74, 0x000003B7, 0x00000300 }, /* GREEK SMALL LETTER ETA WITH VARIA */ { 0x00001F76, 0x000003B9, 0x00000300 }, /* GREEK SMALL LETTER IOTA WITH VARIA */ { 0x00001F78, 0x000003BF, 0x00000300 }, /* GREEK SMALL LETTER OMICRON WITH VARIA */ { 0x00001F7A, 0x000003C5, 0x00000300 }, /* GREEK SMALL LETTER UPSILON WITH VARIA */ { 0x00001F7C, 0x000003C9, 0x00000300 }, /* GREEK SMALL LETTER OMEGA WITH VARIA */ { 0x00001F80, 0x00001F00, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI */ { 0x00001F81, 0x00001F01, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI */ { 0x00001F82, 0x00001F02, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI */ { 0x00001F83, 0x00001F03, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI */ { 0x00001F84, 0x00001F04, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI */ { 0x00001F85, 0x00001F05, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI */ { 0x00001F86, 0x00001F06, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001F87, 0x00001F07, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001F88, 0x00001F08, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI */ { 0x00001F89, 0x00001F09, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI */ { 0x00001F8A, 0x00001F0A, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI */ { 0x00001F8B, 0x00001F0B, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI */ { 0x00001F8C, 0x00001F0C, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI */ { 0x00001F8D, 0x00001F0D, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI */ { 0x00001F8E, 0x00001F0E, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */ { 0x00001F8F, 0x00001F0F, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */ { 0x00001F90, 0x00001F20, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI */ { 0x00001F91, 0x00001F21, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI */ { 0x00001F92, 0x00001F22, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI */ { 0x00001F93, 0x00001F23, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI */ { 0x00001F94, 0x00001F24, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI */ { 0x00001F95, 0x00001F25, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI */ { 0x00001F96, 0x00001F26, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001F97, 0x00001F27, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001F98, 0x00001F28, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI */ { 0x00001F99, 0x00001F29, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI */ { 0x00001F9A, 0x00001F2A, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI */ { 0x00001F9B, 0x00001F2B, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI */ { 0x00001F9C, 0x00001F2C, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI */ { 0x00001F9D, 0x00001F2D, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI */ { 0x00001F9E, 0x00001F2E, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */ { 0x00001F9F, 0x00001F2F, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */ { 0x00001FA0, 0x00001F60, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI */ { 0x00001FA1, 0x00001F61, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI */ { 0x00001FA2, 0x00001F62, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI */ { 0x00001FA3, 0x00001F63, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI */ { 0x00001FA4, 0x00001F64, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI */ { 0x00001FA5, 0x00001F65, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI */ { 0x00001FA6, 0x00001F66, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001FA7, 0x00001F67, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001FA8, 0x00001F68, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI */ { 0x00001FA9, 0x00001F69, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI */ { 0x00001FAA, 0x00001F6A, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI */ { 0x00001FAB, 0x00001F6B, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI */ { 0x00001FAC, 0x00001F6C, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI */ { 0x00001FAD, 0x00001F6D, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI */ { 0x00001FAE, 0x00001F6E, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */ { 0x00001FAF, 0x00001F6F, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */ { 0x00001FB0, 0x000003B1, 0x00000306 }, /* GREEK SMALL LETTER ALPHA WITH VRACHY */ { 0x00001FB1, 0x000003B1, 0x00000304 }, /* GREEK SMALL LETTER ALPHA WITH MACRON */ { 0x00001FB2, 0x00001F70, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI */ { 0x00001FB3, 0x000003B1, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI */ { 0x00001FB4, 0x000003AC, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI */ { 0x00001FB6, 0x000003B1, 0x00000342 }, /* GREEK SMALL LETTER ALPHA WITH PERISPOMENI */ { 0x00001FB7, 0x00001FB6, 0x00000345 }, /* GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001FB8, 0x00000391, 0x00000306 }, /* GREEK CAPITAL LETTER ALPHA WITH VRACHY */ { 0x00001FB9, 0x00000391, 0x00000304 }, /* GREEK CAPITAL LETTER ALPHA WITH MACRON */ { 0x00001FBA, 0x00000391, 0x00000300 }, /* GREEK CAPITAL LETTER ALPHA WITH VARIA */ { 0x00001FBC, 0x00000391, 0x00000345 }, /* GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI */ { 0x00001FC1, 0x000000A8, 0x00000342 }, /* GREEK DIALYTIKA AND PERISPOMENI */ { 0x00001FC2, 0x00001F74, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI */ { 0x00001FC3, 0x000003B7, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI */ { 0x00001FC4, 0x000003AE, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI */ { 0x00001FC6, 0x000003B7, 0x00000342 }, /* GREEK SMALL LETTER ETA WITH PERISPOMENI */ { 0x00001FC7, 0x00001FC6, 0x00000345 }, /* GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001FC8, 0x00000395, 0x00000300 }, /* GREEK CAPITAL LETTER EPSILON WITH VARIA */ { 0x00001FCA, 0x00000397, 0x00000300 }, /* GREEK CAPITAL LETTER ETA WITH VARIA */ { 0x00001FCC, 0x00000397, 0x00000345 }, /* GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI */ { 0x00001FCD, 0x00001FBF, 0x00000300 }, /* GREEK PSILI AND VARIA */ { 0x00001FCE, 0x00001FBF, 0x00000301 }, /* GREEK PSILI AND OXIA */ { 0x00001FCF, 0x00001FBF, 0x00000342 }, /* GREEK PSILI AND PERISPOMENI */ { 0x00001FD0, 0x000003B9, 0x00000306 }, /* GREEK SMALL LETTER IOTA WITH VRACHY */ { 0x00001FD1, 0x000003B9, 0x00000304 }, /* GREEK SMALL LETTER IOTA WITH MACRON */ { 0x00001FD2, 0x000003CA, 0x00000300 }, /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA */ { 0x00001FD6, 0x000003B9, 0x00000342 }, /* GREEK SMALL LETTER IOTA WITH PERISPOMENI */ { 0x00001FD7, 0x000003CA, 0x00000342 }, /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI */ { 0x00001FD8, 0x00000399, 0x00000306 }, /* GREEK CAPITAL LETTER IOTA WITH VRACHY */ { 0x00001FD9, 0x00000399, 0x00000304 }, /* GREEK CAPITAL LETTER IOTA WITH MACRON */ { 0x00001FDA, 0x00000399, 0x00000300 }, /* GREEK CAPITAL LETTER IOTA WITH VARIA */ { 0x00001FDD, 0x00001FFE, 0x00000300 }, /* GREEK DASIA AND VARIA */ { 0x00001FDE, 0x00001FFE, 0x00000301 }, /* GREEK DASIA AND OXIA */ { 0x00001FDF, 0x00001FFE, 0x00000342 }, /* GREEK DASIA AND PERISPOMENI */ { 0x00001FE0, 0x000003C5, 0x00000306 }, /* GREEK SMALL LETTER UPSILON WITH VRACHY */ { 0x00001FE1, 0x000003C5, 0x00000304 }, /* GREEK SMALL LETTER UPSILON WITH MACRON */ { 0x00001FE2, 0x000003CB, 0x00000300 }, /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA */ { 0x00001FE4, 0x000003C1, 0x00000313 }, /* GREEK SMALL LETTER RHO WITH PSILI */ { 0x00001FE5, 0x000003C1, 0x00000314 }, /* GREEK SMALL LETTER RHO WITH DASIA */ { 0x00001FE6, 0x000003C5, 0x00000342 }, /* GREEK SMALL LETTER UPSILON WITH PERISPOMENI */ { 0x00001FE7, 0x000003CB, 0x00000342 }, /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI */ { 0x00001FE8, 0x000003A5, 0x00000306 }, /* GREEK CAPITAL LETTER UPSILON WITH VRACHY */ { 0x00001FE9, 0x000003A5, 0x00000304 }, /* GREEK CAPITAL LETTER UPSILON WITH MACRON */ { 0x00001FEA, 0x000003A5, 0x00000300 }, /* GREEK CAPITAL LETTER UPSILON WITH VARIA */ { 0x00001FEC, 0x000003A1, 0x00000314 }, /* GREEK CAPITAL LETTER RHO WITH DASIA */ { 0x00001FED, 0x000000A8, 0x00000300 }, /* GREEK DIALYTIKA AND VARIA */ { 0x00001FF2, 0x00001F7C, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI */ { 0x00001FF3, 0x000003C9, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI */ { 0x00001FF4, 0x000003CE, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI */ { 0x00001FF6, 0x000003C9, 0x00000342 }, /* GREEK SMALL LETTER OMEGA WITH PERISPOMENI */ { 0x00001FF7, 0x00001FF6, 0x00000345 }, /* GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI */ { 0x00001FF8, 0x0000039F, 0x00000300 }, /* GREEK CAPITAL LETTER OMICRON WITH VARIA */ { 0x00001FFA, 0x000003A9, 0x00000300 }, /* GREEK CAPITAL LETTER OMEGA WITH VARIA */ { 0x00001FFC, 0x000003A9, 0x00000345 }, /* GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI */ /*{ 0x0000219A, 0x00002190, 0x00000338 },*/ /* LEFTWARDS ARROW WITH STROKE */ /*{ 0x0000219B, 0x00002192, 0x00000338 },*/ /* RIGHTWARDS ARROW WITH STROKE */ /*{ 0x000021AE, 0x00002194, 0x00000338 },*/ /* LEFT RIGHT ARROW WITH STROKE */ /*{ 0x000021CD, 0x000021D0, 0x00000338 },*/ /* LEFTWARDS DOUBLE ARROW WITH STROKE */ /*{ 0x000021CE, 0x000021D4, 0x00000338 },*/ /* LEFT RIGHT DOUBLE ARROW WITH STROKE */ /*{ 0x000021CF, 0x000021D2, 0x00000338 },*/ /* RIGHTWARDS DOUBLE ARROW WITH STROKE */ /*{ 0x00002204, 0x00002203, 0x00000338 },*/ /* THERE DOES NOT EXIST */ /*{ 0x00002209, 0x00002208, 0x00000338 },*/ /* NOT AN ELEMENT OF */ /*{ 0x0000220C, 0x0000220B, 0x00000338 },*/ /* DOES NOT CONTAIN AS MEMBER */ /*{ 0x00002224, 0x00002223, 0x00000338 },*/ /* DOES NOT DIVIDE */ /*{ 0x00002226, 0x00002225, 0x00000338 },*/ /* NOT PARALLEL TO */ /*{ 0x00002241, 0x0000223C, 0x00000338 },*/ /* NOT TILDE */ /*{ 0x00002244, 0x00002243, 0x00000338 },*/ /* NOT ASYMPTOTICALLY EQUAL TO */ /*{ 0x00002247, 0x00002245, 0x00000338 },*/ /* NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO */ /*{ 0x00002249, 0x00002248, 0x00000338 },*/ /* NOT ALMOST EQUAL TO */ /*{ 0x00002260, 0x0000003D, 0x00000338 },*/ /* NOT EQUAL TO */ /*{ 0x00002262, 0x00002261, 0x00000338 },*/ /* NOT IDENTICAL TO */ /*{ 0x0000226D, 0x0000224D, 0x00000338 },*/ /* NOT EQUIVALENT TO */ /*{ 0x0000226E, 0x0000003C, 0x00000338 },*/ /* NOT LESS-THAN */ /*{ 0x0000226F, 0x0000003E, 0x00000338 },*/ /* NOT GREATER-THAN */ /*{ 0x00002270, 0x00002264, 0x00000338 },*/ /* NEITHER LESS-THAN NOR EQUAL TO */ /*{ 0x00002271, 0x00002265, 0x00000338 },*/ /* NEITHER GREATER-THAN NOR EQUAL TO */ /*{ 0x00002274, 0x00002272, 0x00000338 },*/ /* NEITHER LESS-THAN NOR EQUIVALENT TO */ /*{ 0x00002275, 0x00002273, 0x00000338 },*/ /* NEITHER GREATER-THAN NOR EQUIVALENT TO */ /*{ 0x00002278, 0x00002276, 0x00000338 },*/ /* NEITHER LESS-THAN NOR GREATER-THAN */ /*{ 0x00002279, 0x00002277, 0x00000338 },*/ /* NEITHER GREATER-THAN NOR LESS-THAN */ /*{ 0x00002280, 0x0000227A, 0x00000338 },*/ /* DOES NOT PRECEDE */ /*{ 0x00002281, 0x0000227B, 0x00000338 },*/ /* DOES NOT SUCCEED */ /*{ 0x00002284, 0x00002282, 0x00000338 },*/ /* NOT A SUBSET OF */ /*{ 0x00002285, 0x00002283, 0x00000338 },*/ /* NOT A SUPERSET OF */ /*{ 0x00002288, 0x00002286, 0x00000338 },*/ /* NEITHER A SUBSET OF NOR EQUAL TO */ /*{ 0x00002289, 0x00002287, 0x00000338 },*/ /* NEITHER A SUPERSET OF NOR EQUAL TO */ /*{ 0x000022AC, 0x000022A2, 0x00000338 },*/ /* DOES NOT PROVE */ /*{ 0x000022AD, 0x000022A8, 0x00000338 },*/ /* NOT TRUE */ /*{ 0x000022AE, 0x000022A9, 0x00000338 },*/ /* DOES NOT FORCE */ /*{ 0x000022AF, 0x000022AB, 0x00000338 },*/ /* NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE */ /*{ 0x000022E0, 0x0000227C, 0x00000338 },*/ /* DOES NOT PRECEDE OR EQUAL */ /*{ 0x000022E1, 0x0000227D, 0x00000338 },*/ /* DOES NOT SUCCEED OR EQUAL */ /*{ 0x000022E2, 0x00002291, 0x00000338 },*/ /* NOT SQUARE IMAGE OF OR EQUAL TO */ /*{ 0x000022E3, 0x00002292, 0x00000338 },*/ /* NOT SQUARE ORIGINAL OF OR EQUAL TO */ /*{ 0x000022EA, 0x000022B2, 0x00000338 },*/ /* NOT NORMAL SUBGROUP OF */ /*{ 0x000022EB, 0x000022B3, 0x00000338 },*/ /* DOES NOT CONTAIN AS NORMAL SUBGROUP */ /*{ 0x000022EC, 0x000022B4, 0x00000338 },*/ /* NOT NORMAL SUBGROUP OF OR EQUAL TO */ /*{ 0x000022ED, 0x000022B5, 0x00000338 },*/ /* DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL */ /*{ 0x00002ADC, 0x00002ADD, 0x00000338 },*/ /* FORKING */ { 0x0000304C, 0x0000304B, 0x00003099 }, /* HIRAGANA LETTER GA */ { 0x0000304E, 0x0000304D, 0x00003099 }, /* HIRAGANA LETTER GI */ { 0x00003050, 0x0000304F, 0x00003099 }, /* HIRAGANA LETTER GU */ { 0x00003052, 0x00003051, 0x00003099 }, /* HIRAGANA LETTER GE */ { 0x00003054, 0x00003053, 0x00003099 }, /* HIRAGANA LETTER GO */ { 0x00003056, 0x00003055, 0x00003099 }, /* HIRAGANA LETTER ZA */ { 0x00003058, 0x00003057, 0x00003099 }, /* HIRAGANA LETTER ZI */ { 0x0000305A, 0x00003059, 0x00003099 }, /* HIRAGANA LETTER ZU */ { 0x0000305C, 0x0000305B, 0x00003099 }, /* HIRAGANA LETTER ZE */ { 0x0000305E, 0x0000305D, 0x00003099 }, /* HIRAGANA LETTER ZO */ { 0x00003060, 0x0000305F, 0x00003099 }, /* HIRAGANA LETTER DA */ { 0x00003062, 0x00003061, 0x00003099 }, /* HIRAGANA LETTER DI */ { 0x00003065, 0x00003064, 0x00003099 }, /* HIRAGANA LETTER DU */ { 0x00003067, 0x00003066, 0x00003099 }, /* HIRAGANA LETTER DE */ { 0x00003069, 0x00003068, 0x00003099 }, /* HIRAGANA LETTER DO */ { 0x00003070, 0x0000306F, 0x00003099 }, /* HIRAGANA LETTER BA */ { 0x00003071, 0x0000306F, 0x0000309A }, /* HIRAGANA LETTER PA */ { 0x00003073, 0x00003072, 0x00003099 }, /* HIRAGANA LETTER BI */ { 0x00003074, 0x00003072, 0x0000309A }, /* HIRAGANA LETTER PI */ { 0x00003076, 0x00003075, 0x00003099 }, /* HIRAGANA LETTER BU */ { 0x00003077, 0x00003075, 0x0000309A }, /* HIRAGANA LETTER PU */ { 0x00003079, 0x00003078, 0x00003099 }, /* HIRAGANA LETTER BE */ { 0x0000307A, 0x00003078, 0x0000309A }, /* HIRAGANA LETTER PE */ { 0x0000307C, 0x0000307B, 0x00003099 }, /* HIRAGANA LETTER BO */ { 0x0000307D, 0x0000307B, 0x0000309A }, /* HIRAGANA LETTER PO */ { 0x00003094, 0x00003046, 0x00003099 }, /* HIRAGANA LETTER VU */ { 0x0000309E, 0x0000309D, 0x00003099 }, /* HIRAGANA VOICED ITERATION MARK */ { 0x000030AC, 0x000030AB, 0x00003099 }, /* KATAKANA LETTER GA */ { 0x000030AE, 0x000030AD, 0x00003099 }, /* KATAKANA LETTER GI */ { 0x000030B0, 0x000030AF, 0x00003099 }, /* KATAKANA LETTER GU */ { 0x000030B2, 0x000030B1, 0x00003099 }, /* KATAKANA LETTER GE */ { 0x000030B4, 0x000030B3, 0x00003099 }, /* KATAKANA LETTER GO */ { 0x000030B6, 0x000030B5, 0x00003099 }, /* KATAKANA LETTER ZA */ { 0x000030B8, 0x000030B7, 0x00003099 }, /* KATAKANA LETTER ZI */ { 0x000030BA, 0x000030B9, 0x00003099 }, /* KATAKANA LETTER ZU */ { 0x000030BC, 0x000030BB, 0x00003099 }, /* KATAKANA LETTER ZE */ { 0x000030BE, 0x000030BD, 0x00003099 }, /* KATAKANA LETTER ZO */ { 0x000030C0, 0x000030BF, 0x00003099 }, /* KATAKANA LETTER DA */ { 0x000030C2, 0x000030C1, 0x00003099 }, /* KATAKANA LETTER DI */ { 0x000030C5, 0x000030C4, 0x00003099 }, /* KATAKANA LETTER DU */ { 0x000030C7, 0x000030C6, 0x00003099 }, /* KATAKANA LETTER DE */ { 0x000030C9, 0x000030C8, 0x00003099 }, /* KATAKANA LETTER DO */ { 0x000030D0, 0x000030CF, 0x00003099 }, /* KATAKANA LETTER BA */ { 0x000030D1, 0x000030CF, 0x0000309A }, /* KATAKANA LETTER PA */ { 0x000030D3, 0x000030D2, 0x00003099 }, /* KATAKANA LETTER BI */ { 0x000030D4, 0x000030D2, 0x0000309A }, /* KATAKANA LETTER PI */ { 0x000030D6, 0x000030D5, 0x00003099 }, /* KATAKANA LETTER BU */ { 0x000030D7, 0x000030D5, 0x0000309A }, /* KATAKANA LETTER PU */ { 0x000030D9, 0x000030D8, 0x00003099 }, /* KATAKANA LETTER BE */ { 0x000030DA, 0x000030D8, 0x0000309A }, /* KATAKANA LETTER PE */ { 0x000030DC, 0x000030DB, 0x00003099 }, /* KATAKANA LETTER BO */ { 0x000030DD, 0x000030DB, 0x0000309A }, /* KATAKANA LETTER PO */ { 0x000030F4, 0x000030A6, 0x00003099 }, /* KATAKANA LETTER VU */ { 0x000030F7, 0x000030EF, 0x00003099 }, /* KATAKANA LETTER VA */ { 0x000030F8, 0x000030F0, 0x00003099 }, /* KATAKANA LETTER VI */ { 0x000030F9, 0x000030F1, 0x00003099 }, /* KATAKANA LETTER VE */ { 0x000030FA, 0x000030F2, 0x00003099 }, /* KATAKANA LETTER VO */ { 0x000030FE, 0x000030FD, 0x00003099 }, /* KATAKANA VOICED ITERATION MARK */ { 0x0000FB1D, 0x000005D9, 0x000005B4 }, /* HEBREW LETTER YOD WITH HIRIQ */ { 0x0000FB1F, 0x000005F2, 0x000005B7 }, /* HEBREW LIGATURE YIDDISH YOD YOD PATAH */ { 0x0000FB2A, 0x000005E9, 0x000005C1 }, /* HEBREW LETTER SHIN WITH SHIN DOT */ { 0x0000FB2B, 0x000005E9, 0x000005C2 }, /* HEBREW LETTER SHIN WITH SIN DOT */ { 0x0000FB2C, 0x0000FB49, 0x000005C1 }, /* HEBREW LETTER SHIN WITH DAGESH AND SHIN DOT */ { 0x0000FB2D, 0x0000FB49, 0x000005C2 }, /* HEBREW LETTER SHIN WITH DAGESH AND SIN DOT */ { 0x0000FB2E, 0x000005D0, 0x000005B7 }, /* HEBREW LETTER ALEF WITH PATAH */ { 0x0000FB2F, 0x000005D0, 0x000005B8 }, /* HEBREW LETTER ALEF WITH QAMATS */ { 0x0000FB30, 0x000005D0, 0x000005BC }, /* HEBREW LETTER ALEF WITH MAPIQ */ { 0x0000FB31, 0x000005D1, 0x000005BC }, /* HEBREW LETTER BET WITH DAGESH */ { 0x0000FB32, 0x000005D2, 0x000005BC }, /* HEBREW LETTER GIMEL WITH DAGESH */ { 0x0000FB33, 0x000005D3, 0x000005BC }, /* HEBREW LETTER DALET WITH DAGESH */ { 0x0000FB34, 0x000005D4, 0x000005BC }, /* HEBREW LETTER HE WITH MAPIQ */ { 0x0000FB35, 0x000005D5, 0x000005BC }, /* HEBREW LETTER VAV WITH DAGESH */ { 0x0000FB36, 0x000005D6, 0x000005BC }, /* HEBREW LETTER ZAYIN WITH DAGESH */ { 0x0000FB38, 0x000005D8, 0x000005BC }, /* HEBREW LETTER TET WITH DAGESH */ { 0x0000FB39, 0x000005D9, 0x000005BC }, /* HEBREW LETTER YOD WITH DAGESH */ { 0x0000FB3A, 0x000005DA, 0x000005BC }, /* HEBREW LETTER FINAL KAF WITH DAGESH */ { 0x0000FB3B, 0x000005DB, 0x000005BC }, /* HEBREW LETTER KAF WITH DAGESH */ { 0x0000FB3C, 0x000005DC, 0x000005BC }, /* HEBREW LETTER LAMED WITH DAGESH */ { 0x0000FB3E, 0x000005DE, 0x000005BC }, /* HEBREW LETTER MEM WITH DAGESH */ { 0x0000FB40, 0x000005E0, 0x000005BC }, /* HEBREW LETTER NUN WITH DAGESH */ { 0x0000FB41, 0x000005E1, 0x000005BC }, /* HEBREW LETTER SAMEKH WITH DAGESH */ { 0x0000FB43, 0x000005E3, 0x000005BC }, /* HEBREW LETTER FINAL PE WITH DAGESH */ { 0x0000FB44, 0x000005E4, 0x000005BC }, /* HEBREW LETTER PE WITH DAGESH */ { 0x0000FB46, 0x000005E6, 0x000005BC }, /* HEBREW LETTER TSADI WITH DAGESH */ { 0x0000FB47, 0x000005E7, 0x000005BC }, /* HEBREW LETTER QOF WITH DAGESH */ { 0x0000FB48, 0x000005E8, 0x000005BC }, /* HEBREW LETTER RESH WITH DAGESH */ { 0x0000FB49, 0x000005E9, 0x000005BC }, /* HEBREW LETTER SHIN WITH DAGESH */ { 0x0000FB4A, 0x000005EA, 0x000005BC }, /* HEBREW LETTER TAV WITH DAGESH */ { 0x0000FB4B, 0x000005D5, 0x000005B9 }, /* HEBREW LETTER VAV WITH HOLAM */ { 0x0000FB4C, 0x000005D1, 0x000005BF }, /* HEBREW LETTER BET WITH RAFE */ { 0x0000FB4D, 0x000005DB, 0x000005BF }, /* HEBREW LETTER KAF WITH RAFE */ { 0x0000FB4E, 0x000005E4, 0x000005BF }, /* HEBREW LETTER PE WITH RAFE */ /*{ 0x0001109A, 0x00011099, 0x000110BA },*/ /* KAITHI LETTER DDDHA */ /*{ 0x0001109C, 0x0001109B, 0x000110BA },*/ /* KAITHI LETTER RHA */ /*{ 0x000110AB, 0x000110A5, 0x000110BA },*/ /* KAITHI LETTER VA */ /*{ 0x0001D15E, 0x0001D157, 0x0001D165 },*/ /* MUSICAL SYMBOL HALF NOTE */ /*{ 0x0001D15F, 0x0001D158, 0x0001D165 },*/ /* MUSICAL SYMBOL QUARTER NOTE */ /*{ 0x0001D160, 0x0001D15F, 0x0001D16E },*/ /* MUSICAL SYMBOL EIGHTH NOTE */ /*{ 0x0001D161, 0x0001D15F, 0x0001D16F },*/ /* MUSICAL SYMBOL SIXTEENTH NOTE */ /*{ 0x0001D162, 0x0001D15F, 0x0001D170 },*/ /* MUSICAL SYMBOL THIRTY-SECOND NOTE */ /*{ 0x0001D163, 0x0001D15F, 0x0001D171 },*/ /* MUSICAL SYMBOL SIXTY-FOURTH NOTE */ /*{ 0x0001D164, 0x0001D15F, 0x0001D172 },*/ /* MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH NOTE */ /*{ 0x0001D1BB, 0x0001D1B9, 0x0001D165 },*/ /* MUSICAL SYMBOL MINIMA */ /*{ 0x0001D1BC, 0x0001D1BA, 0x0001D165 },*/ /* MUSICAL SYMBOL MINIMA BLACK */ /*{ 0x0001D1BD, 0x0001D1BB, 0x0001D16E },*/ /* MUSICAL SYMBOL SEMIMINIMA WHITE */ /*{ 0x0001D1BE, 0x0001D1BC, 0x0001D16E },*/ /* MUSICAL SYMBOL SEMIMINIMA BLACK */ /*{ 0x0001D1BF, 0x0001D1BB, 0x0001D16F },*/ /* MUSICAL SYMBOL FUSA WHITE */ /*{ 0x0001D1C0, 0x0001D1BC, 0x0001D16F },*/ /* MUSICAL SYMBOL FUSA BLACK */ }; static const struct { unsigned int replacement_sp; unsigned int base_sp; unsigned int comb_sp; } precompositions_sp[] = { { 0xD804DC9A, 0xD804DC99, 0xD804DCBA }, /* KAITHI LETTER DDDHA */ { 0xD804DC9C, 0xD804DC9B, 0xD804DCBA }, /* KAITHI LETTER RHA */ { 0xD804DCAB, 0xD804DCA5, 0xD804DCBA }, /* KAITHI LETTER VA */ { 0xD834DD5E, 0xD834DD57, 0xD834DD65 }, /* MUSICAL SYMBOL HALF NOTE */ { 0xD834DD5F, 0xD834DD58, 0xD834DD65 }, /* MUSICAL SYMBOL QUARTER NOTE */ { 0xD834DD60, 0xD834DD5F, 0xD834DD6E }, /* MUSICAL SYMBOL EIGHTH NOTE */ { 0xD834DD61, 0xD834DD5F, 0xD834DD6F }, /* MUSICAL SYMBOL SIXTEENTH NOTE */ { 0xD834DD62, 0xD834DD5F, 0xD834DD70 }, /* MUSICAL SYMBOL THIRTY-SECOND NOTE */ { 0xD834DD63, 0xD834DD5F, 0xD834DD71 }, /* MUSICAL SYMBOL SIXTY-FOURTH NOTE */ { 0xD834DD64, 0xD834DD5F, 0xD834DD72 }, /* MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH NOTE */ { 0xD834DDBB, 0xD834DDB9, 0xD834DD65 }, /* MUSICAL SYMBOL MINIMA */ { 0xD834DDBC, 0xD834DDBA, 0xD834DD65 }, /* MUSICAL SYMBOL MINIMA BLACK */ { 0xD834DDBD, 0xD834DDBB, 0xD834DD6E }, /* MUSICAL SYMBOL SEMIMINIMA WHITE */ { 0xD834DDBF, 0xD834DDBB, 0xD834DD6F }, /* MUSICAL SYMBOL FUSA WHITE */ { 0xD834DDBE, 0xD834DDBC, 0xD834DD6E }, /* MUSICAL SYMBOL SEMIMINIMA BLACK */ { 0xD834DDC0, 0xD834DDBC, 0xD834DD6F }, /* MUSICAL SYMBOL FUSA BLACK */ }; static const struct { unsigned int replacement_sp; unsigned int base_sp; unsigned int comb_sp; } decompositions_sp[] = { { 0xD804DC9A, 0xD804DC99, 0xD804DCBA }, /* KAITHI LETTER DDDHA */ { 0xD804DC9C, 0xD804DC9B, 0xD804DCBA }, /* KAITHI LETTER RHA */ { 0xD804DCAB, 0xD804DCA5, 0xD804DCBA }, /* KAITHI LETTER VA */ { 0xD834DD5E, 0xD834DD57, 0xD834DD65 }, /* MUSICAL SYMBOL HALF NOTE */ { 0xD834DD5F, 0xD834DD58, 0xD834DD65 }, /* MUSICAL SYMBOL QUARTER NOTE */ { 0xD834DD60, 0xD834DD5F, 0xD834DD6E }, /* MUSICAL SYMBOL EIGHTH NOTE */ { 0xD834DD61, 0xD834DD5F, 0xD834DD6F }, /* MUSICAL SYMBOL SIXTEENTH NOTE */ { 0xD834DD62, 0xD834DD5F, 0xD834DD70 }, /* MUSICAL SYMBOL THIRTY-SECOND NOTE */ { 0xD834DD63, 0xD834DD5F, 0xD834DD71 }, /* MUSICAL SYMBOL SIXTY-FOURTH NOTE */ { 0xD834DD64, 0xD834DD5F, 0xD834DD72 }, /* MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH NOTE */ { 0xD834DDBB, 0xD834DDB9, 0xD834DD65 }, /* MUSICAL SYMBOL MINIMA */ { 0xD834DDBC, 0xD834DDBA, 0xD834DD65 }, /* MUSICAL SYMBOL MINIMA BLACK */ { 0xD834DDBD, 0xD834DDBB, 0xD834DD6E }, /* MUSICAL SYMBOL SEMIMINIMA WHITE */ { 0xD834DDBE, 0xD834DDBC, 0xD834DD6E }, /* MUSICAL SYMBOL SEMIMINIMA BLACK */ { 0xD834DDBF, 0xD834DDBB, 0xD834DD6F }, /* MUSICAL SYMBOL FUSA WHITE */ { 0xD834DDC0, 0xD834DDBC, 0xD834DD6F }, /* MUSICAL SYMBOL FUSA BLACK */ }; /* EOF */ netatalk-2.2.2/libatalk/unicode/utf16_case.c0000644000175200017500000000612011655731245015570 00000000000000/* DO NOT EDIT BY HAND!!! This file is generated by contrib/shell_utils/make-casetable.pl UnicodeData.txt utf16_casetable.h utf16_case.c UnicodeData.txt is got from http://www.unicode.org/Public/UNIDATA/UnicodeData.txt */ #include #include #include "utf16_casetable.h" /******************************************************************* Convert a wide character to upper case. *******************************************************************/ ucs2_t toupper_w(ucs2_t val) { if ( val <= 0x02BF) return upper_table_1[val]; if ( val >= 0x0340 && val <= 0x05BF) return upper_table_2[val-0x0340]; if ( val >= 0x1D40 && val <= 0x1D7F) return upper_table_3[val-0x1D40]; if ( val >= 0x1E00 && val <= 0x1FFF) return upper_table_4[val-0x1E00]; if ( val >= 0x2140 && val <= 0x21BF) return upper_table_5[val-0x2140]; if ( val >= 0x24C0 && val <= 0x24FF) return upper_table_6[val-0x24C0]; if ( val >= 0x2C00 && val <= 0x2D3F) return upper_table_7[val-0x2C00]; if ( val >= 0xA640 && val <= 0xA6BF) return upper_table_8[val-0xA640]; if ( val >= 0xA700 && val <= 0xA7BF) return upper_table_9[val-0xA700]; if ( val >= 0xFF40 && val <= 0xFF7F) return upper_table_10[val-0xFF40]; return (val); } /******************************************************************* Convert a surrogate pair to upper case. *******************************************************************/ uint32_t toupper_sp(uint32_t val) { if ( val >= 0xD801DC00 && val <= 0xD801DC7F) return upper_table_sp_1[val-0xD801DC00]; return (val); } /******************************************************************* Convert a wide character to lower case. *******************************************************************/ ucs2_t tolower_w(ucs2_t val) { if ( val <= 0x007F) return lower_table_1[val]; if ( val >= 0x00C0 && val <= 0x027F) return lower_table_2[val-0x00C0]; if ( val >= 0x0340 && val <= 0x057F) return lower_table_3[val-0x0340]; if ( val >= 0x1080 && val <= 0x10FF) return lower_table_4[val-0x1080]; if ( val >= 0x1E00 && val <= 0x1FFF) return lower_table_5[val-0x1E00]; if ( val >= 0x2100 && val <= 0x21BF) return lower_table_6[val-0x2100]; if ( val >= 0x2480 && val <= 0x24FF) return lower_table_7[val-0x2480]; if ( val >= 0x2C00 && val <= 0x2CFF) return lower_table_8[val-0x2C00]; if ( val >= 0xA640 && val <= 0xA6BF) return lower_table_9[val-0xA640]; if ( val >= 0xA700 && val <= 0xA7BF) return lower_table_10[val-0xA700]; if ( val >= 0xFF00 && val <= 0xFF3F) return lower_table_11[val-0xFF00]; return (val); } /******************************************************************* Convert a surrogate pair to lower case. *******************************************************************/ uint32_t tolower_sp(uint32_t val) { if ( val >= 0xD801DC00 && val <= 0xD801DC3F) return lower_table_sp_1[val-0xD801DC00]; return (val); } /* EOF */ netatalk-2.2.2/libatalk/unicode/charcnv.c0000644000175200017500000007763311656515156015277 00000000000000/* Unix SMB/CIFS implementation. Character set conversion Extensions Copyright (C) Igor Vergeichik 2001 Copyright (C) Andrew Tridgell 2001 Copyright (C) Simo Sorce 2001 Copyright (C) Martin Pool 2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #ifdef HAVE_USABLE_ICONV #include #endif #if HAVE_LOCALE_H #include #endif #if HAVE_LANGINFO_H #include #endif #include #include #include #include #include "byteorder.h" /** * @file * * @brief Character-set conversion routines built on our iconv. * * @note Samba's internal character set (at least in the 3.0 series) * is always the same as the one for the Unix filesystem. It is * not necessarily UTF-8 and may be different on machines that * need i18n filenames to be compatible with Unix software. It does * have to be a superset of ASCII. All multibyte sequences must start * with a byte with the high bit set. * * @sa lib/iconv.c */ #define MAX_CHARSETS 20 #define CHECK_FLAGS(a,b) (((a)!=NULL) ? (*(a) & (b)) : 0 ) static atalk_iconv_t conv_handles[MAX_CHARSETS][MAX_CHARSETS]; static char* charset_names[MAX_CHARSETS]; static struct charset_functions* charsets[MAX_CHARSETS]; static char hexdig[] = "0123456789abcdef"; #define hextoint( c ) ( isdigit( c ) ? c - '0' : c + 10 - 'a' ) static char* read_charsets_from_env(charset_t ch) { char *name; switch (ch) { case CH_MAC: if (( name = getenv( "ATALK_MAC_CHARSET" )) != NULL ) return name; else return "MAC_ROMAN"; break; case CH_UNIX: if (( name = getenv( "ATALK_UNIX_CHARSET" )) != NULL ) return name; else return "LOCALE"; break; default: break; } return "ASCII"; } /** * Return the name of a charset to give to iconv(). **/ static const char *charset_name(charset_t ch) { const char *ret = NULL; static int first = 1; static char macname[128]; static char unixname[128]; if (first) { memset(macname, 0, sizeof(macname)); memset(unixname, 0, sizeof(unixname)); first = 0; } if (ch == CH_UCS2) ret = "UCS-2"; else if (ch == CH_UTF8) ret = "UTF8"; else if (ch == CH_UTF8_MAC) ret = "UTF8-MAC"; else if (ch == CH_UNIX) { if (unixname[0] == '\0') { ret = read_charsets_from_env(CH_UNIX); strlcpy(unixname, ret, sizeof(unixname)); } else ret = unixname; } else if (ch == CH_MAC) { if (macname[0] == '\0') { ret = read_charsets_from_env(CH_MAC); strlcpy(macname, ret, sizeof(macname)); } else ret = macname; } if (!ret) ret = charset_names[ch]; #if defined(HAVE_NL_LANGINFO) && defined(CODESET) if (ret && strcasecmp(ret, "LOCALE") == 0) { const char *ln = NULL; #ifdef HAVE_SETLOCALE setlocale(LC_ALL, ""); #endif ln = nl_langinfo(CODESET); if (ln) { /* Check whether the charset name is supported by iconv */ atalk_iconv_t handle = atalk_iconv_open(ln, "UCS-2"); if (handle == (atalk_iconv_t) -1) { LOG(log_debug, logtype_default, "Locale charset '%s' unsupported, using ASCII instead", ln); ln = "ASCII"; } else { atalk_iconv_close(handle); } if (ch==CH_UNIX) strlcpy(unixname, ln, sizeof(unixname)); } ret = ln; } #else /* system doesn't have LOCALE support */ if (ch == CH_UNIX) ret = NULL; #endif if (!ret || !*ret) ret = "ASCII"; return ret; } static struct charset_functions* get_charset_functions (charset_t ch) { if (charsets[ch] != NULL) return charsets[ch]; charsets[ch] = find_charset_functions(charset_name(ch)); return charsets[ch]; } static void lazy_initialize_conv(void) { static int initialized = 0; if (!initialized) { initialized = 1; init_iconv(); } } charset_t add_charset(const char* name) { static charset_t max_charset_t = NUM_CHARSETS-1; charset_t cur_charset_t = max_charset_t+1; unsigned int c1; lazy_initialize_conv(); for (c1=0; c1<=max_charset_t;c1++) { if ( strcasecmp(name, charset_name(c1)) == 0) return (c1); } if ( cur_charset_t >= MAX_CHARSETS ) { LOG (log_debug, logtype_default, "Adding charset %s failed, too many charsets (max. %u allowed)", name, MAX_CHARSETS); return (charset_t) -1; } /* First try to setup the required conversions */ conv_handles[cur_charset_t][CH_UCS2] = atalk_iconv_open( charset_name(CH_UCS2), name); if (conv_handles[cur_charset_t][CH_UCS2] == (atalk_iconv_t)-1) { LOG(log_error, logtype_default, "Required conversion from %s to %s not supported", name, charset_name(CH_UCS2)); conv_handles[cur_charset_t][CH_UCS2] = NULL; return (charset_t) -1; } conv_handles[CH_UCS2][cur_charset_t] = atalk_iconv_open( name, charset_name(CH_UCS2)); if (conv_handles[CH_UCS2][cur_charset_t] == (atalk_iconv_t)-1) { LOG(log_error, logtype_default, "Required conversion from %s to %s not supported", charset_name(CH_UCS2), name); conv_handles[CH_UCS2][cur_charset_t] = NULL; return (charset_t) -1; } /* register the new charset_t name */ charset_names[cur_charset_t] = strdup(name); charsets[cur_charset_t] = get_charset_functions (cur_charset_t); max_charset_t++; #ifdef DEBUG LOG(log_debug9, logtype_default, "Added charset %s with handle %u", name, cur_charset_t); #endif return (cur_charset_t); } /** * Initialize iconv conversion descriptors. * * This is called the first time it is needed, and also called again * every time the configuration is reloaded, because the charset or * codepage might have changed. **/ void init_iconv(void) { int c1; for (c1=0;c1= 2) { buf[len] = 0; buf[len+1] = 0; } else if ( to != CH_UCS2 && bytesleft > 0 ) buf[len] = 0; else { errno = E2BIG; return (size_t)(-1); } return len; } /** * Convert string from one encoding to another, making error checking etc * * @param src pointer to source string (multibyte or singlebyte) * @param srclen length of the source string in bytes * @param dest pointer to destination string (multibyte or singlebyte) * @param destlen maximal length allowed for string * @returns the number of bytes occupied in the destination **/ static size_t convert_string_internal(charset_t from, charset_t to, void const *src, size_t srclen, void *dest, size_t destlen) { size_t i_len, o_len; size_t retval; const char* inbuf = (const char*)src; char* outbuf = (char*)dest; char* o_save = outbuf; atalk_iconv_t descriptor; /* Fixed based on Samba 3.0.6 */ if (srclen == (size_t)-1) { if (from == CH_UCS2) { srclen = (strlen_w((const ucs2_t *)src)) * 2; } else { srclen = strlen((const char *)src); } } lazy_initialize_conv(); descriptor = conv_handles[from][to]; if (descriptor == (atalk_iconv_t)-1 || descriptor == (atalk_iconv_t)0) { return (size_t) -1; } i_len=srclen; o_len=destlen; retval = atalk_iconv(descriptor, &inbuf, &i_len, &outbuf, &o_len); if(retval==(size_t)-1) { const char *reason="unknown error"; switch(errno) { case EINVAL: reason="Incomplete multibyte sequence"; break; case E2BIG: reason="No more room"; break; case EILSEQ: reason="Illegal multibyte sequence"; break; } LOG(log_debug, logtype_default,"Conversion error: %s",reason); return (size_t)-1; } /* Terminate the string */ return add_null( to, o_save, o_len, destlen -o_len); } size_t convert_string(charset_t from, charset_t to, void const *src, size_t srclen, void *dest, size_t destlen) { size_t i_len, o_len; ucs2_t *u; ucs2_t buffer[MAXPATHLEN]; ucs2_t buffer2[MAXPATHLEN]; /* convert from_set to UCS2 */ if ((size_t)-1 == ( o_len = convert_string_internal( from, CH_UCS2, src, srclen, (char*) buffer, sizeof(buffer))) ) { LOG(log_error, logtype_default, "Conversion failed ( %s to CH_UCS2 )", charset_name(from)); return (size_t) -1; } /* Do pre/decomposition */ i_len = sizeof(buffer2); u = buffer2; if (charsets[to] && (charsets[to]->flags & CHARSET_DECOMPOSED) ) { if ( (size_t)-1 == (i_len = decompose_w(buffer, o_len, u, &i_len)) ) return (size_t)-1; } else if (!charsets[from] || (charsets[from]->flags & CHARSET_DECOMPOSED)) { if ( (size_t)-1 == (i_len = precompose_w(buffer, o_len, u, &i_len)) ) return (size_t)-1; } else { u = buffer; i_len = o_len; } /* Convert UCS2 to to_set */ if ((size_t)(-1) == ( o_len = convert_string_internal( CH_UCS2, to, (char*) u, i_len, dest, destlen)) ) { LOG(log_error, logtype_default, "Conversion failed (CH_UCS2 to %s):%s", charset_name(to), strerror(errno)); return (size_t) -1; } return o_len; } /** * Convert between character sets, allocating a new buffer for the result. * * @param srclen length of source buffer. * @param dest always set at least to NULL * @note -1 is not accepted for srclen. * * @returns Size in bytes of the converted string; or -1 in case of error. **/ static size_t convert_string_allocate_internal(charset_t from, charset_t to, void const *src, size_t srclen, char **dest) { size_t i_len, o_len, destlen; size_t retval; const char *inbuf = (const char *)src; char *outbuf = NULL, *ob = NULL; atalk_iconv_t descriptor; *dest = NULL; if (src == NULL || srclen == (size_t)-1) return (size_t)-1; lazy_initialize_conv(); descriptor = conv_handles[from][to]; if (descriptor == (atalk_iconv_t)-1 || descriptor == (atalk_iconv_t)0) { /* conversion not supported, return -1*/ LOG(log_debug, logtype_default, "convert_string_allocate: conversion not supported!"); return -1; } destlen = MAX(srclen, 512); convert: destlen = destlen * 2; outbuf = (char *)realloc(ob, destlen); if (!outbuf) { LOG(log_debug, logtype_default,"convert_string_allocate: realloc failed!"); SAFE_FREE(ob); return (size_t)-1; } else { ob = outbuf; } inbuf = src; /* this restarts the whole conversion if buffer needed to be increased */ i_len = srclen; o_len = destlen; retval = atalk_iconv(descriptor, &inbuf, &i_len, &outbuf, &o_len); if(retval == (size_t)-1) { const char *reason="unknown error"; switch(errno) { case EINVAL: reason="Incomplete multibyte sequence"; break; case E2BIG: goto convert; case EILSEQ: reason="Illegal multibyte sequence"; break; } LOG(log_debug, logtype_default,"Conversion error: %s(%s)",reason,inbuf); SAFE_FREE(ob); return (size_t)-1; } destlen = destlen - o_len; /* Terminate the string */ if (to == CH_UCS2 && o_len >= 2) { ob[destlen] = 0; ob[destlen+1] = 0; *dest = (char *)realloc(ob,destlen+2); } else if ( to != CH_UCS2 && o_len > 0 ) { ob[destlen] = 0; *dest = (char *)realloc(ob,destlen+1); } else { goto convert; /* realloc */ } if (destlen && !*dest) { LOG(log_debug, logtype_default, "convert_string_allocate: out of memory!"); SAFE_FREE(ob); return (size_t)-1; } return destlen; } size_t convert_string_allocate(charset_t from, charset_t to, void const *src, size_t srclen, char ** dest) { size_t i_len, o_len; ucs2_t *u; ucs2_t buffer[MAXPATHLEN]; ucs2_t buffer2[MAXPATHLEN]; *dest = NULL; /* convert from_set to UCS2 */ if ((size_t)(-1) == ( o_len = convert_string_internal( from, CH_UCS2, src, srclen, buffer, sizeof(buffer))) ) { LOG(log_error, logtype_default, "Conversion failed ( %s to CH_UCS2 )", charset_name(from)); return (size_t) -1; } /* Do pre/decomposition */ i_len = sizeof(buffer2); u = buffer2; if (charsets[to] && (charsets[to]->flags & CHARSET_DECOMPOSED) ) { if ( (size_t)-1 == (i_len = decompose_w(buffer, o_len, u, &i_len)) ) return (size_t)-1; } else if ( !charsets[from] || (charsets[from]->flags & CHARSET_DECOMPOSED) ) { if ( (size_t)-1 == (i_len = precompose_w(buffer, o_len, u, &i_len)) ) return (size_t)-1; } else { u = buffer; i_len = o_len; } /* Convert UCS2 to to_set */ if ((size_t)-1 == ( o_len = convert_string_allocate_internal( CH_UCS2, to, (char*)u, i_len, dest)) ) LOG(log_error, logtype_default, "Conversion failed (CH_UCS2 to %s):%s", charset_name(to), strerror(errno)); return o_len; } size_t charset_strupper(charset_t ch, const char *src, size_t srclen, char *dest, size_t destlen) { size_t size; char *buffer; size = convert_string_allocate_internal(ch, CH_UCS2, src, srclen, (char**) &buffer); if (size == (size_t)-1) { SAFE_FREE(buffer); return size; } if (!strupper_w((ucs2_t *)buffer) && (dest == src)) { free(buffer); return srclen; } size = convert_string_internal(CH_UCS2, ch, buffer, size, dest, destlen); free(buffer); return size; } size_t charset_strlower(charset_t ch, const char *src, size_t srclen, char *dest, size_t destlen) { size_t size; char *buffer; size = convert_string_allocate_internal(ch, CH_UCS2, src, srclen, (char **) &buffer); if (size == (size_t)-1) { SAFE_FREE(buffer); return size; } if (!strlower_w((ucs2_t *)buffer) && (dest == src)) { free(buffer); return srclen; } size = convert_string_internal(CH_UCS2, ch, buffer, size, dest, destlen); free(buffer); return size; } size_t unix_strupper(const char *src, size_t srclen, char *dest, size_t destlen) { return charset_strupper( CH_UNIX, src, srclen, dest, destlen); } size_t unix_strlower(const char *src, size_t srclen, char *dest, size_t destlen) { return charset_strlower( CH_UNIX, src, srclen, dest, destlen); } size_t utf8_strupper(const char *src, size_t srclen, char *dest, size_t destlen) { return charset_strupper( CH_UTF8, src, srclen, dest, destlen); } size_t utf8_strlower(const char *src, size_t srclen, char *dest, size_t destlen) { return charset_strlower( CH_UTF8, src, srclen, dest, destlen); } /** * Copy a string from a charset_t char* src to a UCS2 destination, allocating a buffer * * @param dest always set at least to NULL * * @returns The number of bytes occupied by the string in the destination * or -1 in case of error. **/ size_t charset_to_ucs2_allocate(charset_t ch, ucs2_t **dest, const char *src) { size_t src_len = strlen(src); *dest = NULL; return convert_string_allocate(ch, CH_UCS2, src, src_len, (char**) dest); } /** ----------------------------------- * Copy a string from a charset_t char* src to a UTF-8 destination, allocating a buffer * * @param dest always set at least to NULL * * @returns The number of bytes occupied by the string in the destination **/ size_t charset_to_utf8_allocate(charset_t ch, char **dest, const char *src) { size_t src_len = strlen(src); *dest = NULL; return convert_string_allocate(ch, CH_UTF8, src, src_len, dest); } /** ----------------------------------- * Copy a string from a UCS2 src to a unix char * destination, allocating a buffer * * @param dest always set at least to NULL * * @returns The number of bytes occupied by the string in the destination **/ size_t ucs2_to_charset(charset_t ch, const ucs2_t *src, char *dest, size_t destlen) { size_t src_len = (strlen_w(src)) * sizeof(ucs2_t); return convert_string(CH_UCS2, ch, src, src_len, dest, destlen); } /* --------------------------------- */ size_t ucs2_to_charset_allocate(charset_t ch, char **dest, const ucs2_t *src) { size_t src_len = (strlen_w(src)) * sizeof(ucs2_t); *dest = NULL; return convert_string_allocate(CH_UCS2, ch, src, src_len, dest); } /** --------------------------------- * Copy a string from a UTF-8 src to a unix char * destination, allocating a buffer * * @param dest always set at least to NULL * * @returns The number of bytes occupied by the string in the destination **/ size_t utf8_to_charset_allocate(charset_t ch, char **dest, const char *src) { size_t src_len = strlen(src); *dest = NULL; return convert_string_allocate(CH_UTF8, ch, src, src_len, dest); } size_t charset_precompose ( charset_t ch, char * src, size_t inlen, char * dst, size_t outlen) { char *buffer; ucs2_t u[MAXPATHLEN]; size_t len; size_t ilen; if ((size_t)(-1) == (len = convert_string_allocate_internal(ch, CH_UCS2, src, inlen, &buffer)) ) return len; ilen=sizeof(u); if ( (size_t)-1 == (ilen = precompose_w((ucs2_t *)buffer, len, u, &ilen)) ) { free (buffer); return (size_t)(-1); } if ((size_t)(-1) == (len = convert_string_internal( CH_UCS2, ch, (char*)u, ilen, dst, outlen)) ) { free (buffer); return (size_t)(-1); } free(buffer); return (len); } size_t charset_decompose ( charset_t ch, char * src, size_t inlen, char * dst, size_t outlen) { char *buffer; ucs2_t u[MAXPATHLEN]; size_t len; size_t ilen; if ((size_t)(-1) == (len = convert_string_allocate_internal(ch, CH_UCS2, src, inlen, &buffer)) ) return len; ilen=sizeof(u); if ( (size_t)-1 == (ilen = decompose_w((ucs2_t *)buffer, len, u, &ilen)) ) { free (buffer); return (size_t)(-1); } if ((size_t)(-1) == (len = convert_string_internal( CH_UCS2, ch, (char*)u, ilen, dst, outlen)) ) { free (buffer); return (size_t)(-1); } free(buffer); return (len); } size_t utf8_precompose ( char * src, size_t inlen, char * dst, size_t outlen) { return charset_precompose ( CH_UTF8, src, inlen, dst, outlen); } size_t utf8_decompose ( char * src, size_t inlen, char * dst, size_t outlen) { return charset_decompose ( CH_UTF8, src, inlen, dst, outlen); } #if 0 static char debugbuf[ MAXPATHLEN +1 ]; char * debug_out ( char * seq, size_t len) { size_t i = 0; unsigned char *p; char *q; p = (unsigned char*) seq; q = debugbuf; for ( i = 0; i<=(len-1); i++) { sprintf(q, "%2.2x.", *p); q += 3; p++; } *q=0; q = debugbuf; return q; } #endif /* * Convert from MB to UCS2 charset * Flags: * CONV_UNESCAPEHEX: ':XX' will be converted to an UCS2 character * CONV_IGNORE: return the first convertable characters. * CONV_FORCE: force convertion * FIXME: * This will *not* work if the destination charset is not multibyte, i.e. UCS2->UCS2 will fail * The (un)escape scheme is not compatible to the old cap style escape. This is bad, we need it * for e.g. HFS cdroms. */ static size_t pull_charset_flags (charset_t from_set, charset_t cap_set, const char *src, size_t srclen, char* dest, size_t destlen, u_int16_t *flags) { const u_int16_t option = (flags ? *flags : 0); size_t i_len, o_len; size_t j = 0; const char* inbuf = (const char*)src; char* outbuf = dest; atalk_iconv_t descriptor; atalk_iconv_t descriptor_cap; if (srclen == (size_t)-1) srclen = strlen(src) + 1; descriptor = conv_handles[from_set][CH_UCS2]; descriptor_cap = conv_handles[cap_set][CH_UCS2]; if (descriptor == (atalk_iconv_t)-1 || descriptor == (atalk_iconv_t)0) { errno = EINVAL; return (size_t)-1; } i_len=srclen; o_len=destlen; while (i_len > 0) { if ((option & CONV_UNESCAPEHEX)) { for (j = 0; j < i_len; ++j) { if (inbuf[j] == ':') break; } j = i_len - j; i_len -= j; } if (i_len > 0 && atalk_iconv(descriptor, &inbuf, &i_len, &outbuf, &o_len) == (size_t)-1) { if (errno == EILSEQ || errno == EINVAL) { errno = EILSEQ; if ((option & CONV_IGNORE)) { *flags |= CONV_REQMANGLE; return destlen - o_len; } if ((option & CONV__EILSEQ)) { if (o_len < 2) { errno = E2BIG; goto end; } *((ucs2_t *)outbuf) = (ucs2_t) IGNORE_CHAR; /**inbuf */ inbuf++; i_len--; outbuf += 2; o_len -= 2; /* FIXME reset stat ? */ continue; } } goto end; } if (j) { /* we're at the start on an hex encoded ucs2 char */ char h[MAXPATHLEN]; size_t hlen = 0; i_len = j, j = 0; while (i_len >= 3 && inbuf[0] == ':' && isxdigit(inbuf[1]) && isxdigit(inbuf[2])) { h[hlen++] = (hextoint(inbuf[1]) << 4) | hextoint(inbuf[2]); inbuf += 3; i_len -= 3; } if (hlen) { const char *h_buf = h; if (atalk_iconv(descriptor_cap, &h_buf, &hlen, &outbuf, &o_len) == (size_t)-1) { i_len += hlen * 3; inbuf -= hlen * 3; if (errno == EILSEQ && (option & CONV_IGNORE)) { *flags |= CONV_REQMANGLE; return destlen - o_len; } goto end; } } else { /* We have an invalid :xx sequence */ errno = EILSEQ; if ((option & CONV_IGNORE)) { *flags |= CONV_REQMANGLE; return destlen - o_len; } goto end; } } } end: return (i_len + j == 0 || (option & CONV_FORCE)) ? destlen - o_len : (size_t)-1; } /* * Convert from UCS2 to MB charset * Flags: * CONV_ESCAPEDOTS: escape leading dots * CONV_ESCAPEHEX: unconvertable characters and '/' will be escaped to :XX * CONV_IGNORE: return the first convertable characters. * CONV__EILSEQ: unconvertable characters will be replaced with '_' * CONV_FORCE: force convertion * FIXME: * CONV_IGNORE and CONV_ESCAPEHEX can't work together. Should we check this ? * This will *not* work if the destination charset is not multibyte, i.e. UCS2->UCS2 will fail * The escape scheme is not compatible to the old cap style escape. This is bad, we need it * for e.g. HFS cdroms. */ static size_t push_charset_flags (charset_t to_set, charset_t cap_set, char* src, size_t srclen, char* dest, size_t destlen, u_int16_t *flags) { const u_int16_t option = (flags ? *flags : 0); size_t i_len, o_len, i; size_t j = 0; const char* inbuf = (const char*)src; char* outbuf = (char*)dest; atalk_iconv_t descriptor; atalk_iconv_t descriptor_cap; char escch; /* 150210: uninitialized OK, depends on j */ descriptor = conv_handles[CH_UCS2][to_set]; descriptor_cap = conv_handles[CH_UCS2][cap_set]; if (descriptor == (atalk_iconv_t)-1 || descriptor == (atalk_iconv_t)0) { errno = EINVAL; return (size_t) -1; } i_len=srclen; o_len=destlen; if ((option & CONV_ESCAPEDOTS) && i_len >= 2 && SVAL(inbuf, 0) == 0x002e) { /* 0x002e = . */ if (o_len < 3) { errno = E2BIG; goto end; } *outbuf++ = ':'; *outbuf++ = '2'; *outbuf++ = 'e'; o_len -= 3; inbuf += 2; i_len -= 2; *flags |= CONV_REQESCAPE; } while (i_len >= 2) { if ((option & CONV_ESCAPEHEX)) { for (i = 0; i < i_len; i += 2) { ucs2_t c = SVAL(inbuf, i); switch (c) { case 0x003a: /* 0x003a = ':' */ if ( ! (option & CONV_ALLOW_COLON)) { errno = EILSEQ; goto end; } escch = c; j = i_len - i; i_len = i; break; case 0x002f: /* 0x002f = '/' */ escch = c; j = i_len - i; i_len = i; break; } } } while (i_len > 0 && atalk_iconv(descriptor, &inbuf, &i_len, &outbuf, &o_len) == (size_t)-1) { if (errno == EILSEQ) { if ((option & CONV_IGNORE)) { *flags |= CONV_REQMANGLE; return destlen - o_len; } if ((option & CONV_ESCAPEHEX)) { const size_t bufsiz = o_len / 3 + 1; char *buf = malloc(bufsiz); size_t buflen; if (!buf) goto end; i = i_len; for (buflen = 1; buflen <= bufsiz; ++buflen) { char *b = buf; size_t o = buflen; if (atalk_iconv(descriptor_cap, &inbuf, &i, &b, &o) != (size_t)-1) { buflen -= o; break; } else if (errno != E2BIG) { SAFE_FREE(buf); goto end; } else if (o < buflen) { buflen -= o; break; } } if (o_len < buflen * 3) { SAFE_FREE(buf); errno = E2BIG; goto end; } o_len -= buflen * 3; i_len = i; for (i = 0; i < buflen; ++i) { *outbuf++ = ':'; *outbuf++ = hexdig[(buf[i] >> 4) & 0x0f]; *outbuf++ = hexdig[buf[i] & 0x0f]; } SAFE_FREE(buf); *flags |= CONV_REQESCAPE; continue; } } goto end; } if (j) { i_len = j, j = 0; if (o_len < 3) { errno = E2BIG; goto end; } switch (escch) { case '/': *outbuf++ = ':'; *outbuf++ = '2'; *outbuf++ = 'f'; break; case ':': *outbuf++ = ':'; *outbuf++ = '3'; *outbuf++ = 'a'; break; default: /* * THIS SHOULD NEVER BE REACHED !!! * As a safety net I put in a ' ' here */ *outbuf++ = ':'; *outbuf++ = '2'; *outbuf++ = '0'; break; } o_len -= 3; inbuf += 2; i_len -= 2; } } if (i_len > 0) errno = EINVAL; end: return (i_len + j == 0 || (option & CONV_FORCE)) ? destlen - o_len : (size_t)-1; } /* * FIXME the size is a mess we really need a malloc/free logic *`dest size must be dest_len +2 */ size_t convert_charset ( charset_t from_set, charset_t to_set, charset_t cap_charset, const char *src, size_t src_len, char *dest, size_t dest_len, u_int16_t *flags) { size_t i_len, o_len; ucs2_t *u; ucs2_t buffer[MAXPATHLEN +2]; ucs2_t buffer2[MAXPATHLEN +2]; lazy_initialize_conv(); /* convert from_set to UCS2 */ if ((size_t)(-1) == ( o_len = pull_charset_flags( from_set, cap_charset, src, src_len, (char *) buffer, sizeof(buffer) -2, flags)) ) { LOG(log_error, logtype_default, "Conversion failed ( %s to CH_UCS2 )", charset_name(from_set)); return (size_t) -1; } if ( o_len == 0) return o_len; /* Do pre/decomposition */ i_len = sizeof(buffer2) -2; u = buffer2; if (CHECK_FLAGS(flags, CONV_DECOMPOSE) || (charsets[to_set] && (charsets[to_set]->flags & CHARSET_DECOMPOSED)) ) { if ( (size_t)-1 == (i_len = decompose_w(buffer, o_len, u, &i_len)) ) return (size_t)(-1); } else if (CHECK_FLAGS(flags, CONV_PRECOMPOSE) || !charsets[from_set] || (charsets[from_set]->flags & CHARSET_DECOMPOSED)) { if ( (size_t)-1 == (i_len = precompose_w(buffer, o_len, u, &i_len)) ) return (size_t)(-1); } else { u = buffer; i_len = o_len; } /* null terminate */ u[i_len] = 0; u[i_len +1] = 0; /* Do case conversions */ if (CHECK_FLAGS(flags, CONV_TOUPPER)) { strupper_w(u); } else if (CHECK_FLAGS(flags, CONV_TOLOWER)) { strlower_w(u); } /* Convert UCS2 to to_set */ if ((size_t)(-1) == ( o_len = push_charset_flags( to_set, cap_charset, (char *)u, i_len, dest, dest_len, flags )) ) { LOG(log_error, logtype_default, "Conversion failed (CH_UCS2 to %s):%s", charset_name(to_set), strerror(errno)); return (size_t) -1; } /* null terminate */ dest[o_len] = 0; dest[o_len +1] = 0; return o_len; } netatalk-2.2.2/libatalk/unicode/charsets/0000777000175200017500000000000011704770422015360 500000000000000netatalk-2.2.2/libatalk/unicode/charsets/Makefile.am0000644000175200017500000000115411655731127017335 00000000000000# Makefile.am for libatalk/unicode/charsets noinst_LTLIBRARIES = libcharsets.la AM_CFLAGS = -I$(top_srcdir)/sys @CFLAGS@ @ICONV_CFLAGS@ LIBS = libcharsets_la_SOURCES = \ mac_roman.c \ mac_greek.c \ mac_hebrew.c \ mac_centraleurope.c \ mac_turkish.c \ mac_cyrillic.c \ mac_japanese.c \ mac_chinese_trad.c \ mac_chinese_simp.c \ mac_korean.c \ generic_cjk.c \ generic_mb.c noinst_HEADERS = \ mac_roman.h \ mac_greek.h \ mac_centraleurope.h \ mac_hebrew.h \ mac_turkish.h \ mac_cyrillic.h \ mac_japanese.h \ mac_chinese_trad.h \ mac_chinese_simp.h \ mac_korean.h \ generic_cjk.h \ generic_mb.h netatalk-2.2.2/libatalk/unicode/charsets/Makefile.in0000644000175200017500000004221311703521730017336 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/unicode/charsets VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = libatalk/unicode/charsets DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcharsets_la_LIBADD = am_libcharsets_la_OBJECTS = mac_roman.lo mac_greek.lo mac_hebrew.lo \ mac_centraleurope.lo mac_turkish.lo mac_cyrillic.lo \ mac_japanese.lo mac_chinese_trad.lo mac_chinese_simp.lo \ mac_korean.lo generic_cjk.lo generic_mb.lo libcharsets_la_OBJECTS = $(am_libcharsets_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcharsets_la_SOURCES) DIST_SOURCES = $(libcharsets_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libcharsets.la AM_CFLAGS = -I$(top_srcdir)/sys @CFLAGS@ @ICONV_CFLAGS@ libcharsets_la_SOURCES = \ mac_roman.c \ mac_greek.c \ mac_hebrew.c \ mac_centraleurope.c \ mac_turkish.c \ mac_cyrillic.c \ mac_japanese.c \ mac_chinese_trad.c \ mac_chinese_simp.c \ mac_korean.c \ generic_cjk.c \ generic_mb.c noinst_HEADERS = \ mac_roman.h \ mac_greek.h \ mac_centraleurope.h \ mac_hebrew.h \ mac_turkish.h \ mac_cyrillic.h \ mac_japanese.h \ mac_chinese_trad.h \ mac_chinese_simp.h \ mac_korean.h \ generic_cjk.h \ generic_mb.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/unicode/charsets/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/unicode/charsets/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libcharsets.la: $(libcharsets_la_OBJECTS) $(libcharsets_la_DEPENDENCIES) $(LINK) $(libcharsets_la_OBJECTS) $(libcharsets_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generic_cjk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generic_mb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mac_centraleurope.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mac_chinese_simp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mac_chinese_trad.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mac_cyrillic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mac_greek.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mac_hebrew.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mac_japanese.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mac_korean.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mac_roman.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mac_turkish.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/unicode/charsets/mac_turkish.c0000644000175200017500000000410411655731127017754 00000000000000/* Unix SMB/CIFS implementation. minimal iconv implementation Copyright (C) Andrew Tridgell 2001 Copyright (C) Jelmer Vernooij 2002,2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. From samba 3.0 beta and GNU libiconv-1.8 It's bad but most of the time we can't use libc iconv service: - it doesn't round trip for most encoding - it doesn't know about Apple extension */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include "mac_turkish.h" #include "generic_mb.h" static size_t mac_turkish_pull(void *,char **, size_t *, char **, size_t *); static size_t mac_turkish_push(void *,char **, size_t *, char **, size_t *); struct charset_functions charset_mac_turkish = { "MAC_TURKISH", 35, mac_turkish_pull, mac_turkish_push, CHARSET_CLIENT | CHARSET_MULTIBYTE, NULL, NULL, NULL }; static size_t mac_turkish_push( void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return (size_t) mb_generic_push( char_ucs2_to_mac_turkish, cd, inbuf, inbytesleft, outbuf, outbytesleft); } /* ------------------------ */ static size_t mac_turkish_pull ( void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return (size_t) mb_generic_pull( char_mac_turkish_to_ucs2, cd, inbuf, inbytesleft, outbuf, outbytesleft); } netatalk-2.2.2/libatalk/unicode/charsets/mac_japanese.c0000644000175200017500000000724411655731127020061 00000000000000/* * MacJapanese * Copyright (C) TSUBAKIMOTO Hiroya 2004 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Reference * http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #if HAVE_USABLE_ICONV #include "generic_cjk.h" #include "mac_japanese.h" static size_t mac_japanese_pull(void *,char **, size_t *, char **, size_t *); static size_t mac_japanese_push(void *,char **, size_t *, char **, size_t *); struct charset_functions charset_mac_japanese = { "MAC_JAPANESE", 1, mac_japanese_pull, mac_japanese_push, CHARSET_ICONV | CHARSET_MULTIBYTE | CHARSET_PRECOMPOSED | CHARSET_CLIENT, "SHIFT_JIS", NULL, NULL }; static size_t mac_japanese_char_push(u_int8_t* out, const ucs2_t* in, size_t* size) { ucs2_t wc = in[0]; if (wc <= 0x7f) { *size = 1; out[0] = (u_int8_t)(wc == 0x5c ? 0x80 : wc); return 1; } else if ((wc & 0xf000) == 0xe000) { /* user defined */ *size = 1; if (wc > 0xe98b) return 0; wc -= 0xe000; out[0] = (u_int8_t)(wc / 188 + 0xf0); out[1] = (u_int8_t)(wc % 188 + 0x40); if (out[1] >= 0x7f) ++out[1]; return 2; } else if ((wc & ~7) == 0xf860) { wc = cjk_compose_seq(in, size, mac_japanese_compose, sizeof(mac_japanese_compose) / sizeof(u_int32_t)); if (!wc) return (size_t)-1; } else if (*size >= 2 && ((in[1] & ~15) == 0xf870 || in[1] == 0x20dd)) { ucs2_t comp = cjk_compose(wc, in[1], mac_japanese_compose, sizeof(mac_japanese_compose) / sizeof(u_int32_t)); if (comp) { wc = comp; *size = 2; } else { *size = 1; } } else { *size = 1; } return cjk_char_push(cjk_lookup(wc, mac_japanese_uni2_index, mac_japanese_uni2_charset), out); } static size_t mac_japanese_push(void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return cjk_generic_push(mac_japanese_char_push, cd, inbuf, inbytesleft, outbuf, outbytesleft); } static size_t mac_japanese_char_pull(ucs2_t* out, const u_int8_t* in, size_t* size) { u_int16_t c = in[0]; if (c <= 0x7f) { *size = 1; *out = (c == 0x5c ? 0xa5 : c); return 1; } else if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc)) { if (*size >= 2) { u_int8_t c2 = in[1]; if ((c2 >= 0x40 && c2 <= 0x7e) || (c2 >= 0x80 && c2 <= 0xfc)) { *size = 2; if (c >= 0xf0) { /* user defined */ *out = 0xe000 + (c - 0xf0) * 188 + c2 - (c2 < 0x80 ? 0x40 : 0x41); return 1; } c = (c << 8) + c2; } else { errno = EILSEQ; return (size_t)-1; } } else { errno = EINVAL; return (size_t)-1; } } else { *size = 1; } return cjk_char_pull(cjk_lookup(c, mac_japanese_2uni_index, mac_japanese_2uni_charset), out, mac_japanese_compose); } static size_t mac_japanese_pull(void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return cjk_generic_pull(mac_japanese_char_pull, cd, inbuf, inbytesleft, outbuf, outbytesleft); } #endif netatalk-2.2.2/libatalk/unicode/charsets/mac_greek.h0000644000175200017500000001051111655731127017364 00000000000000/* * Copyright (C) 1999-2001 Free Software Foundation, Inc. * This file is part of the GNU LIBICONV Library. * * The GNU LIBICONV Library is free software; you can redistribute it * and/or modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * The GNU LIBICONV Library is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the GNU LIBICONV Library; see the file COPYING.LIB. * If not, write to the Free Software Foundation, Inc., 59 Temple Place - * Suite 330, Boston, MA 02111-1307, USA. */ /* * MacGreek */ static const unsigned short mac_greek_2uni[128] = { /* 0x80 */ 0x00c4, 0x00b9, 0x00b2, 0x00c9, 0x00b3, 0x00d6, 0x00dc, 0x0385, 0x00e0, 0x00e2, 0x00e4, 0x0384, 0x00a8, 0x00e7, 0x00e9, 0x00e8, /* 0x90 */ 0x00ea, 0x00eb, 0x00a3, 0x2122, 0x00ee, 0x00ef, 0x2022, 0x00bd, 0x2030, 0x00f4, 0x00f6, 0x00a6, 0x00ad, 0x00f9, 0x00fb, 0x00fc, /* 0xa0 */ 0x2020, 0x0393, 0x0394, 0x0398, 0x039b, 0x039e, 0x03a0, 0x00df, 0x00ae, 0x00a9, 0x03a3, 0x03aa, 0x00a7, 0x2260, 0x00b0, 0x0387, /* 0xb0 */ 0x0391, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x0392, 0x0395, 0x0396, 0x0397, 0x0399, 0x039a, 0x039c, 0x03a6, 0x03ab, 0x03a8, 0x03a9, /* 0xc0 */ 0x03ac, 0x039d, 0x00ac, 0x039f, 0x03a1, 0x2248, 0x03a4, 0x00ab, 0x00bb, 0x2026, 0x00a0, 0x03a5, 0x03a7, 0x0386, 0x0388, 0x0153, /* 0xd0 */ 0x2013, 0x2015, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x0389, 0x038a, 0x038c, 0x038e, 0x03ad, 0x03ae, 0x03af, 0x03cc, 0x038f, /* 0xe0 */ 0x03cd, 0x03b1, 0x03b2, 0x03c8, 0x03b4, 0x03b5, 0x03c6, 0x03b3, 0x03b7, 0x03b9, 0x03be, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03bf, /* 0xf0 */ 0x03c0, 0x03ce, 0x03c1, 0x03c3, 0x03c4, 0x03b8, 0x03c9, 0x03c2, 0x03c7, 0x03c5, 0x03b6, 0x03ca, 0x03cb, 0x0390, 0x03b0, 0xfffd, }; static const unsigned char mac_greek_page00[96] = { 0xca, 0x00, 0x00, 0x92, 0x00, 0xb4, 0x9b, 0xac, /* 0xa0-0xa7 */ 0x8c, 0xa9, 0x00, 0xc7, 0xc2, 0x9c, 0xa8, 0x00, /* 0xa8-0xaf */ 0xae, 0xb1, 0x82, 0x84, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x81, 0x00, 0xc8, 0x00, 0x97, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0xa7, /* 0xd8-0xdf */ 0x88, 0x00, 0x89, 0x00, 0x8a, 0x00, 0x00, 0x8d, /* 0xe0-0xe7 */ 0x8f, 0x8e, 0x90, 0x91, 0x00, 0x00, 0x94, 0x95, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x99, 0x00, 0x9a, 0xd6, /* 0xf0-0xf7 */ 0x00, 0x9d, 0x00, 0x9e, 0x9f, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static const unsigned char mac_greek_page03[80] = { 0x00, 0x00, 0x00, 0x00, 0x8b, 0x87, 0xcd, 0xaf, /* 0x80-0x87 */ 0xce, 0xd7, 0xd8, 0x00, 0xd9, 0x00, 0xda, 0xdf, /* 0x88-0x8f */ 0xfd, 0xb0, 0xb5, 0xa1, 0xa2, 0xb6, 0xb7, 0xb8, /* 0x90-0x97 */ 0xa3, 0xb9, 0xba, 0xa4, 0xbb, 0xc1, 0xa5, 0xc3, /* 0x98-0x9f */ 0xa6, 0xc4, 0x00, 0xaa, 0xc6, 0xcb, 0xbc, 0xcc, /* 0xa0-0xa7 */ 0xbe, 0xbf, 0xab, 0xbd, 0xc0, 0xdb, 0xdc, 0xdd, /* 0xa8-0xaf */ 0xfe, 0xe1, 0xe2, 0xe7, 0xe4, 0xe5, 0xfa, 0xe8, /* 0xb0-0xb7 */ 0xf5, 0xe9, 0xeb, 0xec, 0xed, 0xee, 0xea, 0xef, /* 0xb8-0xbf */ 0xf0, 0xf2, 0xf7, 0xf3, 0xf4, 0xf9, 0xe6, 0xf8, /* 0xc0-0xc7 */ 0xe3, 0xf6, 0xfb, 0xfc, 0xde, 0xe0, 0xf1, 0x00, /* 0xc8-0xcf */ }; static const unsigned char mac_greek_page20[40] = { 0x00, 0x00, 0x00, 0xd0, 0x00, 0xd1, 0x00, 0x00, /* 0x10-0x17 */ 0xd4, 0xd5, 0x00, 0x00, 0xd2, 0xd3, 0x00, 0x00, /* 0x18-0x1f */ 0xa0, 0x00, 0x96, 0x00, 0x00, 0x00, 0xc9, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ }; static const unsigned char mac_greek_page22[32] = { 0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xad, 0x00, 0x00, 0x00, 0xb2, 0xb3, 0x00, 0x00, /* 0x60-0x67 */ }; netatalk-2.2.2/libatalk/unicode/charsets/mac_chinese_simp.h0000644000175200017500000001366711655731127020754 00000000000000/* * MacChineseSimp * Copyright (C) TSUBAKIMOTO Hiroya 2004 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Reference * http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ */ static const u_int16_t mac_chinese_simp_uni2_page00[][2] = { /* 0x00a */ { 0x022d, 0 }, { 0x0080, 5 }, /* 0x00c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x010 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x014 */ { 0x0110, 6 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x018 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x01c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0200, 8 }, /* 0x020 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x024 */ { 0x0000, 0 }, { 0x0002, 9 }, { 0x0002, 10 }, }; static const u_int16_t mac_chinese_simp_uni2_page1e[][2] = { /* 0x1e3 */ { 0x8000, 11 }, }; static const u_int16_t mac_chinese_simp_uni2_page20[][2] = { /* 0x201 */ { 0x0070, 12 }, { 0x0040, 15 }, { 0x4000, 16 }, }; static const u_int16_t mac_chinese_simp_uni2_page21[][2] = { /* 0x212 */ { 0x0004, 17 }, }; static const u_int16_t mac_chinese_simp_uni2_page22[][2] = { /* 0x22e */ { 0x8000, 18 }, }; static const u_int16_t mac_chinese_simp_uni2_page30[][2] = { /* 0x301 */ { 0x1000, 19 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x304 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x308 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x30c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0800, 20 }, }; static const u_int16_t mac_chinese_simp_uni2_pagee0[][2] = { /* 0xe00 */ { 0x07ff, 21 }, }; static const u_int16_t mac_chinese_simp_uni2_pagef8[][2] = { /* 0xf88 */ { 0x0003, 32 }, }; static const u_int16_t mac_chinese_simp_uni2_pagefe[][2] = { /* 0xfe3 */ { 0xfffa, 34 }, { 0x001f, 48 }, }; static const u_int16_t mac_chinese_simp_uni2_pageff[][2] = { /* 0xff5 */ { 0x4000, 53 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xff8 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xffc */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x002b, 54 }, }; static const cjk_index_t mac_chinese_simp_uni2_index[] = { { { 0x00a0, 0x026f }, mac_chinese_simp_uni2_page00 }, { { 0x1e30, 0x1e3f }, mac_chinese_simp_uni2_page1e }, { { 0x2010, 0x203f }, mac_chinese_simp_uni2_page20 }, { { 0x2120, 0x212f }, mac_chinese_simp_uni2_page21 }, { { 0x22e0, 0x22ef }, mac_chinese_simp_uni2_page22 }, { { 0x3010, 0x30ff }, mac_chinese_simp_uni2_page30 }, { { 0xe000, 0xe00f }, mac_chinese_simp_uni2_pagee0 }, { { 0xf880, 0xf88f }, mac_chinese_simp_uni2_pagef8 }, { { 0xfe30, 0xfe4f }, mac_chinese_simp_uni2_pagefe }, { { 0xff50, 0xffef }, mac_chinese_simp_uni2_pageff }, { { 0, 0 }, NULL } }; static const u_int16_t mac_chinese_simp_uni2_charset[] = { 0x00a0, 0xa1e9, 0xa1ea, 0xa3a4, 0x00fd, 0xa1a4, 0xa8bd, 0xa8be, 0xa8bf, 0xa8bb, 0xa8c0, 0xa8bc, 0xa1aa, 0xffff, 0xa1ac, 0x00ff, 0xa3fe, 0x00fe, 0xa1ad, 0xa1ab, 0xffff, 0x0080, 0xa6f3, 0xa6db, 0xa6da, 0xa6ec, 0xa6ed, 0xa6de, 0xa6d9, 0xa6dc, 0xa6dd, 0xa6df, 0x0081, 0x0082, 0xa6f2, 0xa6f4, 0xa6f5, 0xa6e0, 0xa6e1, 0xa6f0, 0xa6f1, 0xa6e2, 0xa6e3, 0xa6ee, 0xa6ef, 0xa6e6, 0xa6e7, 0xa6e4, 0xa6e5, 0xa6e8, 0xa6e9, 0xa6ea, 0xa6eb, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, }; static const u_int16_t mac_chinese_simp_2uni_page00[][2] = { /* 0x008 */ { 0x0007, 0 }, { 0x0000, 0 }, { 0x0001, 3 }, { 0x0000, 0 }, /* 0x00c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0xe000, 4 }, }; static const u_int16_t mac_chinese_simp_2uni_pagea1[][2] = { /* 0xa1a */ { 0x3c10, 7 }, { 0x0000, 0 }, /* 0xa1c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0600, 12 }, }; static const u_int16_t mac_chinese_simp_2uni_pagea3[][2] = { /* 0xa3a */ { 0x0010, 14 }, { 0x0000, 0 }, /* 0xa3c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x4000, 15 }, }; static const u_int16_t mac_chinese_simp_2uni_pagea6[][2] = { /* 0xa6d */ { 0xfe00, 16 }, { 0xffff, 23 }, { 0x003f, 39 }, }; static const u_int16_t mac_chinese_simp_2uni_pagea8[][2] = { /* 0xa8b */ { 0xf800, 45 }, { 0x0001, 50 }, }; static const cjk_index_t mac_chinese_simp_2uni_index[] = { { { 0x0080, 0x00ff }, mac_chinese_simp_2uni_page00 }, { { 0xa1a0, 0xa1ef }, mac_chinese_simp_2uni_pagea1 }, { { 0xa3a0, 0xa3ff }, mac_chinese_simp_2uni_pagea3 }, { { 0xa6d0, 0xa6ff }, mac_chinese_simp_2uni_pagea6 }, { { 0xa8b0, 0xa8cf }, mac_chinese_simp_2uni_pagea8 }, { { 0, 0 }, NULL } }; static const u_int16_t mac_chinese_simp_2uni_charset[] = { 0xe000, 0xf880, 0xf881, 0x00a0, 0x00a9, 0x2122, 0x2026, 0x00b7, 0x2014, 0x301c, 0x2016, 0x22ef, 0x00a2, 0x00a3, 0x00a5, 0x203e, 0xe007, 0xe003, 0xe002, 0xe008, 0xe009, 0xe006, 0xe00a, 0xfe35, 0xfe36, 0xfe39, 0xfe3a, 0xfe3f, 0xfe40, 0xfe3d, 0xfe3e, 0xfe41, 0xfe42, 0xfe43, 0xfe44, 0xe004, 0xe005, 0xfe3b, 0xfe3c, 0xfe37, 0xfe38, 0xfe31, 0xe001, 0xfe33, 0xfe34, 0x0251, 0x1e3f, 0x0144, 0x0148, 0x01f9, 0x0261, }; static const u_int32_t mac_chinese_simp_compose[] = { 0x00fcf87f, 0x22eff87e, 0x3001f87e, 0x3002f87e, 0x3016f87e, 0x3017f87e, 0xff01f87e, 0xff0cf87e, 0xff1af87e, 0xff1bf87e, 0xff1ff87e, }; netatalk-2.2.2/libatalk/unicode/charsets/generic_mb.h0000644000175200017500000000035211655731127017543 00000000000000size_t mb_generic_pull(int (*charfunc)(ucs2_t *, const unsigned char *), void *,char **, size_t *, char **, size_t *); size_t mb_generic_push(int (*charfunc)(unsigned char *, ucs2_t), void *,char **, size_t *, char **, size_t *); netatalk-2.2.2/libatalk/unicode/charsets/mac_centraleurope.h0000644000175200017500000001342011655731127021141 00000000000000/* * Copyright (C) 1999-2001 Free Software Foundation, Inc. * This file is part of the GNU LIBICONV Library. * * The GNU LIBICONV Library is free software; you can redistribute it * and/or modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * The GNU LIBICONV Library is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the GNU LIBICONV Library; see the file COPYING.LIB. * If not, write to the Free Software Foundation, Inc., 59 Temple Place - * Suite 330, Boston, MA 02111-1307, USA. */ /* * MacCentralEurope */ static const unsigned short mac_centraleurope_2uni[128] = { /* 0x80 */ 0x00c4, 0x0100, 0x0101, 0x00c9, 0x0104, 0x00d6, 0x00dc, 0x00e1, 0x0105, 0x010c, 0x00e4, 0x010d, 0x0106, 0x0107, 0x00e9, 0x0179, /* 0x90 */ 0x017a, 0x010e, 0x00ed, 0x010f, 0x0112, 0x0113, 0x0116, 0x00f3, 0x0117, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x011a, 0x011b, 0x00fc, /* 0xa0 */ 0x2020, 0x00b0, 0x0118, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, 0x00ae, 0x00a9, 0x2122, 0x0119, 0x00a8, 0x2260, 0x0123, 0x012e, /* 0xb0 */ 0x012f, 0x012a, 0x2264, 0x2265, 0x012b, 0x0136, 0x2202, 0x2211, 0x0142, 0x013b, 0x013c, 0x013d, 0x013e, 0x0139, 0x013a, 0x0145, /* 0xc0 */ 0x0146, 0x0143, 0x00ac, 0x221a, 0x0144, 0x0147, 0x2206, 0x00ab, 0x00bb, 0x2026, 0x00a0, 0x0148, 0x0150, 0x00d5, 0x0151, 0x014c, /* 0xd0 */ 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, 0x014d, 0x0154, 0x0155, 0x0158, 0x2039, 0x203a, 0x0159, 0x0156, /* 0xe0 */ 0x0157, 0x0160, 0x201a, 0x201e, 0x0161, 0x015a, 0x015b, 0x00c1, 0x0164, 0x0165, 0x00cd, 0x017d, 0x017e, 0x016a, 0x00d3, 0x00d4, /* 0xf0 */ 0x016b, 0x016e, 0x00da, 0x016f, 0x0170, 0x0171, 0x0172, 0x0173, 0x00dd, 0x00fd, 0x0137, 0x017b, 0x0141, 0x017c, 0x0122, 0x02c7, }; static int char_mac_centraleurope_to_ucs2 (ucs2_t *pwc, const unsigned char *s) { unsigned char c = *s; if (c < 0x80) *pwc = (ucs2_t) c; else *pwc = (ucs2_t) mac_centraleurope_2uni[c-0x80]; return 1; } static const unsigned char mac_centraleurope_page00[224] = { 0xca, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0xa4, /* 0xa0-0xa7 */ 0xac, 0xa9, 0x00, 0xc7, 0xc2, 0x00, 0xa8, 0x00, /* 0xa8-0xaf */ 0xa1, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0xe7, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x83, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0xee, 0xef, 0xcd, 0x85, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0xf2, 0x00, 0x86, 0xf8, 0x00, 0xa7, /* 0xd8-0xdf */ 0x00, 0x87, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x8e, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x97, 0x99, 0x9b, 0x9a, 0xd6, /* 0xf0-0xf7 */ 0x00, 0x00, 0x9c, 0x00, 0x9f, 0xf9, 0x00, 0x00, /* 0xf8-0xff */ /* 0x0100 */ 0x81, 0x82, 0x00, 0x00, 0x84, 0x88, 0x8c, 0x8d, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x89, 0x8b, 0x91, 0x93, /* 0x08-0x0f */ 0x00, 0x00, 0x94, 0x95, 0x00, 0x00, 0x96, 0x98, /* 0x10-0x17 */ 0xa2, 0xab, 0x9d, 0x9e, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0xfe, 0xae, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0xb1, 0xb4, 0x00, 0x00, 0xaf, 0xb0, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb5, 0xfa, /* 0x30-0x37 */ 0x00, 0xbd, 0xbe, 0xb9, 0xba, 0xbb, 0xbc, 0x00, /* 0x38-0x3f */ 0x00, 0xfc, 0xb8, 0xc1, 0xc4, 0xbf, 0xc0, 0xc5, /* 0x40-0x47 */ 0xcb, 0x00, 0x00, 0x00, 0xcf, 0xd8, 0x00, 0x00, /* 0x48-0x4f */ 0xcc, 0xce, 0x00, 0x00, 0xd9, 0xda, 0xdf, 0xe0, /* 0x50-0x57 */ 0xdb, 0xde, 0xe5, 0xe6, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xe1, 0xe4, 0x00, 0x00, 0xe8, 0xe9, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0xed, 0xf0, 0x00, 0x00, 0xf1, 0xf3, /* 0x68-0x6f */ 0xf4, 0xf5, 0xf6, 0xf7, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x8f, 0x90, 0xfb, 0xfd, 0xeb, 0xec, 0x00, /* 0x78-0x7f */ }; static const unsigned char mac_centraleurope_page20[48] = { 0x00, 0x00, 0x00, 0xd0, 0xd1, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd4, 0xd5, 0xe2, 0x00, 0xd2, 0xd3, 0xe3, 0x00, /* 0x18-0x1f */ 0xa0, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xc9, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0xdc, 0xdd, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ }; static const unsigned char mac_centraleurope_page22[32] = { 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xc6, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ }; static const unsigned char mac_centraleurope_page22_1[8] = { 0xad, 0x00, 0x00, 0x00, 0xb2, 0xb3, 0x00, 0x00, /* 0x60-0x67 */ }; static int char_ucs2_to_mac_centraleurope(unsigned char *r, ucs2_t wc) { unsigned char c = 0; if (wc < 0x0080) { *r = wc; return 1; } else if (wc >= 0x00a0 && wc < 0x0180) c = mac_centraleurope_page00[wc-0x00a0]; else if (wc == 0x02c7) c = 0xff; else if (wc >= 0x2010 && wc < 0x2040) c = mac_centraleurope_page20[wc-0x2010]; else if (wc == 0x2122) c = 0xaa; else if (wc >= 0x2200 && wc < 0x2220) c = mac_centraleurope_page22[wc-0x2200]; else if (wc >= 0x2260 && wc < 0x2268) c = mac_centraleurope_page22_1[wc-0x2260]; else if (wc == 0x25ca) c = 0xd7; if (c != 0) { *r = c; return 1; } return 0; } netatalk-2.2.2/libatalk/unicode/charsets/mac_chinese_simp.c0000644000175200017500000000622611655731127020740 00000000000000/* * MacChineseSimp * Copyright (C) TSUBAKIMOTO Hiroya 2004 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Reference * http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #if HAVE_USABLE_ICONV #include "generic_cjk.h" #include "mac_chinese_simp.h" static size_t mac_chinese_simp_pull(void *,char **, size_t *, char **, size_t *); static size_t mac_chinese_simp_push(void *,char **, size_t *, char **, size_t *); struct charset_functions charset_mac_chinese_simp = { "MAC_CHINESE_SIMP", 25, mac_chinese_simp_pull, mac_chinese_simp_push, CHARSET_ICONV | CHARSET_MULTIBYTE | CHARSET_PRECOMPOSED | CHARSET_CLIENT, "EUC-CN", NULL, NULL }; static size_t mac_chinese_simp_char_push(u_int8_t* out, const ucs2_t* in, size_t* size) { ucs2_t wc = in[0]; if (wc <= 0x7f) { *size = 1; out[0] = (u_int8_t)wc; return 1; } else if ((wc & 0xf000) == 0xe000) { *size = 1; return 0; } else if (*size >= 2 && (in[1] & ~15) == 0xf870) { ucs2_t comp = cjk_compose(wc, in[1], mac_chinese_simp_compose, sizeof(mac_chinese_simp_compose) / sizeof(u_int32_t)); if (comp) { wc = comp; *size = 2; } else { *size = 1; } } else { *size = 1; } return cjk_char_push(cjk_lookup(wc, mac_chinese_simp_uni2_index, mac_chinese_simp_uni2_charset), out); } static size_t mac_chinese_simp_push(void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return cjk_generic_push(mac_chinese_simp_char_push, cd, inbuf, inbytesleft, outbuf, outbytesleft); } static size_t mac_chinese_simp_char_pull(ucs2_t* out, const u_int8_t* in, size_t* size) { u_int16_t c = in[0]; if (c <= 0x7f) { *size = 1; *out = c; return 1; } else if (c >= 0xa1 && c <= 0xfc) { if (*size >= 2) { u_int8_t c2 = in[1]; if (c2 >= 0xa1 && c2 <= 0xfe) { *size = 2; c = (c << 8) + c2; } else { errno = EILSEQ; return (size_t)-1; } } else { errno = EINVAL; return (size_t)-1; } } else { *size = 1; } return cjk_char_pull(cjk_lookup(c, mac_chinese_simp_2uni_index, mac_chinese_simp_2uni_charset), out, mac_chinese_simp_compose); } static size_t mac_chinese_simp_pull(void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return cjk_generic_pull(mac_chinese_simp_char_pull, cd, inbuf, inbytesleft, outbuf, outbytesleft); } #endif netatalk-2.2.2/libatalk/unicode/charsets/mac_greek.c0000644000175200017500000000602311655731127017362 00000000000000/* Unix SMB/CIFS implementation. minimal iconv implementation Copyright (C) Andrew Tridgell 2001 Copyright (C) Jelmer Vernooij 2002,2003 Copyright (C) Panos Christeas 2006 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. From samba 3.0 beta and GNU libiconv-1.8 It's bad but most of the time we can't use libc iconv service: - it doesn't round trip for most encoding - it doesn't know about Apple extension */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include "mac_greek.h" #include "generic_mb.h" static size_t mac_greek_pull(void *,char **, size_t *, char **, size_t *); static size_t mac_greek_push(void *,char **, size_t *, char **, size_t *); struct charset_functions charset_mac_greek = { "MAC_GREEK", 6, mac_greek_pull, mac_greek_push, CHARSET_CLIENT | CHARSET_MULTIBYTE, NULL, NULL, NULL }; /* ------------------------ */ static int char_ucs2_to_mac_greek ( unsigned char *r, ucs2_t wc) { unsigned char c = 0; if (wc < 0x0080) { *r = wc; return 1; } else if (wc >= 0x00a0 && wc < 0x0100) c = mac_greek_page00[wc-0x00a0]; else if (wc == 0x0153) c = 0xcf; else if (wc >= 0x0380 && wc < 0x03d0) c = mac_greek_page03[wc-0x0380]; else if (wc >= 0x2010 && wc < 0x2038) c = mac_greek_page20[wc-0x2010]; else if (wc == 0x2122) c = 0x93; else if (wc >= 0x2248 && wc < 0x2268) c = mac_greek_page22[wc-0x2248]; if (c != 0) { *r = c; return 1; } return 0; } static size_t mac_greek_push( void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { /* No special handling required */ return (size_t) mb_generic_push( char_ucs2_to_mac_greek, cd, inbuf, inbytesleft, outbuf, outbytesleft); } /* ------------------------ */ static int char_mac_greek_to_ucs2 (ucs2_t *pwc, const unsigned char *s) { unsigned char c = *s; if (c < 0x80) { *pwc = (ucs2_t) c; return 1; } else { unsigned short wc = mac_greek_2uni[c-0x80]; if (wc != 0xfffd) { *pwc = (ucs2_t) wc; return 1; } } return 0; } static size_t mac_greek_pull ( void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return (size_t) mb_generic_pull( char_mac_greek_to_ucs2, cd, inbuf, inbytesleft, outbuf, outbytesleft); } netatalk-2.2.2/libatalk/unicode/charsets/mac_cyrillic.c0000644000175200017500000000421211655731127020075 00000000000000/* Unix SMB/CIFS implementation. minimal iconv implementation Copyright (C) Andrew Tridgell 2001 Copyright (C) Jelmer Vernooij 2002,2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. From samba 3.0 beta and GNU libiconv-1.8 It's bad but most of the time we can't use libc iconv service: - it doesn't round trip for most encoding - it doesn't know about Apple extension */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include /* for size_t */ #include #include #include "mac_cyrillic.h" #include "generic_mb.h" static size_t mac_cyrillic_pull(void *,char **, size_t *, char **, size_t *); static size_t mac_cyrillic_push(void *,char **, size_t *, char **, size_t *); struct charset_functions charset_mac_cyrillic = { "MAC_CYRILLIC", 7, mac_cyrillic_pull, mac_cyrillic_push, CHARSET_CLIENT | CHARSET_MULTIBYTE, NULL, NULL, NULL }; /* ------------------------ */ static size_t mac_cyrillic_push( void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return (size_t) mb_generic_push( char_ucs2_to_mac_cyrillic, cd, inbuf, inbytesleft, outbuf, outbytesleft); } /* ------------------------ */ static size_t mac_cyrillic_pull ( void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return (size_t) mb_generic_pull( char_mac_cyrillic_to_ucs2, cd, inbuf, inbytesleft, outbuf, outbytesleft); } netatalk-2.2.2/libatalk/unicode/charsets/mac_korean.h0000644000175200017500000013014611655731127017555 00000000000000/* * MacKorean * Copyright (C) TSUBAKIMOTO Hiroya 2004 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Reference * http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ */ static const u_int16_t mac_korean_uni2_page00[][2] = { /* 0x00a */ { 0x7a2d, 0 }, { 0x0880, 9 }, }; static const u_int16_t mac_korean_uni2_page02[][2] = { /* 0x02b */ { 0x1000, 11 }, /* 0x02c */ { 0x0000, 0 }, { 0x1001, 12 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x030 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x034 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x038 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x03c */ { 0x0000, 0 }, { 0x0020, 14 }, }; static const u_int16_t mac_korean_uni2_page20[][2] = { /* 0x201 */ { 0x8878, 15 }, { 0x0004, 21 }, { 0x5670, 22 }, /* 0x204 */ { 0x7284, 29 }, { 0x0002, 35 }, { 0x0000, 0 }, { 0x7c00, 36 }, /* 0x208 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x1200, 41 }, { 0x0000, 0 }, /* 0x20c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x210 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x214 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x218 */ { 0x0000, 0 }, { 0x3000, 43 }, { 0x0000, 0 }, { 0x10df, 45 }, /* 0x21c */ { 0xa031, 53 }, { 0x0001, 58 }, { 0x03cf, 59 }, { 0x0001, 67 }, /* 0x220 */ { 0x1240, 68 }, { 0x8008, 71 }, { 0x0064, 73 }, { 0x1080, 76 }, /* 0x224 */ { 0x0128, 78 }, { 0x040b, 81 }, { 0xccc4, 85 }, { 0x0ecf, 92 }, /* 0x228 */ { 0x0033, 101 }, { 0x02e0, 105 }, { 0x0018, 109 }, { 0x1800, 111 }, /* 0x22c */ { 0xc000, 113 }, { 0x0c00, 115 }, { 0x4000, 117 }, { 0x0000, 0 }, /* 0x230 */ { 0x0040, 118 }, { 0x0010, 119 }, }; static const u_int16_t mac_korean_uni2_page24[][2] = { /* 0x246 */ { 0x8000, 120 }, { 0x000f, 121 }, /* 0x248 */ { 0x00f8, 125 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0xffc0, 130 }, /* 0x24c */ { 0xffff, 140 }, { 0x0000, 0 }, { 0xf800, 156 }, { 0x001f, 161 }, /* 0x250 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x254 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x258 */ { 0x0100, 166 }, { 0x0000, 0 }, { 0x2004, 167 }, { 0x8222, 169 }, /* 0x25c */ { 0x3608, 173 }, { 0x0000, 0 }, { 0x8040, 178 }, { 0x1800, 180 }, /* 0x260 */ { 0x0000, 0 }, { 0xa001, 182 }, { 0x8000, 185 }, { 0x0000, 0 }, /* 0x264 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x8040, 186 }, { 0x0000, 0 }, /* 0x268 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x26c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x270 */ { 0x0000, 0 }, { 0x0440, 188 }, { 0x0009, 190 }, { 0xa002, 192 }, /* 0x274 */ { 0x2083, 195 }, { 0x0040, 199 }, { 0x0000, 0 }, { 0xffc0, 200 }, /* 0x278 */ { 0xfc00, 210 }, { 0x581f, 216 }, { 0x0012, 224 }, { 0x0024, 226 }, }; static const u_int16_t mac_korean_uni2_page29[][2] = { /* 0x293 */ { 0x02f0, 228 }, /* 0x294 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x003c, 233 }, { 0x0000, 0 }, /* 0x298 */ { 0x0062, 237 }, { 0x0180, 240 }, { 0x0008, 242 }, { 0xc000, 243 }, /* 0x29c */ { 0x0100, 245 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x2a0 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0040, 246 }, { 0x0100, 247 }, /* 0x2a4 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0004, 248 }, /* 0x2a8 */ { 0x1800, 249 }, { 0x0006, 251 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x2ac */ { 0x1860, 253 }, { 0x0000, 0 }, { 0x0100, 257 }, }; static const u_int16_t mac_korean_uni2_page30[][2] = { /* 0x301 */ { 0xd3c4, 258 }, { 0x0001, 266 }, { 0x0040, 267 }, }; static const u_int16_t mac_korean_uni2_page32[][2] = { /* 0x323 */ { 0x0202, 268 }, /* 0x324 */ { 0x0000, 0 }, { 0x07fe, 270 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x328 */ { 0xfc00, 280 }, { 0x4011, 286 }, { 0x0020, 289 }, }; static const u_int16_t mac_korean_uni2_page33[][2] = { /* 0x33c */ { 0x0800, 290 }, }; static const u_int16_t mac_korean_uni2_pagee0[][2] = { /* 0xe00 */ { 0xffff, 291 }, { 0xffff, 307 }, { 0xffff, 323 }, { 0xffff, 339 }, /* 0xe04 */ { 0xffff, 355 }, { 0xffff, 371 }, { 0xffff, 387 }, { 0xffff, 403 }, /* 0xe08 */ { 0xffff, 419 }, { 0xffff, 435 }, { 0xffff, 451 }, { 0xffff, 467 }, /* 0xe0c */ { 0xffff, 483 }, { 0xffff, 499 }, { 0xffff, 515 }, { 0xffff, 531 }, /* 0xe10 */ { 0xffff, 547 }, { 0xffff, 563 }, { 0xffff, 579 }, { 0xffff, 595 }, /* 0xe14 */ { 0xffff, 611 }, { 0xffff, 627 }, { 0xffff, 643 }, { 0xffff, 659 }, /* 0xe18 */ { 0xffff, 675 }, { 0xffff, 691 }, { 0xffde, 707 }, { 0xfff7, 721 }, /* 0xe1c */ { 0xdfff, 736 }, { 0xffbf, 751 }, { 0xffe7, 766 }, { 0xff9f, 780 }, /* 0xe20 */ { 0xffff, 794 }, { 0xffff, 810 }, { 0xffff, 826 }, { 0xffff, 842 }, /* 0xe24 */ { 0xffff, 858 }, { 0xffff, 874 }, { 0xffff, 890 }, { 0xffff, 906 }, /* 0xe28 */ { 0xffff, 922 }, { 0xffff, 938 }, { 0xffff, 954 }, { 0xffff, 970 }, /* 0xe2c */ { 0xffff, 986 }, { 0x07ff, 1002 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xe30 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0xfffc, 1013 }, /* 0xe34 */ { 0xffff, 1027 }, { 0xffff, 1043 }, { 0xffff, 1059 }, { 0xffff, 1075 }, /* 0xe38 */ { 0xffff, 1091 }, { 0x1fff, 1107 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xe3c */ { 0xfc00, 1120 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xe40 */ { 0x0000, 0 }, { 0x1ffc, 1126 }, }; static const u_int16_t mac_korean_uni2_pagef8[][2] = { /* 0xf80 */ { 0x1fe0, 1137 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x2000, 1145 }, /* 0xf84 */ { 0xffff, 1146 }, }; static const u_int16_t mac_korean_uni2_pagefe[][2] = { /* 0xfe5 */ { 0x0600, 1162 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xfe8 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xfec */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xff0 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xff4 */ { 0x0000, 0 }, { 0x4000, 1164 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xff8 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xffc */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x002f, 1165 }, }; static const cjk_index_t mac_korean_uni2_index[] = { { { 0x00a0, 0x00bf }, mac_korean_uni2_page00 }, { { 0x02b0, 0x03df }, mac_korean_uni2_page02 }, { { 0x2010, 0x231f }, mac_korean_uni2_page20 }, { { 0x2460, 0x27bf }, mac_korean_uni2_page24 }, { { 0x2930, 0x2aef }, mac_korean_uni2_page29 }, { { 0x3010, 0x303f }, mac_korean_uni2_page30 }, { { 0x3230, 0x32af }, mac_korean_uni2_page32 }, { { 0x33c0, 0x33cf }, mac_korean_uni2_page33 }, { { 0xe000, 0xe41f }, mac_korean_uni2_pagee0 }, { { 0xf800, 0xf84f }, mac_korean_uni2_pagef8 }, { { 0xfe50, 0xffef }, mac_korean_uni2_pagefe }, { { 0, 0 }, NULL } }; static const u_int16_t mac_korean_uni2_charset[] = { 0x0080, 0xa1cb, 0xa1cc, 0xa1cd, 0x0083, 0xa65c, 0xa1fe, 0xffff, 0xffff, 0xa1a4, 0xa65d, 0xa198, 0xa2b0, 0xa2a6, 0xa76a, 0xa1a9, 0xa1aa, 0xffff, 0xa1ab, 0xa170, 0xa16f, 0xa655, 0xa5de, 0xadad, 0xadab, 0xa65a, 0xa65b, 0xa784, 0xa3fe, 0xa64d, 0xa787, 0xa785, 0xa196, 0xa197, 0xa64e, 0xa16d, 0xa171, 0xa172, 0xa17a, 0xa17c, 0xa17d, 0x0081, 0xffff, 0xac53, 0xac52, 0xa882, 0xa87c, 0xa87b, 0xa883, 0xa881, 0xac50, 0xac51, 0xa892, 0xa893, 0xa89e, 0xa89f, 0xa84b, 0xa84a, 0xa849, 0xac6a, 0xac6c, 0xac6b, 0xac6d, 0xac72, 0xac74, 0xac73, 0xac75, 0xac41, 0xa751, 0xa773, 0xa774, 0xa75c, 0xa753, 0xa768, 0xa755, 0xa756, 0xa2fe, 0xffff, 0xa49a, 0xa499, 0xa49b, 0xa769, 0xa759, 0xa758, 0xa777, 0xa764, 0xa75a, 0xa75b, 0xa1ec, 0xa1ed, 0xa76f, 0xa770, 0xa487, 0xa488, 0xa489, 0xa48a, 0xa48f, 0xa490, 0xa491, 0xa481, 0xa482, 0xa485, 0xa486, 0xa772, 0xa771, 0xa75d, 0xa75e, 0xa75f, 0xffff, 0xa76c, 0xa49d, 0xa775, 0xa776, 0xa483, 0xa484, 0xa492, 0xa493, 0xa2fd, 0xa778, 0xa761, 0xa7f0, 0xa7f1, 0xa7f2, 0xa7f3, 0xa7f4, 0xaaf4, 0xaaf5, 0xaaf6, 0xaaf7, 0xaaf8, 0xa386, 0xa387, 0xa388, 0xa389, 0xa38a, 0xa38b, 0xa38c, 0xa38d, 0xa38e, 0xa38f, 0xa390, 0xa391, 0xa392, 0xa393, 0xa394, 0xa395, 0xa396, 0xa397, 0xa398, 0xa399, 0xa39a, 0xa39b, 0xa39c, 0xa39d, 0xa39e, 0xa39f, 0xa6ef, 0xa6f0, 0xa6f1, 0xa6f2, 0xa6f3, 0xa6f4, 0xa6f5, 0xa6f6, 0xa6f7, 0xa6f8, 0xa78f, 0xa678, 0xa74a, 0xa766, 0xa795, 0xa796, 0xa794, 0xa797, 0xa2c1, 0xa79c, 0xa675, 0xa684, 0xa790, 0xa66f, 0xa746, 0xa79a, 0xa677, 0xac8d, 0xac8e, 0xa693, 0xa798, 0xa648, 0xa66d, 0xa66c, 0xa688, 0xa672, 0xa653, 0xa652, 0xa67c, 0xa699, 0xa68d, 0xa654, 0xa683, 0xa673, 0xa6e5, 0xa6e6, 0xa6e7, 0xa6e8, 0xa6e9, 0xa6ea, 0xa6eb, 0xa6ec, 0xa6ed, 0xa6ee, 0xa355, 0xa356, 0xa357, 0xa358, 0xa359, 0xa35a, 0xa35b, 0xa35c, 0xa35d, 0xa35e, 0xac5e, 0xa86a, 0xa860, 0xa878, 0xa874, 0xac48, 0xa85c, 0xac43, 0xa88d, 0xa889, 0xa886, 0xa88b, 0xa88c, 0xa86f, 0xa871, 0xa870, 0xa872, 0xa799, 0xa159, 0xa15a, 0xa199, 0xa19a, 0xa49c, 0xa668, 0xa66e, 0xa664, 0xa47d, 0xa760, 0xa77b, 0xa494, 0xa495, 0xa496, 0xa497, 0xa48b, 0xa48d, 0xa48c, 0xa48e, 0xa76b, 0xa742, 0xa15d, 0xa15e, 0xa15f, 0xa160, 0xa1ad, 0xada9, 0xadaa, 0xa69e, 0xa743, 0xa79d, 0xa79e, 0xa7f5, 0xa7f6, 0xa7f7, 0xa7f8, 0xa7f9, 0xa7fa, 0xa7fb, 0xa7fc, 0xa7fd, 0xa7fe, 0xad71, 0xad72, 0xad73, 0xad74, 0xad75, 0xad76, 0xad70, 0xab5c, 0xa782, 0xab6c, 0xa79f, 0xa18a, 0xadb0, 0xa157, 0xa24b, 0xa158, 0xa24c, 0xa16c, 0xa767, 0xa541, 0xa542, 0xa543, 0xa544, 0xa545, 0xa546, 0xa547, 0xa548, 0xa549, 0xa54a, 0xa179, 0xa765, 0xa762, 0xa178, 0xa183, 0xa161, 0xa163, 0xa184, 0xa162, 0xa164, 0xa181, 0xa182, 0xa647, 0xa176, 0xa2fa, 0xa173, 0x0082, 0xa2fb, 0xa2fc, 0xa16b, 0xa169, 0xa643, 0xa167, 0xa16a, 0xa168, 0x00ff, 0xadae, 0xa5dc, 0xadac, 0xa5dd, 0xa786, 0xa651, 0xa64f, 0xa64b, 0xa1a0, 0xa19d, 0xa690, 0xac89, 0xa869, 0xa86b, 0xac5d, 0xac66, 0xa863, 0xac62, 0xa853, 0xac55, 0xa842, 0xa84e, 0xa85f, 0xac8b, 0xa86d, 0xac60, 0xac68, 0xa865, 0xac64, 0xa855, 0xac57, 0xa843, 0xa84f, 0xa861, 0xac8a, 0xa86c, 0xac67, 0xa864, 0xac63, 0xa854, 0xac56, 0xa841, 0xa84d, 0xac8c, 0xa86e, 0xac61, 0xac69, 0xa866, 0xac65, 0xa856, 0xac58, 0xa844, 0xa850, 0xa862, 0xa851, 0xa852, 0xa845, 0xa846, 0xa847, 0xa848, 0xac7a, 0xac85, 0xa88a, 0xac77, 0xac82, 0xa887, 0xac78, 0xa87d, 0xac83, 0xa888, 0xa899, 0xac4d, 0xa898, 0xac4c, 0xa89b, 0xa89a, 0xa895, 0xa84c, 0xa85b, 0xa857, 0xac47, 0xa897, 0xac6e, 0xada6, 0xa88e, 0xa873, 0xa877, 0xac59, 0xac4f, 0xa85d, 0xa859, 0xac70, 0xada7, 0xa890, 0xa875, 0xa879, 0xac5b, 0xadaf, 0xa858, 0xac46, 0xa896, 0xac6f, 0xada5, 0xa88f, 0xac5a, 0xac4e, 0xa85e, 0xa85a, 0xac71, 0xada8, 0xa891, 0xa876, 0xa87a, 0xac5c, 0xa752, 0xa188, 0xa189, 0xa177, 0xa174, 0xa498, 0xa49e, 0xa185, 0xa757, 0xa186, 0xa754, 0xa779, 0xa175, 0xa17b, 0xa76e, 0xa763, 0xa187, 0xa76d, 0xa77a, 0xa748, 0xa54c, 0xa54d, 0xa54e, 0xa54f, 0xa550, 0xa551, 0xa552, 0xa553, 0xa554, 0xa54b, 0xa473, 0xa35f, 0xa474, 0xa360, 0xa475, 0xa361, 0xa476, 0xa362, 0xa477, 0xa363, 0xa478, 0xa364, 0xa479, 0xa365, 0xa47a, 0xa366, 0xa47b, 0xa367, 0xa47c, 0xa368, 0xa656, 0xa659, 0xa78d, 0xa78e, 0xa78c, 0xa68a, 0xa749, 0xa66b, 0xa66a, 0xa745, 0xa79b, 0xa665, 0xa78b, 0xa662, 0xa657, 0xa789, 0xa78a, 0xa788, 0xa74e, 0xa689, 0xa682, 0xa791, 0xa792, 0xa744, 0xa669, 0xa793, 0xa670, 0xa671, 0xa676, 0xa65e, 0xac8f, 0xa65f, 0xac90, 0xa698, 0xa697, 0xa741, 0xa687, 0xa679, 0xa67b, 0xa69b, 0xa67a, 0xa68e, 0xa469, 0xa46a, 0xa46b, 0xa46c, 0xa46d, 0xa46e, 0xa46f, 0xa470, 0xa471, 0xa472, 0xa685, 0xac7d, 0xac88, 0xa885, 0xac79, 0xac84, 0xac76, 0xac81, 0xac7b, 0xac86, 0xac7c, 0xac87, 0xa884, 0xac45, 0xac44, 0xa243, 0xa241, 0xa153, 0xa165, 0xa155, 0xa151, 0xa244, 0xa242, 0xa154, 0xa166, 0xa156, 0xa152, 0xa667, 0xa49f, 0xa5db, 0xa18b, 0xa14b, 0xa14c, 0xa149, 0xa14a, 0xada1, 0xa143, 0xa145, 0xa141, 0xada2, 0xa144, 0xa146, 0xa142, 0xada3, 0xa147, 0xada4, 0xa148, 0xa249, 0xa15b, 0xa24a, 0xa15c, 0xa67d, 0xa247, 0xa248, 0xa6f9, 0xa6fa, 0xa6fb, 0xa6fc, 0xa6fd, 0xa6fe, 0xa5f9, 0xa5fa, 0xa5fb, 0xa5fc, 0xa783, 0xad55, 0xa18c, 0xad5b, 0xa192, 0xad57, 0xa18e, 0xad5d, 0xa194, 0xad56, 0xa18d, 0xad59, 0xa190, 0xab6d, 0xaa6e, 0xab5a, 0xaa5a, 0xaa66, 0xad5c, 0xa193, 0xad5a, 0xa191, 0xaa9f, 0xaa58, 0xa750, 0xa74f, 0xab60, 0xaa69, 0xab5e, 0xaa62, 0xab63, 0xaa6c, 0xab5b, 0xaa5c, 0xad5e, 0xa195, 0xa692, 0xab44, 0xaa54, 0xab65, 0xab5d, 0xaa5f, 0xaa5d, 0xad58, 0xa18f, 0xab6b, 0xad6f, 0xaa68, 0xaa63, 0xab69, 0xaa70, 0xaa65, 0xab58, 0xaa57, 0xab59, 0xaa6d, 0xab62, 0xaa6b, 0xab67, 0xad69, 0xad6a, 0xad6d, 0xab46, 0xab66, 0xaa61, 0xad6c, 0xab64, 0xaa6f, 0xaa67, 0xad6b, 0xab68, 0xaa5e, 0xaa59, 0xaa6a, 0xab5f, 0xab45, 0xaa60, 0xa77c, 0xaa55, 0xaa64, 0xad6e, 0xab6a, 0xab61, 0xaa5b, 0xab75, 0xab55, 0xab43, 0xaa50, 0xab56, 0xab47, 0xaa96, 0xaa9e, 0xab42, 0xab76, 0xaa8c, 0xaa8b, 0xab77, 0xac91, 0xab48, 0xaa42, 0xaa8e, 0xaa45, 0xaa94, 0xaa4b, 0xaa53, 0xaa81, 0xaa82, 0xaa8d, 0xaa44, 0xaa83, 0xaa97, 0xaa4d, 0xab49, 0xaa9a, 0xaa90, 0xaa47, 0xaa95, 0xaa4c, 0xab6e, 0xaa84, 0xab4a, 0xab4b, 0xac93, 0xaa98, 0xaa93, 0xaa4a, 0xaa9c, 0xab6f, 0xab4c, 0xab57, 0xaa85, 0xaa9b, 0xaa51, 0xab4d, 0xab4e, 0xaa56, 0xab53, 0xaa41, 0xab4f, 0xaa9d, 0xab71, 0xab72, 0xac96, 0xaa99, 0xaa52, 0xac95, 0xab70, 0xaa86, 0xaa4e, 0xab50, 0xaa91, 0xaa48, 0xaa92, 0xaa49, 0xab41, 0xaa71, 0xaa7d, 0xaa43, 0xab51, 0xac94, 0xab73, 0xaa87, 0xac92, 0xaa88, 0xab52, 0xaa89, 0xaa4f, 0xaa8a, 0xab74, 0xab78, 0xaa8f, 0xaa46, 0xab54, 0xac97, 0xacc2, 0xa455, 0xa341, 0xa2e6, 0xa441, 0xacc3, 0xa456, 0xa342, 0xa2e7, 0xa442, 0xacc4, 0xa457, 0xa343, 0xa2e8, 0xa443, 0xacc5, 0xa458, 0xa344, 0xa2e9, 0xa444, 0xacc6, 0xa459, 0xa345, 0xa2ea, 0xa445, 0xacc7, 0xa45a, 0xa346, 0xa2eb, 0xa446, 0xacc8, 0xa45b, 0xa347, 0xa2ec, 0xa447, 0xacc9, 0xa45c, 0xa348, 0xa2ed, 0xa448, 0xacca, 0xa45d, 0xa349, 0xa2ee, 0xa449, 0xa661, 0xad41, 0xad47, 0xad43, 0xad49, 0xad42, 0xad45, 0xad48, 0xad46, 0xad4a, 0xad44, 0xad7d, 0xad77, 0xad78, 0xad7b, 0xad7a, 0xad79, 0xaa76, 0xad7c, 0xab9b, 0xaa77, 0xab9c, 0xab99, 0xab98, 0xab97, 0xab9d, 0xab8a, 0xab87, 0xaa73, 0xaa75, 0xab9e, 0xab79, 0xaa72, 0xab7a, 0xab9a, 0xab89, 0xab86, 0xab88, 0xab7b, 0xab8b, 0xab8c, 0xab7c, 0xab8d, 0xaa78, 0xab8e, 0xaa7c, 0xab9f, 0xab8f, 0xab90, 0xaa79, 0xab91, 0xab7d, 0xaa7a, 0xab92, 0xab93, 0xaa74, 0xab94, 0xab81, 0xab82, 0xab83, 0xab84, 0xab95, 0xab85, 0xab96, 0xaa7b, 0xaaf9, 0xaafa, 0xaafb, 0xaafc, 0xaafd, 0xaafe, 0xabf7, 0xabf8, 0xabf9, 0xabfa, 0xa44a, 0xa44b, 0xa44c, 0xa44d, 0xa44e, 0xa44f, 0xa450, 0xa451, 0xa452, 0xa453, 0xa454, 0xad68, 0xad5f, 0xad65, 0xad61, 0xad67, 0xad60, 0xad63, 0xad66, 0xad64, 0xad62, 0xa77d, 0xa2ef, 0xa2f0, 0xa2f1, 0xa2f2, 0xa2f3, 0xa2f4, 0xa2f5, 0xa2f6, 0xa2f7, 0xa2f8, 0xa2f9, 0xad54, 0xad4b, 0xad51, 0xad4d, 0xad53, 0xad4c, 0xad4f, 0xad52, 0xad50, 0xad4e, 0xa781, 0xa34a, 0xa34b, 0xa34c, 0xa34d, 0xa34e, 0xa34f, 0xa350, 0xa351, 0xa352, 0xa353, 0xa354, 0xa45e, 0xa45f, 0xa460, 0xa461, 0xa462, 0xa463, 0xa464, 0xa465, 0xa466, 0xa467, 0xa468, 0xaccb, 0xaccc, 0xaccd, 0xacce, 0xaccf, 0xacd0, 0xacf2, 0xacf3, 0xacf4, 0xacf5, 0xacf6, 0xa369, 0xa36a, 0xa36b, 0xa36c, 0xa36d, 0xa36e, 0xa36f, 0xa370, 0xa371, 0xa372, 0xa373, 0xa374, 0xa375, 0xa376, 0xa377, 0xa378, 0xa379, 0xa37a, 0xa37b, 0xa37c, 0xa37d, 0xa381, 0xa382, 0xa383, 0xa384, 0xa385, 0xa646, 0xa64c, 0xa555, 0xa941, 0xa556, 0xa942, 0xa557, 0xa943, 0xa558, 0xa944, 0xa559, 0xa945, 0xa55a, 0xa946, 0xa55b, 0xa947, 0xa55c, 0xa948, 0xa55d, 0xa949, 0xa55e, 0xa94a, 0xa55f, 0xa94b, 0xa560, 0xa94c, 0xa561, 0xa94d, 0xa562, 0xa94e, 0xa563, 0xa94f, 0xa564, 0xa950, 0xa565, 0xa951, 0xa566, 0xa952, 0xa567, 0xa953, 0xa568, 0xa954, 0xa569, 0xa955, 0xa56a, 0xa956, 0xa56b, 0xa957, 0xa56c, 0xa958, 0xa56d, 0xa959, 0xa56e, 0xa95a, 0xa56f, 0xa95b, 0xa570, 0xa95c, 0xa571, 0xa95d, 0xa572, 0xa95e, 0xa573, 0xa95f, 0xa574, 0xa960, 0xa575, 0xa961, 0xa576, 0xa962, 0xa577, 0xa963, 0xa578, 0xa964, 0xa579, 0xa965, 0xa57a, 0xa966, 0xa57b, 0xa967, 0xa57c, 0xa968, 0xa57d, 0xa969, 0xa581, 0xa96a, 0xa582, 0xa96b, 0xa583, 0xa96c, 0xa584, 0xa96d, 0xa585, 0xa96e, 0xa586, 0xa96f, 0xa587, 0xa970, 0xa588, 0xa971, 0xa589, 0xa972, 0xa58a, 0xa973, 0xa58b, 0xa974, 0xa644, 0xa645, 0xa650, 0xa666, 0xa660, 0xa691, 0xa686, 0xa641, 0xa245, 0xa14f, 0xa246, 0xa150, 0xa5da, 0xa19f, 0xa64a, 0xa19c, 0xa19e, 0xa649, 0x0084, 0xa658, 0xa663, 0xa69f, 0xa68f, 0xa681, 0xa674, 0xa696, 0xa69a, 0xa642, 0xa16e, 0xa894, 0xac54, 0xac42, 0xac49, 0xac5f, 0xa867, 0xa868, 0xa89d, 0xa89c, 0xac4b, 0xac4a, 0xa747, 0xa74b, 0xa74c, 0xa74d, 0xa14d, 0xa14e, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, }; static const u_int16_t mac_korean_2uni_page00[][2] = { /* 0x008 */ { 0x001f, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x00c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x8000, 5 }, }; static const u_int16_t mac_korean_2uni_pagea1[][2] = { /* 0xa14 */ { 0xfffe, 6 }, { 0xffff, 21 }, { 0xffff, 37 }, { 0x3fff, 53 }, /* 0xa18 */ { 0xfffe, 67 }, { 0xf7ff, 82 }, { 0x2e11, 97 }, { 0x0000, 0 }, /* 0xa1c */ { 0x3800, 103 }, { 0x0000, 0 }, { 0x3000, 106 }, { 0x4000, 108 }, /* 0xa20 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa24 */ { 0x1ffe, 109 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa28 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0040, 121 }, { 0x0001, 122 }, /* 0xa2c */ { 0x0002, 123 }, { 0x0000, 0 }, { 0xffc0, 124 }, { 0x7fff, 134 }, /* 0xa30 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa34 */ { 0xfffe, 149 }, { 0xffff, 164 }, { 0xffff, 180 }, { 0x3fff, 196 }, /* 0xa38 */ { 0xfffe, 210 }, { 0xffff, 225 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa3c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x4000, 241 }, /* 0xa40 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa44 */ { 0xfffe, 242 }, { 0xffff, 257 }, { 0xffff, 273 }, { 0x3fff, 289 }, /* 0xa48 */ { 0xfffe, 303 }, { 0xffff, 318 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa4c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa50 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa54 */ { 0xfffe, 334 }, { 0xffff, 349 }, { 0xffff, 365 }, { 0x3fff, 381 }, /* 0xa58 */ { 0x0ffe, 395 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa5c */ { 0x0000, 0 }, { 0x7c00, 406 }, { 0x0000, 0 }, { 0x1e00, 411 }, /* 0xa60 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa64 */ { 0xfffe, 415 }, { 0xffff, 430 }, { 0xffff, 446 }, { 0x3fff, 462 }, /* 0xa68 */ { 0xe7fe, 476 }, { 0xcfcf, 489 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa6c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0xffe0, 501 }, { 0x7fff, 512 }, /* 0xa70 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa74 */ { 0xfffe, 527 }, { 0xffff, 542 }, { 0xffff, 558 }, { 0x3fff, 574 }, /* 0xa78 */ { 0xfffe, 588 }, { 0xffff, 603 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa7c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x7fff, 619 }, /* 0xa80 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa84 */ { 0xfffe, 634 }, { 0xffff, 649 }, { 0xffff, 665 }, { 0x3fff, 681 }, /* 0xa88 */ { 0xfffe, 695 }, { 0xffff, 710 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa8c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa90 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa94 */ { 0xfffe, 726 }, { 0xffff, 741 }, { 0xffff, 757 }, { 0x001f, 773 }, /* 0xa98 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa9c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xaa0 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xaa4 */ { 0xfffe, 778 }, { 0xffff, 793 }, { 0xffff, 809 }, { 0x3fff, 825 }, /* 0xaa8 */ { 0xfffe, 839 }, { 0xffff, 854 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xaac */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x7ff0, 870 }, /* 0xab0 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xab4 */ { 0xfffe, 881 }, { 0xffff, 896 }, { 0xffff, 912 }, { 0x3fff, 928 }, /* 0xab8 */ { 0xfffe, 942 }, { 0xffff, 957 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xabc */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0780, 973 }, /* 0xac0 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xac4 */ { 0xfffe, 977 }, { 0xffff, 992 }, { 0xffff, 1008 }, { 0x3fff, 1024 }, /* 0xac8 */ { 0xfffe, 1038 }, { 0x00ff, 1053 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xacc */ { 0xfffc, 1061 }, { 0x0001, 1075 }, { 0x0000, 0 }, { 0x007c, 1076 }, /* 0xad0 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xad4 */ { 0xfffe, 1081 }, { 0xffff, 1096 }, { 0xffff, 1112 }, { 0x3fff, 1128 }, /* 0xad8 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0xfffe, 1142 }, { 0x0001, 1157 }, }; static const cjk_index_t mac_korean_2uni_index[] = { { { 0x0080, 0x00ff }, mac_korean_2uni_page00 }, { { 0xa140, 0xadbf }, mac_korean_2uni_pagea1 }, { { 0, 0 }, NULL } }; static const u_int16_t mac_korean_2uni_charset[] = { 0x00a0, 0x20a9, 0xe022, 0x00a9, 0xe41c, 0xe02b, 0xe12a, 0xe12e, 0xe128, 0xe12c, 0xe129, 0xe12d, 0xe130, 0xe132, 0xe125, 0xe126, 0xe123, 0xe124, 0xfe59, 0xfe5a, 0xe413, 0xe415, 0xe118, 0xe11e, 0xe115, 0xe11b, 0xe117, 0xe11d, 0xe002, 0xe004, 0x2985, 0x2986, 0xe134, 0xe136, 0x3016, 0x3017, 0x3018, 0x3019, 0xe017, 0xe01a, 0xe018, 0xe01b, 0xe116, 0xe11c, 0xe028, 0xe02a, 0xe026, 0xe029, 0xe025, 0xe006, 0x2051, 0xf840, 0x201f, 0x201b, 0x207a, 0x207b, 0xe021, 0xe0a2, 0xe0aa, 0xe01f, 0xe0a1, 0xe015, 0xe012, 0x207c, 0xe0ab, 0x207d, 0x207e, 0xe01c, 0xe01d, 0xe016, 0xe019, 0xe0a5, 0xe0a7, 0xe0ae, 0xe09f, 0xe0a0, 0xe000, 0xe122, 0xe146, 0xe14e, 0xe14a, 0xe170, 0xe150, 0xe159, 0xe148, 0xe157, 0xe14c, 0xe167, 0x204c, 0x204d, 0x02bc, 0x2997, 0x2998, 0xe419, 0xe035, 0xe41a, 0xe417, 0xe034, 0x00b7, 0x2013, 0x2014, 0x2016, 0x301c, 0x00a2, 0x00a3, 0x00a5, 0x226a, 0x226b, 0x00ac, 0xe114, 0xe11a, 0xe113, 0xe119, 0xe412, 0xe414, 0xe138, 0xe139, 0xe133, 0xe135, 0xe003, 0xe005, 0x02dc, 0x02d0, 0x25c9, 0xe1fe, 0xe203, 0xe208, 0xe20d, 0xe212, 0xe217, 0xe21c, 0xe221, 0xe226, 0xe289, 0xe28a, 0xe28b, 0xe28c, 0xe28d, 0xe28e, 0xe28f, 0xe290, 0xe291, 0xe292, 0xe293, 0xe020, 0xe023, 0xe024, 0x22ee, 0x2237, 0xe1fd, 0xe202, 0xe207, 0xe20c, 0xe211, 0xe216, 0xe21b, 0xe220, 0xe225, 0xe29f, 0xe2a0, 0xe2a1, 0xe2a2, 0xe2a3, 0xe2a4, 0xe2a5, 0xe2a6, 0xe2a7, 0xe2a8, 0xe2a9, 0x278a, 0x278b, 0x278c, 0x278d, 0x278e, 0x278f, 0x2790, 0x2791, 0x2792, 0x2793, 0xe0bd, 0xe0bf, 0xe0c1, 0xe0c3, 0xe0c5, 0xe0c7, 0xe0c9, 0xe0cb, 0xe0cd, 0xe0cf, 0xe2c0, 0xe2c1, 0xe2c2, 0xe2c3, 0xe2c4, 0xe2c5, 0xe2c6, 0xe2c7, 0xe2c8, 0xe2c9, 0xe2ca, 0xe2cb, 0xe2cc, 0xe2cd, 0xe2ce, 0xe2cf, 0xe2d0, 0xe2d1, 0xe2d2, 0xe2d3, 0xe2d4, 0xe2d5, 0xe2d6, 0xe2d7, 0xe2d8, 0xe2d9, 0x24b6, 0x24b7, 0x24b8, 0x24b9, 0x24ba, 0x24bb, 0x24bc, 0x24bd, 0x24be, 0x24bf, 0x24c0, 0x24c1, 0x24c2, 0x24c3, 0x24c4, 0x24c5, 0x24c6, 0x24c7, 0x24c8, 0x24c9, 0x24ca, 0x24cb, 0x24cc, 0x24cd, 0x24ce, 0x24cf, 0x203e, 0xe1ff, 0xe204, 0xe209, 0xe20e, 0xe213, 0xe218, 0xe21d, 0xe222, 0xe227, 0xe273, 0xe274, 0xe275, 0xe276, 0xe277, 0xe278, 0xe279, 0xe27a, 0xe27b, 0xe27c, 0xe27d, 0xe1fc, 0xe201, 0xe206, 0xe20b, 0xe210, 0xe215, 0xe21a, 0xe21f, 0xe224, 0xe2aa, 0xe2ab, 0xe2ac, 0xe2ad, 0xe2ae, 0xe2af, 0xe2b0, 0xe2b1, 0xe2b2, 0xe2b3, 0xe2b4, 0xe0fa, 0xe0fb, 0xe0fc, 0xe0fd, 0xe0fe, 0xe0ff, 0xe100, 0xe101, 0xe102, 0xe103, 0xe0bc, 0xe0be, 0xe0c0, 0xe0c2, 0xe0c4, 0xe0c6, 0xe0c8, 0xe0ca, 0xe0cc, 0xe0ce, 0x2a26, 0x227a, 0x227b, 0x22ce, 0x22cf, 0x2280, 0x2281, 0x2270, 0x2271, 0x2272, 0x2273, 0x2ac5, 0x2acb, 0x2ac6, 0x2acc, 0x2276, 0x2277, 0x2279, 0x22da, 0x22db, 0x2a8b, 0x2a8c, 0x2a91, 0x2a92, 0xe0a3, 0x2245, 0x2243, 0x2248, 0x29a3, 0x22a4, 0xe0a4, 0xe120, 0xe008, 0xe009, 0xe00a, 0xe00b, 0xe00c, 0xe00d, 0xe00e, 0xe00f, 0xe010, 0xe011, 0xe0bb, 0xe0b2, 0xe0b3, 0xe0b4, 0xe0b5, 0xe0b6, 0xe0b7, 0xe0b8, 0xe0b9, 0xe0ba, 0xe333, 0xe335, 0xe337, 0xe339, 0xe33b, 0xe33d, 0xe33f, 0xe341, 0xe343, 0xe345, 0xe347, 0xe349, 0xe34b, 0xe34d, 0xe34f, 0xe351, 0xe353, 0xe355, 0xe357, 0xe359, 0xe35b, 0xe35d, 0xe35f, 0xe361, 0xe363, 0xe365, 0xe367, 0xe369, 0xe36b, 0xe36d, 0xe36f, 0xe371, 0xe373, 0xe375, 0xe377, 0xe379, 0xe37b, 0xe37d, 0xe37f, 0xe381, 0xe383, 0xe385, 0xe387, 0xe389, 0xe38b, 0xe38d, 0xe38f, 0xe391, 0xe393, 0xe395, 0xe397, 0xe399, 0xe416, 0xe121, 0xe02d, 0xe02f, 0x2034, 0xe140, 0xe141, 0xe142, 0xe143, 0xe3cf, 0xf83d, 0xe027, 0xe39b, 0xe39c, 0xe2da, 0xe01e, 0x266f, 0xe41b, 0xe418, 0xe033, 0xe332, 0x2042, 0x204e, 0xe032, 0xe3ca, 0xe031, 0x273d, 0x2731, 0x2747, 0x2022, 0xe0d0, 0xe0de, 0xf805, 0xe0d1, 0x2039, 0x203a, 0x00ab, 0x00bb, 0xe0ed, 0xe0ef, 0xe3cc, 0xe228, 0xe0dd, 0xf806, 0x29c8, 0xe0db, 0xe3cb, 0xe11f, 0x29be, 0xe0e8, 0xe0d8, 0xe0d7, 0x271a, 0x2716, 0x29bf, 0x25ef, 0xe0ea, 0xe0eb, 0x2723, 0x2756, 0xf80a, 0x25cc, 0xe0ec, 0x2610, 0x25a2, 0xe0f5, 0xe0f8, 0xe0f6, 0x273f, 0xe137, 0xf809, 0xe0e4, 0x274d, 0x25cd, 0xe104, 0xe3ce, 0xe0f4, 0x2720, 0xe0e3, 0xe0d5, 0x2741, 0xe0f9, 0xf808, 0xe036, 0xe3cd, 0xe168, 0x262f, 0xf80b, 0xe0f2, 0xe0f1, 0x2740, 0xf80c, 0xe0f7, 0x3020, 0xf807, 0x2776, 0x2777, 0x2778, 0x2779, 0x277a, 0x277b, 0x277c, 0x277d, 0x277e, 0x277f, 0x24eb, 0x24ec, 0x24ed, 0x24ee, 0x24ef, 0x24f0, 0x24f1, 0x24f2, 0x24f3, 0x24f4, 0xe13a, 0xe13b, 0xe13c, 0xe13d, 0xe13e, 0xe13f, 0xe0f3, 0x3012, 0x3036, 0xe0e7, 0xe0d9, 0x25fb, 0xf84c, 0xe0b1, 0xe0d6, 0x25ad, 0xf84d, 0xf84e, 0xf84f, 0xe0e2, 0xe15d, 0xe15c, 0x2206, 0xe09e, 0x221f, 0xe0a8, 0x2225, 0x2226, 0xe0a6, 0x2253, 0x2251, 0x2266, 0x2267, 0x2213, 0x2295, 0x2296, 0x2297, 0x2a38, 0x2314, 0xe014, 0xe0ad, 0x2262, 0xe013, 0x25b1, 0xe007, 0x2222, 0x2250, 0x03d5, 0x2ae8, 0x22a3, 0xe0af, 0xe0ac, 0x226e, 0x226f, 0x2285, 0x2284, 0x2209, 0x220c, 0x22bb, 0x22bc, 0x225a, 0x2306, 0xe0a9, 0xe0b0, 0x2a72, 0xe191, 0xe288, 0xe29e, 0x329e, 0xe144, 0x203c, 0x2049, 0xe030, 0x2047, 0xe0e1, 0xe0df, 0xe0e0, 0xe0dc, 0xe0d4, 0xe0d2, 0xe0d3, 0x2588, 0x25e6, 0xe0e5, 0xe0e6, 0xe0e9, 0x25bf, 0x25b5, 0x25b9, 0x25c3, 0x2666, 0x2981, 0x25fc, 0xe0da, 0x25ca, 0x3231, 0x3239, 0x33cb, 0x246f, 0x2470, 0x2471, 0x2472, 0x2473, 0x3251, 0x3252, 0x3253, 0x3254, 0x3255, 0x3256, 0x3257, 0x3258, 0x3259, 0x325a, 0xe055, 0xe040, 0xe04b, 0xe05f, 0xe064, 0xe065, 0xe066, 0xe067, 0x21d0, 0x21cf, 0x21cd, 0xe079, 0xe056, 0xe041, 0xe04c, 0xe060, 0xe062, 0xe063, 0xe03e, 0xe053, 0xe049, 0xe05d, 0xe07b, 0xe08e, 0xe086, 0xe097, 0xe07a, 0x27b2, 0xe085, 0xe096, 0xe042, 0x279c, 0xe04d, 0xe061, 0xe03c, 0xe051, 0xe047, 0xe05b, 0xf846, 0xf847, 0xe038, 0x279b, 0xe039, 0xe04f, 0xe044, 0xe058, 0x2962, 0x2964, 0x2963, 0x2965, 0xe081, 0x27a1, 0xe08a, 0xe09b, 0xe082, 0x279e, 0xe08b, 0xe09c, 0x21b2, 0x21b1, 0xe06f, 0x21b4, 0x21b0, 0x21b3, 0xe110, 0xe107, 0x2936, 0xe06d, 0xe071, 0x2935, 0xe06a, 0x2937, 0x2939, 0x2934, 0xe080, 0xe093, 0xe089, 0xe09a, 0x21bc, 0x21c0, 0xf841, 0xe078, 0xe090, 0xe07d, 0xe074, 0xe072, 0xe077, 0xe076, 0xf849, 0xf848, 0x21c4, 0x21c5, 0xe334, 0xe336, 0xe338, 0xe33a, 0xe33c, 0xe33e, 0xe340, 0xe342, 0xe344, 0xe346, 0xe348, 0xe34a, 0xe34c, 0xe34e, 0xe350, 0xe352, 0xe354, 0xe356, 0xe358, 0xe35a, 0xe35c, 0xe35e, 0xe360, 0xe362, 0xe364, 0xe366, 0xe368, 0xe36a, 0xe36c, 0xe36e, 0xe370, 0xe372, 0xe374, 0xe376, 0xe378, 0xe37a, 0xe37c, 0xe37e, 0xe380, 0xe382, 0xe384, 0xe386, 0xe388, 0xe38a, 0xe38c, 0xe38e, 0xe390, 0xe392, 0xe394, 0xe396, 0xe398, 0xe39a, 0xe1d1, 0xe1a9, 0xe1e8, 0xe1b2, 0xe1ab, 0xe1f8, 0xe1ba, 0xe1e0, 0xe1e2, 0xe1c4, 0xe1ad, 0xe1bc, 0xe1b6, 0xe1dd, 0xe1f1, 0xe19b, 0xe1cb, 0xe1d9, 0xe1ae, 0xe16a, 0xe192, 0xe1cf, 0xe179, 0xe15b, 0xe18c, 0xe154, 0xe197, 0xe165, 0xe16e, 0xe18b, 0xe16d, 0xe190, 0xe184, 0xe161, 0xe174, 0xe193, 0xe177, 0xe155, 0xe188, 0xe173, 0xe15f, 0xe18d, 0xe17d, 0xe163, 0xe17b, 0xe152, 0xe187, 0xe176, 0xe1e6, 0xe248, 0xe244, 0xe25f, 0xe245, 0xe239, 0xe23c, 0xe253, 0xe259, 0xe25c, 0xe268, 0xe255, 0xe1e7, 0xe1af, 0xe1b0, 0xe1b4, 0xe1be, 0xe1c9, 0xe1dc, 0xe1ec, 0xe1ee, 0xe1f0, 0xe1f2, 0xe1a4, 0xe1a3, 0xe1b1, 0xe1aa, 0xe1f7, 0xe1b9, 0xe1df, 0xe1e1, 0xe1c3, 0xe1ac, 0xe1bb, 0xe19e, 0xe1b5, 0xe1c2, 0xe1d8, 0xe1b8, 0xe1ca, 0xe1c5, 0xe1d3, 0xe19f, 0xe15a, 0x2483, 0x2484, 0x2485, 0x2486, 0x2487, 0xe269, 0xe26a, 0xe26b, 0xe26c, 0xe26d, 0xe26e, 0xe1e5, 0xe1a1, 0xe19a, 0xe169, 0xe18f, 0xe182, 0xe19d, 0xe1a8, 0xe1b7, 0xe1bf, 0xe1c0, 0xe1c7, 0xe1cc, 0xe1ce, 0xe1d2, 0xe1de, 0xe1e9, 0xe1ef, 0xe1d0, 0xe1f9, 0xe199, 0xe19c, 0xe1c8, 0xe178, 0xe17a, 0xe153, 0xe164, 0x3294, 0xe16c, 0xe160, 0xe18e, 0xe15e, 0xe196, 0xe17c, 0xe162, 0xe186, 0xe16b, 0xe183, 0xe17e, 0xe18a, 0xe175, 0xe195, 0xe171, 0x32a5, 0xe151, 0xe1bd, 0xe1c6, 0xe1db, 0xe1d4, 0xe1d5, 0xe1eb, 0xe1f3, 0xe198, 0xe1a2, 0xe1a6, 0xe1f4, 0xe247, 0xe249, 0xe24e, 0xe251, 0xe25b, 0xe261, 0xe262, 0xe263, 0xe264, 0xe266, 0xe24c, 0xe243, 0xe24d, 0xe24b, 0xe242, 0xe24f, 0xe250, 0xe252, 0xe254, 0xe257, 0xe258, 0xe25a, 0xe25d, 0xe25e, 0xe260, 0xe265, 0xe267, 0xe240, 0xe23f, 0xe23e, 0xe24a, 0xe23b, 0xe23d, 0xe241, 0xe246, 0xe256, 0xe26f, 0xe270, 0xe271, 0xe272, 0x21f0, 0xf843, 0x27b5, 0xe112, 0xe111, 0xe08f, 0xe07c, 0x27a4, 0xf844, 0xf84b, 0xf84a, 0xe075, 0xe073, 0xe095, 0xe084, 0x21b6, 0x21b7, 0x219d, 0x219c, 0xf842, 0xe03f, 0xe054, 0xe04a, 0xe05e, 0xe083, 0xe094, 0xe08c, 0xe09d, 0xe03a, 0x2794, 0xf845, 0xe045, 0xe059, 0xe03d, 0xe052, 0xe048, 0xe05c, 0xe03b, 0xe050, 0xe046, 0xe05a, 0x21e0, 0x21e2, 0x21e1, 0x21e3, 0xe07e, 0xe091, 0xe087, 0xe098, 0x21e6, 0x21e8, 0x21e7, 0x21e9, 0xe10a, 0xe06b, 0xe06e, 0xe108, 0xe068, 0xe10c, 0xe10e, 0xe105, 0xe10b, 0xe06c, 0xe070, 0xe109, 0xe069, 0xe10d, 0xe10f, 0xe106, 0xe037, 0xe04e, 0xe043, 0xe057, 0x261d, 0x261f, 0xe0ee, 0xe0f0, 0xe1a7, 0xe1ed, 0xe1c1, 0xe1ea, 0xe1da, 0xe1d7, 0xe1fa, 0xe1fb, 0xe200, 0xe205, 0xe20a, 0xe20f, 0xe214, 0xe219, 0xe21e, 0xe223, 0xe2b5, 0xe2b6, 0xe2b7, 0xe2b8, 0xe2b9, 0xe2ba, 0xe2bb, 0xe2bc, 0xe2bd, 0xe2be, 0xe2bf, 0xe229, 0xe22d, 0xe22b, 0xe232, 0xe22e, 0xe230, 0xe22a, 0xe22f, 0xe22c, 0xe231, 0xe295, 0xe299, 0xe297, 0xe29d, 0xe29a, 0xe29c, 0xe296, 0xe29b, 0xe298, 0xe294, 0xe145, 0xe14d, 0xe149, 0xe16f, 0xe14f, 0xe158, 0xe147, 0xe156, 0xe14b, 0xe166, 0xe27f, 0xe283, 0xe281, 0xe287, 0xe284, 0xe286, 0xe280, 0xe285, 0xe282, 0xe27e, 0xe17f, 0xe180, 0xe189, 0xe185, 0xe181, 0xe194, 0xe172, 0x3290, 0x328a, 0x328b, 0x328c, 0x328d, 0x328e, 0x328f, 0xe234, 0xe235, 0xe238, 0xe237, 0xe236, 0xe23a, 0xe233, 0xe127, 0xe12b, 0xe12f, 0xe131, 0xe092, 0xe07f, 0xe088, 0xe099, 0x301e, 0x301f, 0x2036, 0xe02e, 0x2035, 0xe02c, 0xe08d, 0xe001, }; static const u_int32_t mac_korean_compose[] = { 0x0021f877, 0x0021f87f, 0x0028f87c, 0x0028f87f, 0x0029f87c, 0x0029f87f, 0x002af877, 0x002d0308, 0x003020de, 0x003120de, 0x003220de, 0x003320de, 0x003420de, 0x003520de, 0x003620de, 0x003720de, 0x003820de, 0x003920de, 0x003cf877, 0x003d20d2, 0x003d20e5, 0x003ef877, 0x005bf877, 0x005bf87b, 0x005bf87c, 0x005df877, 0x005df87b, 0x005df87c, 0x007bf877, 0x007df877, 0x00a7f87c, 0x00b1f877, 0x00b6f87f, 0x00d7f877, 0x2013f87f, 0x2016f87b, 0x2016f87c, 0x2020f877, 0x2020f87b, 0x2020f87c, 0x2020f87f, 0x2021f87c, 0x2021f87f, 0x2026f87f, 0x2032f873, 0x2032f87f, 0x2033f873, 0x2033f87f, 0x203cf87f, 0x2042f879, 0x2051f871, 0x2051f874, 0x2051f879, 0x2051f87c, 0x20a9f87f, 0x2190f870, 0x2190f871, 0x2190f872, 0x2190f873, 0x2190f874, 0x2190f875, 0x2190f878, 0x2190f879, 0x2190f87a, 0x2190f87b, 0x2190f87c, 0x2190f87f, 0x2191f870, 0x2191f872, 0x2191f873, 0x2191f874, 0x2191f875, 0x2191f878, 0x2191f879, 0x2191f87a, 0x2191f87b, 0x2191f87c, 0x2191f87f, 0x2192f870, 0x2192f872, 0x2192f874, 0x2192f875, 0x2192f878, 0x2192f879, 0x2192f87a, 0x2192f87b, 0x2192f87c, 0x2193f870, 0x2193f872, 0x2193f873, 0x2193f874, 0x2193f875, 0x2193f878, 0x2193f879, 0x2193f87a, 0x2193f87b, 0x2193f87c, 0x2193f87f, 0x2194f87c, 0x2195f87c, 0x2196f87b, 0x2197f87b, 0x2198f87b, 0x2199f87b, 0x21b0f87a, 0x21b0f87c, 0x21b0f87f, 0x21b1f87a, 0x21b1f87c, 0x21b1f87f, 0x21bbf87a, 0x21bbf87b, 0x21bbf87c, 0x21bbf87f, 0x21bcf879, 0x21bcf87f, 0x21c0f879, 0x21c0f87f, 0x21d0f87c, 0x21d2f87c, 0x21d4f879, 0x21d4f87f, 0x21e620dd, 0x21e620de, 0x21e6f870, 0x21e6f874, 0x21e6f875, 0x21e6f878, 0x21e6f879, 0x21e6f87a, 0x21e6f87b, 0x21e6f87c, 0x21e6f87f, 0x21e720dd, 0x21e720de, 0x21e7f875, 0x21e7f878, 0x21e7f879, 0x21e7f87a, 0x21e7f87b, 0x21e7f87c, 0x21e7f87f, 0x21e820de, 0x21e8f870, 0x21e8f874, 0x21e8f875, 0x21e8f878, 0x21e8f879, 0x21e8f87c, 0x21e8f87f, 0x21e920dd, 0x21e920de, 0x21e9f875, 0x21e9f878, 0x21e9f879, 0x21e9f87a, 0x21e9f87b, 0x21e9f87c, 0x2206f87f, 0x2208f877, 0x2211f877, 0x2213f877, 0x221ef877, 0x2222f87f, 0x22250347, 0x2229f877, 0x2229f87f, 0x222af877, 0x222af87f, 0x223d0336, 0x223df877, 0x2260f877, 0x226120d2, 0x226120e5, 0x2282f877, 0x22a50338, 0x2314f87f, 0x2394f876, 0x2460f87f, 0x2461f87f, 0x2462f87f, 0x2463f87f, 0x2464f87f, 0x2465f87f, 0x2466f87f, 0x2467f87f, 0x2468f87f, 0x24eaf87f, 0x24ebf878, 0x24ebf87f, 0x24ecf878, 0x24ecf87f, 0x24edf878, 0x24edf87f, 0x24eef878, 0x24eef87f, 0x24eff878, 0x24eff87f, 0x24f0f878, 0x24f0f87f, 0x24f1f878, 0x24f1f87f, 0x24f2f878, 0x24f2f87f, 0x24f3f878, 0x24f3f87f, 0x24f4f878, 0x24f4f87f, 0x25a020df, 0x25a120df, 0x25a1f879, 0x25a1f87b, 0x25a1f87c, 0x25a8f87f, 0x25adf878, 0x25b220dd, 0x25b320dd, 0x25b3f87f, 0x25b420e4, 0x25c620de, 0x25c6f879, 0x25c720de, 0x25c720df, 0x25c7f879, 0x25c7f87b, 0x25c7f87c, 0x25c7f87f, 0x25c8f87f, 0x25c920dd, 0x25cbf879, 0x25cbf87b, 0x25cbf87f, 0x25ce20dd, 0x25cff879, 0x25eff87c, 0x2610f87c, 0x2610f87f, 0x261cf87f, 0x261df87f, 0x261ef87f, 0x261ff87f, 0x262ff876, 0x262ff87a, 0x2642f87f, 0x2720f87a, 0x2723f87a, 0x273ff87a, 0x274820d8, 0x2756f87a, 0x2756f87f, 0x278af87f, 0x278bf87f, 0x278cf87f, 0x278df87f, 0x278ef87f, 0x278ff87f, 0x2790f87f, 0x2791f87f, 0x2792f87f, 0x2793f87f, 0x27e120dd, 0x2934f87a, 0x2934f87c, 0x2934f87f, 0x2935f87a, 0x2935f87c, 0x2936f87a, 0x2936f87c, 0x2937f87a, 0x2937f87c, 0x2939f87a, 0x2939f87c, 0x2939f87f, 0x2962f87f, 0x2964f87f, 0x2985f873, 0x2985f878, 0x2985f879, 0x2985f87b, 0x2985f87c, 0x2985f87f, 0x2986f873, 0x2986f878, 0x2986f879, 0x2986f87b, 0x2986f87c, 0x2986f87f, 0x29c820de, 0x2afd0347, 0x3002f87d, 0x3007f876, 0x3008f878, 0x3009f878, 0x300af878, 0x300bf878, 0x300cf879, 0x300cf87b, 0x300cf87c, 0x300cf87f, 0x300df879, 0x300df87b, 0x300df87c, 0x300df87f, 0x300ef879, 0x300ef87c, 0x300ff879, 0x300ff87c, 0x3010f878, 0x3010f87f, 0x3011f878, 0x3011f87f, 0x3013f87c, 0x3016f878, 0x3017f878, 0x3251f87a, 0x3252f87a, 0x3253f87a, 0x3254f87a, 0x3255f87a, 0x3256f87a, 0x3257f87a, 0x3258f87a, 0x3259f87a, 0x325af87a, 0x329ef87f, 0x4e0020de, 0x4e00f876, 0x4e0320de, 0x4e03f876, 0x4e0920de, 0x4e09f876, 0x4e5d20de, 0x4e5df876, 0x4e8c20de, 0x4e8cf876, 0x4e9420de, 0x4e94f876, 0x4ed620dd, 0x4ed620de, 0x4ee320dd, 0x4ee320de, 0x4f8b20de, 0x516b20de, 0x516bf876, 0x516d20de, 0x516df876, 0x51a020dd, 0x51a020de, 0x51f8f87f, 0x51f9f87f, 0x524d20dd, 0x524d20de, 0x526f20dd, 0x526f20de, 0x52a920dd, 0x52a920de, 0x52d520dd, 0x52d520de, 0x534120de, 0x5341f876, 0x534df87f, 0x537020dd, 0x537020de, 0x53c320dd, 0x53cd20dd, 0x53cd20de, 0x540d20de, 0x56db20de, 0x56dbf876, 0x570b20dd, 0x571f20de, 0x5b5020de, 0x5e8f20de, 0x5f6220dd, 0x5f6220de, 0x5f7120de, 0x611f20dd, 0x611f20de, 0x616320dd, 0x630720de, 0x63a520dd, 0x63a520de, 0x65b020dd, 0x65e520de, 0x670820de, 0x672820de, 0x672b20dd, 0x672c20dd, 0x672c20de, 0x6c3420de, 0x6ce820dd, 0x6d3e20de, 0x6e9020de, 0x706b20de, 0x73fe20dd, 0x76ee20de, 0x7b5420de, 0x7bc020de, 0x81ea20dd, 0x886320dd, 0x88dc20de, 0x88dc20e4, 0x8a3b20de, 0x902320de, 0x91d120de, 0x959320dd, 0x96fb20dd, 0x982d20de, 0xac0020dd, 0xac0420dd, 0xac1020dd, 0xac1020de, 0xac1920dd, 0xac7020dd, 0xac8c20dd, 0xad0020dd, 0xad5020de, 0xad6d20dd, 0xb09820dd, 0xb0ae20dd, 0xb19220dd, 0xb29020dd, 0xb2e420dd, 0xb2e820dd, 0xb2f520dd, 0xb2f520de, 0xb30020dd, 0xb30020de, 0xb3d920dd, 0xb3d920de, 0xb73b20de, 0xb77c20dd, 0xb9c820dd, 0xba8520dd, 0xba8520de, 0xbb3820de, 0xbc1420dd, 0xbc1820dd, 0xbc1820de, 0xbcc020dd, 0xbcf820dd, 0xbd8020dd, 0xbd8020de, 0xbe4420dd, 0xbe4420de, 0xbe6020dd, 0xc0ac20dd, 0xc0c120dd, 0xc13c20dd, 0xc18c20dd, 0xc18d20dd, 0xc21820dd, 0xc21820de, 0xc21920dd, 0xc2dc20dd, 0xc2e020dd, 0xc2e420dd, 0xc54420dd, 0xc57d20dd, 0xc57d20de, 0xc5ec20dd, 0xc5ed20de, 0xc60820dd, 0xc60820de, 0xc67820dd, 0xc6b420de, 0xc6d020dd, 0xc72020dd, 0xc73c20dd, 0xc74c20dd, 0xc74c20de, 0xc77420dd, 0xc77820dd, 0xc77820de, 0xc77c20dd, 0xc78520dd, 0xc79020dd, 0xc79020de, 0xc79120dd, 0xc80420dd, 0xc80420de, 0xc81120dd, 0xc81120de, 0xc81520de, 0xc81c20dd, 0xc87020dd, 0xc87020de, 0xc87420dd, 0xc8fc20de, 0xc90020dd, 0xc91120dd, 0xc9c120dd, 0xcc2820dd, 0xcc3820dd, 0xce7420dd, 0xd0b920dd, 0xd0c020dd, 0xd0c020de, 0xd30c20dd, 0xd45c20dd, 0xd55820dd, 0xd57420dd, 0xd57420de, 0xd61520dd, 0xd61520de, 0xd65c20dd, 0xd73420dd, 0xe009f875, 0xe009f87a, 0xe009f87b, 0xe009f87c, 0xe009f87f, 0xe00af875, 0xe00af87a, 0xe00af87b, 0xe00af87c, 0xe00af87f, 0xe00bf875, 0xe00bf87a, 0xe00bf87b, 0xe00bf87c, 0xe00bf87f, 0xe00cf875, 0xe00cf87a, 0xe00cf87b, 0xe00cf87c, 0xe00cf87f, 0xe00df875, 0xe00df87a, 0xe00df87b, 0xe00df87c, 0xe00df87f, 0xe00ef875, 0xe00ef87a, 0xe00ef87b, 0xe00ef87c, 0xe00ef87f, 0xe00ff875, 0xe00ff87a, 0xe00ff87b, 0xe00ff87c, 0xe00ff87f, 0xe010f875, 0xe010f87a, 0xe010f87b, 0xe010f87c, 0xe010f87f, 0xe011f875, 0xe011f87a, 0xe011f87b, 0xe011f87c, 0xe011f87f, 0xe0de20df, 0xe145f87a, 0xe147f87a, 0xe149f87a, 0xe14bf87a, 0xe14df87a, 0xe14ff87a, 0xe156f87a, 0xe158f87a, 0xe166f87a, 0xe16ff87a, 0xe172f87c, 0xe17ff87c, 0xe180f87c, 0xe181f87c, 0xe185f87c, 0xe189f87c, 0xe192f87a, 0xe194f87c, 0xe198f87a, 0xe1a0f87a, 0xe1a2f87a, 0xe1a3f87a, 0xe1a4f87a, 0xe1a5f87a, 0xe1a6f87a, 0xe1a7f87a, 0xe1a8f87a, 0xe1a9f87a, 0xe1aef87a, 0xe1aff87a, 0xe1b0f87a, 0xe1b3f87a, 0xe1b4f87a, 0xe1b5f87a, 0xe1b8f87a, 0xe1bbf87a, 0xe1bdf87a, 0xe1bef87a, 0xe1c0f87a, 0xe1c6f87a, 0xe1c9f87a, 0xe1ccf87a, 0xe1cdf87a, 0xe1cef87a, 0xe1cff87a, 0xe1d0f87a, 0xe1d4f87a, 0xe1d5f87a, 0xe1d6f87a, 0xe1dbf87a, 0xe1dcf87a, 0xe1e3f87a, 0xe1e4f87a, 0xe1e7f87a, 0xe1e8f87a, 0xe1e9f87a, 0xe1ecf87a, 0xe1eef87a, 0xe1f0f87a, 0xe1f2f87a, 0xe1f3f87a, 0xe1f4f87a, 0xe1f5f87a, 0xe1f6f87a, 0xe2db0029, 0xe2dc0029, 0xe2dd0029, 0xe2de0029, 0xe2df0029, 0xe2e00029, 0xe2e10029, 0xe2e20029, 0xe2e30029, 0xe2e40029, 0xe2e5005d, 0xe2e6005d, 0xe2e7005d, 0xe2e8005d, 0xe2e9005d, 0xe2ea005d, 0xe2eb005d, 0xe2ec005d, 0xe2ed005d, 0xe2ee005d, 0xe2ef005d, 0xe2f0005d, 0xe2f1005d, 0xe2f2005d, 0xe2f3005d, 0xe2f4005d, 0xe2f5005d, 0xe2f6005d, 0xe2f7005d, 0xe2f8005d, 0xe2f9005d, 0xe2fac0ac, 0xe2fb005d, 0xe2fc005d, 0xe2fd005d, 0xe2fe005d, 0xe2ff005d, 0xe300005d, 0xe301005d, 0xe302005d, 0xe303005d, 0xe304005d, 0xe305005d, 0xe306005d, 0xe307005d, 0xe308005d, 0xe309005d, 0xe30a005d, 0xe30b005d, 0xe30c005d, 0xe30d005d, 0xe30e005d, 0xe30f005d, 0xe310c0ac, 0xe311005d, 0xe312005d, 0xe313005d, 0xe314005d, 0xe315005d, 0xe316005d, 0xe317005d, 0xe318005d, 0xe319005d, 0xe31a005d, 0xe31b005d, 0xe31c005d, 0xe31d005d, 0xe31e005d, 0xe31f005d, 0xe320005d, 0xe321005d, 0xe322005d, 0xe323005d, 0xe324005d, 0xe325005d, 0xe326005d, 0xe327005d, 0xe328005d, 0xe329005d, 0xe32a005d, 0xe32b005d, 0xe32c005d, 0xe32d005d, 0xe32e005d, 0xe32f005d, 0xe330005d, 0xe331005d, 0xe39d0029, 0xe39e0029, 0xe39f0029, 0xe3a00029, 0xe3a10029, 0xe3a20029, 0xe3a30029, 0xe3a40029, 0xe3a50029, 0xe3a60029, 0xe3a70029, 0xe3a80029, 0xe3a90029, 0xe3aa0029, 0xe3ab0029, 0xe3ac0029, 0xe3ad0029, 0xe3ae0029, 0xe3af0029, 0xe3b00029, 0xe3b10029, 0xe3b20029, 0xe3b30029, 0xe3b40029, 0xe3b50029, 0xe3b60029, 0xe3b72020, 0xe3b80031, 0xe3b80032, 0xe3b80033, 0xe3b80034, 0xe3b80035, 0xe3b80036, 0xe3b80037, 0xe3b80038, 0xe3b80039, 0xe3b90030, 0xe3ba0030, 0xe3ba0031, 0xe3ba0032, 0xe3ba0033, 0xe3ba0034, 0xe3ba0035, 0xe3ba0036, 0xe3ba0037, 0xe3ba0038, 0xe3ba0039, 0xe3bb0030, 0xe3bc5341, 0xe3bd4e00, 0xe3bd4e03, 0xe3bd4e09, 0xe3bd4e5d, 0xe3bd4e8c, 0xe3bd4e94, 0xe3bd516b, 0xe3bd516d, 0xe3bd56db, 0xe3bed68c, 0xe3bf0030, 0xe3bf0031, 0xe3bf0032, 0xe3bf0033, 0xe3bf0034, 0xe3bf0035, 0xe3bf0036, 0xe3bf0037, 0xe3bf0038, 0xe3bf0039, 0xe3c00030, 0xe3c15341, 0xe3c24e00, 0xe3c24e03, 0xe3c24e09, 0xe3c24e5d, 0xe3c24e8c, 0xe3c24e94, 0xe3c2516b, 0xe3c2516d, 0xe3c256db, 0xe3c3d68c, 0xe3c40030, 0xe3c40031, 0xe3c40032, 0xe3c40033, 0xe3c40034, 0xe3c40035, 0xe3c40036, 0xe3c40037, 0xe3c40038, 0xe3c40039, 0xe3c50030, 0xe3c60030, 0xe3c60031, 0xe3c60032, 0xe3c60033, 0xe3c60034, 0xe3c60035, 0xe3c60036, 0xe3c60037, 0xe3c60038, 0xe3c60039, 0xe3c70030, 0xe3c80030, 0xe3c80031, 0xe3c80032, 0xe3c80033, 0xe3c80034, 0xe3c80035, 0xe3c80036, 0xe3c80037, 0xe3c80038, 0xe3c80039, 0xe3c90030, 0xe3d0002a, 0xe3d10029, 0xe3d1002e, 0xe3d20029, 0xe3d2002e, 0xe3d30029, 0xe3d3002e, 0xe3d40029, 0xe3d4002e, 0xe3d50029, 0xe3d5002e, 0xe3d60029, 0xe3d6002e, 0xe3d70029, 0xe3d7002e, 0xe3d80029, 0xe3d8002e, 0xe3d90029, 0xe3d9002e, 0xe3da0029, 0xe3da002e, 0xe3db0029, 0xe3db002e, 0xe3dc0029, 0xe3dc002e, 0xe3dd0029, 0xe3dd002e, 0xe3de0029, 0xe3de002e, 0xe3df0029, 0xe3df002e, 0xe3e00029, 0xe3e0002e, 0xe3e10029, 0xe3e1002e, 0xe3e20029, 0xe3e2002e, 0xe3e30029, 0xe3e3002e, 0xe3e40029, 0xe3e4002e, 0xe3e50029, 0xe3e5002e, 0xe3e60029, 0xe3e6002e, 0xe3e70029, 0xe3e7002e, 0xe3e80029, 0xe3e8002e, 0xe3e90029, 0xe3e9002e, 0xe3ea0029, 0xe3ea002e, 0xe3eb0029, 0xe3eb002e, 0xe3ec0029, 0xe3ec002e, 0xe3ed0029, 0xe3ed002e, 0xe3ee0029, 0xe3ee002e, 0xe3ef0029, 0xe3ef002e, 0xe3f00029, 0xe3f0002e, 0xe3f10029, 0xe3f1002e, 0xe3f20029, 0xe3f2002e, 0xe3f30029, 0xe3f3002e, 0xe3f40029, 0xe3f4002e, 0xe3f50029, 0xe3f5002e, 0xe3f60029, 0xe3f6002e, 0xe3f70029, 0xe3f7002e, 0xe3f80029, 0xe3f8002e, 0xe3f90029, 0xe3f9002e, 0xe3fa0029, 0xe3fa002e, 0xe3fb0029, 0xe3fb002e, 0xe3fc0029, 0xe3fc002e, 0xe3fd0029, 0xe3fd002e, 0xe3fe0029, 0xe3fe002e, 0xe3ff0029, 0xe3ff002e, 0xe4000029, 0xe400002e, 0xe4010029, 0xe401002e, 0xe4020029, 0xe402002e, 0xe4030029, 0xe403002e, 0xe4040029, 0xe404002e, 0xe4052020, 0xe4062021, 0xe4070041, 0xe4070042, 0xe4070043, 0xe4070044, 0xe4070045, 0xe4070046, 0xe4070047, 0xe4070048, 0xe4070049, 0xe407004a, 0xe407004b, 0xe407004c, 0xe407004d, 0xe407004e, 0xe407004f, 0xe4070050, 0xe4070051, 0xe4070052, 0xe4070053, 0xe4070054, 0xe4070055, 0xe4070056, 0xe4070057, 0xe4070058, 0xe4070059, 0xe407005a, 0xe4082020, 0xe4090032, 0xe4090033, 0xe40a0031, 0xe40a0032, 0xe40a4e8c, 0xe40a5341, 0xe40bc2dd, 0xe40c0031, 0xe40c0032, 0xe40c4e8c, 0xe40c5341, 0xe40dc2dd, 0xe40e0031, 0xe40e0032, 0xe40f0031, 0xe40f0032, 0xe4100031, 0xe4100032, 0xe411002a, 0xf80520de, 0xf80620df, 0xf809f87a, 0xf80bf87f, 0xf83df87f, 0xf860002a, 0xf8600041, 0xf8600042, 0xf8600043, 0xf8600044, 0xf8600045, 0xf8600046, 0xf8600047, 0xf8600048, 0xf8600049, 0xf860004a, 0xf860004b, 0xf860004c, 0xf860004d, 0xf860004e, 0xf860004f, 0xf8600050, 0xf8600051, 0xf8600052, 0xf8600053, 0xf8600054, 0xf8600055, 0xf8600056, 0xf8600057, 0xf8600058, 0xf8600059, 0xf860005a, 0xf8600061, 0xf8600062, 0xf8600063, 0xf8600064, 0xf8600065, 0xf8600066, 0xf8600067, 0xf8600068, 0xf8600069, 0xf860006a, 0xf860006b, 0xf860006c, 0xf860006d, 0xf860006e, 0xf860006f, 0xf8600070, 0xf8600071, 0xf8600072, 0xf8600073, 0xf8600074, 0xf8600075, 0xf8600076, 0xf8600077, 0xf8600078, 0xf8600079, 0xf860007a, 0xf8602020, 0xf8602021, 0xf8610028, 0xf8612020, 0xf8620028, 0xf862005b, 0xf862c8fc, 0xf863005b, 0xf863c8fc, 0xf864005b, 0xf865005b, 0xf866005b, 0xf867002a, 0xfe59f87c, 0xfe59f87f, 0xfe5af87c, 0xfe5af87f, 0xff01f874, 0xff0af871, 0xff0af873, 0xff0af874, 0xff0af875, 0xff0af87f, 0xff3ff87f, }; netatalk-2.2.2/libatalk/unicode/charsets/generic_cjk.c0000644000175200017500000001267211655731127017717 00000000000000/* * generic_cjk * Copyright (C) TSUBAKIMOTO Hiroya 2004 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #if HAVE_USABLE_ICONV #include "generic_cjk.h" #include static size_t cjk_iconv(void *cd, char **inbuf, char *end, char **outbuf, size_t *outbytesleft) { size_t n = end - *inbuf; if (iconv(cd, (ICONV_CONST char**)inbuf, &n, outbuf, outbytesleft) == (size_t)-1) { iconv(cd, NULL, NULL, NULL, NULL); } return n; } size_t cjk_generic_push(size_t (*char_func)(u_int8_t*, const ucs2_t*, size_t*), void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { char *in = *inbuf; while (*inbytesleft >= sizeof(ucs2_t) && *outbytesleft > 0) { u_int8_t buf[CJK_PUSH_BUFFER]; size_t size = *inbytesleft / sizeof(ucs2_t); size_t n = (char_func)(buf, (const ucs2_t*)in, &size); if (n == 0) { in += size * sizeof(ucs2_t); *inbytesleft -= size * sizeof(ucs2_t); continue; } if (in != *inbuf) { int err = errno; *inbytesleft += cjk_iconv(cd, inbuf, in, outbuf, outbytesleft); if (in != *inbuf) return -1; errno = err; } if (n == (size_t)-1) return -1; if (*outbytesleft < n) break; memcpy(*outbuf, buf, n); *outbuf += n; *outbytesleft -= n; in += size * sizeof(ucs2_t); *inbytesleft -= size * sizeof(ucs2_t); *inbuf = in; } if (in != *inbuf) { *inbytesleft += cjk_iconv(cd, inbuf, in, outbuf, outbytesleft); if (in != *inbuf) return -1; } if (*inbytesleft > 0) { errno = (*inbytesleft < sizeof(ucs2_t) ? EINVAL : E2BIG); return -1; } return 0; } size_t cjk_generic_pull(size_t (*char_func)(ucs2_t*, const u_int8_t*, size_t*), void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { char *in = *inbuf; while (*inbytesleft > 0 && *outbytesleft >= sizeof(ucs2_t)) { ucs2_t buf[CJK_PULL_BUFFER]; size_t size = *inbytesleft; size_t n = (char_func)(buf, (const u_int8_t*)in, &size); if (n == 0) { in += size; *inbytesleft -= size; continue; } if (in != *inbuf) { int err = errno; *inbytesleft += cjk_iconv(cd, inbuf, in, outbuf, outbytesleft); if (in != *inbuf) return -1; errno = err; } if (n == (size_t)-1) return -1; if (*outbytesleft < n * sizeof(ucs2_t)) break; memcpy(*outbuf, buf, n * sizeof(ucs2_t)); *outbuf += n * sizeof(ucs2_t); *outbytesleft -= n * sizeof(ucs2_t); in += size; *inbytesleft -= size; *inbuf = in; } if (in != *inbuf) { *inbytesleft += cjk_iconv(cd, inbuf, in, outbuf, outbytesleft); if (in != *inbuf) return -1; } if (*inbytesleft > 0) { errno = E2BIG; return -1; } return 0; } size_t cjk_char_push(u_int16_t c, u_int8_t *out) { if (!c) return 0; if (c == (u_int16_t)-1) { errno = EILSEQ; return (size_t)-1; } if (c <= 0xff) { out[0] = (u_int8_t)c; return 1; } out[0] = (u_int8_t)(c >> 8); out[1] = (u_int8_t)c; return 2; } size_t cjk_char_pull(ucs2_t wc, ucs2_t* out, const u_int32_t* compose) { if (!wc) return 0; if ((wc & 0xf000) == 0xe000) { ucs2_t buf[CJK_PULL_BUFFER]; size_t i = sizeof(buf) / sizeof(*buf) - 1; do { u_int32_t v = compose[wc & 0xfff]; buf[i] = (ucs2_t)v; wc = (ucs2_t)(v >> 16); } while (--i && (wc & 0xf000) == 0xe000); buf[i] = wc; memcpy(out, buf + i, sizeof(buf) - sizeof(*buf) * i); return sizeof(buf) / sizeof(*buf) - i; } *out = wc; return 1; } u_int16_t cjk_lookup(u_int16_t c, const cjk_index_t *index, const u_int16_t *charset) { while (index->summary && c >= index->range[0]) { if (c <= index->range[1]) { const u_int16_t* summary = index->summary[(c - index->range[0]) >> 4]; u_int16_t used = 1 << (c & 15); if (summary[0] & used) { used = summary[0] & (used - 1); charset += summary[1]; while (used) used &= used - 1, ++charset; return *charset; } return 0; } ++index; } return 0; } ucs2_t cjk_compose(ucs2_t base, ucs2_t comb, const u_int32_t* table, size_t size) { u_int32_t v = ((u_int32_t)base << 16) | comb; size_t low = 0; while (size > low) { size_t n = (low + size) / 2; if (table[n] == v) return 0xe000 + n; if (table[n] < v) { low = n + 1; } else { size = n; } } return 0; } ucs2_t cjk_compose_seq(const ucs2_t* in, size_t* len, const u_int32_t* table, size_t size) { static u_int8_t sz[] = { 3, 4, 5, 5, 5, 5, 5, 3 }; ucs2_t wc = in[0]; size_t n = sz[wc & 7]; size_t i = 0; if (n > *len) { errno = EINVAL; return 0; } while (++i < n) { wc = cjk_compose(wc, in[i], table, size); if (!wc) { errno = EILSEQ; return 0; } } *len = n; return wc; } #endif netatalk-2.2.2/libatalk/unicode/charsets/mac_hebrew.c0000644000175200017500000001266111655731127017546 00000000000000/* Unix SMB/CIFS implementation. minimal iconv implementation Copyright (C) Andrew Tridgell 2001 Copyright (C) Jelmer Vernooij 2002,2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. From samba 3.0 beta and GNU libiconv-1.8 It's bad but most of the time we can't use libc iconv service: - it doesn't round trip for most encoding - it doesn't know about Apple extension */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include "../byteorder.h" #include "mac_hebrew.h" static size_t mac_hebrew_pull(void *,char **, size_t *, char **, size_t *); static size_t mac_hebrew_push(void *,char **, size_t *, char **, size_t *); struct charset_functions charset_mac_hebrew = { "MAC_HEBREW", 5, mac_hebrew_pull, mac_hebrew_push, CHARSET_CLIENT | CHARSET_MULTIBYTE, NULL, NULL, NULL }; /* ------------------------ * from unicode to mac hebrew code page */ static int char_ucs2_to_mac_hebrew ( unsigned char *r, ucs2_t wc) { unsigned char c = 0; if (wc < 0x0080) { *r = wc; return 1; } else if (wc >= 0x00a0 && wc < 0x0100) c = mac_hebrew_page00[wc-0x00a0]; else if (wc >= 0x05b0 && wc < 0x05f0) c = mac_hebrew_page05[wc-0x05b0]; else if (wc >= 0x2010 && wc < 0x2028) c = mac_hebrew_page20[wc-0x2010]; else if (wc == 0x20aa) c = 0xa6; else if (wc >= 0xfb18 && wc < 0xfb50) c = mac_hebrew_pagefb[wc-0xfb18]; if (c != 0) { *r = c; return 1; } return 0; } static size_t mac_hebrew_push( void *cd _U_, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { unsigned char c = 0; int len = 0; unsigned char *tmpptr = (unsigned char *) *outbuf; while (*inbytesleft >= 2 && *outbytesleft >= 1) { ucs2_t inptr = SVAL((*inbuf),0); if (inptr == 0x05b8) { (*inbuf) += 2; (*inbytesleft) -= 2; if (*inbytesleft >= 2 && SVAL((*inbuf),0) == 0xf87f ) { (*inbuf) += 2; (*inbytesleft) -= 2; c = 0xde; } else { c = 0xcb; } *tmpptr = c; } else if (inptr == 0x05f2 && *inbytesleft >= 4 && SVAL((*inbuf),2) == 0x05b7) { (*inbuf) += 4; (*inbytesleft) -= 4; *tmpptr = 0x81; } else if (inptr == 0xf86a && *inbytesleft >= 6 && SVAL((*inbuf),2) == 0x05dc && SVAL((*inbuf),4) == 0x05b9) { (*inbuf) += 6; (*inbytesleft) -= 6; *tmpptr = 0xc0; } else if (char_ucs2_to_mac_hebrew ( tmpptr, inptr)) { (*inbuf) += 2; (*inbytesleft) -= 2; } else { errno = EILSEQ; return (size_t) -1; } (*outbytesleft) -= 1; tmpptr++; len++; } if (*inbytesleft > 0) { errno = E2BIG; return -1; } return len; } /* ------------------------ */ static int char_mac_hebrew_to_ucs2 (ucs2_t *pwc, const unsigned char *s) { unsigned char c = *s; if (c < 0x80) { *pwc = (ucs2_t) c; return 1; } else { unsigned short wc = mac_hebrew_2uni[c-0x80]; if (wc != 0xfffd) { *pwc = (ucs2_t) wc; return 1; } } return 0; } static size_t mac_hebrew_pull ( void *cd _U_, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { ucs2_t temp; unsigned char *inptr; size_t len = 0; while (*inbytesleft >= 1 && *outbytesleft >= 2) { inptr = (unsigned char *) *inbuf; if (char_mac_hebrew_to_ucs2 ( &temp, inptr)) { if (temp == 1) { /* 0x81 --> 0x05f2+0x05b7 */ if (*outbytesleft < 4) { errno = E2BIG; return (size_t) -1; } SSVAL((*outbuf),0,0x05f2); SSVAL((*outbuf),2,0x05b7); (*outbuf) +=4; (*outbytesleft)-=4; len += 2; } else if (temp == 2) { /* 0xc0 -> 0xf86a 0x05dc 0x05b9*/ if (*outbytesleft < 6) { errno = E2BIG; return (size_t) -1; } SSVAL((*outbuf),0,0xf86a); SSVAL((*outbuf),2,0x05dc); SSVAL((*outbuf),4,0x05b9); (*outbuf) +=6; (*outbytesleft)-=6; len += 3; } else if (temp == 3) { /* 0xde --> 0x05b8 0xf87f */ if (*outbytesleft < 4) { errno = E2BIG; return (size_t) -1; } SSVAL((*outbuf),0,0x05b8); SSVAL((*outbuf),2,0xf87f); (*outbuf) +=4; (*outbytesleft)-=4; len += 2; } else { SSVAL((*outbuf),0,temp); (*outbuf) +=2; (*outbytesleft)-=2; len++; } (*inbuf) +=1; (*inbytesleft) -=1; } else { errno = EILSEQ; return (size_t) -1; } } if (*inbytesleft > 0) { errno = E2BIG; return (size_t) -1; } return len; } netatalk-2.2.2/libatalk/unicode/charsets/mac_chinese_trad.c0000644000175200017500000000645011655731127020721 00000000000000/* * MacChineseTrad * Copyright (C) TSUBAKIMOTO Hiroya 2004 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Reference * http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #if HAVE_USABLE_ICONV #include "generic_cjk.h" #include "mac_chinese_trad.h" static size_t mac_chinese_trad_pull(void *,char **, size_t *, char **, size_t *); static size_t mac_chinese_trad_push(void *,char **, size_t *, char **, size_t *); struct charset_functions charset_mac_chinese_trad = { "MAC_CHINESE_TRAD", 2, mac_chinese_trad_pull, mac_chinese_trad_push, CHARSET_ICONV | CHARSET_MULTIBYTE | CHARSET_PRECOMPOSED | CHARSET_CLIENT, "BIG-5", NULL, NULL }; static size_t mac_chinese_trad_char_push(u_int8_t* out, const ucs2_t* in, size_t* size) { ucs2_t wc = in[0]; if (wc <= 0x7f) { if (wc == 0x5c && *size >= 2 && in[1] == 0xf87f) { *size = 2; out[0] = 0x80; } else { *size = 1; out[0] = (u_int8_t)wc; } return 1; } else if ((wc & 0xf000) == 0xe000) { *size = 1; return 0; } else if (*size >= 2 && (in[1] & ~15) == 0xf870) { ucs2_t comp = cjk_compose(wc, in[1], mac_chinese_trad_compose, sizeof(mac_chinese_trad_compose) / sizeof(u_int32_t)); if (comp) { wc = comp; *size = 2; } else { *size = 1; } } else { *size = 1; } return cjk_char_push(cjk_lookup(wc, mac_chinese_trad_uni2_index, mac_chinese_trad_uni2_charset), out); } static size_t mac_chinese_trad_push(void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return cjk_generic_push(mac_chinese_trad_char_push, cd, inbuf, inbytesleft, outbuf, outbytesleft); } static size_t mac_chinese_trad_char_pull(ucs2_t* out, const u_int8_t* in, size_t* size) { u_int16_t c = in[0]; if (c <= 0x7f) { *size = 1; *out = c; return 1; } else if (c >= 0xa1 && c <= 0xfc) { if (*size >= 2) { u_int8_t c2 = in[1]; if ((c2 >= 0x40 && c2 <= 0x7e) || (c2 >= 0xa1 && c2 <= 0xfe)) { *size = 2; c = (c << 8) + c2; } else { errno = EILSEQ; return (size_t)-1; } } else { errno = EINVAL; return (size_t)-1; } } else { *size = 1; } return cjk_char_pull(cjk_lookup(c, mac_chinese_trad_2uni_index, mac_chinese_trad_2uni_charset), out, mac_chinese_trad_compose); } static size_t mac_chinese_trad_pull(void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return cjk_generic_pull(mac_chinese_trad_char_pull, cd, inbuf, inbytesleft, outbuf, outbytesleft); } #endif netatalk-2.2.2/libatalk/unicode/charsets/mac_centraleurope.c0000644000175200017500000000424611655731127021142 00000000000000/* Unix SMB/CIFS implementation. minimal iconv implementation Copyright (C) Andrew Tridgell 2001 Copyright (C) Jelmer Vernooij 2002,2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. From samba 3.0 beta and GNU libiconv-1.8 It's bad but most of the time we can't use libc iconv service: - it doesn't round trip for most encoding - it doesn't know about Apple extension */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include "mac_centraleurope.h" #include "generic_mb.h" static size_t mac_centraleurope_pull(void *,char **, size_t *, char **, size_t *); static size_t mac_centraleurope_push(void *,char **, size_t *, char **, size_t *); struct charset_functions charset_mac_centraleurope = { "MAC_CENTRALEUROPE", 29, mac_centraleurope_pull, mac_centraleurope_push, CHARSET_CLIENT | CHARSET_MULTIBYTE, NULL, NULL, NULL }; /* ------------------------ */ static size_t mac_centraleurope_push( void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return (size_t) mb_generic_push( char_ucs2_to_mac_centraleurope, cd, inbuf, inbytesleft, outbuf, outbytesleft); } /* ------------------------ */ static size_t mac_centraleurope_pull ( void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return (size_t) mb_generic_pull( char_mac_centraleurope_to_ucs2, cd, inbuf, inbytesleft, outbuf, outbytesleft); } netatalk-2.2.2/libatalk/unicode/charsets/mac_hebrew.h0000644000175200017500000001127311655731127017551 00000000000000/* * Copyright (C) 1999-2001 Free Software Foundation, Inc. * This file is part of the GNU LIBICONV Library. * * The GNU LIBICONV Library is free software; you can redistribute it * and/or modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * The GNU LIBICONV Library is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the GNU LIBICONV Library; see the file COPYING.LIB. * If not, write to the Free Software Foundation, Inc., 59 Temple Place - * Suite 330, Boston, MA 02111-1307, USA. * * from libiconv * modified for round trip by didier gautheron * Reference * http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ */ /* * MacHebrew */ static const unsigned short mac_hebrew_2uni[128] = { /* 0x80 0x81 -> 0x05f2+0x05b7 was 0xfb1f */ 0x00c4, 01, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, /* 0x90 */ 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, /* 0xa0 */ /* 0xffd move to right to left (not 0x20aa) */ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x20aa, 0x0027, 0x0029, 0x0028, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, /* 0xb0 */ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, /* 0xc0 -> 0xf86a 0x05dc 0x05b9*/ 02, 0x201e, 0xf89b, 0xf89c, 0xf89d, 0xf89e, 0x05bc, 0xfb4b, 0xfb35, 0x2026, 0x00a0, 0x05b8, 0x05b7, 0x05b5, 0x05b6, 0x05b4, /* 0xd0 0xde --> 0x05b8 0xf87f */ 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0xfb2a, 0xfb2b, 0x05bf, 0x05b0, 0x05b2, 0x05b1, 0x05bb, 0x05b9, 03, 0x05b3, /* 0xe0 */ 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, /* 0xf0 */ 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7, 0x05e8, 0x05e9, 0x05ea, 0x007d, 0x005d, 0x007b, 0x005b, 0x007c, }; /* (wc >= 0x00a0 && wc < 0x0100) */ static const unsigned char mac_hebrew_page00[96] = { 0xca, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x82, /* 0xc0-0xc7 */ 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0x00, 0x8d, /* 0xe0-0xe7 */ 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, /* 0xe8-0xef */ 0x00, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0x00, /* 0xf0-0xf7 */ 0x00, 0x9d, 0x9c, 0x9e, 0x9f, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; /* (wc >= 0x05b0 && wc < 0x05f0) */ static const unsigned char mac_hebrew_page05[64] = { 0xd9, 0xdb, 0xda, 0xdf, 0xcf, 0xcd, 0xce, 0xcc, /* 0xb0-0xb7 */ 0xcb, 0xdd, 0x00, 0xdc, 0xc6, 0x00, 0x00, 0xd8, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xd0-0xd7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xd8-0xdf */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xe0-0xe7 */ 0xf8, 0xf9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ }; /* (wc >= 0x2010 && wc < 0x2028) */ static const unsigned char mac_hebrew_page20[24] = { 0x00, 0x00, 0x00, 0xd0, 0xd1, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd4, 0xd5, 0x00, 0x00, 0xd2, 0xd3, 0xc1, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc9, 0x00, /* 0x20-0x27 */ }; /* (wc >= 0xfb18 && wc < 0xfb50) */ static const unsigned char mac_hebrew_pagefb[56] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0xd6, 0xd7, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ }; netatalk-2.2.2/libatalk/unicode/charsets/mac_roman.h0000644000175200017500000001331111655731127017404 00000000000000 /* * $Id: mac_roman.h,v 1.2 2005-04-28 20:50:04 bfernhomberg Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * from GNU libiconv * modified by Bjorn (Apple Logo 0xf0 to Apple unicode 0xf8ff ) */ static const unsigned char mac_roman_page00[96] = { 0xca, 0xc1, 0xa2, 0xa3, 0xdb, 0xb4, 0x00, 0xa4, /* 0xa0-0xa7 */ 0xac, 0xa9, 0xbb, 0xc7, 0xc2, 0x00, 0xa8, 0xf8, /* 0xa8-0xaf */ 0xa1, 0xb1, 0x00, 0x00, 0xab, 0xb5, 0xa6, 0xe1, /* 0xb0-0xb7 */ 0xfc, 0x00, 0xbc, 0xc8, 0x00, 0x00, 0x00, 0xc0, /* 0xb8-0xbf */ 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, /* 0xc0-0xc7 */ 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, /* 0xc8-0xcf */ 0x00, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0x00, /* 0xd0-0xd7 */ 0xaf, 0xf4, 0xf2, 0xf3, 0x86, 0x00, 0x00, 0xa7, /* 0xd8-0xdf */ 0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0xbe, 0x8d, /* 0xe0-0xe7 */ 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, /* 0xe8-0xef */ 0x00, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, /* 0xf0-0xf7 */ 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0x00, 0x00, 0xd8, /* 0xf8-0xff */ }; static const unsigned char mac_roman_page01[104] = { 0x00, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0xce, 0xcf, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0xd9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ }; static const unsigned char mac_roman_page02[32] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xff, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0xf9, 0xfa, 0xfb, 0xfe, 0xf7, 0xfd, 0x00, 0x00, /* 0xd8-0xdf */ }; static const unsigned char mac_roman_page20[56] = { 0x00, 0x00, 0x00, 0xd0, 0xd1, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd4, 0xd5, 0xe2, 0x00, 0xd2, 0xd3, 0xe3, 0x00, /* 0x18-0x1f */ 0xa0, 0xe0, 0xa5, 0x00, 0x00, 0x00, 0xc9, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0xdc, 0xdd, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x40-0x47 */ }; static const unsigned char mac_roman_page21[8] = { 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0xbd, 0x00, /* 0x20-0x27 */ }; static const unsigned char mac_roman_page22[104] = { 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xc6, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, /* 0x08-0x0f */ 0x00, 0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xb0, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xad, 0x00, 0x00, 0x00, 0xb2, 0xb3, 0x00, 0x00, /* 0x60-0x67 */ }; static const unsigned char mac_roman_pagefb[8] = { 0x00, 0xde, 0xdf, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ }; static const unsigned short mac_roman_2uni[128] = { /* 0x80 */ 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, /* 0x90 */ 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, /* 0xa0 */ 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x00c6, 0x00d8, /* 0xb0 */ 0x221e, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x2202, 0x2211, 0x220f, 0x03c0, 0x222b, 0x00aa, 0x00ba, 0x2126, 0x00e6, 0x00f8, /* 0xc0 */ 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, /* 0xd0 */ 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, 0x00ff, 0x0178, 0x2044, 0x00a4, 0x2039, 0x203a, 0xfb01, 0xfb02, /* 0xe0 */ 0x2021, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, /* 0xf0 */ 0xf8ff, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, 0x00af, 0x02d8, 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7, }; netatalk-2.2.2/libatalk/unicode/charsets/mac_japanese.h0000644000175200017500000003331111655731127020060 00000000000000/* * MacJapanese * Copyright (C) TSUBAKIMOTO Hiroya 2004 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Reference * http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ */ static const u_int16_t mac_japanese_uni2_page00[][2] = { /* 0x00a */ { 0x0201, 1 }, }; static const u_int16_t mac_japanese_uni2_page20[][2] = { /* 0x201 */ { 0x0030, 3 }, { 0x0000, 0 }, { 0x4000, 5 }, /* 0x204 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x208 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x20c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x210 */ { 0x0200, 6 }, { 0x0048, 7 }, { 0x0006, 9 }, { 0x0000, 0 }, /* 0x214 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0fff, 11 }, { 0x0fff, 23 }, /* 0x218 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x21c */ { 0x0070, 35 }, { 0x0000, 0 }, { 0x03c0, 38 }, { 0x0000, 0 }, /* 0x220 */ { 0x0000, 0 }, { 0x8000, 42 }, { 0x4000, 43 }, { 0x0000, 0 }, /* 0x224 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x228 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x8000, 44 }, }; static const u_int16_t mac_japanese_uni2_page24[][2] = { /* 0x246 */ { 0xffff, 45 }, { 0xffff, 61 }, /* 0x248 */ { 0xffff, 77 }, { 0xf001, 93 }, { 0xffff, 98 }, { 0x003f, 114 }, }; static const u_int16_t mac_japanese_uni2_page26[][2] = { /* 0x260 */ { 0x4000, 120 }, { 0xf000, 121 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x264 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x00ff, 125 }, { 0x0000, 0 }, /* 0x268 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x26c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x270 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x274 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x7fc0, 133 }, }; static const u_int16_t mac_japanese_uni2_page30[][2] = { /* 0x300 */ { 0x0010, 142 }, { 0xa000, 143 }, { 0x0001, 145 }, { 0x0000, 0 }, /* 0x304 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x308 */ { 0x0000, 0 }, { 0x0010, 146 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x30c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0780, 147 }, }; static const u_int16_t mac_japanese_uni2_page32[][2] = { /* 0x322 */ { 0xfc00, 151 }, { 0xffff, 157 }, /* 0x324 */ { 0x000d, 173 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x328 */ { 0x0000, 0 }, { 0x6340, 176 }, { 0x03f0, 181 }, { 0x0000, 0 }, /* 0x32c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x330 */ { 0x2029, 187 }, { 0x4170, 191 }, { 0x0ccc, 196 }, { 0x0a4a, 202 }, /* 0x334 */ { 0x6684, 207 }, { 0x0082, 213 }, { 0x0000, 0 }, { 0xf800, 215 }, /* 0x338 */ { 0xc0e0, 220 }, { 0xf1c1, 225 }, { 0x0037, 233 }, { 0x000f, 238 }, /* 0x33c */ { 0x2810, 242 }, { 0x0010, 245 }, }; static const u_int16_t mac_japanese_uni2_pagee0[][2] = { /* 0xe00 */ { 0xffff, 246 }, { 0xffff, 262 }, { 0x0fff, 278 }, { 0x001f, 290 }, /* 0xe04 */ { 0x7f00, 295 }, }; static const u_int16_t mac_japanese_uni2_pagefe[][2] = { /* 0xfe3 */ { 0xffeb, 302 }, /* 0xfe4 */ { 0x001f, 316 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xfe8 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xfec */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xff0 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x1000, 321 }, }; static const cjk_index_t mac_japanese_uni2_index[] = { { { 0x00a0, 0x00af }, mac_japanese_uni2_page00 }, { { 0x2010, 0x22bf }, mac_japanese_uni2_page20 }, { { 0x2460, 0x24bf }, mac_japanese_uni2_page24 }, { { 0x2600, 0x277f }, mac_japanese_uni2_page26 }, { { 0x3000, 0x30ff }, mac_japanese_uni2_page30 }, { { 0x3220, 0x33df }, mac_japanese_uni2_page32 }, { { 0xe000, 0xe04f }, mac_japanese_uni2_pagee0 }, { { 0xfe30, 0xff3f }, mac_japanese_uni2_pagefe }, { { 0, 0 }, NULL } }; static const u_int16_t mac_japanese_uni2_charset[] = { 0x0080, 0x00a0, 0x00fd, 0x815c, 0xffff, 0xffff, 0x8656, 0x8650, 0x869b, 0x869d, 0x00fe, 0x859f, 0x85a0, 0x85a1, 0x85a2, 0x85a3, 0x85a4, 0x85a5, 0x85a6, 0x85a7, 0x85a8, 0x85a9, 0x85aa, 0x85b3, 0x85b4, 0x85b5, 0x85b6, 0x85b7, 0x85b8, 0x85b9, 0x85ba, 0x85bb, 0x85bc, 0x85bd, 0x85be, 0x86cc, 0x86cd, 0x86cb, 0x86d0, 0x86d1, 0x86cf, 0x86d2, 0x8841, 0x8840, 0x8842, 0x8540, 0x8541, 0x8542, 0x8543, 0x8544, 0x8545, 0x8546, 0x8547, 0x8548, 0x8549, 0x854a, 0x854b, 0x854c, 0x854d, 0x854e, 0x854f, 0x8550, 0x8551, 0x8552, 0x8553, 0x855e, 0x855f, 0x8560, 0x8561, 0x8562, 0x8563, 0x8564, 0x8565, 0x8566, 0x8567, 0x8568, 0x8569, 0x856a, 0x856b, 0x856c, 0x856d, 0x856e, 0x856f, 0x8570, 0x8571, 0x8592, 0x8593, 0x8594, 0x8595, 0x8596, 0x8597, 0x8598, 0x8599, 0x859a, 0x85db, 0x85dc, 0x85dd, 0x85de, 0x85df, 0x85e0, 0x85e1, 0x85e2, 0x85e3, 0x85e4, 0x85e5, 0x85e6, 0x85e7, 0x85e8, 0x85e9, 0x85ea, 0x85eb, 0x85ec, 0x85ed, 0x85ee, 0x85ef, 0x85f0, 0x85f1, 0x85f2, 0x85f3, 0x85f4, 0x86b4, 0x86c8, 0x86c9, 0x86c7, 0x86ca, 0x86a3, 0x86a1, 0x86a2, 0x86a4, 0x869f, 0x86a5, 0x86a6, 0x86a0, 0x857c, 0x857d, 0x857e, 0x8580, 0x8581, 0x8582, 0x8583, 0x8584, 0x8585, 0x86b5, 0x8854, 0x8855, 0x86b3, 0x8868, 0x886a, 0x886b, 0x886c, 0x886d, 0x8741, 0x8742, 0x8743, 0x8744, 0x8745, 0x8746, 0x8740, 0x874d, 0x8750, 0x8753, 0x874f, 0x8754, 0x8752, 0x8748, 0x8758, 0x874b, 0x874c, 0x8751, 0x8755, 0x8756, 0x874e, 0x8757, 0x8747, 0x8749, 0x874a, 0x8799, 0x879b, 0x879e, 0x879a, 0x879c, 0x8793, 0x8794, 0x8795, 0x8796, 0x8797, 0x8798, 0x87bd, 0x87a7, 0x87a4, 0x87b0, 0x87a2, 0x87aa, 0x87a3, 0x87a9, 0x87be, 0x87a0, 0x87b2, 0x87b3, 0x87ab, 0x87bf, 0x87b5, 0x87c0, 0x87a5, 0x87a8, 0x87ae, 0x87b4, 0x87b1, 0x87c1, 0x879f, 0x87ad, 0x87a1, 0x87a6, 0x87ac, 0x87af, 0x87e8, 0x87e7, 0x87e6, 0x87e5, 0x87fa, 0x865a, 0x865b, 0x865c, 0x864a, 0x864c, 0x8659, 0x864e, 0x864f, 0x8651, 0x8640, 0x8642, 0x8648, 0x8641, 0x8643, 0x8646, 0x8649, 0x8644, 0x8647, 0x8655, 0x8654, 0x8653, 0x8652, 0x864d, 0x8658, 0x869c, 0x8657, 0xeb5d, 0xeb61, 0xeb63, 0x00ff, 0x86d4, 0x86d5, 0x86d3, 0x86d6, 0xeb41, 0xeb42, 0xeb60, 0xec9f, 0xeca1, 0xeca3, 0xeca5, 0xeca7, 0xecc1, 0xece1, 0xece3, 0xece5, 0xecec, 0xed40, 0xed42, 0xed44, 0xed46, 0xed48, 0xed62, 0xed83, 0xed85, 0xed87, 0xed8e, 0xed95, 0xed96, 0xeb5b, 0x8791, 0x8792, 0x879d, 0x85ab, 0x85bf, 0x87fb, 0x87fc, 0x869e, 0x85ac, 0x85c0, 0x8591, 0x865d, 0x85ad, 0x85c1, 0x86ce, 0xeb81, 0xeb6d, 0xeb6e, 0x864b, 0x8645, 0xeb62, 0xeb50, 0xeb64, 0xeb5c, 0xeb51, 0xeb69, 0xeb6a, 0xeb6f, 0xeb70, 0xeb6b, 0xeb6c, 0xeb79, 0xeb7a, 0xeb73, 0xeb74, 0xeb71, 0xeb72, 0xeb75, 0xeb76, 0xeb77, 0xeb78, 0x815f, }; static const u_int16_t mac_japanese_2uni_page00[][2] = { /* 0x008 */ { 0x0001, 0 }, { 0x0000, 0 }, { 0x0001, 1 }, { 0x0000, 0 }, /* 0x00c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0xe000, 2 }, }; static const u_int16_t mac_japanese_2uni_page81[][2] = { /* 0x815 */ { 0x9000, 5 }, }; static const u_int16_t mac_japanese_2uni_page85[][2] = { /* 0x854 */ { 0xffff, 7 }, { 0xc00f, 23 }, { 0xffff, 29 }, { 0x7003, 45 }, /* 0x858 */ { 0x003f, 50 }, { 0x87fe, 56 }, { 0x3fff, 67 }, { 0xfff8, 81 }, /* 0x85c */ { 0x0003, 94 }, { 0xf800, 96 }, { 0xffff, 101 }, { 0x001f, 117 }, /* 0x860 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x864 */ { 0xffff, 122 }, { 0x3fff, 138 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x868 */ { 0x0000, 0 }, { 0xf800, 152 }, { 0x007f, 157 }, { 0x0038, 164 }, /* 0x86c */ { 0xff80, 167 }, { 0x007f, 176 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x870 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x874 */ { 0xffff, 183 }, { 0x01ff, 199 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x878 */ { 0x0000, 0 }, { 0xfffe, 208 }, { 0xffff, 223 }, { 0xe03f, 239 }, /* 0x87c */ { 0x0003, 248 }, { 0x0000, 0 }, { 0x01e0, 250 }, { 0x1c00, 254 }, /* 0x880 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x884 */ { 0x0007, 257 }, { 0x0030, 260 }, { 0x3d00, 262 }, }; static const u_int16_t mac_japanese_2uni_pageeb[][2] = { /* 0xeb4 */ { 0x0006, 267 }, { 0x3803, 269 }, { 0xfe1f, 274 }, { 0x07ff, 286 }, /* 0xeb8 */ { 0x0002, 297 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xebc */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xec0 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xec4 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xec8 */ { 0x0000, 0 }, { 0x8000, 298 }, { 0x00aa, 299 }, { 0x0000, 0 }, /* 0xecc */ { 0x0002, 303 }, { 0x0000, 0 }, { 0x102a, 304 }, { 0x0000, 0 }, /* 0xed0 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xed4 */ { 0x0155, 308 }, { 0x0000, 0 }, { 0x0004, 313 }, { 0x0000, 0 }, /* 0xed8 */ { 0x40a8, 314 }, { 0x0060, 318 }, }; static const cjk_index_t mac_japanese_2uni_index[] = { { { 0x0080, 0x00ff }, mac_japanese_2uni_page00 }, { { 0x8150, 0x815f }, mac_japanese_2uni_page81 }, { { 0x8540, 0x886f }, mac_japanese_2uni_page85 }, { { 0xeb40, 0xed9f }, mac_japanese_2uni_pageeb }, { { 0, 0 }, NULL } }; static const u_int16_t mac_japanese_2uni_charset[] = { 0x005c, 0x00a0, 0x00a9, 0x2122, 0xe003, 0x2014, 0xff3c, 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x2469, 0x246a, 0x246b, 0x246c, 0x246d, 0x246e, 0x246f, 0x2470, 0x2471, 0x2472, 0x2473, 0x2474, 0x2475, 0x2476, 0x2477, 0x2478, 0x2479, 0x247a, 0x247b, 0x247c, 0x247d, 0x247e, 0x247f, 0x2480, 0x2481, 0x2482, 0x2483, 0x2484, 0x2485, 0x2486, 0x2487, 0x2776, 0x2777, 0x2778, 0x2779, 0x277a, 0x277b, 0x277c, 0x277d, 0x277e, 0xe030, 0x2488, 0x2489, 0x248a, 0x248b, 0x248c, 0x248d, 0x248e, 0x248f, 0x2490, 0x2160, 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0x216a, 0x216b, 0xe025, 0xe02a, 0xe032, 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x217a, 0x217b, 0xe026, 0xe02b, 0xe033, 0x249c, 0x249d, 0x249e, 0x249f, 0x24a0, 0x24a1, 0x24a2, 0x24a3, 0x24a4, 0x24a5, 0x24a6, 0x24a7, 0x24a8, 0x24a9, 0x24aa, 0x24ab, 0x24ac, 0x24ad, 0x24ae, 0x24af, 0x24b0, 0x24b1, 0x24b2, 0x24b3, 0x24b4, 0x24b5, 0x339c, 0x339f, 0x339d, 0x33a0, 0x33a4, 0xe04c, 0x33a1, 0x33a5, 0x339e, 0x33a2, 0x338e, 0xe04b, 0x338f, 0x33c4, 0x3396, 0x3397, 0x2113, 0x3398, 0x33b3, 0x33b2, 0x33b1, 0x33b0, 0x2109, 0x33d4, 0x33cb, 0x3390, 0x3385, 0x3386, 0x3387, 0xe031, 0x2116, 0x33cd, 0x2121, 0xe029, 0x2664, 0x2667, 0x2661, 0x2662, 0x2660, 0x2663, 0x2665, 0x2666, 0x3020, 0x260e, 0x3004, 0x261e, 0x261c, 0x261d, 0x261f, 0x21c6, 0x21c4, 0x21c5, 0xe034, 0x21e8, 0x21e6, 0x21e7, 0x21e9, 0xe006, 0xe004, 0xe005, 0xe007, 0x3230, 0x322a, 0x322b, 0x322c, 0x322d, 0x322e, 0x322f, 0x3240, 0x3237, 0x3242, 0x3243, 0x3239, 0x323a, 0x3231, 0x323e, 0x3234, 0x3232, 0x323b, 0x3236, 0x3233, 0x3235, 0x323c, 0x323d, 0x323f, 0x3238, 0xe022, 0xe023, 0x32a4, 0x32a5, 0x32a6, 0x32a7, 0x32a8, 0x32a9, 0x3296, 0x329d, 0x3298, 0x329e, 0xe024, 0x3299, 0x3349, 0x3322, 0x334d, 0x3314, 0x3316, 0x3305, 0x3333, 0x334e, 0x3303, 0x3336, 0x3318, 0x3315, 0x3327, 0x3351, 0x334a, 0x3339, 0x3357, 0x330d, 0x3342, 0x3323, 0x3326, 0x333b, 0x332b, 0x3300, 0x331e, 0x332a, 0x3331, 0x3347, 0x337e, 0x337d, 0x337c, 0x337b, 0x337f, 0xe027, 0xe028, 0x222e, 0x221f, 0x22bf, 0x301d, 0x301f, 0x3094, 0x30f7, 0x30f8, 0x30f9, 0x30fa, 0xe008, 0xe009, 0xe04e, 0xfe33, 0xe021, 0xfe31, 0xe000, 0xe00a, 0xe001, 0xe04d, 0xe002, 0xfe30, 0xfe35, 0xfe36, 0xfe39, 0xfe3a, 0xe049, 0xe04a, 0xfe37, 0xfe38, 0xfe3f, 0xfe40, 0xfe3d, 0xfe3e, 0xfe41, 0xfe42, 0xfe43, 0xfe44, 0xfe3b, 0xfe3c, 0xe048, 0xe00b, 0xe00c, 0xe00d, 0xe00e, 0xe00f, 0xe010, 0xe011, 0xe012, 0xe013, 0xe014, 0xe015, 0xe016, 0xe017, 0xe018, 0xe019, 0xe01a, 0xe01b, 0xe01c, 0xe01d, 0xe01e, 0xe01f, 0xe020, }; static const u_int32_t mac_japanese_compose[] = { 0x2010f87e, 0x2016f87e, 0x2026f87e, 0x2026f87f, 0x21e6f87a, 0x21e7f87a, 0x21e8f87a, 0x21e9f87a, 0x3001f87e, 0x3002f87e, 0x301cf87e, 0x3041f87e, 0x3043f87e, 0x3045f87e, 0x3047f87e, 0x3049f87e, 0x3063f87e, 0x3083f87e, 0x3085f87e, 0x3087f87e, 0x308ef87e, 0x30a1f87e, 0x30a3f87e, 0x30a5f87e, 0x30a7f87e, 0x30a9f87e, 0x30c3f87e, 0x30e3f87e, 0x30e5f87e, 0x30e7f87e, 0x30eef87e, 0x30f5f87e, 0x30f6f87e, 0x30fcf87e, 0x592720dd, 0x5c0f20dd, 0x63a720dd, 0xe02c0049, 0xe02d0069, 0xe02e793e, 0xe02f4eba, 0xe0350058, 0xe0360056, 0xe0370076, 0xe0380049, 0xe0390069, 0xe03a4f1a, 0xe03b6cd5, 0xe03c002e, 0xe03d0042, 0xe03e0056, 0xe03f0076, 0xe0402191, 0xe0410041, 0xe0420049, 0xe0430069, 0xe0440049, 0xe0450069, 0xe0469650, 0xe04756e3, 0xf8600030, 0xf8600054, 0xf8600058, 0xf8600078, 0xf8602193, 0xf8610046, 0xf8610058, 0xf8610078, 0xf8620058, 0xf8620078, 0xf8626709, 0xf8628ca1, 0xff1df87e, 0xff3bf87e, 0xff3df87e, 0xff47f87f, 0xff4df87f, 0xff5cf87e, 0xffe3f87e, }; netatalk-2.2.2/libatalk/unicode/charsets/mac_roman.c0000644000175200017500000000631211655731127017402 00000000000000/* Unix SMB/CIFS implementation. minimal iconv implementation Copyright (C) Andrew Tridgell 2001 Copyright (C) Jelmer Vernooij 2002,2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. From samba 3.0 beta and GNU libiconv-1.8 It's bad but most of the time we can't use libc iconv service: - it doesn't round trip for most encoding - it doesn't know about Apple extension */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include "mac_roman.h" #include "generic_mb.h" static size_t mac_roman_pull(void *,char **, size_t *, char **, size_t *); static size_t mac_roman_push(void *,char **, size_t *, char **, size_t *); struct charset_functions charset_mac_roman = { "MAC_ROMAN", 0, mac_roman_pull, mac_roman_push, CHARSET_CLIENT | CHARSET_MULTIBYTE | CHARSET_PRECOMPOSED, NULL, NULL, NULL }; /* ------------------------ */ static int char_ucs2_to_mac_roman ( unsigned char *r, ucs2_t wc) { unsigned char c = 0; if (wc < 0x0080) { *r = wc; return 1; } else if (wc >= 0x00a0 && wc < 0x0100) c = mac_roman_page00[wc-0x00a0]; else if (wc >= 0x0130 && wc < 0x0198) c = mac_roman_page01[wc-0x0130]; else if (wc >= 0x02c0 && wc < 0x02e0) c = mac_roman_page02[wc-0x02c0]; else if (wc == 0x03c0) c = 0xb9; else if (wc >= 0x2010 && wc < 0x2048) c = mac_roman_page20[wc-0x2010]; else if (wc >= 0x2120 && wc < 0x2128) c = mac_roman_page21[wc-0x2120]; else if (wc >= 0x2200 && wc < 0x2268) c = mac_roman_page22[wc-0x2200]; else if (wc == 0x25ca) c = 0xd7; else if (wc >= 0xfb00 && wc < 0xfb08) c = mac_roman_pagefb[wc-0xfb00]; else if (wc == 0xf8ff) c = 0xf0; if (c != 0) { *r = c; return 1; } return 0; } static size_t mac_roman_push( void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { /* No special handling required */ return (size_t) mb_generic_push( char_ucs2_to_mac_roman, cd, inbuf, inbytesleft, outbuf, outbytesleft); } /* ------------------------ */ static int char_mac_roman_to_ucs2 (ucs2_t *pwc, const unsigned char *s) { unsigned char c = *s; if (c < 0x80) { *pwc = (ucs2_t) c; return 1; } else { unsigned short wc = mac_roman_2uni[c-0x80]; *pwc = (ucs2_t) wc; return 1; } return 0; } static size_t mac_roman_pull ( void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return (size_t) mb_generic_pull( char_mac_roman_to_ucs2, cd, inbuf, inbytesleft, outbuf, outbytesleft); } netatalk-2.2.2/libatalk/unicode/charsets/generic_mb.c0000644000175200017500000000532711655731127017545 00000000000000/* Unix SMB/CIFS implementation. minimal iconv implementation Copyright (C) Andrew Tridgell 2001 Copyright (C) Jelmer Vernooij 2002,2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. From samba 3.0 beta and GNU libiconv-1.8 It's bad but most of the time we can't use libc iconv service: - it doesn't round trip for most encoding - it doesn't know about Apple extension */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include "generic_mb.h" #include "../byteorder.h" /* ------------------------ */ size_t mb_generic_push( int (*char_func)(unsigned char *, ucs2_t), void *cd _U_, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { int len = 0; unsigned char *tmpptr = (unsigned char *) *outbuf; ucs2_t inval; while (*inbytesleft >= 2 && *outbytesleft >= 1) { inval = SVAL((*inbuf),0); if ( (char_func)( tmpptr, inval)) { (*inbuf) += 2; tmpptr++; len++; (*inbytesleft) -= 2; (*outbytesleft) -= 1; } else { errno = EILSEQ; return (size_t) -1; } } if (*inbytesleft > 0) { errno = E2BIG; return -1; } return len; } /* ------------------------ */ size_t mb_generic_pull ( int (*char_func)(ucs2_t *, const unsigned char *), void *cd _U_, char **inbuf, size_t *inbytesleft,char **outbuf, size_t *outbytesleft) { ucs2_t temp; unsigned char *inptr; size_t len = 0; while (*inbytesleft >= 1 && *outbytesleft >= 2) { inptr = (unsigned char *) *inbuf; if (char_func ( &temp, inptr)) { SSVAL((*outbuf), 0, temp); (*inbuf) +=1; (*outbuf) +=2; (*inbytesleft) -=1; (*outbytesleft)-=2; len++; } else { errno = EILSEQ; return (size_t) -1; } } if (*inbytesleft > 0) { errno = E2BIG; return (size_t) -1; } return len; } netatalk-2.2.2/libatalk/unicode/charsets/mac_cyrillic.h0000644000175200017500000001321611655731127020106 00000000000000/* * Copyright (C) 1999-2001 Free Software Foundation, Inc. * This file is part of the GNU LIBICONV Library. * * The GNU LIBICONV Library is free software; you can redistribute it * and/or modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * The GNU LIBICONV Library is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the GNU LIBICONV Library; see the file COPYING.LIB. * If not, write to the Free Software Foundation, Inc., 59 Temple Place - * Suite 330, Boston, MA 02111-1307, USA. */ /* * MacCyrillic */ static const unsigned short mac_cyrillic_2uni[128] = { /* 0x80 */ 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, /* 0x90 */ 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, /* 0xa0 */ 0x2020, 0x00b0, 0x0490, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x0406, 0x00ae, 0x00a9, 0x2122, 0x0402, 0x0452, 0x2260, 0x0403, 0x0453, /* 0xb0 */ 0x221e, 0x00b1, 0x2264, 0x2265, 0x0456, 0x00b5, 0x0491, 0x0408, 0x0404, 0x0454, 0x0407, 0x0457, 0x0409, 0x0459, 0x040a, 0x045a, /* 0xc0 */ 0x0458, 0x0405, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, 0x00bb, 0x2026, 0x00a0, 0x040b, 0x045b, 0x040c, 0x045c, 0x0455, /* 0xd0 */ 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x201e, 0x040e, 0x045e, 0x040f, 0x045f, 0x2116, 0x0401, 0x0451, 0x044f, /* 0xe0 */ 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, /* 0xf0 */ 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x20ac, }; static int char_mac_cyrillic_to_ucs2 (ucs2_t *pwc, const unsigned char *s) { unsigned char c = *s; if (c >= 0x80) *pwc = (ucs2_t) mac_cyrillic_2uni[c-0x80]; else *pwc = (ucs2_t) c; return 1; } static const unsigned char mac_cyrillic_page00[32] = { 0xca, 0x00, 0xa2, 0xa3, 0xff, 0x00, 0x00, 0xa4, /* 0xa0-0xa7 */ 0x00, 0xa9, 0x00, 0xc7, 0xc2, 0x00, 0xa8, 0x00, /* 0xa8-0xaf */ 0xa1, 0xb1, 0x00, 0x00, 0x00, 0xb5, 0xa6, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ }; static const unsigned char mac_cyrillic_page04[96] = { 0x00, 0xdd, 0xab, 0xae, 0xb8, 0xc1, 0xa7, 0xba, /* 0x00-0x07 */ 0xb7, 0xbc, 0xbe, 0xcb, 0xcd, 0x00, 0xd8, 0xda, /* 0x08-0x0f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x10-0x17 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x18-0x1f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x20-0x27 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x28-0x2f */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x30-0x37 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x38-0x3f */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x40-0x47 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xdf, /* 0x48-0x4f */ 0x00, 0xde, 0xac, 0xaf, 0xb9, 0xcf, 0xb4, 0xbb, /* 0x50-0x57 */ 0xc0, 0xbd, 0xbf, 0xcc, 0xce, 0x00, 0xd9, 0xdb, /* 0x58-0x5f */ }; static const unsigned char mac_cyrillic_page20[24] = { 0x00, 0x00, 0x00, 0xd0, 0xd1, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd4, 0xd5, 0x00, 0x00, 0xd2, 0xd3, 0xd7, 0x00, /* 0x18-0x1f */ 0xa0, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xc9, 0x00, /* 0x20-0x27 */ }; static const unsigned char mac_cyrillic_page21[24] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ }; static const unsigned char mac_cyrillic_page22[104] = { 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xc6, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xb0, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xad, 0x00, 0x00, 0x00, 0xb2, 0xb3, 0x00, 0x00, /* 0x60-0x67 */ }; static int char_ucs2_to_mac_cyrillic(unsigned char *r, ucs2_t wc) { unsigned char c = 0; if (wc < 0x0080) { *r = wc; return 1; } else if (wc >= 0x00a0 && wc < 0x00c0) c = mac_cyrillic_page00[wc-0x00a0]; else if (wc == 0x00f7) c = 0xd6; else if (wc == 0x0192) c = 0xc4; else if (wc >= 0x0400 && wc < 0x0460) c = mac_cyrillic_page04[wc-0x0400]; else if (wc == 0x0490) c = 0xa2; else if (wc == 0x0491) c = 0xb6; else if (wc >= 0x2010 && wc < 0x2028) c = mac_cyrillic_page20[wc-0x2010]; else if (wc == 0x20ac) c = 0xff; else if (wc >= 0x2110 && wc < 0x2128) c = mac_cyrillic_page21[wc-0x2110]; else if (wc >= 0x2200 && wc < 0x2268) c = mac_cyrillic_page22[wc-0x2200]; if (c != 0) { *r = c; return 1; } return 0; } netatalk-2.2.2/libatalk/unicode/charsets/mac_turkish.h0000644000175200017500000001563111655731127017770 00000000000000/* * Copyright (C) 1999-2001 Free Software Foundation, Inc. * This file is part of the GNU LIBICONV Library. * * The GNU LIBICONV Library is free software; you can redistribute it * and/or modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * The GNU LIBICONV Library is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the GNU LIBICONV Library; see the file COPYING.LIB. * If not, write to the Free Software Foundation, Inc., 59 Temple Place - * Suite 330, Boston, MA 02111-1307, USA. */ /* * MacTurkish */ static const unsigned short mac_turkish_2uni[128] = { /* 0x80 */ 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, /* 0x90 */ 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, /* 0xa0 */ 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x00c6, 0x00d8, /* 0xb0 */ 0x221e, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x2202, 0x2211, 0x220f, 0x03c0, 0x222b, 0x00aa, 0x00ba, 0x2126, 0x00e6, 0x00f8, /* 0xc0 */ 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, /* 0xd0 */ 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, 0x00ff, 0x0178, 0x011e, 0x011f, 0x0130, 0x0131, 0x015e, 0x015f, /* 0xe0 */ 0x2021, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, /* 0xf0 */ 0xf8ff, 0x00d2, 0x00da, 0x00db, 0x00d9, 0xf8a0, 0x02c6, 0x02dc, 0x00af, 0x02d8, 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7, }; static int char_mac_turkish_to_ucs2 (ucs2_t *pwc, const unsigned char *s) { unsigned char c = *s; if (c < 0x80) { *pwc = (ucs2_t) c; return 1; } else { unsigned short wc = mac_turkish_2uni[c-0x80]; if (wc != 0xfffd) { *pwc = (ucs2_t) wc; return 1; } } return 0; } static const unsigned char mac_turkish_page00[96] = { 0xca, 0xc1, 0xa2, 0xa3, 0x00, 0xb4, 0x00, 0xa4, /* 0xa0-0xa7 */ 0xac, 0xa9, 0xbb, 0xc7, 0xc2, 0x00, 0xa8, 0xf8, /* 0xa8-0xaf */ 0xa1, 0xb1, 0x00, 0x00, 0xab, 0xb5, 0xa6, 0xe1, /* 0xb0-0xb7 */ 0xfc, 0x00, 0xbc, 0xc8, 0x00, 0x00, 0x00, 0xc0, /* 0xb8-0xbf */ 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, /* 0xc0-0xc7 */ 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, /* 0xc8-0xcf */ 0x00, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0x00, /* 0xd0-0xd7 */ 0xaf, 0xf4, 0xf2, 0xf3, 0x86, 0x00, 0x00, 0xa7, /* 0xd8-0xdf */ 0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0xbe, 0x8d, /* 0xe0-0xe7 */ 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, /* 0xe8-0xef */ 0x00, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, /* 0xf0-0xf7 */ 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0x00, 0x00, 0xd8, /* 0xf8-0xff */ }; static const unsigned char mac_turkish_page01[128] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xda, 0xdb, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0xdc, 0xdd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0xce, 0xcf, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0xdf, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0xd9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ }; static const unsigned char mac_turkish_page02[32] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xff, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0xf9, 0xfa, 0xfb, 0xfe, 0xf7, 0xfd, 0x00, 0x00, /* 0xd8-0xdf */ }; static const unsigned char mac_turkish_page20[40] = { 0x00, 0x00, 0x00, 0xd0, 0xd1, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd4, 0xd5, 0xe2, 0x00, 0xd2, 0xd3, 0xe3, 0x00, /* 0x18-0x1f */ 0xa0, 0xe0, 0xa5, 0x00, 0x00, 0x00, 0xc9, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ }; static const unsigned char mac_turkish_page21[8] = { 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0xbd, 0x00, /* 0x20-0x27 */ }; static const unsigned char mac_turkish_page22[104] = { 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xc6, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, /* 0x08-0x0f */ 0x00, 0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xb0, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xad, 0x00, 0x00, 0x00, 0xb2, 0xb3, 0x00, 0x00, /* 0x60-0x67 */ }; static int char_ucs2_to_mac_turkish (unsigned char *r, ucs2_t wc) { unsigned char c = 0; if (wc < 0x0080) { *r = wc; return 1; } else if (wc >= 0x00a0 && wc < 0x0100) c = mac_turkish_page00[wc-0x00a0]; else if (wc >= 0x0118 && wc < 0x0198) c = mac_turkish_page01[wc-0x0118]; else if (wc >= 0x02c0 && wc < 0x02e0) c = mac_turkish_page02[wc-0x02c0]; else if (wc == 0x03c0) c = 0xb9; else if (wc >= 0x2010 && wc < 0x2038) c = mac_turkish_page20[wc-0x2010]; else if (wc >= 0x2120 && wc < 0x2128) c = mac_turkish_page21[wc-0x2120]; else if (wc >= 0x2200 && wc < 0x2268) c = mac_turkish_page22[wc-0x2200]; else if (wc == 0x25ca) c = 0xd7; else if (wc == 0xf8ff) /* Apple Logo */ c = 0xf0; else if (wc == 0xf8a0) /* undefinded1, roundtrip only */ c = 0xf5; if (c != 0) { *r = c; return 1; } return 0; } netatalk-2.2.2/libatalk/unicode/charsets/generic_cjk.h0000644000175200017500000000310511655731127017713 00000000000000/* * generic_cjk * Copyright (C) TSUBAKIMOTO Hiroya 2004 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include "../byteorder.h" #define CJK_PUSH_BUFFER 4 #define CJK_PULL_BUFFER 8 typedef struct { u_int16_t range[2]; const u_int16_t (*summary)[2]; } cjk_index_t; extern size_t cjk_generic_push (size_t (*)(u_int8_t*, const ucs2_t*, size_t*), void*, char**, size_t*, char**, size_t*); extern size_t cjk_generic_pull (size_t (*)(ucs2_t*, const u_int8_t*, size_t*), void*, char**, size_t*, char**, size_t*); extern size_t cjk_char_push (u_int16_t, u_int8_t*); extern size_t cjk_char_pull (ucs2_t, ucs2_t*, const u_int32_t*); extern u_int16_t cjk_lookup (u_int16_t, const cjk_index_t*, const u_int16_t*); extern ucs2_t cjk_compose (ucs2_t, ucs2_t, const u_int32_t*, size_t); extern ucs2_t cjk_compose_seq (const ucs2_t*, size_t*, const u_int32_t*, size_t); netatalk-2.2.2/libatalk/unicode/charsets/mac_korean.c0000644000175200017500000000656611655731127017560 00000000000000/* * MacKorean * Copyright (C) TSUBAKIMOTO Hiroya 2004 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Reference * http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #if HAVE_USABLE_ICONV #include "generic_cjk.h" #include "mac_korean.h" static size_t mac_korean_pull(void *,char **, size_t *, char **, size_t *); static size_t mac_korean_push(void *,char **, size_t *, char **, size_t *); struct charset_functions charset_mac_korean = { "MAC_KOREAN", 3, mac_korean_pull, mac_korean_push, CHARSET_ICONV | CHARSET_MULTIBYTE | CHARSET_PRECOMPOSED | CHARSET_CLIENT, "EUC-KR", NULL, NULL }; static size_t mac_korean_char_push(u_int8_t* out, const ucs2_t* in, size_t* size) { ucs2_t wc = in[0]; if ((wc & ~7) == 0xf860) { wc = cjk_compose_seq(in, size, mac_korean_compose, sizeof(mac_korean_compose) / sizeof(u_int32_t)); if (!wc) return (size_t)-1; } else if ((wc & 0xf000) == 0xe000) { *size = 1; return 0; } else if (*size >= 2) { ucs2_t comb = in[1]; size_t n = 1; while ((comb & ~15) == 0xf870 || (comb >= 0x0300 && comb <= 0x036f) || (comb >= 0x20d0 && comb <= 0x20ea)) { ucs2_t comp = cjk_compose(wc, comb, mac_korean_compose, sizeof(mac_korean_compose) / sizeof(u_int32_t)); if (!comp) break; wc = comp; if (++n == *size) break; comb = in[n]; } *size = n; } else { *size = 1; } if (wc <= 0x7f) { out[0] = (u_int8_t)wc; return 1; } return cjk_char_push(cjk_lookup(wc, mac_korean_uni2_index, mac_korean_uni2_charset), out); } static size_t mac_korean_push(void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return cjk_generic_push(mac_korean_char_push, cd, inbuf, inbytesleft, outbuf, outbytesleft); } static size_t mac_korean_char_pull(ucs2_t* out, const u_int8_t* in, size_t* size) { u_int16_t c = in[0]; if (c <= 0x7f) { *size = 1; *out = c; return 1; } else if (c >= 0xa1 && c <= 0xfe) { if (*size >= 2) { u_int8_t c2 = in[1]; if ((c2 >= 0x41 && c2 <= 0x7d) || (c2 >= 0x81 && c2 <= 0xfe)) { *size = 2; c = (c << 8) + c2; } else { errno = EILSEQ; return (size_t)-1; } } else { errno = EINVAL; return (size_t)-1; } } else { *size = 1; } return cjk_char_pull(cjk_lookup(c, mac_korean_2uni_index, mac_korean_2uni_charset), out, mac_korean_compose); } static size_t mac_korean_pull(void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return cjk_generic_pull(mac_korean_char_pull, cd, inbuf, inbytesleft, outbuf, outbytesleft); } #endif netatalk-2.2.2/libatalk/unicode/charsets/mac_chinese_trad.h0000644000175200017500000001136211655731127020724 00000000000000/* * MacChineseTrad * Copyright (C) TSUBAKIMOTO Hiroya 2004 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Reference * http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ */ static const u_int16_t mac_chinese_trad_uni2_page00[][2] = { /* 0x00a */ { 0x0201, 0 }, { 0x0080, 2 }, }; static const u_int16_t mac_chinese_trad_uni2_page20[][2] = { /* 0x202 */ { 0x0044, 3 }, }; static const u_int16_t mac_chinese_trad_uni2_page21[][2] = { /* 0x212 */ { 0x0004, 5 }, }; static const u_int16_t mac_chinese_trad_uni2_page22[][2] = { /* 0x229 */ { 0x0020, 6 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0x22c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x8000, 7 }, }; static const u_int16_t mac_chinese_trad_uni2_page25[][2] = { /* 0x259 */ { 0x0020, 8 }, }; static const u_int16_t mac_chinese_trad_uni2_page26[][2] = { /* 0x264 */ { 0x0002, 9 }, }; static const u_int16_t mac_chinese_trad_uni2_pagee0[][2] = { /* 0xe00 */ { 0xffff, 10 }, { 0x00ff, 26 }, }; static const u_int16_t mac_chinese_trad_uni2_pagef8[][2] = { /* 0xf88 */ { 0x0003, 34 }, }; static const u_int16_t mac_chinese_trad_uni2_pagefe[][2] = { /* 0xfe4 */ { 0x1000, 36 }, { 0x7ef5, 37 }, }; static const u_int16_t mac_chinese_trad_uni2_pageff[][2] = { /* 0xff6 */ { 0x0010, 49 }, }; static const cjk_index_t mac_chinese_trad_uni2_index[] = { { { 0x00a0, 0x00bf }, mac_chinese_trad_uni2_page00 }, { { 0x2020, 0x202f }, mac_chinese_trad_uni2_page20 }, { { 0x2120, 0x212f }, mac_chinese_trad_uni2_page21 }, { { 0x2290, 0x22ef }, mac_chinese_trad_uni2_page22 }, { { 0x2590, 0x259f }, mac_chinese_trad_uni2_page25 }, { { 0x2640, 0x264f }, mac_chinese_trad_uni2_page26 }, { { 0xe000, 0xe01f }, mac_chinese_trad_uni2_pagee0 }, { { 0xf880, 0xf88f }, mac_chinese_trad_uni2_pagef8 }, { { 0xfe40, 0xfe5f }, mac_chinese_trad_uni2_pagefe }, { { 0xff60, 0xff6f }, mac_chinese_trad_uni2_pageff }, { { 0, 0 }, NULL } }; static const u_int16_t mac_chinese_trad_uni2_charset[] = { 0x00a0, 0x00fd, 0xa145, 0xffff, 0x00ff, 0x00fe, 0xa1f2, 0xa14b, 0xffff, 0xffff, 0x0080, 0xa1c3, 0xa279, 0xa14e, 0xa1a3, 0xa1a4, 0xa2cc, 0xa2ce, 0xa1cb, 0xa154, 0xa17d, 0xa17e, 0xa14d, 0xa14f, 0xa150, 0xa1fe, 0xa152, 0xa151, 0xa153, 0xa240, 0xa1c5, 0xa15a, 0xa1a1, 0xa1a2, 0x0081, 0x0082, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, }; static const u_int16_t mac_chinese_trad_2uni_page00[][2] = { /* 0x008 */ { 0x0007, 0 }, { 0x0000, 0 }, { 0x0001, 3 }, { 0x0000, 0 }, /* 0x00c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0xe000, 4 }, }; static const u_int16_t mac_chinese_trad_2uni_pagea1[][2] = { /* 0xa14 */ { 0xe820, 7 }, { 0x041f, 12 }, { 0x0000, 0 }, { 0x6000, 18 }, /* 0xa18 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x001e, 20 }, { 0x0000, 0 }, /* 0xa1c */ { 0x0828, 24 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x4004, 27 }, /* 0xa20 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa24 */ { 0x0001, 29 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0200, 30 }, /* 0xa28 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, /* 0xa2c */ { 0x5000, 31 }, }; static const cjk_index_t mac_chinese_trad_2uni_index[] = { { { 0x0080, 0x00ff }, mac_chinese_trad_2uni_page00 }, { { 0xa140, 0xa2cf }, mac_chinese_trad_2uni_pagea1 }, { { 0, 0 }, NULL } }; static const u_int16_t mac_chinese_trad_2uni_charset[] = { 0xe000, 0xf880, 0xf881, 0x00a0, 0x00a9, 0x2122, 0x2026, 0x00b7, 0x22ef, 0xe00c, 0xe003, 0xe00d, 0xe00e, 0xe011, 0xe010, 0xe012, 0xe009, 0xe015, 0xe00a, 0xe00b, 0xe016, 0xe017, 0xe004, 0xe005, 0xe001, 0xe014, 0xe008, 0x2295, 0xe00f, 0xe013, 0xe002, 0xe006, 0xe007, }; static const u_int32_t mac_chinese_trad_compose[] = { 0x005cf87f, 0x203ef87c, 0x2502f87f, 0x3001f87d, 0x3014f87f, 0x3015f87f, 0x5341f87f, 0x5345f87f, 0xfe4bf87c, 0xff01f87d, 0xff08f87f, 0xff09f87f, 0xff0cf87d, 0xff0ef87d, 0xff0ef87e, 0xff0ff87f, 0xff1af87d, 0xff1bf87d, 0xff1ff87d, 0xff3cf87f, 0xff3ff87c, 0xff3ff87f, 0xff5bf87f, 0xff5df87f, }; netatalk-2.2.2/libatalk/util/0000777000175200017500000000000011704770421013072 500000000000000netatalk-2.2.2/libatalk/util/Makefile.am0000644000175200017500000000066211655731127015053 00000000000000# Makefile.am for libatalk/util/ noinst_LTLIBRARIES = libutil.la AM_CFLAGS = -I$(top_srcdir)/sys libutil_la_SOURCES = \ atalk_addr.c \ bprint.c \ cnid.c \ fault.c \ getiface.c \ locking.c \ logger.c \ module.c \ queue.c \ server_child.c \ server_ipc.c \ server_lock.c \ socket.c \ strcasestr.c \ strdicasecmp.c \ strlcpy.c \ volinfo.c \ unix.c if HAVE_ATFUNCS libutil_la_SOURCES += ftw.c endif netatalk-2.2.2/libatalk/util/Makefile.in0000644000175200017500000004303511703521730015054 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/util/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @HAVE_ATFUNCS_TRUE@am__append_1 = ftw.c subdir = libatalk/util DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libutil_la_LIBADD = am__libutil_la_SOURCES_DIST = atalk_addr.c bprint.c cnid.c fault.c \ getiface.c locking.c logger.c module.c queue.c server_child.c \ server_ipc.c server_lock.c socket.c strcasestr.c \ strdicasecmp.c strlcpy.c volinfo.c unix.c ftw.c @HAVE_ATFUNCS_TRUE@am__objects_1 = ftw.lo am_libutil_la_OBJECTS = atalk_addr.lo bprint.lo cnid.lo fault.lo \ getiface.lo locking.lo logger.lo module.lo queue.lo \ server_child.lo server_ipc.lo server_lock.lo socket.lo \ strcasestr.lo strdicasecmp.lo strlcpy.lo volinfo.lo unix.lo \ $(am__objects_1) libutil_la_OBJECTS = $(am_libutil_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libutil_la_SOURCES) DIST_SOURCES = $(am__libutil_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libutil.la AM_CFLAGS = -I$(top_srcdir)/sys libutil_la_SOURCES = atalk_addr.c bprint.c cnid.c fault.c getiface.c \ locking.c logger.c module.c queue.c server_child.c \ server_ipc.c server_lock.c socket.c strcasestr.c \ strdicasecmp.c strlcpy.c volinfo.c unix.c $(am__append_1) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/util/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/util/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libutil.la: $(libutil_la_OBJECTS) $(libutil_la_DEPENDENCIES) $(LINK) $(libutil_la_OBJECTS) $(libutil_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atalk_addr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bprint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fault.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getiface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/locking.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logger.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server_child.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server_ipc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server_lock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strcasestr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdicasecmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strlcpy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/volinfo.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/util/server_lock.c0000644000175200017500000000630711655731245015504 00000000000000/* * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include static struct itimerval itimer; /* this creates an open lock file which hangs around until the program * dies. it returns the pid. due to problems w/ solaris, this has * been changed to do the kill() thing. */ pid_t server_lock(char *program, char *pidfile, int debug) { char buf[10]; FILE *pf; pid_t pid; int mask; mask = umask(022); /* check for pid. this can get fooled by stale pid's. */ if ((pf = fopen(pidfile, "r"))) { if (fgets(buf, sizeof(buf), pf) && !kill(pid = atol(buf), 0)) { fprintf( stderr, "%s is already running (pid = %d), or the lock file is stale.\n", program, pid); fclose(pf); return -1; } fclose(pf); } if ((pf = fopen(pidfile, "w")) == NULL) { fprintf(stderr, "%s: can't open lock file, \"%s\"\n", program, pidfile); return -1; } umask(mask); /* * Disassociate from controlling tty. */ if ( !debug ) { int i; getitimer(ITIMER_PROF, &itimer); switch (pid = fork()) { case 0 : setitimer(ITIMER_PROF, &itimer, NULL); fclose(stdin); fclose(stdout); fclose(stderr); i = open( "/dev/null", O_RDWR ); i = open( "/dev/null", O_RDWR ); i = open( "/dev/null", O_RDWR ); #ifdef TIOCNOTTY if (( i = open( "/dev/tty", O_RDWR )) >= 0 ) { (void)ioctl( i, TIOCNOTTY, 0 ); setpgid( 0, getpid()); (void) close(i); } #else setpgid( 0, getpid()); #endif break; case -1 : /* error */ perror( "fork" ); default : /* server */ fclose(pf); return pid; } } fprintf(pf, "%d\n", getpid()); fclose(pf); return 0; } /*! * Check lockfile */ int check_lockfile(const char *program, const char *pidfile) { char buf[10]; FILE *pf; pid_t pid; /* check for pid. this can get fooled by stale pid's. */ if ((pf = fopen(pidfile, "r"))) { if (fgets(buf, sizeof(buf), pf) && !kill(pid = atol(buf), 0)) { fprintf(stderr, "%s is already running (pid = %d), or the lock file is stale.\n", program, pid); fclose(pf); return -1; } fclose(pf); } return 0; } /*! * Check and create lockfile */ int create_lockfile(const char *program, const char *pidfile) { char buf[10]; FILE *pf; pid_t pid; int mask; if (check_lockfile(program, pidfile) != 0) return -1; /* Write PID to pidfile */ mask = umask(022); if ((pf = fopen(pidfile, "w")) == NULL) { fprintf(stderr, "%s: can't open lock file, \"%s\"\n", program, pidfile); return -1; } umask(mask); fprintf(pf, "%d\n", getpid()); fclose(pf); return 0; } netatalk-2.2.2/libatalk/util/module.c0000644000175200017500000000257211655731127014452 00000000000000/* * $Id: module.c,v 1.5 2003-02-17 02:03:12 srittau Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #ifndef HAVE_DLFCN_H #ifdef MACOSX_SERVER #include void *mod_open(const char *path) { NSObjectFileImage file; if (NSCreateObjectFileImageFromFile(path, &file) != NSObjectFileImageSuccess) return NULL; return NSLinkModule(file, path, TRUE); } void *mod_symbol(void *module, const char *name) { NSSymbol symbol; char *underscore; if ((underscore = (char *) malloc(strlen(name) + 2)) == NULL) return NULL; strcpy(underscore, "_"); strcat(underscore, name); symbol = NSLookupAndBindSymbol(underscore); free(underscore); return NSAddressOfSymbol(symbol); } void mod_close(void *module) { NSUnLinkModule(module, FALSE); } #endif /* MACOSX_SERVER */ #else /* HAVE_DLFCN_H */ #include #ifdef DLSYM_PREPEND_UNDERSCORE void *mod_symbol(void *module, const char *name) { void *symbol; char *underscore; if (!module) return NULL; if ((underscore = (char *) malloc(strlen(name) + 2)) == NULL) return NULL; strcpy(underscore, "_"); strcat(underscore, name); symbol = dlsym(module, underscore); free(underscore); return symbol; } #endif /* DLSYM_PREPEND_UNDERSCORE */ #endif /* HAVE_DLFCN_H */ netatalk-2.2.2/libatalk/util/logger.c0000644000175200017500000005137511655731245014452 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif /* ========================================================================= logger.c was written by Simon Bazley (sibaz@sibaz.com) I believe libatalk is released under the L/GPL licence. Just incase, it is, thats the licence I'm applying to this file. Netatalk 2001 (c) ========================================================================= */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define OPEN_LOGS_AS_UID 0 #define COUNT_ARRAY(array) (sizeof((array))/sizeof((array)[0])) #define MAXLOGSIZE 512 #define LOGLEVEL_STRING_IDENTIFIERS { \ "LOG_NOTHING", \ "LOG_SEVERE", \ "LOG_ERROR", \ "LOG_WARN", \ "LOG_NOTE", \ "LOG_INFO", \ "LOG_DEBUG", \ "LOG_DEBUG6", \ "LOG_DEBUG7", \ "LOG_DEBUG8", \ "LOG_DEBUG9", \ "LOG_MAXDEBUG"} /* these are the string identifiers corresponding to each logtype */ #define LOGTYPE_STRING_IDENTIFIERS { \ "Default", \ "Logger", \ "CNID", \ "AFPDaemon", \ "DSI", \ "ATalkDaemon", \ "PAPDaemon", \ "UAMS", \ "end_of_list_marker"} \ /* ========================================================================= Config ========================================================================= */ /* Main log config container */ log_config_t log_config = { 0 }; /* Default log config: log nothing to files. 0: set ? 0: syslog ? -1: logfiles fd log_none: no logging by default 0: Display options */ #define DEFAULT_LOG_CONFIG {0, 0, -1, log_none, 0} UAM_MODULE_EXPORT logtype_conf_t type_configs[logtype_end_of_list_marker] = { DEFAULT_LOG_CONFIG, /* logtype_default */ DEFAULT_LOG_CONFIG, /* logtype_logger */ DEFAULT_LOG_CONFIG, /* logtype_cnid */ DEFAULT_LOG_CONFIG, /* logtype_afpd */ DEFAULT_LOG_CONFIG, /* logtype_dsi */ DEFAULT_LOG_CONFIG, /* logtype_atalkd */ DEFAULT_LOG_CONFIG, /* logtype_papd */ DEFAULT_LOG_CONFIG /* logtype_uams */ }; /* We use this in order to track the last n log messages in order to prevent flooding */ #define LOG_FLOODING_MINCOUNT 5 /* this controls after how many consecutive messages must be detected before we start to hide them */ #define LOG_FLOODING_MAXCOUNT 1000 /* this controls after how many consecutive messages we force a "repeated x times" message */ #define LOG_FLOODING_ARRAY_SIZE 3 /* this contols how many messages in flow we track */ struct log_flood_entry { int count; unsigned int hash; }; static struct log_flood_entry log_flood_array[LOG_FLOODING_ARRAY_SIZE]; static int log_flood_entries; /* These are used by the LOG macro to store __FILE__ and __LINE__ */ static const char *log_src_filename; static int log_src_linenumber; /* Array to store text to list given a log type */ static const char *arr_logtype_strings[] = LOGTYPE_STRING_IDENTIFIERS; static const unsigned int num_logtype_strings = COUNT_ARRAY(arr_logtype_strings); /* Array for charachters representing log severity in the log file */ static const char arr_loglevel_chars[] = {'-','S', 'E', 'W', 'N', 'I', 'D'}; static const unsigned int num_loglevel_chars = COUNT_ARRAY(arr_loglevel_chars); static const char *arr_loglevel_strings[] = LOGLEVEL_STRING_IDENTIFIERS; static const unsigned int num_loglevel_strings = COUNT_ARRAY(arr_loglevel_strings); /* ========================================================================= Internal function definitions ========================================================================= */ /* Hash a log message */ static unsigned int hash_message(const char *message) { const char *p = message; unsigned int hash = 0, i = 7; while (*p) { hash += *p * i; i++; p++; } return hash; } /* * If filename == NULL its for syslog logging, otherwise its for file-logging. * "unsetuplog" calls with loglevel == NULL. * loglevel == NULL means: * if logtype == default * disable logging * else * set to default logging */ static void setuplog_internal(const char *loglevel, const char *logtype, const char *filename) { unsigned int typenum, levelnum; /* Parse logtype */ for( typenum=0; typenum < num_logtype_strings; typenum++) { if (strcasecmp(logtype, arr_logtype_strings[typenum]) == 0) break; } if (typenum >= num_logtype_strings) { return; } /* Parse loglevel */ if (loglevel == NULL) { levelnum = 0; } else { for(levelnum=1; levelnum < num_loglevel_strings; levelnum++) { if (strcasecmp(loglevel, arr_loglevel_strings[levelnum]) == 0) break; } if (levelnum >= num_loglevel_strings) { return; } } /* is this a syslog setup or a filelog setup ? */ if (filename == NULL) { /* must be syslog */ syslog_setup(levelnum, typenum, logoption_ndelay | logoption_pid, logfacility_daemon); } else { /* this must be a filelog */ log_setup(filename, levelnum, typenum); } return; } static void generate_message_details(char *message_details_buffer, int message_details_buffer_length, int display_options, enum loglevels loglevel, enum logtypes logtype) { char *ptr = message_details_buffer; int templen; int len = message_details_buffer_length; struct timeval tv; pid_t pid; *ptr = 0; /* Print time */ gettimeofday(&tv, NULL); strftime(ptr, len, "%b %d %H:%M:%S.", localtime(&tv.tv_sec)); templen = strlen(ptr); len -= templen; ptr += templen; templen = snprintf(ptr, len, "%06u ", (int)tv.tv_usec); if (templen == -1 || templen >= len) return; len -= templen; ptr += templen; /* Process name && PID */ pid = getpid(); templen = snprintf(ptr, len, "%s[%d]", log_config.processname, pid); if (templen == -1 || templen >= len) return; len -= templen; ptr += templen; /* Source info ? */ if ( ! (display_options & logoption_nsrcinfo)) { char *basename = strrchr(log_src_filename, '/'); if (basename) templen = snprintf(ptr, len, " {%s:%d}", basename + 1, log_src_linenumber); else templen = snprintf(ptr, len, " {%s:%d}", log_src_filename, log_src_linenumber); if (templen == -1 || templen >= len) return; len -= templen; ptr += templen; } /* Errorlevel */ if (loglevel >= (num_loglevel_chars - 1)) templen = snprintf(ptr, len, " (D%d:", loglevel - 1); else templen = snprintf(ptr, len, " (%c:", arr_loglevel_chars[loglevel]); if (templen == -1 || templen >= len) return; len -= templen; ptr += templen; /* Errortype */ if (logtype= len) return; len -= templen; ptr += templen; } strncat(ptr, "): ", len); ptr[len -1] = 0; } static int get_syslog_equivalent(enum loglevels loglevel) { switch (loglevel) { /* The question is we know how bad it is for us, but how should that translate in the syslogs? */ case 1: /* severe */ return LOG_ERR; case 2: /* error */ return LOG_ERR; case 3: /* warning */ return LOG_WARNING; case 4: /* note */ return LOG_NOTICE; case 5: /* information */ return LOG_INFO; default: /* debug */ return LOG_DEBUG; } } /* ========================================================================= Global function definitions ========================================================================= */ void log_init(void) { syslog_setup(log_info, logtype_default, logoption_ndelay | logoption_pid, logfacility_daemon); } void log_setup(const char *filename, enum loglevels loglevel, enum logtypes logtype) { uid_t process_uid; if (loglevel == 0) { /* Disable */ if (type_configs[logtype].set) { if (type_configs[logtype].fd != -1) close(type_configs[logtype].fd); type_configs[logtype].fd = -1; type_configs[logtype].level = -1; type_configs[logtype].set = false; /* if disabling default also set all "default using" levels to 0 */ if (logtype == logtype_default) { while (logtype != logtype_end_of_list_marker) { if ( ! (type_configs[logtype].set)) type_configs[logtype].level = -1; logtype++; } } } return; } /* Safety check */ if (NULL == filename) return; /* Resetting existing config ? */ if (type_configs[logtype].set) { if (type_configs[logtype].fd != -1) close(type_configs[logtype].fd); type_configs[logtype].fd = -1; type_configs[logtype].level = -1; type_configs[logtype].set = false; type_configs[logtype].syslog = false; /* Reset configs using default */ if (logtype == logtype_default) { int typeiter = 0; while (typeiter != logtype_end_of_list_marker) { if (type_configs[typeiter].set == false) { type_configs[typeiter].level = -1; type_configs[typeiter].syslog = false; } typeiter++; } } } /* Set new values */ type_configs[logtype].level = loglevel; /* Open log file as OPEN_LOGS_AS_UID*/ /* Is it /dev/tty ? */ if (strcmp(filename, "/dev/tty") == 0) { type_configs[logtype].fd = 1; /* stdout */ /* Does it end in "XXXXXX" ? debug reguest via SIGINT */ } else if (strcmp(filename + strlen(filename) - 6, "XXXXXX") == 0) { char *tmp = strdup(filename); type_configs[logtype].fd = mkstemp(tmp); free(tmp); } else { process_uid = geteuid(); if (process_uid) { if (seteuid(OPEN_LOGS_AS_UID) == -1) { process_uid = 0; } } type_configs[logtype].fd = open(filename, O_CREAT | O_WRONLY | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (process_uid) { if (seteuid(process_uid) == -1) { LOG(log_error, logtype_logger, "can't seteuid back %s", strerror(errno)); exit(EXITERR_SYS); } } } /* Check for error opening/creating logfile */ if (type_configs[logtype].fd == -1) { type_configs[logtype].level = -1; type_configs[logtype].set = false; return; } fcntl(type_configs[logtype].fd, F_SETFD, FD_CLOEXEC); type_configs[logtype].set = true; log_config.inited = true; /* Here's how we make it possible to LOG to a logtype like "logtype_afpd" */ /* which then uses the default logtype setup if it isn't setup itself: */ /* we just copy the loglevel from default to all logtypes that are not setup. */ /* In "make_log_entry" we then check for the logtypes if they arent setup */ /* and use default then. We must provide accessible values for all logtypes */ /* in order to make it easy and fast to check the loglevels in the LOG macro! */ if (logtype == logtype_default) { int typeiter = 0; while (typeiter != logtype_end_of_list_marker) { if ( ! (type_configs[typeiter].set)) type_configs[typeiter].level = loglevel; typeiter++; } } LOG(log_debug, logtype_logger, "Setup file logging: type: %s, level: %s, file: %s", arr_logtype_strings[logtype], arr_loglevel_strings[loglevel], filename); } /* Setup syslog logging */ void syslog_setup(int loglevel, enum logtypes logtype, int display_options, int facility) { /* * FIXME: * this currently doesn't care if logtype is already logging to a file. * Fortunately currently there's no way a user could trigger this as afpd.conf * is not re-read on SIGHUP. */ type_configs[logtype].level = loglevel; type_configs[logtype].set = true; type_configs[logtype].syslog = true; log_config.syslog_display_options = display_options; log_config.syslog_facility = facility; /* Setting default logging? Then set all logtype not set individually */ if (logtype == logtype_default) { int typeiter = 0; while (typeiter != logtype_end_of_list_marker) { if ( ! (type_configs[typeiter].set)) { type_configs[typeiter].level = loglevel; type_configs[typeiter].syslog = true; } typeiter++; } } log_config.inited = 1; LOG(log_info, logtype_logger, "Set syslog logging to level: %s", arr_loglevel_strings[loglevel]); } void log_close(void) { } /* This function sets up the processname */ void set_processname(const char *processname) { strncpy(log_config.processname, processname, 15); log_config.processname[15] = 0; } /* Called by the LOG macro for syslog messages */ static void make_syslog_entry(enum loglevels loglevel, enum logtypes logtype _U_, char *message) { if ( !log_config.syslog_opened ) { openlog(log_config.processname, log_config.syslog_display_options, log_config.syslog_facility); log_config.syslog_opened = true; } syslog(get_syslog_equivalent(loglevel), "%s", message); } /* ------------------------------------------------------------------------- make_log_entry has 1 main flaws: The message in its entirity, must fit into the tempbuffer. So it must be shorter than MAXLOGSIZE ------------------------------------------------------------------------- */ void make_log_entry(enum loglevels loglevel, enum logtypes logtype, const char *file, int line, char *message, ...) { /* fn is not reentrant but is used in signal handler * with LOGGER it's a little late source name and line number * are already changed. */ static int inlog = 0; int fd, len; char temp_buffer[MAXLOGSIZE]; char log_details_buffer[MAXLOGSIZE]; va_list args; struct iovec iov[2]; if (inlog) return; inlog = 1; if (!log_config.inited) { log_init(); } if (type_configs[logtype].syslog) { if (type_configs[logtype].level >= loglevel) { /* Initialise the Messages and send it to syslog */ va_start(args, message); vsnprintf(temp_buffer, MAXLOGSIZE -1, message, args); va_end(args); temp_buffer[MAXLOGSIZE -1] = 0; make_syslog_entry(loglevel, logtype, temp_buffer); } inlog = 0; return; } /* logging to a file */ log_src_filename = file; log_src_linenumber = line; /* Check if requested logtype is setup */ if (type_configs[logtype].set) /* Yes */ fd = type_configs[logtype].fd; else /* No: use default */ fd = type_configs[logtype_default].fd; if (fd < 0) { /* no where to send the output, give up */ goto exit; } /* Initialise the Messages */ va_start(args, message); len = vsnprintf(temp_buffer, MAXLOGSIZE -1, message, args); va_end(args); /* Append \n */ if (len ==-1 || len >= MAXLOGSIZE -1) { /* vsnprintf hit the buffer size*/ temp_buffer[MAXLOGSIZE-2] = '\n'; temp_buffer[MAXLOGSIZE-1] = 0; } else { temp_buffer[len] = '\n'; temp_buffer[len+1] = 0; } if (type_configs[logtype].level >= log_debug) goto log; /* bypass flooding checks */ /* Prevent flooding: hash the message and check if we got the same one recently */ int hash = hash_message(temp_buffer) + log_src_linenumber; /* Search for the same message by hash */ for (int i = log_flood_entries - 1; i >= 0; i--) { if (log_flood_array[i].hash == hash) { /* found same message */ log_flood_array[i].count++; /* Check if that message has reached LOG_FLOODING_MAXCOUNT */ if (log_flood_array[i].count >= LOG_FLOODING_MAXCOUNT) { /* yes, log it and remove from array */ /* reusing log_details_buffer */ sprintf(log_details_buffer, "message repeated %i times\n", LOG_FLOODING_MAXCOUNT - 1); write(fd, log_details_buffer, strlen(log_details_buffer)); if ((i + 1) == LOG_FLOODING_ARRAY_SIZE) { /* last array element, just decrement count */ log_flood_entries--; goto exit; } /* move array elements down */ for (int j = i + 1; j != LOG_FLOODING_ARRAY_SIZE ; j++) log_flood_array[j-1] = log_flood_array[j]; log_flood_entries--; } if (log_flood_array[i].count < LOG_FLOODING_MINCOUNT) /* log it */ goto log; /* discard it */ goto exit; } /* if */ } /* for */ /* No matching message found, add this message to array*/ if (log_flood_entries == LOG_FLOODING_ARRAY_SIZE) { /* array is full, discard oldest entry printing "message repeated..." if count > 1 */ if (log_flood_array[0].count >= LOG_FLOODING_MINCOUNT) { /* reusing log_details_buffer */ sprintf(log_details_buffer, "message repeated %i times\n", log_flood_array[0].count - LOG_FLOODING_MINCOUNT + 1); write(fd, log_details_buffer, strlen(log_details_buffer)); } for (int i = 1; i < LOG_FLOODING_ARRAY_SIZE; i++) { log_flood_array[i-1] = log_flood_array[i]; } log_flood_entries--; } log_flood_array[log_flood_entries].count = 1; log_flood_array[log_flood_entries].hash = hash; log_flood_entries++; log: if ( ! log_config.console) { generate_message_details(log_details_buffer, sizeof(log_details_buffer), type_configs[logtype].set ? type_configs[logtype].display_options : type_configs[logtype_default].display_options, loglevel, logtype); /* If default wasnt setup its fd is -1 */ iov[0].iov_base = log_details_buffer; iov[0].iov_len = strlen(log_details_buffer); iov[1].iov_base = temp_buffer; iov[1].iov_len = strlen(temp_buffer); writev( fd, iov, 2); } else { write(fd, temp_buffer, strlen(temp_buffer)); } exit: inlog = 0; } void setuplog(const char *logstr) { char *ptr, *ptrbak, *logtype, *loglevel = NULL, *filename = NULL; ptr = strdup(logstr); ptrbak = ptr; /* logtype */ logtype = ptr; /* get loglevel */ ptr = strpbrk(ptr, " \t"); if (ptr) { *ptr++ = 0; while (*ptr && isspace(*ptr)) ptr++; loglevel = ptr; /* get filename */ ptr = strpbrk(ptr, " \t"); if (ptr) { *ptr++ = 0; while (*ptr && isspace(*ptr)) ptr++; } filename = ptr; if (filename && *filename == 0) filename = NULL; } /* finally call setuplog, filename can be NULL */ setuplog_internal(loglevel, logtype, filename); free(ptrbak); } void unsetuplog(const char *logstr) { char *str, *logtype, *filename; str = strdup(logstr); /* logtype */ logtype = str; /* get filename, can be NULL */ strtok(str, " \t"); filename = strtok(NULL, " \t"); /* finally call setuplog, filename can be NULL */ setuplog_internal(NULL, str, filename); free(str); } netatalk-2.2.2/libatalk/util/cnid.c0000644000175200017500000001031711655731127014076 00000000000000/* * Copyright (c) 2009 Frank Lahm * Copyright (c) 1991, 1993, 1994 * 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. * 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /*! * Build path relativ to volume root * * path might be: * (a) relative: * "dir/subdir" with cwd: "/afp_volume/topdir" * (b) absolute: * "/afp_volume/dir/subdir" * * @param path (r) path relative to cwd() or absolute * @param volpath (r) volume path that path is a subdir of (has been computed in volinfo funcs) * * @returns relative path in new bstring, caller must bdestroy it */ bstring rel_path_in_vol(const char *path, const char *volpath) { EC_INIT; int cwd = -1; bstring fpath = NULL; char *dname = NULL; struct stat st; if (path == NULL || volpath == NULL) return NULL; EC_NEG1_LOG(cwd = open(".", O_RDONLY)); EC_ZERO_LOGSTR(lstat(path, &st), "lstat(%s): %s", path, strerror(errno)); if (path[0] == '/') { EC_NULL(fpath = bfromcstr(path)); } else { switch (S_IFMT & st.st_mode) { case S_IFREG: case S_IFLNK: EC_NULL_LOG(dname = strdup(path)); EC_ZERO_LOGSTR(chdir(dirname(dname)), "chdir(%s): %s", dirname, strerror(errno)); free(dname); dname = NULL; EC_NULL(fpath = bfromcstr(getcwdpath())); BSTRING_STRIP_SLASH(fpath); EC_ZERO(bcatcstr(fpath, "/")); EC_NULL_LOG(dname = strdup(path)); EC_ZERO(bcatcstr(fpath, basename(dname))); break; case S_IFDIR: EC_ZERO_LOGSTR(chdir(path), "chdir(%s): %s", path, strerror(errno)); EC_NULL(fpath = bfromcstr(getcwdpath())); break; default: EC_FAIL; } } BSTRING_STRIP_SLASH(fpath); /* * Now we have eg: * fpath: /Volume/netatalk/dir/bla * volpath: /Volume/netatalk/ * we want: "dir/bla" */ int len = strlen(volpath); if (volpath[len-1] != '/') /* in case volpath has no trailing slash */ len ++; EC_ZERO(bdelete(fpath, 0, len)); EC_CLEANUP: if (dname) free(dname); if (cwd != -1) { fchdir(cwd); close(cwd); } if (ret != 0) return NULL; return fpath; } netatalk-2.2.2/libatalk/util/atalk_addr.c0000644000175200017500000000401711655731245015250 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef NO_DDP #include #include #include #include #include /* * Check whether "cp" is a valid ascii representation * of an AppleTalk address and convert to a binary address. * Examples of accepted forms are (in decimal, net of 4321, * node of 65): * * 4321.65 * 0x10E1.41 * 16.225.65 * 0x10.E1.41 * * If hex is used, and the first digit is one of A-F, the leading * 0x is redundant. Returns 1 if the address is valid, 0 if not. * * Unlike Internet addresses, AppleTalk addresses can have leading * 0's. This means that we can't support octal addressing. */ int atalk_aton(char *cp, struct at_addr *addr) { u_int32_t val, base, n; char c; val = 0; base = 10; if ( *cp == '0' && ( *++cp == 'x' || *cp == 'X' )) { base = 16, cp++; } if ( !isdigit( *cp ) && isxdigit( *cp )) { base = 16; } for ( n = 0;; n++ ) { while (( c = *cp ) != '\0') { if ( isascii( c ) && isdigit( c )) { val = (val * base) + (c - '0'); cp++; continue; } if ( base == 16 && isascii( c ) && isxdigit( c )) { val = ( val << 4 ) + ( c + 10 - ( islower( c ) ? 'a' : 'A' )); cp++; continue; } break; } if ( c != '.' && c != '\0' ) { return( 0 ); } switch ( n ) { case 0: if ( addr ) { if ( val > 65535 ) { return( 0 ); } addr->s_net = val; } if ( *cp++ ) { val = 0; } else { break; } continue; case 2: if ( addr ) { if ( addr->s_net > 255 ) { return( 0 ); } addr->s_net <<= 8; addr->s_net += addr->s_node; } /*FALLTHROUGH*/ case 1: if ( addr ) { if ( val > 255 ) { return( 0 ); } addr->s_node = val; } if ( *cp++ ) { val = 0; } else { break; } continue; default: return( 0 ); } break; } if ( n < 1 ) { return( 0 ); } if ( addr ) { addr->s_net = htons( addr->s_net ); } return (1); } #endif /* NO_DDP */ netatalk-2.2.2/libatalk/util/strcasestr.c0000644000175200017500000000574011655731127015362 00000000000000/* Return the offset of one string within another. Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * My personal strstr() implementation that beats most other algorithms. * Until someone tells me otherwise, I assume that this is the * fastest implementation of strstr() in C. * I deliberately chose not to comment it. You should have at least * as much fun trying to understand it, as I had to write it :-). * * Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */ /* added strcasestr support, davidm@lineo.com */ #if HAVE_CONFIG_H # include #endif #ifndef HAVE_STRCASESTR #if defined HAVE_STRING_H # include #endif typedef unsigned chartype; #include #define VAL(x) tolower(x) #define FUNC strcasestr #undef strcasestr char * FUNC ( const char *phaystack, const char *pneedle) { register const unsigned char *haystack, *needle; register chartype b, c; haystack = (const unsigned char *) phaystack; needle = (const unsigned char *) pneedle; b = *needle; if (b != '\0') { haystack--; /* possible ANSI violation */ do { c = *++haystack; if (c == '\0') goto ret0; } while (VAL(c) != VAL(b)); c = *++needle; if (c == '\0') goto foundneedle; ++needle; goto jin; for (;;) { register chartype a; register const unsigned char *rhaystack, *rneedle; do { a = *++haystack; if (a == '\0') goto ret0; if (VAL(a) == VAL(b)) break; a = *++haystack; if (a == '\0') goto ret0; shloop:;} while (VAL(a) != VAL(b)); jin:a = *++haystack; if (a == '\0') goto ret0; if (VAL(a) != VAL(c)) goto shloop; rhaystack = haystack-- + 1; rneedle = needle; a = *rneedle; if (VAL(*rhaystack) == VAL(a)) do { if (a == '\0') goto foundneedle; ++rhaystack; a = *++needle; if (VAL(*rhaystack) != VAL(a)) break; if (a == '\0') goto foundneedle; ++rhaystack; a = *++needle; } while (VAL(*rhaystack) == VAL(a)); needle = rneedle; /* took the register-poor approach */ if (a == '\0') break; } } foundneedle: return (char *) haystack; ret0: return 0; } #endif netatalk-2.2.2/libatalk/util/unix.c0000644000175200017500000001227411655731245014151 00000000000000/* Copyright (c) 2010 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ /*! * @file * Netatalk utility functions */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* close all FDs >= a specified value */ static void closeall(int fd) { int fdlimit = sysconf(_SC_OPEN_MAX); while (fd < fdlimit) close(fd++); } /*! * Daemonize * * Fork, exit parent, setsid(), optionally chdir("/"), optionally close all fds * * returns -1 on failure, but you can't do much except exit in that case * since we may already have forked */ int daemonize(int nochdir, int noclose) { switch (fork()) { case 0: break; case -1: return -1; default: _exit(0); } if (setsid() < 0) return -1; switch (fork()) { case 0: break; case -1: return -1; default: _exit(0); } if (!nochdir) chdir("/"); if (!noclose) { closeall(0); open("/dev/null",O_RDWR); dup(0); dup(0); } return 0; } /*! * @brief get cwd in static buffer * * @returns pointer to path or pointer to error messages on error */ const char *getcwdpath(void) { static char cwd[MAXPATHLEN + 1]; char *p; if ((p = getcwd(cwd, MAXPATHLEN)) != NULL) return p; else return strerror(errno); } /*! * @brief Request absolute path * * @returns Absolute filesystem path to object */ const char *fullpathname(const char *name) { static char wd[MAXPATHLEN + 1]; if (name[0] == '/') return name; if (getcwd(wd , MAXPATHLEN)) { strlcat(wd, "/", MAXPATHLEN); strlcat(wd, name, MAXPATHLEN); } else { strlcpy(wd, name, MAXPATHLEN); } return wd; } /*! * Takes a buffer with a path, strips slashs, returns basename * * @param p (rw) path * path may be * "[/][dir/[...]]file" * or * "[/][dir/[...]]dir/[/]" * Result is "file" or "dir" * * @returns pointer to basename in path buffer, buffer is possibly modified */ char *stripped_slashes_basename(char *p) { int i = strlen(p) - 1; while (i > 0 && p[i] == '/') p[i--] = 0; return (strrchr(p, '/') ? strrchr(p, '/') + 1 : p); } /*! * @brief symlink safe chdir replacement * * Only chdirs to dir if it doesn't contain symlinks. * * @returns 1 if a path element is a symlink, 0 otherwise, -1 on syserror */ int lchdir(const char *dir) { char buf[MAXPATHLEN+1]; char cwd[MAXPATHLEN+1]; char *test; int i; /* dir is a canonical path (without "../" "./" "//" ) but may end with a / */ *cwd = 0; if (*dir != '/') { if (getcwd(cwd, MAXPATHLEN) == NULL) return -1; } if (chdir(dir) != 0) return -1; /* * Cases: * chdir request | realpath result | ret * (after getwcwd) | | * ======================================= * /a/b/. | /a/b | 0 * /a/b/. | /c | 1 * /a/b/. | /c/d/e/f | 1 */ if (getcwd(buf, MAXPATHLEN) == NULL) return 1; i = 0; if (*cwd) { /* relative path requested, * Same directory? */ for (; cwd[i]; i++) { if (buf[i] != cwd[i]) return 1; } if (buf[i]) { if (buf[i] != '/') return 1; i++; } } test = &buf[i]; for (i = 0; test[i]; i++) { if (test[i] != dir[i]) { return 1; } } /* trailing '/' ? */ if (!dir[i]) return 0; if (dir[i] != '/') return 1; i++; if (dir[i]) return 1; return 0; } /*! * Store n random bytes an buf */ void randombytes(void *buf, int n) { char *p = (char *)buf; int fd, i; struct timeval tv; if ((fd = open("/dev/urandom", O_RDONLY)) != -1) { /* generate from /dev/urandom */ if (read(fd, buf, n) != n) { close(fd); fd = -1; } else { close(fd); /* fd now != -1, so srandom wont be called below */ } } if (fd == -1) { gettimeofday(&tv, NULL); srandom((unsigned int)tv.tv_usec); for (i=0 ; i < n ; i++) p[i] = random() & 0xFF; } return; } netatalk-2.2.2/libatalk/util/queue.c0000644000175200017500000000440411655731127014305 00000000000000/* Copyright (c) 2010 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ /*! * @file * Netatalk utility functions: queue */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include static qnode_t *alloc_init_node(void *data) { qnode_t *node; if ((node = malloc(sizeof(qnode_t))) == NULL) return NULL; node->data = data; return node; } /******************************************************************************** * Interface *******************************************************************************/ q_t *queue_init(void) { q_t *queue; if ((queue = alloc_init_node(NULL)) == NULL) return NULL; queue->prev = queue->next = queue; return queue; } /* Insert at tail */ qnode_t *enqueue(q_t *q, void *data) { qnode_t *node; if ((node = alloc_init_node(data)) == NULL) return NULL; /* insert at tail */ node->next = q; node->prev = q->prev; q->prev->next = node; q->prev = node; return node; } /* Insert at head */ qnode_t *prequeue(q_t *q, void *data) { qnode_t *node; if ((node = alloc_init_node(data)) == NULL) return NULL; /* insert at head */ q->next->prev = node; node->next = q->next; node->prev = q; q->next = node; return node; } /* Take from head */ void *dequeue(q_t *q) { qnode_t *node; void *data; if (q == NULL || q->next == q) return NULL; /* take first node from head */ node = q->next; data = node->data; q->next = node->next; node->next->prev = node->prev; free(node); return data; } void queue_destroy(q_t *q, void (*callback)(void *)) { void *p; while ((p = dequeue(q)) != NULL) callback(p); free(q); q = NULL; } netatalk-2.2.2/libatalk/util/volinfo.c0000644000175200017500000004256611655731245014651 00000000000000/* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. .volinfo file handling, command line utilities copyright Bjoern Fernhomberg, 2004 */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #ifdef HAVE_STRINGS_H #include #endif #ifdef STDC_HEADERS #include #endif #include #include #include #include #include #include #ifdef CNID_DB #include #endif /* CNID_DB*/ static const vol_opt_name_t vol_opt_names[] = { {AFPVOL_A2VOL, "PRODOS"}, /* prodos volume */ {AFPVOL_CRLF, "CRLF"}, /* cr/lf translation */ {AFPVOL_NOADOUBLE, "NOADOUBLE"}, /* don't create .AppleDouble by default */ {AFPVOL_RO, "READONLY"}, /* read-only volume */ {AFPVOL_MSWINDOWS, "MSWINDOWS"}, /* deal with ms-windows yuckiness. this is going away. */ {AFPVOL_NOHEX, "NOHEX"}, /* don't do :hex translation */ {AFPVOL_USEDOTS, "USEDOTS"}, /* use real dots */ {AFPVOL_LIMITSIZE, "LIMITSIZE"}, /* limit size for older macs */ {AFPVOL_MAPASCII, "MAPASCII"}, /* map the ascii range as well */ {AFPVOL_DROPBOX, "DROPBOX"}, /* dropkludge dropbox support */ {AFPVOL_NOFILEID, "NOFILEID"}, /* don't advertise createid resolveid and deleteid calls */ {AFPVOL_NOSTAT, "NOSTAT"}, /* advertise the volume even if we can't stat() it * maybe because it will be mounted later in preexec */ {AFPVOL_UNIX_PRIV, "UNIXPRIV"}, /* support unix privileges */ {AFPVOL_NODEV, "NODEV"}, /* always use 0 for device number in cnid calls */ {AFPVOL_CASEINSEN, "CASEINSENSITIVE"}, /* volume is case insensitive */ {AFPVOL_EILSEQ, "ILLEGALSEQ"}, /* encode illegal sequence */ {AFPVOL_CACHE, "CACHEID"}, /* Use adouble v2 CNID caching, default don't use it */ {AFPVOL_INV_DOTS, "INVISIBLEDOTS"}, {AFPVOL_ACLS, "ACLS"}, /* Vol supports ACLs */ {AFPVOL_TM, "TM"}, /* Set "kSupportsTMLockSteal" is volume attributes */ {0, NULL} }; static const vol_opt_name_t vol_opt_casefold[] = { {AFPVOL_MTOUUPPER, "MTOULOWER"}, {AFPVOL_MTOULOWER, "MTOULOWER"}, {AFPVOL_UTOMUPPER, "UTOMUPPER"}, {AFPVOL_UTOMLOWER, "UTOMLOWER"}, {0, NULL} }; typedef struct { const char *name; int type; } info_option_t; #define MAC_CHARSET 0 #define VOL_CHARSET 1 #define ADOUBLE_VER 2 #define CNIDBACKEND 3 #define CNIDDBDHOST 4 #define CNIDDBDPORT 5 #define CNID_DBPATH 6 #define VOLUME_OPTS 7 #define VOLCASEFOLD 8 #define EXTATTRTYPE 9 static const info_option_t info_options[] = { {"MAC_CHARSET", MAC_CHARSET}, {"VOL_CHARSET", VOL_CHARSET}, {"ADOUBLE_VER", ADOUBLE_VER}, {"CNIDBACKEND", CNIDBACKEND}, {"CNIDDBDHOST", CNIDDBDHOST}, {"CNIDDBDPORT", CNIDDBDPORT}, {"CNID_DBPATH", CNID_DBPATH}, {"VOLUME_OPTS", VOLUME_OPTS}, {"VOLCASEFOLD", VOLCASEFOLD}, {"EXTATTRTYPE", EXTATTRTYPE}, {NULL, 0} }; static char* find_in_path( char *path, char *subdir, size_t maxlen) { char *pos; struct stat st; strlcat(path, subdir, maxlen); pos = strrchr(path, '/'); while ( stat(path, &st) != 0) { path[pos-path]=0; if ((pos = strrchr(path, '/'))) { path[pos-path]=0; strlcat(path, subdir, maxlen); } else { return NULL; } } path[pos-path] = '/'; path[pos-path+1] = 0; return path; } static char * make_path_absolute(char *path, size_t bufsize) { struct stat st; char savecwd[MAXPATHLEN]; char abspath[MAXPATHLEN]; char *p; strlcpy(abspath, path, sizeof(abspath)); /* we might be called from `ad cp ...` with non existing target */ if (stat(abspath, &st) != 0) { if (errno != ENOENT) return NULL; if (NULL == (p = strrchr(abspath, '/')) ) /* single component `ad cp SOURCEFILE TARGETFILE`, use "." instead */ strcpy(abspath, "."); else /* try without the last path element */ *p = '\0'; if (stat(abspath, &st) != 0) { return NULL; } } if (S_ISREG(st.st_mode)) { /* single file copy SOURCE */ if (NULL == (p = strrchr(abspath, '/')) ) /* no path, use "." instead */ strcpy(abspath, "."); else /* try without the last path element */ *p = '\0'; } if (!getcwd(savecwd, sizeof(savecwd)) || chdir(abspath) < 0) return NULL; if (!getcwd(abspath, sizeof(abspath)) || chdir (savecwd) < 0) return NULL; if (strlen(abspath) > bufsize) return NULL; strlcpy(path, abspath, bufsize); return path; } static char * find_volumeroot(char *path, size_t maxlen) { char *volume = make_path_absolute(path, maxlen); if (volume == NULL) return NULL; if (NULL == (find_in_path(volume, "/.AppleDesktop", maxlen)) ) return NULL; return volume; } int vol_load_charsets( struct volinfo *vol) { if ( (charset_t) -1 == ( vol->v_maccharset = add_charset(vol->v_maccodepage)) ) { fprintf( stderr, "Setting codepage %s as Mac codepage failed", vol->v_maccodepage); return (-1); } if ( (charset_t) -1 == ( vol->v_volcharset = add_charset(vol->v_volcodepage)) ) { fprintf( stderr, "Setting codepage %s as volume codepage failed", vol->v_volcodepage); return (-1); } return 0; } static int parse_options (char *buf, int *flags, const vol_opt_name_t *options) { char *p, *q; const vol_opt_name_t *op; q = p = buf; while ( *p != '\0') { if (*p == ' ') { *p = '\0'; op = options; for (;op->name; op++) { if ( !strcmp(op->name, q )) { *flags |= op->option; break; } } q = p+1; } p++; } return 0; } static int parseline ( char *buf, struct volinfo *vol) { char *value; size_t len; int option=-1; const info_option_t *p = &info_options[0]; if (NULL == ( value = strchr(buf, ':')) ) return 1; *value = '\0'; value++; if ( 0 == (len = strlen(value)) ) return 0; if (value[len-1] == '\n') value[len-1] = '\0'; for (;p->name; p++) { if ( !strcmp(p->name, buf )) { option=p->type; break; } } switch (option) { case MAC_CHARSET: if ((vol->v_maccodepage = strdup(value)) == NULL) { fprintf (stderr, "strdup: %s", strerror(errno)); return -1; } break; case VOL_CHARSET: if ((vol->v_volcodepage = strdup(value)) == NULL) { fprintf (stderr, "strdup: %s", strerror(errno)); return -1; } break; case CNIDBACKEND: if ((vol->v_cnidscheme = strdup(value)) == NULL) { fprintf (stderr, "strdup: %s", strerror(errno)); return -1; } break; case CNIDDBDHOST: if ((vol->v_dbd_host = strdup(value)) == NULL) { fprintf (stderr, "strdup: %s", strerror(errno)); return -1; } break; case CNIDDBDPORT: if ((vol->v_dbd_port = strdup(value)) == NULL) { fprintf (stderr, "strdup: %s", strerror(errno)); return -1; } break; case CNID_DBPATH: if ((vol->v_dbpath = malloc(MAXPATHLEN+1)) == NULL) return -1; strcpy(vol->v_dbpath, value); break; case ADOUBLE_VER: if (strcasecmp(value, "v1") == 0) { vol->v_adouble = AD_VERSION1; vol->ad_path = ad_path; } #if AD_VERSION == AD_VERSION2 else if (strcasecmp(value, "v2") == 0) { vol->ad_path = ad_path; vol->v_adouble = AD_VERSION2; } else if (strcasecmp(value, "osx") == 0) { vol->v_adouble = AD_VERSION2_OSX; vol->ad_path = ad_path_osx; } #endif else { fprintf (stderr, "unknown adouble version: %s, %s", buf, value); return -1; } break; case VOLUME_OPTS: parse_options(value, &vol->v_flags, &vol_opt_names[0]); break; case VOLCASEFOLD: parse_options(value, &vol->v_casefold, &vol_opt_casefold[0]); break; case EXTATTRTYPE: if (strcasecmp(value, "AFPVOL_EA_AD") == 0) vol->v_vfs_ea = AFPVOL_EA_AD; else if (strcasecmp(value, "AFPVOL_EA_SYS") == 0) vol->v_vfs_ea = AFPVOL_EA_SYS; break; default: fprintf (stderr, "unknown volume information: %s, %s", buf, value); return (-1); break; } return 0; } int loadvolinfo (char *path, struct volinfo *vol) { char volinfofile[MAXPATHLEN]; char buf[MAXPATHLEN]; struct flock lock; int fd, len; FILE *fp; if ( !path || !vol) return -1; memset(vol, 0, sizeof(struct volinfo)); strlcpy(volinfofile, path, sizeof(volinfofile)); /* volinfo file is in .AppleDesktop */ if ( NULL == find_volumeroot(volinfofile, sizeof(volinfofile))) return -1; if ((vol->v_path = strdup(volinfofile)) == NULL ) { fprintf (stderr, "strdup: %s", strerror(errno)); return (-1); } /* Remove trailing slashes */ len = strlen(vol->v_path); while (len && (vol->v_path[len-1] == '/')) { vol->v_path[len-1] = 0; len--; } strlcat(volinfofile, ".AppleDesktop/", sizeof(volinfofile)); strlcat(volinfofile, VOLINFOFILE, sizeof(volinfofile)); /* open the file read only */ if ( NULL == (fp = fopen( volinfofile, "r")) ) { fprintf (stderr, "error opening volinfo (%s): %s", volinfofile, strerror(errno)); return (-1); } fd = fileno(fp); /* try to get a read lock */ lock.l_start = 0; lock.l_whence = SEEK_SET; lock.l_len = 0; lock.l_type = F_RDLCK; /* wait for read lock */ if (fcntl(fd, F_SETLKW, &lock) < 0) { fclose(fp); return (-1); } /* read the file */ while (NULL != fgets(buf, sizeof(buf), fp)) { parseline(buf, vol); } /* unlock file */ lock.l_type = F_UNLCK; fcntl(fd, F_SETLK, &lock); /* Translate vol options to ad options like afp/volume.c does it */ vol->v_ad_options = 0; if ((vol->v_flags & AFPVOL_NODEV)) vol->v_ad_options |= ADVOL_NODEV; if ((vol->v_flags & AFPVOL_CACHE)) vol->v_ad_options |= ADVOL_CACHE; if ((vol->v_flags & AFPVOL_UNIX_PRIV)) vol->v_ad_options |= ADVOL_UNIXPRIV; if ((vol->v_flags & AFPVOL_INV_DOTS)) vol->v_ad_options |= ADVOL_INVDOTS; vol->retaincount = 1; fclose(fp); return 0; } /*! * Allocate a struct volinfo object for refcounting usage with retain and close, and * call loadvolinfo with it */ struct volinfo *allocvolinfo(char *path) { struct volinfo *p = malloc(sizeof(struct volinfo)); if (p == NULL) return NULL; if (loadvolinfo(path, p) == -1) return NULL; p->malloced = 1; return p; } void retainvolinfo(struct volinfo *vol) { vol->retaincount++; } /*! * Decrement retain count, free resources when retaincount reaches 0 */ int closevolinfo(struct volinfo *volinfo) { if (volinfo->retaincount <= 0) abort(); volinfo->retaincount--; if (volinfo->retaincount == 0) { free(volinfo->v_name); volinfo->v_name = NULL; free(volinfo->v_path); volinfo->v_path = NULL; free(volinfo->v_cnidscheme); volinfo->v_cnidscheme = NULL; free(volinfo->v_dbpath); volinfo->v_dbpath = NULL; free(volinfo->v_volcodepage); volinfo->v_volcodepage = NULL; free(volinfo->v_maccodepage); volinfo->v_maccodepage = NULL; free(volinfo->v_dbd_host); volinfo->v_dbd_host = NULL; free(volinfo->v_dbd_port); volinfo->v_dbd_port = NULL; if (volinfo->malloced) { volinfo->malloced = 0; free(volinfo); } } return 0; } /* * Save the volume options to a file, used by shell utilities. Writing the file * everytime a volume is opened is unnecessary, but it shouldn't hurt much. */ int savevolinfo(const struct vol *vol, const char *Cnid_srv, const char *Cnid_port) { uid_t process_uid; char buf[16348]; char item[MAXPATHLEN]; int fd; int ret = 0; struct flock lock; const vol_opt_name_t *op = &vol_opt_names[0]; const vol_opt_name_t *cf = &vol_opt_casefold[0]; strlcpy (item, vol->v_path, sizeof(item)); strlcat (item, "/.AppleDesktop/", sizeof(item)); strlcat (item, VOLINFOFILE, sizeof(item)); process_uid = geteuid(); if (process_uid) { if (seteuid(0) == -1) { process_uid = 0; } } if ((fd = open(item, O_RDWR | O_CREAT , 0666)) <0 ) { LOG(log_debug, logtype_default,"Error opening %s: %s", item, strerror(errno)); if (process_uid) { if (seteuid(process_uid) == -1) { LOG(log_error, logtype_default, "can't seteuid back %s", strerror(errno)); exit(EXITERR_SYS); } } return (-1); } if (process_uid) { if (seteuid(process_uid) == -1) { LOG(log_error, logtype_default, "can't seteuid back %s", strerror(errno)); exit(EXITERR_SYS); } } /* try to get a lock */ lock.l_start = 0; lock.l_whence = SEEK_SET; lock.l_len = 0; lock.l_type = F_WRLCK; if (fcntl(fd, F_SETLK, &lock) < 0) { if (errno == EACCES || errno == EAGAIN) { /* ignore, other process already writing the file */ return 0; } else { LOG(log_error, logtype_default, "savevoloptions: cannot get lock: %s", strerror(errno)); return (-1); } } /* write volume options */ snprintf(buf, sizeof(buf), "MAC_CHARSET:%s\n", vol->v_maccodepage); snprintf(item, sizeof(item), "VOL_CHARSET:%s\n", vol->v_volcodepage); strlcat(buf, item, sizeof(buf)); switch (vol->v_adouble) { case AD_VERSION1: strlcat(buf, "ADOUBLE_VER:v1\n", sizeof(buf)); break; case AD_VERSION2: strlcat(buf, "ADOUBLE_VER:v2\n", sizeof(buf)); break; case AD_VERSION2_OSX: strlcat(buf, "ADOUBLE_VER:osx\n", sizeof(buf)); break; case AD_VERSION1_SFM: strlcat(buf, "ADOUBLE_VER:sfm\n", sizeof(buf)); break; } strlcat(buf, "CNIDBACKEND:", sizeof(buf)); strlcat(buf, vol->v_cnidscheme, sizeof(buf)); strlcat(buf, "\n", sizeof(buf)); strlcat(buf, "CNIDDBDHOST:", sizeof(buf)); strlcat(buf, Cnid_srv, sizeof(buf)); strlcat(buf, "\n", sizeof(buf)); strlcat(buf, "CNIDDBDPORT:", sizeof(buf)); strlcat(buf, Cnid_port, sizeof(buf)); strlcat(buf, "\n", sizeof(buf)); strcpy(item, "CNID_DBPATH:"); if (vol->v_dbpath) strlcat(item, vol->v_dbpath, sizeof(item)); else strlcat(item, vol->v_path, sizeof(item)); strlcat(item, "\n", sizeof(item)); strlcat(buf, item, sizeof(buf)); /* volume flags */ strcpy(item, "VOLUME_OPTS:"); for (;op->name; op++) { if ( (vol->v_flags & op->option) ) { strlcat(item, op->name, sizeof(item)); strlcat(item, " ", sizeof(item)); } } strlcat(item, "\n", sizeof(item)); strlcat(buf, item, sizeof(buf)); /* casefold flags */ strcpy(item, "VOLCASEFOLD:"); for (;cf->name; cf++) { if ( (vol->v_casefold & cf->option) ) { strlcat(item, cf->name, sizeof(item)); strlcat(item, " ", sizeof(item)); } } strlcat(item, "\n", sizeof(item)); strlcat(buf, item, sizeof(buf)); /* ExtendedAttributes */ strcpy(item, "EXTATTRTYPE:"); switch (vol->v_vfs_ea) { case AFPVOL_EA_SYS: strlcat(item, "AFPVOL_EA_SYS\n", sizeof(item)); break; case AFPVOL_EA_AD: strlcat(item, "AFPVOL_EA_AD\n", sizeof(item)); break; case AFPVOL_EA_NONE: strlcat(item, "AFPVOL_EA_NONE\n", sizeof(item)); break; default: strlcat(item, "AFPVOL_EA_UNKNOWN\n", sizeof(item)); } strlcat(buf, item, sizeof(buf)); if (strlen(buf) >= sizeof(buf)-1) LOG(log_debug, logtype_default, "Error writing .volinfo file: buffer too small, %s", buf); if (write( fd, buf, strlen(buf)) < 0 || ftruncate(fd, strlen(buf)) < 0 ) { LOG(log_debug, logtype_default, "Error writing .volinfo file: %s", strerror(errno)); } lock.l_type = F_UNLCK; fcntl(fd, F_SETLK, &lock); close (fd); return ret; } netatalk-2.2.2/libatalk/util/strdicasecmp.c0000644000175200017500000002606111655731127015645 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include const int _diacasemap[] = { /* map value name */ 0 /* 0 NUL*/, 1 /* 1 SOH*/, 2 /* 2 STX*/, 3 /* 3 ETX*/, 4 /* 4 EOT*/, 5 /* 5 ENQ*/, 6 /* 6 ACK*/, 7 /* 7 BEL*/, 8 /* 8 BS*/, 9 /* 9 HT*/, 10 /* 10 NL*/, 11 /* 11 VT*/, 12 /* 12 NP*/, 13 /* 13 CR*/, 14 /* 14 SO*/, 15 /* 15 SI*/, 16 /* 16 DLE*/, 17 /* 17 DC1*/, 18 /* 18 DC2*/, 19 /* 19 DC3*/, 20 /* 20 DC4*/, 21 /* 21 NAK*/, 22 /* 22 SYN*/, 23 /* 23 ETB*/, 24 /* 24 CAN*/, 25 /* 25 EM*/, 26 /* 26 SUB*/, 27 /* 27 ESC*/, 28 /* 28 FS*/, 29 /* 29 GS*/, 30 /* 30 RS*/, 31 /* 31 US*/, 32 /* 32 SP*/, 33 /* 33 ! */, 34 /* 34 " */, 35 /* 35 # */, 36 /* 36 $ */, 37 /* 37 % */, 38 /* 38 & */, 39 /* 39 ' */, 40 /* 40 ( */, 41 /* 41 ) */, 42 /* 42 * */, 43 /* 43 + */, 44 /* 44 , */, 45 /* 45 - */, 46 /* 46 . */, 47 /* 47 / */, 48 /* 48 0 */, 49 /* 49 1 */, 50 /* 50 2 */, 51 /* 51 3 */, 52 /* 52 4 */, 53 /* 53 5 */, 54 /* 54 6 */, 55 /* 55 7 */, 56 /* 56 8 */, 57 /* 57 9 */, 58 /* 58 : */, 59 /* 59 ; */, 60 /* 60 < */, 61 /* 61 = */, 62 /* 62 > */, 63 /* 63 ? */, 64 /* 64 @ */, 65 /* 65 A */, 66 /* 66 B */, 67 /* 67 C */, 68 /* 68 D */, 69 /* 69 E */, 70 /* 70 F */, 71 /* 71 G */, 72 /* 72 H */, 73 /* 73 I */, 74 /* 74 J */, 75 /* 75 K */, 76 /* 76 L */, 77 /* 77 M */, 78 /* 78 N */, 79 /* 79 O */, 80 /* 80 P */, 81 /* 81 Q */, 82 /* 82 R */, 83 /* 83 S */, 84 /* 84 T */, 85 /* 85 U */, 86 /* 86 V */, 87 /* 87 W */, 88 /* 88 X */, 89 /* 89 Y */, 90 /* 90 Z */, 91 /* 91 [ */, 92 /* 92 \ */, 93 /* 93 ] */, 94 /* 94 ^ */, 95 /* 95 _ */, 96 /* 96 ` */, 65 /* 97 a */, 66 /* 98 b */, 67 /* 99 c */, 68 /* 100 d */, 69 /* 101 e */, 70 /* 102 f */, 71 /* 103 g */, 72 /* 104 h */, 73 /* 105 i */, 74 /* 106 j */, 75 /* 107 k */, 76 /* 108 l */, 77 /* 109 m */, 78 /* 110 n */, 79 /* 111 o */, 80 /* 112 p */, 81 /* 113 q */, 82 /* 114 r */, 83 /* 115 s */, 84 /* 116 t */, 85 /* 117 u */, 86 /* 118 v */, 87 /* 119 w */, 88 /* 120 x */, 89 /* 121 y */, 90 /* 122 z */, 123 /* 123 { */, 124 /* 124 | */, 125 /* 125 } */, 126 /* 126 ~ */, 127 /* 127 DEL*/, 128 /* 128 Adieresis*/, 129 /* 129 Aring*/, 130 /* 130 Ccedilla*/, 131 /* 131 Eacute*/, 132 /* 132 Ntilda*/, 133 /* 133 Odieresis*/, 134 /* 134 Udieresis*/, 231 /* 135 aacute*/, 203 /* 136 agrave*/, 229 /* 137 acircumflex*/, 128 /* 138 adieresis*/, 204 /* 139 atilda*/, 129 /* 140 aring*/, 130 /* 141 ccedilla*/, 131 /* 142 eacute*/, 233 /* 143 egrave*/, 230 /* 144 ecircumflex*/, 232 /* 145 edieresis*/, 234 /* 146 iacute*/, 237 /* 147 igrave*/, 235 /* 148 icircumflex*/, 236 /* 149 idieresis*/, 132 /* 150 ntilda*/, 238 /* 151 oacute*/, 241 /* 152 ograve*/, 239 /* 153 ocircumflex*/, 133 /* 154 odieresis*/, 205 /* 155 otilda*/, 242 /* 156 uacute*/, 244 /* 157 ugrave*/, 243 /* 158 ucircumflex*/, 134 /* 159 udieresis*/, 160 /* 160 daggar*/, 161 /* 161 ring*/, 162 /* 162 cent*/, 163 /* 163 sterling*/, 164 /* 164 section*/, 165 /* 165 bullet*/, 166 /* 166 paragraph*/, 167 /* 167 germandbls*/, 168 /* 168 registered*/, 169 /* 169 copyright*/, 170 /* 170 trademark*/, 171 /* 171 acute*/, 172 /* 172 dieresis*/, 173 /* 173 notequal*/, 174 /* 174 AE*/, 175 /* 175 Oslash*/, 176 /* 176 infinity*/, 177 /* 177 plusminus*/, 178 /* 178 lessequal*/, 179 /* 179 greaterequal*/, 180 /* 180 yen*/, 181 /* 181 mu*/, 198 /* 182 delta*/, 183 /* 183 Sigma*/, 184 /* 184 Pi*/, 184 /* 185 pi*/, 186 /* 186 intergral*/, 187 /* 187 ordfeminine*/, 188 /* 188 ordmasculine*/, 189 /* 189 Omega*/, 174 /* 190 ae*/, 175 /* 191 oslash*/, 192 /* 192 questiondown*/, 193 /* 193 exclamdown*/, 194 /* 194 not*/, 195 /* 195 radical*/, 196 /* 196 florin*/, 197 /* 197 aprox*/, 198 /* 198 Delta*/, 199 /* 199 guillemotleft*/, 200 /* 200 guillemotright*/, 201 /* 201 ellipsis*/, 202 /* 202 */, 203 /* 203 Agrave*/, 204 /* 204 Atilda*/, 205 /* 205 Otilda*/, 206 /* 206 OE*/, 206 /* 207 oe*/, 208 /* 208 endash*/, 209 /* 209 emdash*/, 210 /* 210 quotedblleft*/, 211 /* 211 quotedblright*/, 212 /* 212 quoteleft*/, 213 /* 213 quoteright*/, 214 /* 214 divide*/, 215 /* 215 diamond*/, 217 /* 216 ydieresis*/, 217 /* 217 Ydieresis*/, 218 /* 218 fraction*/, 219 /* 219 currency*/, 220 /* 220 guilsinglleft*/, 221 /* 221 guilsinglright*/, 222 /* 222 fi*/, 223 /* 223 fl*/, 224 /* 224 daggardbl*/, 225 /* 225 periodcentered*/, 226 /* 226 quotesinglbase*/, 227 /* 227 quotedblbase*/, 228 /* 228 perthousand*/, 229 /* 229 Acircumflex*/, 230 /* 230 Ecircumflex*/, 231 /* 231 Aaccute*/, 232 /* 232 Edieresis*/, 233 /* 233 Egrave*/, 234 /* 234 Iaccute*/, 235 /* 235 Icircumflex*/, 236 /* 236 Idieresis*/, 237 /* 237 Igrave*/, 238 /* 238 Oaccute*/, 239 /* 239 Ocircumflex*/, 240 /* 240 apple*/, 241 /* 241 Ograve*/, 242 /* 242 Uaccute*/, 243 /* 243 Ucircumflex*/, 244 /* 244 Ugrave*/, 245 /* 245 dotlessi*/, 246 /* 246 circumflex*/, 247 /* 247 tilda*/, 248 /* 248 macron*/, 249 /* 249 breve*/, 250 /* 250 dotaccent*/, 251 /* 251 ring*/, 252 /* 252 cedilla*/, 253 /* 253 hungarumlaut*/, 254 /* 254 ogonek*/, 255 /* 255 caron*/, }; const int _dialowermap[] = { /* map value name */ 0 /* 0 NUL*/, 1 /* 1 SOH*/, 2 /* 2 STX*/, 3 /* 3 ETX*/, 4 /* 4 EOT*/, 5 /* 5 ENQ*/, 6 /* 6 ACK*/, 7 /* 7 BEL*/, 8 /* 8 BS*/, 9 /* 9 HT*/, 10 /* 10 NL*/, 11 /* 11 VT*/, 12 /* 12 NP*/, 13 /* 13 CR*/, 14 /* 14 SO*/, 15 /* 15 SI*/, 16 /* 16 DLE*/, 17 /* 17 DC1*/, 18 /* 18 DC2*/, 19 /* 19 DC3*/, 20 /* 20 DC4*/, 21 /* 21 NAK*/, 22 /* 22 SYN*/, 23 /* 23 ETB*/, 24 /* 24 CAN*/, 25 /* 25 EM*/, 26 /* 26 SUB*/, 27 /* 27 ESC*/, 28 /* 28 FS*/, 29 /* 29 GS*/, 30 /* 30 RS*/, 31 /* 31 US*/, 32 /* 32 SP*/, 33 /* 33 ! */, 34 /* 34 " */, 35 /* 35 # */, 36 /* 36 $ */, 37 /* 37 % */, 38 /* 38 & */, 39 /* 39 ' */, 40 /* 40 ( */, 41 /* 41 ) */, 42 /* 42 * */, 43 /* 43 + */, 44 /* 44 , */, 45 /* 45 - */, 46 /* 46 . */, 47 /* 47 / */, 48 /* 48 0 */, 49 /* 49 1 */, 50 /* 50 2 */, 51 /* 51 3 */, 52 /* 52 4 */, 53 /* 53 5 */, 54 /* 54 6 */, 55 /* 55 7 */, 56 /* 56 8 */, 57 /* 57 9 */, 58 /* 58 : */, 59 /* 59 ; */, 60 /* 60 < */, 61 /* 61 = */, 62 /* 62 > */, 63 /* 63 ? */, 64 /* 64 @ */, 97 /* 65 A */, 98 /* 66 B */, 99 /* 67 C */, 100 /* 68 D */, 101 /* 69 E */, 102 /* 70 F */, 103 /* 71 G */, 104 /* 72 H */, 105 /* 73 I */, 106 /* 74 J */, 107 /* 75 K */, 108 /* 76 L */, 109 /* 77 M */, 110 /* 78 N */, 111 /* 79 O */, 112 /* 80 P */, 113 /* 81 Q */, 114 /* 82 R */, 115 /* 83 S */, 116 /* 84 T */, 117 /* 85 U */, 118 /* 86 V */, 119 /* 87 W */, 120 /* 88 X */, 121 /* 89 Y */, 122 /* 90 Z */, 91 /* 91 [ */, 92 /* 92 \ */, 93 /* 93 ] */, 94 /* 94 ^ */, 95 /* 95 _ */, 96 /* 96 ` */, 97 /* 97 a */, 98 /* 98 b */, 99 /* 99 c */, 100 /* 100 d */, 101 /* 101 e */, 102 /* 102 f */, 103 /* 103 g */, 104 /* 104 h */, 105 /* 105 i */, 106 /* 106 j */, 107 /* 107 k */, 108 /* 108 l */, 109 /* 109 m */, 110 /* 110 n */, 111 /* 111 o */, 112 /* 112 p */, 113 /* 113 q */, 114 /* 114 r */, 115 /* 115 s */, 116 /* 116 t */, 117 /* 117 u */, 118 /* 118 v */, 119 /* 119 w */, 120 /* 120 x */, 121 /* 121 y */, 122 /* 122 z */, 123 /* 123 { */, 124 /* 124 | */, 125 /* 125 } */, 126 /* 126 ~ */, 127 /* 127 DEL*/, 138 /* 128 Adieresis*/, 140 /* 129 Aring*/, 141 /* 130 Ccedilla*/, 142 /* 131 Eacute*/, 150 /* 132 Ntilda*/, 154 /* 133 Odieresis*/, 159 /* 134 Udieresis*/, 135 /* 135 aacute*/, 136 /* 136 agrave*/, 137 /* 137 acircumflex*/, 138 /* 138 adieresis*/, 139 /* 139 atilda*/, 140 /* 140 aring*/, 141 /* 141 ccedilla*/, 142 /* 142 eacute*/, 143 /* 143 egrave*/, 144 /* 144 ecircumflex*/, 145 /* 145 edieresis*/, 146 /* 146 iacute*/, 147 /* 147 igrave*/, 148 /* 148 icircumflex*/, 149 /* 149 idieresis*/, 132 /* 150 ntilda*/, 151 /* 151 oacute*/, 152 /* 152 ograve*/, 153 /* 153 ocircumflex*/, 154 /* 154 odieresis*/, 155 /* 155 otilda*/, 156 /* 156 uacute*/, 157 /* 157 ugrave*/, 158 /* 158 ucircumflex*/, 159 /* 159 udieresis*/, 160 /* 160 daggar*/, 161 /* 161 ring*/, 162 /* 162 cent*/, 163 /* 163 sterling*/, 164 /* 164 section*/, 165 /* 165 bullet*/, 166 /* 166 paragraph*/, 167 /* 167 germandbls*/, 168 /* 168 registered*/, 169 /* 169 copyright*/, 170 /* 170 trademark*/, 171 /* 171 acute*/, 172 /* 172 dieresis*/, 173 /* 173 notequal*/, 190 /* 174 AE*/, 191 /* 175 Oslash*/, 176 /* 176 infinity*/, 177 /* 177 plusminus*/, 178 /* 178 lessequal*/, 179 /* 179 greaterequal*/, 180 /* 180 yen*/, 181 /* 181 mu*/, 198 /* 182 delta*/, 183 /* 183 Sigma*/, 185 /* 184 Pi*/, 185 /* 185 pi*/, 186 /* 186 intergral*/, 187 /* 187 ordfeminine*/, 188 /* 188 ordmasculine*/, 189 /* 189 Omega*/, 190 /* 190 ae*/, 191 /* 191 oslash*/, 192 /* 192 questiondown*/, 193 /* 193 exclamdown*/, 194 /* 194 not*/, 195 /* 195 radical*/, 196 /* 196 florin*/, 197 /* 197 aprox*/, 198 /* 198 Delta*/, 199 /* 199 guillemotleft*/, 200 /* 200 guillemotright*/, 201 /* 201 ellipsis*/, 202 /* 202 */, 136 /* 203 Agrave*/, 139 /* 204 Atilda*/, 155 /* 205 Otilda*/, 207 /* 206 OE*/, 207 /* 207 oe*/, 208 /* 208 endash*/, 209 /* 209 emdash*/, 210 /* 210 quotedblleft*/, 211 /* 211 quotedblright*/, 212 /* 212 quoteleft*/, 213 /* 213 quoteright*/, 214 /* 214 divide*/, 215 /* 215 diamond*/, 217 /* 216 ydieresis*/, 217 /* 217 Ydieresis*/, 218 /* 218 fraction*/, 219 /* 219 currency*/, 220 /* 220 guilsinglleft*/, 221 /* 221 guilsinglright*/, 222 /* 222 fi*/, 223 /* 223 fl*/, 224 /* 224 daggardbl*/, 225 /* 225 periodcentered*/, 226 /* 226 quotesinglbase*/, 227 /* 227 quotedblbase*/, 228 /* 228 perthousand*/, 137 /* 229 Acircumflex*/, 144 /* 230 Ecircumflex*/, 135 /* 231 Aacute*/, 145 /* 232 Edieresis*/, 143 /* 233 Egrave*/, 146 /* 234 Iaccute*/, 148 /* 235 Icircumflex*/, 149 /* 236 Idieresis*/, 147 /* 237 Igrave*/, 151 /* 238 Oacute*/, 153 /* 239 Ocircumflex*/, 240 /* 240 apple*/, 152 /* 241 Ograve*/, 156 /* 242 Uacute*/, 158 /* 243 Ucircumflex*/, 157 /* 244 Ugrave*/, 245 /* 245 dotlessi*/, 246 /* 246 circumflex*/, 247 /* 247 tilda*/, 248 /* 248 macron*/, 249 /* 249 breve*/, 250 /* 250 dotaccent*/, 251 /* 251 ring*/, 252 /* 252 cedilla*/, 253 /* 253 hungarumlaut*/, 254 /* 254 ogonek*/, 255 /* 255 caron*/, }; int strdiacasecmp( const char *s1, const char *s2 ) { while ( _diacasemap[ (unsigned char) *s1 ] == _diacasemap[ (unsigned char) *s2++ ] ) { if ( *s1++ == '\0' ) { return( 0 ); } } return( _diacasemap[ (unsigned char) *s1 ] - _diacasemap[ (unsigned char) *--s2 ] ); } int strndiacasecmp( const char *s1, const char *s2, size_t n ) { while ( n > 0 && _diacasemap[ (unsigned char) *s1 ] == _diacasemap[ (unsigned char) *s2++ ] ) { if ( *s1++ == '\0' ) { return( 0 ); } n--; } if (n == 0) return 0; return _diacasemap[ (unsigned char) *s1 ] - _diacasemap[ (unsigned char) *--s2 ]; } netatalk-2.2.2/libatalk/util/getiface.c0000644000175200017500000000611511655731127014731 00000000000000/* * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999-2000 Adrian Sun. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #ifdef HAVE_STDINT_H #include #endif #include #include #include #include #include #ifdef TRU64 #include #include #endif /* TRU64 */ #include #include #ifdef __svr4__ #include #endif #include /* allocation size for interface list. */ #define IFACE_NUM 5 /* we leave all of the ioctl's to the application */ static int addname(char **list, int *i, const char *name) { /* if we've run out of room, allocate some more. just return * the present list if we can't. */ if ((list[*i] = strdup(name)) == NULL) return -1; (*i)++; list[*i] = NULL; /* zero out the next entry */ return 0; } static int getifaces(const int sockfd, char ***list) { #ifdef HAVE_IFNAMEINDEX struct if_nameindex *ifstart, *ifs; int i = 0; char **new; ifs = ifstart = if_nameindex(); new = (char **) malloc((sizeof(ifs)/sizeof(struct if_nameindex) + 1) * sizeof(char *)); while (ifs && ifs->if_name) { /* just bail if there's a problem */ if (addname(new, &i, ifs->if_name) < 0) break; ifs++; } if_freenameindex(ifstart); *list = new; return i; #else struct ifconf ifc; struct ifreq ifrs[ 64 ], *ifr, *nextifr; int ifrsize, i = 0; char **new; if (!list) return 0; memset( &ifc, 0, sizeof( struct ifconf )); ifc.ifc_len = sizeof( ifrs ); memset( ifrs, 0, sizeof( ifrs )); ifc.ifc_buf = (caddr_t)ifrs; if ( ioctl( sockfd, SIOCGIFCONF, &ifc ) < 0 ) { return 0; } new = (char **) malloc((ifc.ifc_len/sizeof(struct ifreq) + 1) * sizeof(char *)); for ( ifr = ifc.ifc_req; ifc.ifc_len >= (int) sizeof( struct ifreq ); ifc.ifc_len -= ifrsize, ifr = nextifr ) { #ifdef BSD4_4 ifrsize = sizeof(ifr->ifr_name) + (ifr->ifr_addr.sa_len > sizeof(struct sockaddr) ? ifr->ifr_addr.sa_len : sizeof(struct sockaddr)); #else /* !BSD4_4 */ ifrsize = sizeof( struct ifreq ); #endif /* BSD4_4 */ nextifr = (struct ifreq *)((caddr_t)ifr + ifrsize ); /* just bail if there's a problem */ if (addname(new, &i, ifr->ifr_name) < 0) break; } *list = new; return i; #endif } /* * Get interfaces from the kernel. we keep an extra null entry to signify * the end of the interface list. */ char **getifacelist(void) { char **list = NULL; /* FIXME */ int i, fd; if ((fd = socket(PF_INET, SOCK_STREAM, 0)) < 0) return NULL; if ((i = getifaces(fd, &list)) == 0) { free(list); close(fd); return NULL; } close(fd); return list; } /* go through and free the interface list */ void freeifacelist(char **ifacelist) { char *value, **list = ifacelist; if (!ifacelist) return; while ((value = *list++)) { free(value); } free(ifacelist); } netatalk-2.2.2/libatalk/util/server_ipc.c0000644000175200017500000002217511655731245015330 00000000000000/* * All rights reserved. See COPYRIGHT. * * IPC over socketpair between parent and children. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define IPC_HEADERLEN 14 #define IPC_MAXMSGSIZE 90 typedef struct ipc_header { uint16_t command; pid_t child_pid; uid_t uid; uint32_t len; char *msg; int afp_socket; uint16_t DSI_requestID; } ipc_header_t; static char *ipc_cmd_str[] = { "IPC_DISCOLDSESSION", "IPC_GETSESSION"}; /* * Pass afp_socket to old disconnected session if one has a matching token (token = pid) * @returns -1 on error, 0 if no matching session was found, 1 if session was found and socket passed */ static int ipc_kill_token(struct ipc_header *ipc, server_child *children) { pid_t pid; if (ipc->len != sizeof(pid_t)) { return -1; } /* assume signals SA_RESTART set */ memcpy (&pid, ipc->msg, sizeof(pid_t)); return server_child_transfer_session(children, CHILD_DSIFORK, pid, ipc->uid, ipc->afp_socket, ipc->DSI_requestID); } /* ----------------- */ static int ipc_get_session(struct ipc_header *ipc, server_child *children) { u_int32_t boottime; u_int32_t idlen; char *clientid, *p; if (ipc->len < (sizeof(idlen) + sizeof(boottime)) ) return -1; p = ipc->msg; memcpy (&idlen, p, sizeof(idlen)); idlen = ntohl (idlen); p += sizeof(idlen); memcpy (&boottime, p, sizeof(boottime)); p += sizeof(boottime); if (ipc->len < idlen + sizeof(idlen) + sizeof(boottime)) return -1; if (NULL == (clientid = (char*) malloc(idlen)) ) return -1; memcpy (clientid, p, idlen); LOG(log_debug, logtype_afpd, "ipc_get_session(pid: %u, uid: %u, time: 0x%08x)", ipc->child_pid, ipc->uid, boottime); server_child_kill_one_by_id(children, CHILD_DSIFORK, ipc->child_pid, ipc->uid, idlen, clientid, boottime); return 0; } /*********************************************************************************** * Public functions ***********************************************************************************/ /*! * Listen on UNIX domain socket "name" for IPC from old sesssion * * @args name (r) file name to use for UNIX domain socket * @returns socket fd, -1 on error */ int ipc_server_uds(const char *name) { EC_INIT; struct sockaddr_un address; socklen_t address_length; int fd = -1; EC_NEG1_LOG( fd = socket(PF_UNIX, SOCK_STREAM, 0) ); EC_ZERO_LOG( setnonblock(fd, 1) ); unlink(name); address.sun_family = AF_UNIX; address_length = sizeof(address.sun_family) + sprintf(address.sun_path, "%s", name); EC_ZERO_LOG( bind(fd, (struct sockaddr *)&address, address_length) ); EC_ZERO_LOG( listen(fd, 1024) ); EC_CLEANUP: if (ret != 0) { return -1; } return fd; } /*! * Connect to UNIX domain socket "name" for IPC with new afpd master * * 1. Connect * 2. send pid, which establishes a child structure for us in the master * * @args name (r) file name to use for UNIX domain socket * @returns socket fd, -1 on error */ int ipc_client_uds(const char *name) { EC_INIT; struct sockaddr_un address; socklen_t address_length; int fd = -1; pid_t pid = getpid(); EC_NEG1_LOG( fd = socket(PF_UNIX, SOCK_STREAM, 0) ); address.sun_family = AF_UNIX; address_length = sizeof(address.sun_family) + sprintf(address.sun_path, "%s", name); EC_ZERO_LOG( connect(fd, (struct sockaddr *)&address, address_length) ); /* 1 */ LOG(log_debug, logtype_afpd, "ipc_client_uds: connected to master"); EC_ZERO_LOG( setnonblock(fd, 1) ); if (writet(fd, &pid, sizeof(pid_t), 0, 1) != sizeof(pid_t)) { LOG(log_error, logtype_afpd, "ipc_client_uds: writet: %s", strerror(errno)); EC_FAIL; } EC_CLEANUP: if (ret != 0) { return -1; } LOG(log_debug, logtype_afpd, "ipc_client_uds: fd: %d", fd); return fd; } int reconnect_ipc(AFPObj *obj) { int retrycount = 0; LOG(log_debug, logtype_afpd, "reconnect_ipc: start"); close(obj->ipc_fd); obj->ipc_fd = -1; sleep((getpid() % 5) + 15); /* give it enough time to start */ while (retrycount++ < 10) { if ((obj->ipc_fd = ipc_client_uds(_PATH_AFP_IPC)) == -1) { LOG(log_error, logtype_afpd, "reconnect_ipc: cant reconnect to master"); sleep(1); continue; } LOG(log_debug, logtype_afpd, "reconnect_ipc: succesfull IPC reconnect"); return 0; } return -1; } /* ----------------- * Ipc format * command * pid * uid * */ /*! * Read a IPC message from a child * * This is using an fd with non-blocking IO, so EAGAIN is not an error * * @args children (rw) pointer to our structure with all childs * @args fd (r) IPC socket with child * * @returns -1 on error, 0 on success */ int ipc_server_read(server_child *children, int fd) { int ret; struct ipc_header ipc; char buf[IPC_MAXMSGSIZE], *p; if ((ret = read(fd, buf, IPC_HEADERLEN)) != IPC_HEADERLEN) { if (ret != 0) { if (errno == EAGAIN) return 0; LOG(log_error, logtype_afpd, "Reading IPC header failed (%i of %u bytes read): %s", ret, IPC_HEADERLEN, strerror(errno)); } return -1; } p = buf; memcpy(&ipc.command, p, sizeof(ipc.command)); p += sizeof(ipc.command); memcpy(&ipc.child_pid, p, sizeof(ipc.child_pid)); p += sizeof(ipc.child_pid); memcpy(&ipc.uid, p, sizeof(ipc.uid)); p += sizeof(ipc.uid); memcpy(&ipc.len, p, sizeof(ipc.len)); /* This should never happen */ if (ipc.len > (IPC_MAXMSGSIZE - IPC_HEADERLEN)) { LOG (log_info, logtype_afpd, "IPC message exceeds allowed size (%u)", ipc.len); return -1; } memset (buf, 0, IPC_MAXMSGSIZE); if ( ipc.len != 0) { if ((ret = read(fd, buf, ipc.len)) != (int) ipc.len) { LOG(log_info, logtype_afpd, "Reading IPC message failed (%u of %u bytes read): %s", ret, ipc.len, strerror(errno)); return -1; } } ipc.msg = buf; LOG(log_debug, logtype_afpd, "ipc_server_read(%s): pid: %u", ipc_cmd_str[ipc.command], ipc.child_pid); int afp_socket; switch (ipc.command) { case IPC_DISCOLDSESSION: if (readt(fd, &ipc.DSI_requestID, 2, 0, 2) != 2) { LOG (log_error, logtype_afpd, "ipc_read(%s:child[%u]): couldnt read DSI id: %s", ipc_cmd_str[ipc.command], ipc.child_pid, strerror(errno)); return -1; } if ((ipc.afp_socket = recv_fd(fd, 1)) == -1) { LOG (log_error, logtype_afpd, "ipc_read(%s:child[%u]): recv_fd: %s", ipc_cmd_str[ipc.command], ipc.child_pid, strerror(errno)); return -1; } if (ipc_kill_token(&ipc, children) == 1) { /* Transfered session (ie afp_socket) to old disconnected child, now kill the new one */ LOG(log_note, logtype_afpd, "Reconnect: killing new session child[%u] after transfer", ipc.child_pid); kill(ipc.child_pid, SIGTERM); } close(ipc.afp_socket); break; case IPC_GETSESSION: if (ipc_get_session(&ipc, children) != 0) return -1; break; default: LOG (log_info, logtype_afpd, "ipc_read: unknown command: %d", ipc.command); return -1; } return 0; } /* ----------------- */ int ipc_child_write(int fd, uint16_t command, int len, void *msg) { char block[IPC_MAXMSGSIZE], *p; pid_t pid; uid_t uid; ssize_t ret; p = block; memset ( p, 0 , IPC_MAXMSGSIZE); if (len + IPC_HEADERLEN > IPC_MAXMSGSIZE) return -1; memcpy(p, &command, sizeof(command)); p += sizeof(command); pid = getpid(); memcpy(p, &pid, sizeof(pid_t)); p += sizeof(pid_t); /* FIXME * using uid is wrong. It will not disconnect if the new connection * is with a different user. * But we really don't want a remote kill command. */ uid = geteuid(); memcpy(p, &uid, sizeof(uid_t)); p += sizeof(uid_t); memcpy(p, &len, 4); p += 4; memcpy(p, msg, len); LOG(log_debug, logtype_afpd, "ipc_child_write(%s)", ipc_cmd_str[command]); if ((ret = writet(fd, block, len+IPC_HEADERLEN, 0, 1)) != len + IPC_HEADERLEN) { return -1; } return 0; } netatalk-2.2.2/libatalk/util/strlcpy.c0000644000175200017500000000405011655731127014656 00000000000000/* Copy from samba lib/replace.c Unix SMB/CIFS implementation. replacement routines for broken systems Copyright (C) Andrew Tridgell 1992-1998 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. strlcpy strlcat functions. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #ifndef HAVE_STRLCPY /* like strncpy but does not 0 fill the buffer and always null terminates. bufsize is the size of the destination buffer */ size_t strlcpy(char *d, const char *s, size_t bufsize) { size_t len = strlen(s); size_t ret = len; if (bufsize <= 0) return 0; if (len >= bufsize) len = bufsize-1; memcpy(d, s, len); d[len] = 0; return ret; } #endif #ifndef HAVE_STRLCAT /* like strncat but does not 0 fill the buffer and always null terminates. bufsize is the length of the buffer, which should be one more than the maximum resulting string length */ size_t strlcat(char *d, const char *s, size_t bufsize) { size_t len1 = strlen(d); size_t len2 = strlen(s); size_t ret = len1 + len2; if (len1 >= bufsize) { return 0; } if (len1+len2 >= bufsize) { len2 = bufsize - (len1+1); } if (len2 > 0) { memcpy(d+len1, s, len2); d[len1+len2] = 0; } return ret; } #endif netatalk-2.2.2/libatalk/util/locking.c0000644000175200017500000000537111655731127014613 00000000000000/* $Id: locking.c,v 1.4 2010-01-05 19:05:52 franklahm Exp $ Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ /*! * @file * Netatalk utility functions */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include /*! * @def read_lock(fd, offset, whence, len) * @brief place read lock on file * * @param fd (r) File descriptor * @param offset (r) byte offset relative to l_whence * @param whence (r) SEEK_SET, SEEK_CUR, SEEK_END * @param len (r) no. of bytes (0 means to EOF) * * @returns 0 on success, -1 on failure with * fcntl return value and errno */ /*! * @def write_lock(fd, offset, whence, len) * @brief place write lock on file * * @param fd (r) File descriptor * @param offset (r) byte offset relative to l_whence * @param whence (r) SEEK_SET, SEEK_CUR, SEEK_END * @param len (r) no. of bytes (0 means to EOF) * * @returns 0 on success, -1 on failure with * fcntl return value and errno */ /*! * @def unlock(fd, offset, whence, len) * @brief unlock a file * * @param fd (r) File descriptor * @param offset (r) byte offset relative to l_whence * @param whence (r) SEEK_SET, SEEK_CUR, SEEK_END * @param len (r) no. of bytes (0 means to EOF) * * @returns 0 on success, -1 on failure with * fcntl return value and errno */ /*! * @brief lock a file with fctnl * * This function is called via the macros: * read_lock, write_lock, un_lock * * @param fd (r) File descriptor * @param cmd (r) cmd to fcntl, only F_SETLK is usable here * @param type (r) F_RDLCK, F_WRLCK, F_UNLCK * @param offset (r) byte offset relative to l_whence * @param whence (r) SEEK_SET, SEEK_CUR, SEEK_END * @param len (r) no. of bytes (0 means to EOF) * * @returns 0 on success, -1 on failure with * fcntl return value and errno * * @sa read_lock, write_lock, unlock */ int lock_reg(int fd, int cmd, int type, off_t offset, int whence, off_t len) { struct flock lock; lock.l_type = type; lock.l_start = offset; lock.l_whence = whence; lock.l_len = len; return (fcntl(fd, cmd, &lock)); } netatalk-2.2.2/libatalk/util/socket.c0000644000175200017500000004717011655731245014461 00000000000000/* Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ /*! * @file * Netatalk utility functions */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static char ipv4mapprefix[] = {0,0,0,0,0,0,0,0,0,0,0xff,0xff}; /*! * @brief set or unset non-blocking IO on a fd * * @param fd (r) File descriptor * @param cmd (r) 0: disable non-blocking IO, ie block\n * <>0: enable non-blocking IO * * @returns 0 on success, -1 on failure */ int setnonblock(int fd, int cmd) { int ofdflags; int fdflags; if ((fdflags = ofdflags = fcntl(fd, F_GETFL, 0)) == -1) return -1; if (cmd) fdflags |= O_NONBLOCK; else fdflags &= ~O_NONBLOCK; if (fdflags != ofdflags) if (fcntl(fd, F_SETFL, fdflags) == -1) return -1; return 0; } /*! * non-blocking drop-in replacement for read with timeout using select * * @param socket (r) socket, if in blocking mode, pass "setnonblocking" arg as 1 * @param data (rw) buffer for the read data * @param lenght (r) how many bytes to read * @param setnonblocking (r) when non-zero this func will enable and disable non blocking * io mode for the socket * @param timeout (r) number of seconds to try reading * * @returns number of bytes actually read or -1 on timeout or error */ ssize_t readt(int socket, void *data, const size_t length, int setnonblocking, int timeout) { size_t stored = 0; ssize_t len = 0; struct timeval now, end, tv; fd_set rfds; int ret; FD_ZERO(&rfds); if (setnonblocking) { if (setnonblock(socket, 1) != 0) return -1; } /* Calculate end time */ (void)gettimeofday(&now, NULL); end = now; end.tv_sec += timeout; while (stored < length) { len = read(socket, (char *) data + stored, length - stored); if (len == -1) { switch (errno) { case EINTR: continue; case EAGAIN: FD_SET(socket, &rfds); tv.tv_usec = 0; tv.tv_sec = timeout; while ((ret = select(socket + 1, &rfds, NULL, NULL, &tv)) < 1) { switch (ret) { case 0: LOG(log_debug, logtype_afpd, "select timeout %d s", timeout); errno = EAGAIN; goto exit; default: /* -1 */ switch (errno) { case EINTR: (void)gettimeofday(&now, NULL); if (now.tv_sec > end.tv_sec || (now.tv_sec == end.tv_sec && now.tv_usec >= end.tv_usec)) { LOG(log_debug, logtype_afpd, "select timeout %d s", timeout); goto exit; } if (now.tv_usec > end.tv_usec) { tv.tv_usec = 1000000 + end.tv_usec - now.tv_usec; tv.tv_sec = end.tv_sec - now.tv_sec - 1; } else { tv.tv_usec = end.tv_usec - now.tv_usec; tv.tv_sec = end.tv_sec - now.tv_sec; } FD_SET(socket, &rfds); continue; case EBADF: /* possibly entered disconnected state, don't spam log here */ LOG(log_debug, logtype_afpd, "select: %s", strerror(errno)); stored = -1; goto exit; default: LOG(log_error, logtype_afpd, "select: %s", strerror(errno)); stored = -1; goto exit; } } } /* while (select) */ continue; } /* switch (errno) */ LOG(log_error, logtype_afpd, "read: %s", strerror(errno)); stored = -1; goto exit; } /* (len == -1) */ else if (len > 0) stored += len; else break; } /* while (stored < length) */ exit: if (setnonblocking) { if (setnonblock(socket, 0) != 0) return -1; } if (len == -1 && stored == 0) /* last read or select got an error and we haven't got yet anything => return -1*/ return -1; return stored; } /*! * non-blocking drop-in replacement for read with timeout using select * * @param socket (r) socket, if in blocking mode, pass "setnonblocking" arg as 1 * @param data (rw) buffer for the read data * @param lenght (r) how many bytes to read * @param setnonblocking (r) when non-zero this func will enable and disable non blocking * io mode for the socket * @param timeout (r) number of seconds to try reading * * @returns number of bytes actually read or -1 on fatal error */ ssize_t writet(int socket, void *data, const size_t length, int setnonblocking, int timeout) { size_t stored = 0; ssize_t len = 0; struct timeval now, end, tv; fd_set rfds; int ret; if (setnonblocking) { if (setnonblock(socket, 1) != 0) return -1; } /* Calculate end time */ (void)gettimeofday(&now, NULL); end = now; end.tv_sec += timeout; while (stored < length) { len = write(socket, (char *) data + stored, length - stored); if (len == -1) { switch (errno) { case EINTR: continue; case EAGAIN: FD_ZERO(&rfds); FD_SET(socket, &rfds); tv.tv_usec = 0; tv.tv_sec = timeout; while ((ret = select(socket + 1, &rfds, NULL, NULL, &tv)) < 1) { switch (ret) { case 0: LOG(log_warning, logtype_afpd, "select timeout %d s", timeout); goto exit; default: /* -1 */ if (errno == EINTR) { (void)gettimeofday(&now, NULL); if (now.tv_sec >= end.tv_sec && now.tv_usec >= end.tv_usec) { LOG(log_warning, logtype_afpd, "select timeout %d s", timeout); goto exit; } if (now.tv_usec > end.tv_usec) { tv.tv_usec = 1000000 + end.tv_usec - now.tv_usec; tv.tv_sec = end.tv_sec - now.tv_sec - 1; } else { tv.tv_usec = end.tv_usec - now.tv_usec; tv.tv_sec = end.tv_sec - now.tv_sec; } FD_ZERO(&rfds); FD_SET(socket, &rfds); continue; } LOG(log_error, logtype_afpd, "select: %s", strerror(errno)); stored = -1; goto exit; } } /* while (select) */ continue; } /* switch (errno) */ LOG(log_error, logtype_afpd, "read: %s", strerror(errno)); stored = -1; goto exit; } /* (len == -1) */ else if (len > 0) stored += len; else break; } /* while (stored < length) */ exit: if (setnonblocking) { if (setnonblock(socket, 0) != 0) return -1; } if (len == -1 && stored == 0) /* last read or select got an error and we haven't got yet anything => return -1*/ return -1; return stored; } /*! * @brief convert an IPv4 or IPv6 address to a static string using inet_ntop * * IPv6 mapped IPv4 addresses are returned as IPv4 addreses eg * ::ffff:10.0.0.0 is returned as "10.0.0.0". * * @param sa (r) pointer to an struct sockaddr * * @returns pointer to a static string cotaining the converted address as string.\n * On error pointers to "0.0.0.0" or "::0" are returned. */ const char *getip_string(const struct sockaddr *sa) { static char ip4[INET_ADDRSTRLEN]; static char ip6[INET6_ADDRSTRLEN]; switch (sa->sa_family) { case AF_INET: { const struct sockaddr_in *sai4 = (const struct sockaddr_in *)sa; if ((inet_ntop(AF_INET, &(sai4->sin_addr), ip4, INET_ADDRSTRLEN)) == NULL) return "0.0.0.0"; return ip4; } case AF_INET6: { const struct sockaddr_in6 *sai6 = (const struct sockaddr_in6 *)sa; if ((inet_ntop(AF_INET6, &(sai6->sin6_addr), ip6, INET6_ADDRSTRLEN)) == NULL) return "::0"; /* Deal with IPv6 mapped IPv4 addresses*/ if ((memcmp(sai6->sin6_addr.s6_addr, ipv4mapprefix, sizeof(ipv4mapprefix))) == 0) return (strrchr(ip6, ':') + 1); return ip6; } default: return "getip_string ERROR"; } /* We never get here */ } /*! * @brief return port number from struct sockaddr * * @param sa (r) pointer to an struct sockaddr * * @returns port as unsigned int */ unsigned int getip_port(const struct sockaddr *sa) { if (sa->sa_family == AF_INET) { /* IPv4 */ const struct sockaddr_in *sai4 = (const struct sockaddr_in *)sa; return ntohs(sai4->sin_port); } else { /* IPv6 */ const struct sockaddr_in6 *sai6 = (const struct sockaddr_in6 *)sa; return ntohs(sai6->sin6_port); } /* We never get here */ } /*! * @brief apply netmask to IP (v4 or v6) * * Modifies IP address in sa->sin[6]_addr-s[6]_addr. The caller is responsible * for passing a value for mask that is sensible to the passed address, * eg 0 <= mask <= 32 for IPv4 or 0<= mask <= 128 for IPv6. mask > 32 for * IPv4 is treated as mask = 32, mask > 128 is set to 128 for IPv6. * * @param ai (rw) pointer to an struct sockaddr * @parma mask (r) number of maskbits */ void apply_ip_mask(struct sockaddr *sa, int mask) { switch (sa->sa_family) { case AF_INET: { if (mask >= 32) return; struct sockaddr_in *si = (struct sockaddr_in *)sa; uint32_t nmask = mask ? ~((1 << (32 - mask)) - 1) : 0; si->sin_addr.s_addr &= htonl(nmask); break; } case AF_INET6: { if (mask >= 128) return; int i, maskbytes, maskbits; struct sockaddr_in6 *si6 = (struct sockaddr_in6 *)sa; /* Deal with IPv6 mapped IPv4 addresses*/ if ((memcmp(si6->sin6_addr.s6_addr, ipv4mapprefix, sizeof(ipv4mapprefix))) == 0) { mask += 96; if (mask >= 128) return; } maskbytes = (128 - mask) / 8; /* maskbytes really are those that will be 0'ed */ maskbits = mask % 8; for (i = maskbytes - 1; i >= 0; i--) si6->sin6_addr.s6_addr[15 - i] = 0; if (maskbits) si6->sin6_addr.s6_addr[15 - maskbytes] &= ~((1 << (8 - maskbits)) - 1); break; } default: break; } } /*! * @brief compare IP addresses for equality * * @param sa1 (r) pointer to an struct sockaddr * @param sa2 (r) pointer to an struct sockaddr * * @returns Addresses are converted to strings and compared with strcmp and * the result of strcmp is returned. * * @note IPv6 mapped IPv4 addresses are treated as IPv4 addresses. */ int compare_ip(const struct sockaddr *sa1, const struct sockaddr *sa2) { int ret; char *ip1; const char *ip2; ip1 = strdup(getip_string(sa1)); ip2 = getip_string(sa2); ret = strcmp(ip1, ip2); free(ip1); return ret; } /*! * Add a fd to a dynamic pollfd array that is allocated and grown as needed * * This uses an additional array of struct polldata which stores type information * (enum fdtype) and a pointer to anciliary user data. * * 1. Allocate the arrays with the size of "maxconns" if *fdsetp is NULL. * 2. Fill in both array elements and increase count of used elements * * @param maxconns (r) maximum number of connections, determines array size * @param fdsetp (rw) pointer to callers pointer to the pollfd array * @param polldatap (rw) pointer to callers pointer to the polldata array * @param fdset_usedp (rw) pointer to an int with the number of used elements * @param fdset_sizep (rw) pointer to an int which stores the array sizes * @param fd (r) file descriptor to add to the arrays * @param fdtype (r) type of fd, currently IPC_FD or LISTEN_FD * @param data (rw) pointer to data the caller want to associate with an fd */ void fdset_add_fd(int maxconns, struct pollfd **fdsetp, struct polldata **polldatap, int *fdset_usedp, int *fdset_sizep, int fd, enum fdtype fdtype, void *data) { struct pollfd *fdset = *fdsetp; struct polldata *polldata = *polldatap; int fdset_size = *fdset_sizep; LOG(log_debug, logtype_default, "fdset_add_fd: adding fd %i in slot %i", fd, *fdset_usedp); if (fdset == NULL) { /* 1 */ /* Initialize with space for all possibly active fds */ fdset = calloc(maxconns, sizeof(struct pollfd)); if (! fdset) exit(EXITERR_SYS); polldata = calloc(maxconns, sizeof(struct polldata)); if (! polldata) exit(EXITERR_SYS); fdset_size = maxconns; *fdset_sizep = fdset_size; *fdsetp = fdset; *polldatap = polldata; LOG(log_debug, logtype_default, "fdset_add_fd: initialized with space for %i conncections", maxconns); } /* 2 */ fdset[*fdset_usedp].fd = fd; fdset[*fdset_usedp].events = POLLIN; polldata[*fdset_usedp].fdtype = fdtype; polldata[*fdset_usedp].data = data; (*fdset_usedp)++; } /*! * Remove a fd from our pollfd array * * 1. Search fd * 2a Matched last (or only) in the set ? null it and return * 2b If we remove the last array elemnt, just decrease count * 3. If found move all following elements down by one * 4. Decrease count of used elements in array * * This currently doesn't shrink the allocated storage of the array. * * @param fdsetp (rw) pointer to callers pointer to the pollfd array * @param polldatap (rw) pointer to callers pointer to the polldata array * @param fdset_usedp (rw) pointer to an int with the number of used elements * @param fdset_sizep (rw) pointer to an int which stores the array sizes * @param fd (r) file descriptor to remove from the arrays */ void fdset_del_fd(struct pollfd **fdsetp, struct polldata **polldatap, int *fdset_usedp, int *fdset_sizep _U_, int fd) { struct pollfd *fdset = *fdsetp; struct polldata *polldata = *polldatap; if (*fdset_usedp < 1) return; for (int i = 0; i < *fdset_usedp; i++) { if (fdset[i].fd == fd) { /* 1 */ if ((i + 1) == *fdset_usedp) { /* 2a */ fdset[i].fd = -1; memset(&polldata[i], 0, sizeof(struct polldata)); } else if (i < (*fdset_usedp - 1)) { /* 2b */ memmove(&fdset[i], &fdset[i+1], (*fdset_usedp - i - 1) * sizeof(struct pollfd)); /* 3 */ memmove(&polldata[i], &polldata[i+1], (*fdset_usedp - i - 1) * sizeof(struct polldata)); /* 3 */ } (*fdset_usedp)--; break; } } } /* Length of the space taken up by a padded control message of length len */ #ifndef CMSG_SPACE #define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len)) #endif /* * Receive a fd on a suitable socket * @args fd (r) PF_UNIX socket to receive on * @args nonblocking (r) 0: fd is in blocking mode - 1: fd is nonblocking, poll for 1 sec * @returns fd on success, -1 on error */ int recv_fd(int fd, int nonblocking) { int ret; struct msghdr msgh; struct iovec iov[1]; struct cmsghdr *cmsgp = NULL; char buf[CMSG_SPACE(sizeof(int))]; char dbuf[80]; struct pollfd pollfds[1]; pollfds[0].fd = fd; pollfds[0].events = POLLIN; memset(&msgh,0,sizeof(msgh)); memset(buf,0,sizeof(buf)); msgh.msg_name = NULL; msgh.msg_namelen = 0; msgh.msg_iov = iov; msgh.msg_iovlen = 1; iov[0].iov_base = dbuf; iov[0].iov_len = sizeof(dbuf); msgh.msg_control = buf; msgh.msg_controllen = sizeof(buf); if (nonblocking) { do { ret = poll(pollfds, 1, 2000); /* poll 2 seconds, evtl. multipe times (EINTR) */ } while ( ret == -1 && errno == EINTR ); if (ret != 1) return -1; ret = recvmsg(fd, &msgh, 0); } else { do { ret = recvmsg(fd, &msgh, 0); } while ( ret == -1 && errno == EINTR ); } if ( ret == -1 ) { return -1; } for ( cmsgp = CMSG_FIRSTHDR(&msgh); cmsgp != NULL; cmsgp = CMSG_NXTHDR(&msgh,cmsgp) ) { if ( cmsgp->cmsg_level == SOL_SOCKET && cmsgp->cmsg_type == SCM_RIGHTS ) { return *(int *) CMSG_DATA(cmsgp); } } if ( ret == sizeof (int) ) errno = *(int *)dbuf; /* Rcvd errno */ else errno = ENOENT; /* Default errno */ return -1; } /* * Send a fd across a suitable socket */ int send_fd(int socket, int fd) { int ret; struct msghdr msgh; struct iovec iov[1]; struct cmsghdr *cmsgp = NULL; char *buf; size_t size; int er=0; size = CMSG_SPACE(sizeof fd); buf = malloc(size); if (!buf) { LOG(log_error, logtype_cnid, "error in sendmsg: %s", strerror(errno)); return -1; } memset(&msgh,0,sizeof (msgh)); memset(buf,0, size); msgh.msg_name = NULL; msgh.msg_namelen = 0; msgh.msg_iov = iov; msgh.msg_iovlen = 1; iov[0].iov_base = &er; iov[0].iov_len = sizeof(er); msgh.msg_control = buf; msgh.msg_controllen = size; cmsgp = CMSG_FIRSTHDR(&msgh); cmsgp->cmsg_level = SOL_SOCKET; cmsgp->cmsg_type = SCM_RIGHTS; cmsgp->cmsg_len = CMSG_LEN(sizeof(fd)); *((int *)CMSG_DATA(cmsgp)) = fd; msgh.msg_controllen = cmsgp->cmsg_len; do { ret = sendmsg(socket,&msgh, 0); } while ( ret == -1 && errno == EINTR ); if (ret == -1) { LOG(log_error, logtype_cnid, "error in sendmsg: %s", strerror(errno)); free(buf); return -1; } free(buf); return 0; } netatalk-2.2.2/libatalk/util/server_child.c0000644000175200017500000002732611655731245015643 00000000000000/* * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. * * * handle inserting, removing, and freeing of children. * this does it via a hash table. it incurs some overhead over * a linear append/remove in total removal and kills, but it makes * single-entry removals a fast operation. as total removals occur during * child initialization and kills during server shutdown, this is * probably a win for a lot of connections and unimportant for a small * number of connections. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include /* POSIX.1 sys/wait.h check */ #include #ifdef HAVE_SYS_WAIT_H #include #endif /* HAVE_SYS_WAIT_H */ #include #include #include #include #include #ifndef WEXITSTATUS #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif /* ! WEXITSTATUS */ #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif /* ! WIFEXITED */ #ifndef WIFSTOPPED #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) #endif #ifndef WIFSIGNALED #define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status)) #endif #ifndef WTERMSIG #define WTERMSIG(status) ((status) & 0x7f) #endif /* hash/child functions: hash OR's pid */ #define CHILD_HASHSIZE 32 #define HASH(i) ((((i) >> 8) ^ (i)) & (CHILD_HASHSIZE - 1)) typedef struct server_child_fork { struct server_child_data *table[CHILD_HASHSIZE]; void (*cleanup)(const pid_t); } server_child_fork; int parent_or_child; /* 0: parent, 1: child */ static inline void hash_child(struct server_child_data **htable, struct server_child_data *child) { struct server_child_data **table; table = &htable[HASH(child->pid)]; if ((child->next = *table) != NULL) (*table)->prevp = &child->next; *table = child; child->prevp = table; } static inline void unhash_child(struct server_child_data *child) { if (child->prevp) { if (child->next) child->next->prevp = child->prevp; *(child->prevp) = child->next; } } static struct server_child_data *resolve_child(struct server_child_data **table, pid_t pid) { struct server_child_data *child; for (child = table[HASH(pid)]; child; child = child->next) { if (child->pid == pid) break; } return child; } /* initialize server_child structure */ server_child *server_child_alloc(const int connections, const int nforks) { server_child *children; children = (server_child *) calloc(1, sizeof(server_child)); if (!children) return NULL; children->nsessions = connections; children->nforks = nforks; children->fork = (void *) calloc(nforks, sizeof(server_child_fork)); if (!children->fork) { free(children); return NULL; } return children; } /*! * add a child * @return pointer to struct server_child_data on success, NULL on error */ afp_child_t *server_child_add(server_child *children, int forkid, pid_t pid, uint ipc_fds[2]) { server_child_fork *fork; afp_child_t *child = NULL; sigset_t sig, oldsig; /* we need to prevent deletions from occuring before we get a * chance to add the child in. */ sigemptyset(&sig); sigaddset(&sig, SIGCHLD); pthread_sigmask(SIG_BLOCK, &sig, &oldsig); /* it's possible that the child could have already died before the * pthread_sigmask. we need to check for this. */ if (kill(pid, 0) < 0) { LOG(log_error, logtype_default, "server_child_add: no such process pid [%d]", pid); goto exit; } fork = (server_child_fork *) children->fork + forkid; /* if we already have an entry. just return. */ if (child = resolve_child(fork->table, pid)) goto exit; if ((child = calloc(1, sizeof(afp_child_t))) == NULL) goto exit; child->pid = pid; child->valid = 0; child->killed = 0; child->ipc_fds[0] = ipc_fds[0]; child->ipc_fds[1] = ipc_fds[1]; hash_child(fork->table, child); children->count++; exit: pthread_sigmask(SIG_SETMASK, &oldsig, NULL); return child; } /* remove a child and free it */ int server_child_remove(server_child *children, const int forkid, pid_t pid) { int fd; server_child_fork *fork; struct server_child_data *child; fork = (server_child_fork *) children->fork + forkid; if (!(child = resolve_child(fork->table, pid))) return -1; unhash_child(child); if (child->clientid) { free(child->clientid); child->clientid = NULL; } /* In main:child_handler() we need the fd in order to remove it from the pollfd set */ fd = child->ipc_fds[0]; if (child->ipc_fds[0] != -1) { close(child->ipc_fds[0]); child->ipc_fds[0] = -1; } if (child->ipc_fds[1] != -1) { close(child->ipc_fds[1]); child->ipc_fds[1] = -1; } free(child); children->count--; if (fork->cleanup) fork->cleanup(pid); return fd; } /* free everything: by using a hash table, this increases the cost of * this part over a linked list by the size of the hash table */ void server_child_free(server_child *children) { server_child_fork *fork; struct server_child_data *child, *tmp; int i, j; for (i = 0; i < children->nforks; i++) { fork = (server_child_fork *) children->fork + i; for (j = 0; j < CHILD_HASHSIZE; j++) { child = fork->table[j]; /* start at the beginning */ while (child) { tmp = child->next; if (child->clientid) { free(child->clientid); } free(child); child = tmp; } } } free(children->fork); free(children); } /* send signal to all child processes */ void server_child_kill(server_child *children, int forkid, int sig) { server_child_fork *fork; struct server_child_data *child, *tmp; int i; fork = (server_child_fork *) children->fork + forkid; for (i = 0; i < CHILD_HASHSIZE; i++) { child = fork->table[i]; while (child) { tmp = child->next; kill(child->pid, sig); child = tmp; } } } /* send kill to a child processes. * a plain-old linked list * FIXME use resolve_child ? */ static int kill_child(struct server_child_data *child) { if (!child->killed) { kill(child->pid, SIGTERM); /* we don't wait because there's no guarantee that we can really kill it */ child->killed = 1; return 1; } else { LOG(log_info, logtype_default, "Unresponsive child[%d], sending SIGKILL", child->pid); kill(child->pid, SIGKILL); } return 1; } /*! * Try to find an old session and pass socket * @returns -1 on error, 0 if no matching session was found, 1 if session was found and socket passed */ int server_child_transfer_session(server_child *children, int forkid, pid_t pid, uid_t uid, int afp_socket, uint16_t DSI_requestID) { EC_INIT; server_child_fork *fork; struct server_child_data *child; int i; fork = (server_child_fork *) children->fork + forkid; if ((child = resolve_child(fork->table, pid)) == NULL) { LOG(log_note, logtype_default, "Reconnect: no child[%u]", pid); if (kill(pid, 0) == 0) { LOG(log_note, logtype_default, "Reconnect: terminating old session[%u]", pid); kill(pid, SIGTERM); sleep(2); if (kill(pid, 0) == 0) { LOG(log_error, logtype_default, "Reconnect: killing old session[%u]", pid); kill(pid, SIGKILL); sleep(2); } } return 0; } if (!child->valid) { /* hmm, client 'guess' the pid, rogue? */ LOG(log_error, logtype_default, "Reconnect: invalidated child[%u]", pid); return 0; } else if (child->uid != uid) { LOG(log_error, logtype_default, "Reconnect: child[%u] not the same user", pid); return 0; } LOG(log_note, logtype_default, "Reconnect: transfering session to child[%u]", pid); if (writet(child->ipc_fds[0], &DSI_requestID, 2, 0, 2) != 2) { LOG(log_error, logtype_default, "Reconnect: error sending DSI id to child[%u]", pid); EC_STATUS(-1); goto EC_CLEANUP; } EC_ZERO_LOG(send_fd(child->ipc_fds[0], afp_socket)); EC_ZERO_LOG(kill(pid, SIGURG)); EC_STATUS(1); EC_CLEANUP: EC_EXIT; } /* see if there is a process for the same mac */ /* if the times don't match mac has been rebooted */ void server_child_kill_one_by_id(server_child *children, int forkid, pid_t pid, uid_t uid, uint32_t idlen, char *id, uint32_t boottime) { server_child_fork *fork; struct server_child_data *child, *tmp; int i; fork = (server_child_fork *)children->fork + forkid; for (i = 0; i < CHILD_HASHSIZE; i++) { child = fork->table[i]; while (child) { tmp = child->next; if ( child->pid != pid) { if (child->idlen == idlen && memcmp(child->clientid, id, idlen) == 0) { if ( child->time != boottime ) { /* Client rebooted */ if (uid == child->uid) { kill_child(child); LOG(log_warning, logtype_default, "Terminated disconnected child[%u], client rebooted.", child->pid); } else { LOG(log_warning, logtype_default, "Session with different pid[%u]", child->pid); } } else { /* One client with multiple sessions */ LOG(log_debug, logtype_default, "Found another session[%u] for client[%u]", child->pid, pid); } } } else { /* update childs own slot */ child->time = boottime; if (child->clientid) free(child->clientid); LOG(log_debug, logtype_default, "Setting client ID for %u", child->pid); child->uid = uid; child->valid = 1; child->idlen = idlen; child->clientid = id; } child = tmp; } } } /* for extra cleanup if necessary */ void server_child_setup(server_child *children, const int forkid, void (*fcn)(const pid_t)) { server_child_fork *fork; fork = (server_child_fork *) children->fork + forkid; fork->cleanup = fcn; } /* --------------------------- * reset children signals */ void server_reset_signal(void) { struct sigaction sv; sigset_t sigs; const struct itimerval none = {{0, 0}, {0, 0}}; setitimer(ITIMER_REAL, &none, NULL); memset(&sv, 0, sizeof(sv)); sv.sa_handler = SIG_DFL; sigemptyset( &sv.sa_mask ); sigaction(SIGALRM, &sv, NULL ); sigaction(SIGHUP, &sv, NULL ); sigaction(SIGTERM, &sv, NULL ); sigaction(SIGUSR1, &sv, NULL ); sigaction(SIGCHLD, &sv, NULL ); sigemptyset(&sigs); sigaddset(&sigs, SIGALRM); sigaddset(&sigs, SIGHUP); sigaddset(&sigs, SIGUSR1); sigaddset(&sigs, SIGCHLD); pthread_sigmask(SIG_UNBLOCK, &sigs, NULL); } netatalk-2.2.2/libatalk/util/fault.c0000644000175200017500000001062211655731127014273 00000000000000/* Unix SMB/CIFS implementation. Critical Fault handling Copyright (C) Andrew Tridgell 1992-1998 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #ifdef HAVE_BACKTRACE_SYMBOLS #include #endif #include #ifndef SIGNAL_CAST #define SIGNAL_CAST (RETSIGTYPE (*)(int)) #endif #ifndef SAFE_FREE /* Oh no this is also defined in tdb.h */ #define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0) #endif #define BACKTRACE_STACK_SIZE 64 static void (*cont_fn)(void *); /******************************************************************* Catch a signal. This should implement the following semantics: 1) The handler remains installed after being called. 2) The signal should be blocked during handler execution. ********************************************************************/ static void (*CatchSignal(int signum,void (*handler)(int )))(int) { #ifdef HAVE_SIGACTION struct sigaction act; struct sigaction oldact; ZERO_STRUCT(act); act.sa_handler = handler; #if 0 /* * We *want* SIGALRM to interrupt a system call. */ if(signum != SIGALRM) act.sa_flags = SA_RESTART; #endif sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask,signum); sigaction(signum,&act,&oldact); return oldact.sa_handler; #else /* !HAVE_SIGACTION */ /* FIXME: need to handle sigvec and systems with broken signal() */ return signal(signum, handler); #endif } /******************************************************************* Something really nasty happened - panic ! ********************************************************************/ void netatalk_panic(const char *why) { #ifdef HAVE_BACKTRACE_SYMBOLS void *backtrace_stack[BACKTRACE_STACK_SIZE]; size_t backtrace_size; char **backtrace_strings; /* get the backtrace (stack frames) */ backtrace_size = backtrace(backtrace_stack,BACKTRACE_STACK_SIZE); backtrace_strings = backtrace_symbols(backtrace_stack, backtrace_size); LOG(log_severe, logtype_default, "BACKTRACE: %d stack frames:", backtrace_size); if (backtrace_strings) { size_t i; for (i = 0; i < backtrace_size; i++) LOG(log_severe, logtype_default, " #%u %s", i, backtrace_strings[i]); SAFE_FREE(backtrace_strings); } #endif } /******************************************************************* report a fault ********************************************************************/ static void fault_report(int sig) { static int counter; if (counter) abort(); counter++; LOG(log_severe, logtype_default, "==============================================================="); LOG(log_severe, logtype_default, "INTERNAL ERROR: Signal %d in pid %d (%s)",sig,(int)getpid(),VERSION); LOG(log_severe, logtype_default, "==============================================================="); netatalk_panic("internal error"); if (cont_fn) { cont_fn(NULL); #ifdef SIGSEGV CatchSignal(SIGSEGV,SIGNAL_CAST SIG_DFL); #endif #ifdef SIGBUS CatchSignal(SIGBUS,SIGNAL_CAST SIG_DFL); #endif return; /* this should cause a core dump */ } abort(); } /**************************************************************************** catch serious errors ****************************************************************************/ static void sig_fault(int sig) { fault_report(sig); } /******************************************************************* setup our fault handlers ********************************************************************/ void fault_setup(void (*fn)(void *)) { cont_fn = fn; #ifdef SIGSEGV CatchSignal(SIGSEGV,SIGNAL_CAST sig_fault); #endif #ifdef SIGBUS CatchSignal(SIGBUS,SIGNAL_CAST sig_fault); #endif } netatalk-2.2.2/libatalk/util/ftw.c0000644000175200017500000005462111655731127013767 00000000000000/* File tree walker functions. Copyright (C) 1996-2004, 2006-2008, 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #if __GNUC__ # define alloca __builtin_alloca #else # include #endif #include #define NAMLEN(dirent) strlen ((dirent)->d_name) #include #include #include #include #include #include #include #include #if HAVE_SYS_PARAM_H # include #endif #include #define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N))) #define NDEBUG 1 #include #ifndef _LIBC # undef __chdir # define __chdir chdir # undef __closedir # define __closedir closedir # undef __fchdir # define __fchdir fchdir # undef __getcwd # define __getcwd(P, N) xgetcwd () # undef __mempcpy # define __mempcpy mempcpy # undef __opendir # define __opendir opendir # undef __readdir64 # define __readdir64 readdir # undef __tdestroy # define __tdestroy tdestroy # undef __tfind # define __tfind tfind # undef __tsearch # define __tsearch tsearch # undef internal_function # define internal_function /* empty */ # undef dirent64 # define dirent64 dirent # undef MAX # define MAX(a, b) ((a) > (b) ? (a) : (b)) #endif #ifndef __set_errno # define __set_errno(Val) errno = (Val) #endif /* Support for the LFS API version. */ #ifndef FTW_NAME # define FTW_NAME ftw # define NFTW_NAME nftw # define NFTW_OLD_NAME __old_nftw # define NFTW_NEW_NAME __new_nftw # define INO_T ino_t # define STAT stat # define LXSTAT(V,f,sb) lstat (f,sb) # define XSTAT(V,f,sb) stat (f,sb) # define FXSTATAT(V,d,f,sb,m) fstatat (d, f, sb, m) #endif /* We define PATH_MAX if the system does not provide a definition. This does not artificially limit any operation. PATH_MAX is simply used as a guesstimate for the expected maximal path length. Buffers will be enlarged if necessary. */ #ifndef PATH_MAX # define PATH_MAX 1024 #endif struct dir_data { DIR *stream; int streamfd; char *content; }; struct known_object { dev_t dev; INO_T ino; }; struct ftw_data { /* Array with pointers to open directory streams. */ struct dir_data **dirstreams; size_t actdir; size_t maxdir; /* Buffer containing name of currently processed object. */ char *dirbuf; size_t dirbufsize; /* Passed as fourth argument to `nftw' callback. The `base' member tracks the content of the `dirbuf'. */ struct FTW ftw; /* Flags passed to `nftw' function. 0 for `ftw'. */ int flags; /* Conversion array for flag values. It is the identity mapping for `nftw' calls, otherwise it maps the values to those known by `ftw'. */ const int *cvt_arr; /* Callback function. We always use the `nftw' form. */ NFTW_FUNC_T func; /* Device of starting point. Needed for FTW_MOUNT. */ dev_t dev; /* Data structure for keeping fingerprints of already processed object. This is needed when not using FTW_PHYS. */ void *known_objects; }; /* Internally we use the FTW_* constants used for `nftw'. When invoked as `ftw', map each flag to the subset of values used by `ftw'. */ static const int nftw_arr[] = { FTW_F, FTW_D, FTW_DNR, FTW_NS, FTW_SL, FTW_DP, FTW_SLN }; static const int ftw_arr[] = { FTW_F, FTW_D, FTW_DNR, FTW_NS, FTW_F, FTW_D, FTW_NS }; static dir_notification_func_t upfunc; /* Forward declarations of local functions. */ static int ftw_dir (struct ftw_data *data, struct STAT *st, struct dir_data *old_dir) internal_function; typedef void (*__free_fn_t) (void *__nodep); typedef struct node_t { const void *key; struct node_t *left; struct node_t *right; unsigned int red:1; } *node; static void tdestroy_recurse (node root, __free_fn_t freefct) { if (root->left != NULL) tdestroy_recurse (root->left, freefct); if (root->right != NULL) tdestroy_recurse (root->right, freefct); (*freefct) ((void *) root->key); /* Free the node itself. */ free (root); } static void mytdestroy (void *vroot, __free_fn_t freefct) { node root = (node) vroot; if (root != NULL) tdestroy_recurse (root, freefct); } static char *mystpcpy(char *a, const char *b) { strcpy(a, b); return (a + strlen(a)); } static char *xgetcwd(void) { char *cwd; char *ret; unsigned path_max; errno = 0; path_max = (unsigned) PATH_MAX; path_max += 2; /* The getcwd docs say to do this. */ cwd = malloc (path_max); errno = 0; while ((ret = getcwd (cwd, path_max)) == NULL && errno == ERANGE) { path_max += 512; cwd = realloc (cwd, path_max); errno = 0; } if (ret == NULL) { int save_errno = errno; free (cwd); errno = save_errno; return NULL; } return cwd; } static int object_compare (const void *p1, const void *p2) { /* We don't need a sophisticated and useful comparison. We are only interested in equality. However, we must be careful not to accidentally compare `holes' in the structure. */ const struct known_object *kp1 = p1, *kp2 = p2; int cmp1; cmp1 = (kp1->ino > kp2->ino) - (kp1->ino < kp2->ino); if (cmp1 != 0) return cmp1; return (kp1->dev > kp2->dev) - (kp1->dev < kp2->dev); } static int add_object (struct ftw_data *data, struct STAT *st) { struct known_object *newp = malloc (sizeof (struct known_object)); if (newp == NULL) return -1; newp->dev = st->st_dev; newp->ino = st->st_ino; return __tsearch (newp, &data->known_objects, object_compare) ? 0 : -1; } static inline int find_object (struct ftw_data *data, struct STAT *st) { struct known_object obj; obj.dev = st->st_dev; obj.ino = st->st_ino; return __tfind (&obj, &data->known_objects, object_compare) != NULL; } static inline int open_dir_stream (int *dfdp, struct ftw_data *data, struct dir_data *dirp) { int result = 0; if (data->dirstreams[data->actdir] != NULL) { /* Oh, oh. We must close this stream. Get all remaining entries and store them as a list in the `content' member of the `struct dir_data' variable. */ size_t bufsize = 1024; char *buf = malloc (bufsize); if (buf == NULL) result = -1; else { DIR *st = data->dirstreams[data->actdir]->stream; struct dirent64 *d; size_t actsize = 0; while ((d = __readdir64 (st)) != NULL) { size_t this_len = NAMLEN (d); if (actsize + this_len + 2 >= bufsize) { char *newp; bufsize += MAX (1024, 2 * this_len); newp = (char *) realloc (buf, bufsize); if (newp == NULL) { /* No more memory. */ int save_err = errno; free (buf); __set_errno (save_err); return -1; } buf = newp; } *((char *) __mempcpy (buf + actsize, d->d_name, this_len)) = '\0'; actsize += this_len + 1; } /* Terminate the list with an additional NUL byte. */ buf[actsize++] = '\0'; /* Shrink the buffer to what we actually need. */ data->dirstreams[data->actdir]->content = realloc (buf, actsize); if (data->dirstreams[data->actdir]->content == NULL) { int save_err = errno; free (buf); __set_errno (save_err); result = -1; } else { __closedir (st); data->dirstreams[data->actdir]->stream = NULL; data->dirstreams[data->actdir]->streamfd = -1; data->dirstreams[data->actdir] = NULL; } } } /* Open the new stream. */ if (result == 0) { assert (data->dirstreams[data->actdir] == NULL); if (dfdp != NULL && *dfdp != -1) { int fd = openat(*dfdp, data->dirbuf + data->ftw.base, O_RDONLY); dirp->stream = NULL; if (fd != -1 && (dirp->stream = fdopendir (fd)) == NULL) close(fd); } else { const char *name; if (data->flags & FTW_CHDIR) { name = data->dirbuf + data->ftw.base; if (name[0] == '\0') name = "."; } else name = data->dirbuf; dirp->stream = __opendir (name); } if (dirp->stream == NULL) result = -1; else { dirp->streamfd = dirfd (dirp->stream); dirp->content = NULL; data->dirstreams[data->actdir] = dirp; if (++data->actdir == data->maxdir) data->actdir = 0; } } return result; } static int process_entry (struct ftw_data *data, struct dir_data *dir, const char *name, size_t namlen) { struct STAT st; int result = 0; int flag = 0; size_t new_buflen; if (name[0] == '.' && (name[1] == '\0' || (name[1] == '.' && name[2] == '\0'))) /* Don't process the "." and ".." entries. */ return 0; new_buflen = data->ftw.base + namlen + 2; if (data->dirbufsize < new_buflen) { /* Enlarge the buffer. */ char *newp; data->dirbufsize = 2 * new_buflen; newp = (char *) realloc (data->dirbuf, data->dirbufsize); if (newp == NULL) return -1; data->dirbuf = newp; } *((char *) __mempcpy (data->dirbuf + data->ftw.base, name, namlen)) = '\0'; int statres; if (dir->streamfd != -1) statres = FXSTATAT (_STAT_VER, dir->streamfd, name, &st, (data->flags & FTW_PHYS) ? AT_SYMLINK_NOFOLLOW : 0); else { if ((data->flags & FTW_CHDIR) == 0) name = data->dirbuf; statres = ((data->flags & FTW_PHYS) ? LXSTAT (_STAT_VER, name, &st) : XSTAT (_STAT_VER, name, &st)); } if (statres < 0) { if (errno != EACCES && errno != ENOENT) result = -1; else if (data->flags & FTW_PHYS) flag = FTW_NS; else { if (dir->streamfd != -1) statres = FXSTATAT (_STAT_VER, dir->streamfd, name, &st, AT_SYMLINK_NOFOLLOW); else statres = LXSTAT (_STAT_VER, name, &st); if (statres == 0 && S_ISLNK (st.st_mode)) flag = FTW_SLN; else flag = FTW_NS; } } else { if (S_ISDIR (st.st_mode)) flag = FTW_D; else if (S_ISLNK (st.st_mode)) flag = FTW_SL; else flag = FTW_F; } if (result == 0 && (flag == FTW_NS || !(data->flags & FTW_MOUNT) || st.st_dev == data->dev)) { if (flag == FTW_D) { if ((data->flags & FTW_PHYS) || (!find_object (data, &st) /* Remember the object. */ && (result = add_object (data, &st)) == 0)) result = ftw_dir (data, &st, dir); } else result = (*data->func) (data->dirbuf, &st, data->cvt_arr[flag], &data->ftw); } if ((data->flags & FTW_ACTIONRETVAL) && result == FTW_SKIP_SUBTREE) result = 0; return result; } static int ftw_dir (struct ftw_data *data, struct STAT *st, struct dir_data *old_dir) { struct dir_data dir; struct dirent64 *d; int previous_base = data->ftw.base; int result; char *startp; /* Open the stream for this directory. This might require that another stream has to be closed. */ result = open_dir_stream (old_dir == NULL ? NULL : &old_dir->streamfd, data, &dir); if (result != 0) { if (errno == EACCES) /* We cannot read the directory. Signal this with a special flag. */ result = (*data->func) (data->dirbuf, st, FTW_DNR, &data->ftw); return result; } /* First, report the directory (if not depth-first). */ if (!(data->flags & FTW_DEPTH)) { result = (*data->func) (data->dirbuf, st, FTW_D, &data->ftw); if (result != 0) { int save_err; fail: save_err = errno; __closedir (dir.stream); dir.streamfd = -1; __set_errno (save_err); if (data->actdir-- == 0) data->actdir = data->maxdir - 1; data->dirstreams[data->actdir] = NULL; return result; } } /* If necessary, change to this directory. */ if (data->flags & FTW_CHDIR) { if (__fchdir (dirfd (dir.stream)) < 0) { result = -1; goto fail; } } /* Next, update the `struct FTW' information. */ ++data->ftw.level; startp = data->dirbuf + strlen(data->dirbuf); /* There always must be a directory name. */ assert (startp != data->dirbuf); if (startp[-1] != '/') *startp++ = '/'; data->ftw.base = startp - data->dirbuf; while (dir.stream != NULL && (d = __readdir64 (dir.stream)) != NULL) { result = process_entry (data, &dir, d->d_name, NAMLEN (d)); if (result != 0) break; } if (dir.stream != NULL) { /* The stream is still open. I.e., we did not need more descriptors. Simply close the stream now. */ int save_err = errno; assert (dir.content == NULL); __closedir (dir.stream); dir.streamfd = -1; __set_errno (save_err); if (data->actdir-- == 0) data->actdir = data->maxdir - 1; data->dirstreams[data->actdir] = NULL; } else { int save_err; char *runp = dir.content; while (result == 0 && *runp != '\0') { char *endp = strchr (runp, '\0'); // XXX Should store the d_type values as well?! result = process_entry (data, &dir, runp, endp - runp); runp = endp + 1; } save_err = errno; free (dir.content); __set_errno (save_err); } if ((data->flags & FTW_ACTIONRETVAL) && result == FTW_SKIP_SIBLINGS) result = 0; /* Prepare the return, revert the `struct FTW' information. */ data->dirbuf[data->ftw.base - 1] = '\0'; --data->ftw.level; if (upfunc) (*upfunc)(); data->ftw.base = previous_base; /* Finally, if we process depth-first report the directory. */ if (result == 0 && (data->flags & FTW_DEPTH)) result = (*data->func) (data->dirbuf, st, FTW_DP, &data->ftw); if (old_dir && (data->flags & FTW_CHDIR) && (result == 0 || ((data->flags & FTW_ACTIONRETVAL) && (result != -1 && result != FTW_STOP)))) { /* Change back to the parent directory. */ int done = 0; if (old_dir->stream != NULL) if (__fchdir (dirfd (old_dir->stream)) == 0) done = 1; if (!done) { if (data->ftw.base == 1) { if (__chdir ("/") < 0) result = -1; } else if (__chdir ("..") < 0) result = -1; } } return result; } static int ftw_startup (const char *dir, int is_nftw, void *func, dir_notification_func_t up, int descriptors, int flags) { struct ftw_data data; struct STAT st; int result = 0; int save_err; int cwdfd = -1; char *cwd = NULL; char *cp; upfunc = up; /* First make sure the parameters are reasonable. */ if (dir[0] == '\0') { __set_errno (ENOENT); return -1; } data.maxdir = descriptors < 1 ? 1 : descriptors; data.actdir = 0; data.dirstreams = (struct dir_data **) alloca (data.maxdir * sizeof (struct dir_data *)); memset (data.dirstreams, '\0', data.maxdir * sizeof (struct dir_data *)); /* PATH_MAX is always defined when we get here. */ data.dirbufsize = MAX (2 * strlen (dir), PATH_MAX); data.dirbuf = (char *) malloc (data.dirbufsize); if (data.dirbuf == NULL) return -1; cp = mystpcpy (data.dirbuf, dir); /* Strip trailing slashes. */ while (cp > data.dirbuf + 1 && cp[-1] == '/') --cp; *cp = '\0'; data.ftw.level = 0; /* Find basename. */ while (cp > data.dirbuf && cp[-1] != '/') --cp; data.ftw.base = cp - data.dirbuf; data.flags = flags; /* This assignment might seem to be strange but it is what we want. The trick is that the first three arguments to the `ftw' and `nftw' callback functions are equal. Therefore we can call in every case the callback using the format of the `nftw' version and get the correct result since the stack layout for a function call in C allows this. */ data.func = (NFTW_FUNC_T) func; /* Since we internally use the complete set of FTW_* values we need to reduce the value range before calling a `ftw' callback. */ data.cvt_arr = is_nftw ? nftw_arr : ftw_arr; /* No object known so far. */ data.known_objects = NULL; /* Now go to the directory containing the initial file/directory. */ if (flags & FTW_CHDIR) { /* We have to be able to go back to the current working directory. The best way to do this is to use a file descriptor. */ cwdfd = open (".", O_RDONLY); if (cwdfd == -1) { /* Try getting the directory name. This can be needed if the current directory is executable but not readable. */ if (errno == EACCES) /* GNU extension ahead. */ cwd = __getcwd(NULL, 0); if (cwd == NULL) goto out_fail; } else if (data.maxdir > 1) /* Account for the file descriptor we use here. */ --data.maxdir; if (data.ftw.base > 0) { /* Change to the directory the file is in. In data.dirbuf we have a writable copy of the file name. Just NUL terminate it for now and change the directory. */ if (data.ftw.base == 1) /* I.e., the file is in the root directory. */ result = __chdir ("/"); else { char ch = data.dirbuf[data.ftw.base - 1]; data.dirbuf[data.ftw.base - 1] = '\0'; result = __chdir (data.dirbuf); data.dirbuf[data.ftw.base - 1] = ch; } } } /* Get stat info for start directory. */ if (result == 0) { const char *name; if (data.flags & FTW_CHDIR) { name = data.dirbuf + data.ftw.base; if (name[0] == '\0') name = "."; } else name = data.dirbuf; if (((flags & FTW_PHYS) ? LXSTAT (_STAT_VER, name, &st) : XSTAT (_STAT_VER, name, &st)) < 0) { if (!(flags & FTW_PHYS) && errno == ENOENT && LXSTAT (_STAT_VER, name, &st) == 0 && S_ISLNK (st.st_mode)) result = (*data.func) (data.dirbuf, &st, data.cvt_arr[FTW_SLN], &data.ftw); else /* No need to call the callback since we cannot say anything about the object. */ result = -1; } else { if (S_ISDIR (st.st_mode)) { /* Remember the device of the initial directory in case FTW_MOUNT is given. */ data.dev = st.st_dev; /* We know this directory now. */ if (!(flags & FTW_PHYS)) result = add_object (&data, &st); if (result == 0) result = ftw_dir (&data, &st, NULL); } else { int flag = S_ISLNK (st.st_mode) ? FTW_SL : FTW_F; result = (*data.func) (data.dirbuf, &st, data.cvt_arr[flag], &data.ftw); } } if ((flags & FTW_ACTIONRETVAL) && (result == FTW_SKIP_SUBTREE || result == FTW_SKIP_SIBLINGS)) result = 0; } /* Return to the start directory (if necessary). */ if (cwdfd != -1) { int save_err = errno; __fchdir (cwdfd); close(cwdfd); __set_errno (save_err); } else if (cwd != NULL) { int save_err = errno; __chdir (cwd); free (cwd); __set_errno (save_err); } /* Free all memory. */ out_fail: save_err = errno; mytdestroy (data.known_objects, free); free (data.dirbuf); __set_errno (save_err); return result; } /* Entry points. */ int NFTW_NAME(const char *path, NFTW_FUNC_T func, dir_notification_func_t up, int descriptors, int flags) { return ftw_startup (path, 1, func, up, descriptors, flags); } netatalk-2.2.2/libatalk/util/bprint.c0000644000175200017500000000165411655731127014463 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef DEBUG1 #include #include #include #include #include static const char hexdig[] = "0123456789ABCDEF"; #define BPXLEN 50 #define BPALEN 18 void bprint( data, len ) char *data; int len; { char xout[ BPXLEN ], aout[ BPALEN ]; int i; memset( xout, 0, BPXLEN ); memset( aout, 0, BPALEN ); for ( i = 0; len; len--, data++, i++ ) { if ( i == 16 ) { printf( "%-48s\t%-16s\n", xout, aout ); memset( xout, 0, BPXLEN ); memset( aout, 0, BPALEN ); i = 0; } if (isprint( (unsigned char)*data )) { aout[ i ] = *data; } else { aout[ i ] = '.'; } xout[ (i*3) ] = hexdig[ ( *data & 0xf0 ) >> 4 ]; xout[ (i*3) + 1 ] = hexdig[ *data & 0x0f ]; xout[ (i*3) + 2 ] = ' '; } if ( i ) printf( "%-48s\t%-16s\n", xout, aout ); printf("(end)\n"); } #endif netatalk-2.2.2/libatalk/tdb/0000777000175200017500000000000011704770421012666 500000000000000netatalk-2.2.2/libatalk/tdb/Makefile.am0000644000175200017500000000023611655731127014644 00000000000000# Makefile.am for libatalk/tdb/ noinst_LTLIBRARIES = libtdb.la libtdb_la_SOURCES = tdb.c \ spinlock.c \ spinlock.h netatalk-2.2.2/libatalk/tdb/Makefile.in0000644000175200017500000003715511703521730014656 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/tdb/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = libatalk/tdb DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libtdb_la_LIBADD = am_libtdb_la_OBJECTS = tdb.lo spinlock.lo libtdb_la_OBJECTS = $(am_libtdb_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libtdb_la_SOURCES) DIST_SOURCES = $(libtdb_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libtdb.la libtdb_la_SOURCES = tdb.c \ spinlock.c \ spinlock.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/tdb/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/tdb/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libtdb.la: $(libtdb_la_OBJECTS) $(libtdb_la_DEPENDENCIES) $(LINK) $(libtdb_la_OBJECTS) $(libtdb_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spinlock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tdb.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/tdb/tdb.c0000644000175200017500000015343611655731127013540 00000000000000 /* Unix SMB/CIFS implementation. Samba database functions Copyright (C) Andrew Tridgell 1999-2000 Copyright (C) Luke Kenneth Casson Leighton 2000 Copyright (C) Paul `Rusty' Russell 2000 Copyright (C) Jeremy Allison 2000-2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define STANDALONE 1 /* NOTE: If you use tdbs under valgrind, and in particular if you run * tdbtorture, you may get spurious "uninitialized value" warnings. I * think this is because valgrind doesn't understand that the mmap'd * area may be written to by other processes. Memory can, from the * point of view of the grinded process, spontaneously become * initialized. * * I can think of a few solutions. [mbp 20030311] * * 1 - Write suppressions for Valgrind so that it doesn't complain * about this. Probably the most reasonable but people need to * remember to use them. * * 2 - Use IO not mmap when running under valgrind. Not so nice. * * 3 - Use the special valgrind macros to mark memory as valid at the * right time. Probably too hard -- the process just doesn't know. */ #ifdef STANDALONE #if HAVE_CONFIG_H #include #endif #define _XOPEN_SOURCE 600 #include #include #include #include #include #include #include #include #include #include #include #include "spinlock.h" #else #include "includes.h" #endif #define TDB_MAGIC_FOOD "TDB file\n" #define TDB_VERSION (0x26011967 + 6) #define TDB_MAGIC (0x26011999U) #define TDB_FREE_MAGIC (~TDB_MAGIC) #define TDB_DEAD_MAGIC (0xFEE1DEAD) #define TDB_ALIGNMENT 4 #define MIN_REC_SIZE (2*sizeof(struct list_struct) + TDB_ALIGNMENT) #define DEFAULT_HASH_SIZE 131 #define TDB_PAGE_SIZE 0x2000 #define FREELIST_TOP (sizeof(struct tdb_header)) #define TDB_ALIGN(x,a) (((x) + (a)-1) & ~((a)-1)) #define TDB_BYTEREV(x) (((((x)&0xff)<<24)|((x)&0xFF00)<<8)|(((x)>>8)&0xFF00)|((x)>>24)) #define TDB_DEAD(r) ((r)->magic == TDB_DEAD_MAGIC) #define TDB_BAD_MAGIC(r) ((r)->magic != TDB_MAGIC && !TDB_DEAD(r)) #define TDB_HASH_TOP(hash) (FREELIST_TOP + (BUCKET(hash)+1)*sizeof(tdb_off)) /* NB assumes there is a local variable called "tdb" that is the * current context, also takes doubly-parenthesized print-style * argument. */ #define TDB_LOG(x) (tdb->log_fn?((tdb->log_fn x),0) : 0) /* lock offsets */ #define GLOBAL_LOCK 0 #define ACTIVE_LOCK 4 #ifndef MAP_FILE #define MAP_FILE 0 #endif #ifndef MAP_FAILED #define MAP_FAILED ((void *)-1) #endif /* free memory if the pointer is valid and zero the pointer */ #ifndef SAFE_FREE #define SAFE_FREE(x) do { if ((x) != NULL) {free((x)); (x)=NULL;} } while(0) #endif #define BUCKET(hash) ((hash) % tdb->header.hash_size) TDB_DATA tdb_null; /* all contexts, to ensure no double-opens (fcntl locks don't nest!) */ static TDB_CONTEXT *tdbs = NULL; static int tdb_munmap(TDB_CONTEXT *tdb) { if (tdb->flags & TDB_INTERNAL) return 0; #ifdef HAVE_MMAP if (tdb->map_ptr) { int ret = munmap(tdb->map_ptr, tdb->map_size); if (ret != 0) return ret; } #endif tdb->map_ptr = NULL; return 0; } static void tdb_mmap(TDB_CONTEXT *tdb) { if (tdb->flags & TDB_INTERNAL) return; #ifdef HAVE_MMAP if (!(tdb->flags & TDB_NOMMAP)) { tdb->map_ptr = mmap(NULL, tdb->map_size, PROT_READ|(tdb->read_only? 0:PROT_WRITE), MAP_SHARED|MAP_FILE, tdb->fd, 0); /* * NB. When mmap fails it returns MAP_FAILED *NOT* NULL !!!! */ if (tdb->map_ptr == MAP_FAILED) { tdb->map_ptr = NULL; TDB_LOG((tdb, 2, "tdb_mmap failed for size %d (%s)\n", tdb->map_size, strerror(errno))); } } else { tdb->map_ptr = NULL; } #else tdb->map_ptr = NULL; #endif } /* Endian conversion: we only ever deal with 4 byte quantities */ static void *convert(void *buf, u32 size) { u32 i, *p = buf; for (i = 0; i < size / 4; i++) p[i] = TDB_BYTEREV(p[i]); return buf; } #define DOCONV() (tdb->flags & TDB_CONVERT) #define CONVERT(x) (DOCONV() ? convert(&x, sizeof(x)) : &x) /* the body of the database is made of one list_struct for the free space plus a separate data list for each hash value */ struct list_struct { tdb_off next; /* offset of the next record in the list */ tdb_len rec_len; /* total byte length of record */ tdb_len key_len; /* byte length of key */ tdb_len data_len; /* byte length of data */ u32 full_hash; /* the full 32 bit hash of the key */ u32 magic; /* try to catch errors */ /* the following union is implied: union { char record[rec_len]; struct { char key[key_len]; char data[data_len]; } u32 totalsize; (tailer) } */ }; /*************************************************************** Allow a caller to set a "alarm" flag that tdb can check to abort a blocking lock on SIGALRM. ***************************************************************/ static sig_atomic_t *palarm_fired; void tdb_set_lock_alarm(sig_atomic_t *palarm) { palarm_fired = palarm; } /* a byte range locking function - return 0 on success this functions locks/unlocks 1 byte at the specified offset. On error, errno is also set so that errors are passed back properly through tdb_open(). */ static int tdb_brlock(TDB_CONTEXT *tdb, tdb_off offset, int rw_type, int lck_type, int probe) { struct flock fl; int ret; if (tdb->flags & TDB_NOLOCK) return 0; if ((rw_type == F_WRLCK) && (tdb->read_only)) { errno = EACCES; return -1; } fl.l_type = rw_type; fl.l_whence = SEEK_SET; fl.l_start = offset; fl.l_len = 1; fl.l_pid = 0; do { ret = fcntl(tdb->fd,lck_type,&fl); if (ret == -1 && errno == EINTR && palarm_fired && *palarm_fired) break; } while (ret == -1 && errno == EINTR); if (ret == -1) { if (!probe && lck_type != F_SETLK) { /* Ensure error code is set for log fun to examine. */ if (errno == EINTR && palarm_fired && *palarm_fired) tdb->ecode = TDB_ERR_LOCK_TIMEOUT; else tdb->ecode = TDB_ERR_LOCK; TDB_LOG((tdb, 5,"tdb_brlock failed (fd=%d) at offset %d rw_type=%d lck_type=%d\n", tdb->fd, offset, rw_type, lck_type)); } /* Was it an alarm timeout ? */ if (errno == EINTR && palarm_fired && *palarm_fired) return TDB_ERRCODE(TDB_ERR_LOCK_TIMEOUT, -1); /* Otherwise - generic lock error. */ /* errno set by fcntl */ return TDB_ERRCODE(TDB_ERR_LOCK, -1); } return 0; } /* lock a list in the database. list -1 is the alloc list */ static int tdb_lock(TDB_CONTEXT *tdb, int list, int ltype) { if (list < -1 || list >= (int)tdb->header.hash_size) { TDB_LOG((tdb, 0,"tdb_lock: invalid list %d for ltype=%d\n", list, ltype)); return -1; } if (tdb->flags & TDB_NOLOCK) return 0; /* Since fcntl locks don't nest, we do a lock for the first one, and simply bump the count for future ones */ if (tdb->locked[list+1].count == 0) { if (!tdb->read_only && tdb->header.rwlocks) { if (tdb_spinlock(tdb, list, ltype)) { TDB_LOG((tdb, 0, "tdb_lock spinlock failed on list ltype=%d\n", list, ltype)); return -1; } } else if (tdb_brlock(tdb,FREELIST_TOP+4*list,ltype,F_SETLKW, 0)) { TDB_LOG((tdb, 0,"tdb_lock failed on list %d ltype=%d (%s)\n", list, ltype, strerror(errno))); return -1; } tdb->locked[list+1].ltype = ltype; } tdb->locked[list+1].count++; return 0; } /* unlock the database: returns void because it's too late for errors. */ /* changed to return int it may be interesting to know there has been an error --simo */ static int tdb_unlock(TDB_CONTEXT *tdb, int list, int ltype) { int ret = -1; if (tdb->flags & TDB_NOLOCK) return 0; /* Sanity checks */ if (list < -1 || list >= (int)tdb->header.hash_size) { TDB_LOG((tdb, 0, "tdb_unlock: list %d invalid (%d)\n", list, tdb->header.hash_size)); return ret; } if (tdb->locked[list+1].count==0) { TDB_LOG((tdb, 0, "tdb_unlock: count is 0\n")); return ret; } if (tdb->locked[list+1].count == 1) { /* Down to last nested lock: unlock underneath */ if (!tdb->read_only && tdb->header.rwlocks) { ret = tdb_spinunlock(tdb, list, ltype); } else { ret = tdb_brlock(tdb, FREELIST_TOP+4*list, F_UNLCK, F_SETLKW, 0); } } else { ret = 0; } tdb->locked[list+1].count--; if (ret) TDB_LOG((tdb, 0,"tdb_unlock: An error occurred unlocking!\n")); return ret; } /* This is based on the hash algorithm from gdbm */ static u32 tdb_hash(TDB_DATA *key) { u32 value; /* Used to compute the hash value. */ u32 i; /* Used to cycle through random values. */ /* Set the initial value from the key size. */ for (value = 0x238F13AF * key->dsize, i=0; i < key->dsize; i++) value = (value + (key->dptr[i] << (i*5 % 24))); return (1103515243 * value + 12345); } /* check for an out of bounds access - if it is out of bounds then see if the database has been expanded by someone else and expand if necessary note that "len" is the minimum length needed for the db */ static int tdb_oob(TDB_CONTEXT *tdb, tdb_off len, int probe) { struct stat st; if (len <= tdb->map_size) return 0; if (tdb->flags & TDB_INTERNAL) { if (!probe) { /* Ensure ecode is set for log fn. */ tdb->ecode = TDB_ERR_IO; TDB_LOG((tdb, 0,"tdb_oob len %d beyond internal malloc size %d\n", (int)len, (int)tdb->map_size)); } return TDB_ERRCODE(TDB_ERR_IO, -1); } if (fstat(tdb->fd, &st) == -1) return TDB_ERRCODE(TDB_ERR_IO, -1); if (st.st_size < (size_t)len) { if (!probe) { /* Ensure ecode is set for log fn. */ tdb->ecode = TDB_ERR_IO; TDB_LOG((tdb, 0,"tdb_oob len %d beyond eof at %d\n", (int)len, (int)st.st_size)); } return TDB_ERRCODE(TDB_ERR_IO, -1); } /* Unmap, update size, remap */ if (tdb_munmap(tdb) == -1) return TDB_ERRCODE(TDB_ERR_IO, -1); tdb->map_size = st.st_size; tdb_mmap(tdb); return 0; } /* write a lump of data at a specified offset */ static int tdb_write(TDB_CONTEXT *tdb, tdb_off off, void *buf, tdb_len len) { if (tdb_oob(tdb, off + len, 0) != 0) return -1; if (tdb->map_ptr) memcpy(off + (char *)tdb->map_ptr, buf, len); #ifdef HAVE_PWRITE else if (pwrite(tdb->fd, buf, len, off) != (ssize_t)len) { #else else if (lseek(tdb->fd, off, SEEK_SET) != off || write(tdb->fd, buf, len) != (ssize_t)len) { #endif /* Ensure ecode is set for log fn. */ tdb->ecode = TDB_ERR_IO; TDB_LOG((tdb, 0,"tdb_write failed at %d len=%d (%s)\n", off, len, strerror(errno))); return TDB_ERRCODE(TDB_ERR_IO, -1); } return 0; } /* read a lump of data at a specified offset, maybe convert */ static int tdb_read(TDB_CONTEXT *tdb,tdb_off off,void *buf,tdb_len len,int cv) { if (tdb_oob(tdb, off + len, 0) != 0) return -1; if (tdb->map_ptr) memcpy(buf, off + (char *)tdb->map_ptr, len); #ifdef HAVE_PREAD else if (pread(tdb->fd, buf, len, off) != (ssize_t)len) { #else else if (lseek(tdb->fd, off, SEEK_SET) != off || read(tdb->fd, buf, len) != (ssize_t)len) { #endif /* Ensure ecode is set for log fn. */ tdb->ecode = TDB_ERR_IO; TDB_LOG((tdb, 0,"tdb_read failed at %d len=%d (%s)\n", off, len, strerror(errno))); return TDB_ERRCODE(TDB_ERR_IO, -1); } if (cv) convert(buf, len); return 0; } /* read a lump of data, allocating the space for it */ static char *tdb_alloc_read(TDB_CONTEXT *tdb, tdb_off offset, tdb_len len) { char *buf; if (!(buf = malloc(len))) { /* Ensure ecode is set for log fn. */ tdb->ecode = TDB_ERR_OOM; TDB_LOG((tdb, 0,"tdb_alloc_read malloc failed len=%d (%s)\n", len, strerror(errno))); return TDB_ERRCODE(TDB_ERR_OOM, buf); } if (tdb_read(tdb, offset, buf, len, 0) == -1) { SAFE_FREE(buf); return NULL; } return buf; } /* read/write a tdb_off */ static int ofs_read(TDB_CONTEXT *tdb, tdb_off offset, tdb_off *d) { return tdb_read(tdb, offset, (char*)d, sizeof(*d), DOCONV()); } static int ofs_write(TDB_CONTEXT *tdb, tdb_off offset, tdb_off *d) { tdb_off off = *d; return tdb_write(tdb, offset, CONVERT(off), sizeof(*d)); } /* read/write a record */ static int rec_read(TDB_CONTEXT *tdb, tdb_off offset, struct list_struct *rec) { if (tdb_read(tdb, offset, rec, sizeof(*rec),DOCONV()) == -1) return -1; if (TDB_BAD_MAGIC(rec)) { /* Ensure ecode is set for log fn. */ tdb->ecode = TDB_ERR_CORRUPT; TDB_LOG((tdb, 0,"rec_read bad magic 0x%x at offset=%d\n", rec->magic, offset)); return TDB_ERRCODE(TDB_ERR_CORRUPT, -1); } return tdb_oob(tdb, rec->next+sizeof(*rec), 0); } static int rec_write(TDB_CONTEXT *tdb, tdb_off offset, struct list_struct *rec) { struct list_struct r = *rec; return tdb_write(tdb, offset, CONVERT(r), sizeof(r)); } /* read a freelist record and check for simple errors */ static int rec_free_read(TDB_CONTEXT *tdb, tdb_off off, struct list_struct *rec) { if (tdb_read(tdb, off, rec, sizeof(*rec),DOCONV()) == -1) return -1; if (rec->magic == TDB_MAGIC) { /* this happens when a app is showdown while deleting a record - we should not completely fail when this happens */ TDB_LOG((tdb, 0,"rec_free_read non-free magic at offset=%d - fixing\n", rec->magic, off)); rec->magic = TDB_FREE_MAGIC; if (tdb_write(tdb, off, rec, sizeof(*rec)) == -1) return -1; } if (rec->magic != TDB_FREE_MAGIC) { /* Ensure ecode is set for log fn. */ tdb->ecode = TDB_ERR_CORRUPT; TDB_LOG((tdb, 0,"rec_free_read bad magic 0x%x at offset=%d\n", rec->magic, off)); return TDB_ERRCODE(TDB_ERR_CORRUPT, -1); } if (tdb_oob(tdb, rec->next+sizeof(*rec), 0) != 0) return -1; return 0; } /* update a record tailer (must hold allocation lock) */ static int update_tailer(TDB_CONTEXT *tdb, tdb_off offset, const struct list_struct *rec) { tdb_off totalsize; /* Offset of tailer from record header */ totalsize = sizeof(*rec) + rec->rec_len; return ofs_write(tdb, offset + totalsize - sizeof(tdb_off), &totalsize); } static tdb_off tdb_dump_record(TDB_CONTEXT *tdb, tdb_off offset) { struct list_struct rec; tdb_off tailer_ofs, tailer; if (tdb_read(tdb, offset, (char *)&rec, sizeof(rec), DOCONV()) == -1) { printf("ERROR: failed to read record at %u\n", offset); return 0; } printf(" rec: offset=%u next=%d rec_len=%d key_len=%d data_len=%d full_hash=0x%x magic=0x%x\n", offset, rec.next, rec.rec_len, rec.key_len, rec.data_len, rec.full_hash, rec.magic); tailer_ofs = offset + sizeof(rec) + rec.rec_len - sizeof(tdb_off); if (ofs_read(tdb, tailer_ofs, &tailer) == -1) { printf("ERROR: failed to read tailer at %u\n", tailer_ofs); return rec.next; } if (tailer != rec.rec_len + sizeof(rec)) { printf("ERROR: tailer does not match record! tailer=%u totalsize=%u\n", (unsigned)tailer, (unsigned)(rec.rec_len + sizeof(rec))); } return rec.next; } static int tdb_dump_chain(TDB_CONTEXT *tdb, int i) { tdb_off rec_ptr, top; top = TDB_HASH_TOP(i); if (tdb_lock(tdb, i, F_WRLCK) != 0) return -1; if (ofs_read(tdb, top, &rec_ptr) == -1) return tdb_unlock(tdb, i, F_WRLCK); if (rec_ptr) printf("hash=%d\n", i); while (rec_ptr) { rec_ptr = tdb_dump_record(tdb, rec_ptr); } return tdb_unlock(tdb, i, F_WRLCK); } void tdb_dump_all(TDB_CONTEXT *tdb) { unsigned int i; for (i=0;iheader.hash_size;i++) { tdb_dump_chain(tdb, i); } printf("freelist:\n"); tdb_dump_chain(tdb, -1); } int tdb_printfreelist(TDB_CONTEXT *tdb) { int ret; long total_free = 0; tdb_off offset, rec_ptr; struct list_struct rec; if ((ret = tdb_lock(tdb, -1, F_WRLCK)) != 0) return ret; offset = FREELIST_TOP; /* read in the freelist top */ if (ofs_read(tdb, offset, &rec_ptr) == -1) { tdb_unlock(tdb, -1, F_WRLCK); return 0; } printf("freelist top=[0x%08x]\n", rec_ptr ); while (rec_ptr) { if (tdb_read(tdb, rec_ptr, (char *)&rec, sizeof(rec), DOCONV()) == -1) { tdb_unlock(tdb, -1, F_WRLCK); return -1; } if (rec.magic != TDB_FREE_MAGIC) { printf("bad magic 0x%08x in free list\n", rec.magic); tdb_unlock(tdb, -1, F_WRLCK); return -1; } printf("entry offset=[0x%08x], rec.rec_len = [0x%08x (%d)]\n", rec.next, rec.rec_len, rec.rec_len ); total_free += rec.rec_len; /* move to the next record */ rec_ptr = rec.next; } printf("total rec_len = [0x%08x (%d)]\n", (int)total_free, (int)total_free); return tdb_unlock(tdb, -1, F_WRLCK); } /* Remove an element from the freelist. Must have alloc lock. */ static int remove_from_freelist(TDB_CONTEXT *tdb, tdb_off off, tdb_off next) { tdb_off last_ptr, i; /* read in the freelist top */ last_ptr = FREELIST_TOP; while (ofs_read(tdb, last_ptr, &i) != -1 && i != 0) { if (i == off) { /* We've found it! */ return ofs_write(tdb, last_ptr, &next); } /* Follow chain (next offset is at start of record) */ last_ptr = i; } TDB_LOG((tdb, 0,"remove_from_freelist: not on list at off=%d\n", off)); return TDB_ERRCODE(TDB_ERR_CORRUPT, -1); } /* Add an element into the freelist. Merge adjacent records if neccessary. */ static int tdb_free(TDB_CONTEXT *tdb, tdb_off offset, struct list_struct *rec) { tdb_off right, left; /* Allocation and tailer lock */ if (tdb_lock(tdb, -1, F_WRLCK) != 0) return -1; /* set an initial tailer, so if we fail we don't leave a bogus record */ if (update_tailer(tdb, offset, rec) != 0) { TDB_LOG((tdb, 0, "tdb_free: upfate_tailer failed!\n")); goto fail; } /* Look right first (I'm an Australian, dammit) */ right = offset + sizeof(*rec) + rec->rec_len; if (right + sizeof(*rec) <= tdb->map_size) { struct list_struct r; if (tdb_read(tdb, right, &r, sizeof(r), DOCONV()) == -1) { TDB_LOG((tdb, 0, "tdb_free: right read failed at %u\n", right)); goto left; } /* If it's free, expand to include it. */ if (r.magic == TDB_FREE_MAGIC) { if (remove_from_freelist(tdb, right, r.next) == -1) { TDB_LOG((tdb, 0, "tdb_free: right free failed at %u\n", right)); goto left; } rec->rec_len += sizeof(r) + r.rec_len; } } left: /* Look left */ left = offset - sizeof(tdb_off); if (left > TDB_HASH_TOP(tdb->header.hash_size-1)) { struct list_struct l; tdb_off leftsize; /* Read in tailer and jump back to header */ if (ofs_read(tdb, left, &leftsize) == -1) { TDB_LOG((tdb, 0, "tdb_free: left offset read failed at %u\n", left)); goto update; } left = offset - leftsize; /* Now read in record */ if (tdb_read(tdb, left, &l, sizeof(l), DOCONV()) == -1) { TDB_LOG((tdb, 0, "tdb_free: left read failed at %u (%u)\n", left, leftsize)); goto update; } /* If it's free, expand to include it. */ if (l.magic == TDB_FREE_MAGIC) { if (remove_from_freelist(tdb, left, l.next) == -1) { TDB_LOG((tdb, 0, "tdb_free: left free failed at %u\n", left)); goto update; } else { offset = left; rec->rec_len += leftsize; } } } update: if (update_tailer(tdb, offset, rec) == -1) { TDB_LOG((tdb, 0, "tdb_free: update_tailer failed at %u\n", offset)); goto fail; } /* Now, prepend to free list */ rec->magic = TDB_FREE_MAGIC; if (ofs_read(tdb, FREELIST_TOP, &rec->next) == -1 || rec_write(tdb, offset, rec) == -1 || ofs_write(tdb, FREELIST_TOP, &offset) == -1) { TDB_LOG((tdb, 0, "tdb_free record write failed at offset=%d\n", offset)); goto fail; } /* And we're done. */ tdb_unlock(tdb, -1, F_WRLCK); return 0; fail: tdb_unlock(tdb, -1, F_WRLCK); return -1; } /* expand a file. we prefer to use ftruncate, as that is what posix says to use for mmap expansion */ static int expand_file(TDB_CONTEXT *tdb, tdb_off size, tdb_off addition) { char buf[1024]; #if HAVE_FTRUNCATE_EXTEND if (ftruncate(tdb->fd, size+addition) != 0) { TDB_LOG((tdb, 0, "expand_file ftruncate to %d failed (%s)\n", size+addition, strerror(errno))); return -1; } #else char b = 0; #ifdef HAVE_PWRITE if (pwrite(tdb->fd, &b, 1, (size+addition) - 1) != 1) { #else if (lseek(tdb->fd, (size+addition) - 1, SEEK_SET) != (size+addition) - 1 || write(tdb->fd, &b, 1) != 1) { #endif TDB_LOG((tdb, 0, "expand_file to %d failed (%s)\n", size+addition, strerror(errno))); return -1; } #endif /* now fill the file with something. This ensures that the file isn't sparse, which would be very bad if we ran out of disk. This must be done with write, not via mmap */ memset(buf, 0x42, sizeof(buf)); while (addition) { int n = addition>sizeof(buf)?sizeof(buf):addition; #ifdef HAVE_PWRITE int ret = pwrite(tdb->fd, buf, n, size); #else int ret; if (lseek(tdb->fd, size, SEEK_SET) != size) return -1; ret = write(tdb->fd, buf, n); #endif if (ret != n) { TDB_LOG((tdb, 0, "expand_file write of %d failed (%s)\n", n, strerror(errno))); return -1; } addition -= n; size += n; } return 0; } /* expand the database at least size bytes by expanding the underlying file and doing the mmap again if necessary */ static int tdb_expand(TDB_CONTEXT *tdb, tdb_off size) { struct list_struct rec; tdb_off offset; if (tdb_lock(tdb, -1, F_WRLCK) == -1) { TDB_LOG((tdb, 0, "lock failed in tdb_expand\n")); return -1; } /* must know about any previous expansions by another process */ tdb_oob(tdb, tdb->map_size + 1, 1); /* always make room for at least 10 more records, and round the database up to a multiple of TDB_PAGE_SIZE */ size = TDB_ALIGN(tdb->map_size + size*10, TDB_PAGE_SIZE) - tdb->map_size; if (!(tdb->flags & TDB_INTERNAL)) tdb_munmap(tdb); /* * We must ensure the file is unmapped before doing this * to ensure consistency with systems like OpenBSD where * writes and mmaps are not consistent. */ /* expand the file itself */ if (!(tdb->flags & TDB_INTERNAL)) { if (expand_file(tdb, tdb->map_size, size) != 0) goto fail; } tdb->map_size += size; if (tdb->flags & TDB_INTERNAL) tdb->map_ptr = realloc(tdb->map_ptr, tdb->map_size); else { /* * We must ensure the file is remapped before adding the space * to ensure consistency with systems like OpenBSD where * writes and mmaps are not consistent. */ /* We're ok if the mmap fails as we'll fallback to read/write */ tdb_mmap(tdb); } /* form a new freelist record */ memset(&rec,'\0',sizeof(rec)); rec.rec_len = size - sizeof(rec); /* link it into the free list */ offset = tdb->map_size - size; if (tdb_free(tdb, offset, &rec) == -1) goto fail; tdb_unlock(tdb, -1, F_WRLCK); return 0; fail: tdb_unlock(tdb, -1, F_WRLCK); return -1; } /* allocate some space from the free list. The offset returned points to a unconnected list_struct within the database with room for at least length bytes of total data 0 is returned if the space could not be allocated */ static tdb_off tdb_allocate(TDB_CONTEXT *tdb, tdb_len length, struct list_struct *rec) { tdb_off rec_ptr, last_ptr, newrec_ptr; struct list_struct newrec; if (tdb_lock(tdb, -1, F_WRLCK) == -1) return 0; /* Extra bytes required for tailer */ length += sizeof(tdb_off); again: last_ptr = FREELIST_TOP; /* read in the freelist top */ if (ofs_read(tdb, FREELIST_TOP, &rec_ptr) == -1) goto fail; /* keep looking until we find a freelist record big enough */ while (rec_ptr) { if (rec_free_read(tdb, rec_ptr, rec) == -1) goto fail; if (rec->rec_len >= length) { /* found it - now possibly split it up */ if (rec->rec_len > length + MIN_REC_SIZE) { /* Length of left piece */ length = TDB_ALIGN(length, TDB_ALIGNMENT); /* Right piece to go on free list */ newrec.rec_len = rec->rec_len - (sizeof(*rec) + length); newrec_ptr = rec_ptr + sizeof(*rec) + length; /* And left record is shortened */ rec->rec_len = length; } else newrec_ptr = 0; /* Remove allocated record from the free list */ if (ofs_write(tdb, last_ptr, &rec->next) == -1) goto fail; /* Update header: do this before we drop alloc lock, otherwise tdb_free() might try to merge with us, thinking we're free. (Thanks Jeremy Allison). */ rec->magic = TDB_MAGIC; if (rec_write(tdb, rec_ptr, rec) == -1) goto fail; /* Did we create new block? */ if (newrec_ptr) { /* Update allocated record tailer (we shortened it). */ if (update_tailer(tdb, rec_ptr, rec) == -1) goto fail; /* Free new record */ if (tdb_free(tdb, newrec_ptr, &newrec) == -1) goto fail; } /* all done - return the new record offset */ tdb_unlock(tdb, -1, F_WRLCK); return rec_ptr; } /* move to the next record */ last_ptr = rec_ptr; rec_ptr = rec->next; } /* we didn't find enough space. See if we can expand the database and if we can then try again */ if (tdb_expand(tdb, length + sizeof(*rec)) == 0) goto again; fail: tdb_unlock(tdb, -1, F_WRLCK); return 0; } /* initialise a new database with a specified hash size */ static int tdb_new_database(TDB_CONTEXT *tdb, int hash_size) { struct tdb_header *newdb; int size, ret = -1; /* We make it up in memory, then write it out if not internal */ size = sizeof(struct tdb_header) + (hash_size+1)*sizeof(tdb_off); if (!(newdb = calloc(size, 1))) return TDB_ERRCODE(TDB_ERR_OOM, -1); /* Fill in the header */ newdb->version = TDB_VERSION; newdb->hash_size = hash_size; #ifdef USE_SPINLOCKS newdb->rwlocks = size; #endif if (tdb->flags & TDB_INTERNAL) { tdb->map_size = size; tdb->map_ptr = (char *)newdb; memcpy(&tdb->header, newdb, sizeof(tdb->header)); /* Convert the `ondisk' version if asked. */ CONVERT(*newdb); return 0; } if (lseek(tdb->fd, 0, SEEK_SET) == -1) goto fail; if (ftruncate(tdb->fd, 0) == -1) goto fail; /* This creates an endian-converted header, as if read from disk */ CONVERT(*newdb); memcpy(&tdb->header, newdb, sizeof(tdb->header)); /* Don't endian-convert the magic food! */ memcpy(newdb->magic_food, TDB_MAGIC_FOOD, strlen(TDB_MAGIC_FOOD)+1); if (write(tdb->fd, newdb, size) != size) ret = -1; else ret = tdb_create_rwlocks(tdb->fd, hash_size); fail: SAFE_FREE(newdb); return ret; } /* Returns 0 on fail. On success, return offset of record, and fills in rec */ static tdb_off tdb_find(TDB_CONTEXT *tdb, TDB_DATA key, u32 hash, struct list_struct *r) { tdb_off rec_ptr; /* read in the hash top */ if (ofs_read(tdb, TDB_HASH_TOP(hash), &rec_ptr) == -1) return 0; /* keep looking until we find the right record */ while (rec_ptr) { if (rec_read(tdb, rec_ptr, r) == -1) return 0; if (!TDB_DEAD(r) && hash==r->full_hash && key.dsize==r->key_len) { char *k; /* a very likely hit - read the key */ k = tdb_alloc_read(tdb, rec_ptr + sizeof(*r), r->key_len); if (!k) return 0; if (memcmp(key.dptr, k, key.dsize) == 0) { SAFE_FREE(k); return rec_ptr; } SAFE_FREE(k); } rec_ptr = r->next; } return TDB_ERRCODE(TDB_ERR_NOEXIST, 0); } /* If they do lockkeys, check that this hash is one they locked */ static int tdb_keylocked(TDB_CONTEXT *tdb, u32 hash) { u32 i; if (!tdb->lockedkeys) return 1; for (i = 0; i < tdb->lockedkeys[0]; i++) if (tdb->lockedkeys[i+1] == hash) return 1; return TDB_ERRCODE(TDB_ERR_NOLOCK, 0); } /* As tdb_find, but if you succeed, keep the lock */ static tdb_off tdb_find_lock(TDB_CONTEXT *tdb, TDB_DATA key, int locktype, struct list_struct *rec) { u32 hash, rec_ptr; hash = tdb_hash(&key); if (!tdb_keylocked(tdb, hash)) return 0; if (tdb_lock(tdb, BUCKET(hash), locktype) == -1) return 0; if (!(rec_ptr = tdb_find(tdb, key, hash, rec))) tdb_unlock(tdb, BUCKET(hash), locktype); return rec_ptr; } enum TDB_ERROR tdb_error(TDB_CONTEXT *tdb) { return tdb->ecode; } static struct tdb_errname { enum TDB_ERROR ecode; const char *estring; } emap[] = { {TDB_SUCCESS, "Success"}, {TDB_ERR_CORRUPT, "Corrupt database"}, {TDB_ERR_IO, "IO Error"}, {TDB_ERR_LOCK, "Locking error"}, {TDB_ERR_OOM, "Out of memory"}, {TDB_ERR_EXISTS, "Record exists"}, {TDB_ERR_NOLOCK, "Lock exists on other keys"}, {TDB_ERR_NOEXIST, "Record does not exist"} }; /* Error string for the last tdb error */ const char *tdb_errorstr(TDB_CONTEXT *tdb) { u32 i; for (i = 0; i < sizeof(emap) / sizeof(struct tdb_errname); i++) if (tdb->ecode == emap[i].ecode) return emap[i].estring; return "Invalid error code"; } /* update an entry in place - this only works if the new data size is <= the old data size and the key exists. on failure return -1. */ static int tdb_update(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf) { struct list_struct rec; tdb_off rec_ptr; /* find entry */ if (!(rec_ptr = tdb_find(tdb, key, tdb_hash(&key), &rec))) return -1; /* must be long enough key, data and tailer */ if (rec.rec_len < key.dsize + dbuf.dsize + sizeof(tdb_off)) { tdb->ecode = TDB_SUCCESS; /* Not really an error */ return -1; } if (tdb_write(tdb, rec_ptr + sizeof(rec) + rec.key_len, dbuf.dptr, dbuf.dsize) == -1) return -1; if (dbuf.dsize != rec.data_len) { /* update size */ rec.data_len = dbuf.dsize; return rec_write(tdb, rec_ptr, &rec); } return 0; } /* find an entry in the database given a key */ /* If an entry doesn't exist tdb_err will be set to * TDB_ERR_NOEXIST. If a key has no data attached * tdb_err will not be set. Both will return a * zero pptr and zero dsize. */ TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA key) { tdb_off rec_ptr; struct list_struct rec; TDB_DATA ret; /* find which hash bucket it is in */ if (!(rec_ptr = tdb_find_lock(tdb,key,F_RDLCK,&rec))) return tdb_null; if (rec.data_len) ret.dptr = tdb_alloc_read(tdb, rec_ptr + sizeof(rec) + rec.key_len, rec.data_len); else ret.dptr = NULL; ret.dsize = rec.data_len; tdb_unlock(tdb, BUCKET(rec.full_hash), F_RDLCK); return ret; } /* check if an entry in the database exists note that 1 is returned if the key is found and 0 is returned if not found this doesn't match the conventions in the rest of this module, but is compatible with gdbm */ int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key) { struct list_struct rec; if (tdb_find_lock(tdb, key, F_RDLCK, &rec) == 0) return 0; tdb_unlock(tdb, BUCKET(rec.full_hash), F_RDLCK); return 1; } /* record lock stops delete underneath */ static int lock_record(TDB_CONTEXT *tdb, tdb_off off) { return off ? tdb_brlock(tdb, off, F_RDLCK, F_SETLKW, 0) : 0; } /* Write locks override our own fcntl readlocks, so check it here. Note this is meant to be F_SETLK, *not* F_SETLKW, as it's not an error to fail to get the lock here. */ static int write_lock_record(TDB_CONTEXT *tdb, tdb_off off) { struct tdb_traverse_lock *i; for (i = &tdb->travlocks; i; i = i->next) if (i->off == off) return -1; return tdb_brlock(tdb, off, F_WRLCK, F_SETLK, 1); } /* Note this is meant to be F_SETLK, *not* F_SETLKW, as it's not an error to fail to get the lock here. */ static int write_unlock_record(TDB_CONTEXT *tdb, tdb_off off) { return tdb_brlock(tdb, off, F_UNLCK, F_SETLK, 0); } /* fcntl locks don't stack: avoid unlocking someone else's */ static int unlock_record(TDB_CONTEXT *tdb, tdb_off off) { struct tdb_traverse_lock *i; u32 count = 0; if (off == 0) return 0; for (i = &tdb->travlocks; i; i = i->next) if (i->off == off) count++; return (count == 1 ? tdb_brlock(tdb, off, F_UNLCK, F_SETLKW, 0) : 0); } /* actually delete an entry in the database given the offset */ static int do_delete(TDB_CONTEXT *tdb, tdb_off rec_ptr, struct list_struct*rec) { tdb_off last_ptr, i; struct list_struct lastrec; if (tdb->read_only) return -1; if (write_lock_record(tdb, rec_ptr) == -1) { /* Someone traversing here: mark it as dead */ rec->magic = TDB_DEAD_MAGIC; return rec_write(tdb, rec_ptr, rec); } if (write_unlock_record(tdb, rec_ptr) != 0) return -1; /* find previous record in hash chain */ if (ofs_read(tdb, TDB_HASH_TOP(rec->full_hash), &i) == -1) return -1; for (last_ptr = 0; i != rec_ptr; last_ptr = i, i = lastrec.next) if (rec_read(tdb, i, &lastrec) == -1) return -1; /* unlink it: next ptr is at start of record. */ if (last_ptr == 0) last_ptr = TDB_HASH_TOP(rec->full_hash); if (ofs_write(tdb, last_ptr, &rec->next) == -1) return -1; /* recover the space */ if (tdb_free(tdb, rec_ptr, rec) == -1) return -1; return 0; } /* Uses traverse lock: 0 = finish, -1 = error, other = record offset */ static int tdb_next_lock(TDB_CONTEXT *tdb, struct tdb_traverse_lock *tlock, struct list_struct *rec) { int want_next = (tlock->off != 0); /* No traversal allows if you've called tdb_lockkeys() */ if (tdb->lockedkeys) return TDB_ERRCODE(TDB_ERR_NOLOCK, -1); /* Lock each chain from the start one. */ for (; tlock->hash < tdb->header.hash_size; tlock->hash++) { if (tdb_lock(tdb, tlock->hash, F_WRLCK) == -1) return -1; /* No previous record? Start at top of chain. */ if (!tlock->off) { if (ofs_read(tdb, TDB_HASH_TOP(tlock->hash), &tlock->off) == -1) goto fail; } else { /* Otherwise unlock the previous record. */ if (unlock_record(tdb, tlock->off) != 0) goto fail; } if (want_next) { /* We have offset of old record: grab next */ if (rec_read(tdb, tlock->off, rec) == -1) goto fail; tlock->off = rec->next; } /* Iterate through chain */ while( tlock->off) { tdb_off current; if (rec_read(tdb, tlock->off, rec) == -1) goto fail; if (!TDB_DEAD(rec)) { /* Woohoo: we found one! */ if (lock_record(tdb, tlock->off) != 0) goto fail; return tlock->off; } /* Try to clean dead ones from old traverses */ current = tlock->off; tlock->off = rec->next; if (do_delete(tdb, current, rec) != 0) goto fail; } tdb_unlock(tdb, tlock->hash, F_WRLCK); want_next = 0; } /* We finished iteration without finding anything */ return TDB_ERRCODE(TDB_SUCCESS, 0); fail: tlock->off = 0; if (tdb_unlock(tdb, tlock->hash, F_WRLCK) != 0) TDB_LOG((tdb, 0, "tdb_next_lock: On error unlock failed!\n")); return -1; } /* traverse the entire database - calling fn(tdb, key, data) on each element. return -1 on error or the record count traversed if fn is NULL then it is not called a non-zero return value from fn() indicates that the traversal should stop */ int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *state) { TDB_DATA key, dbuf; struct list_struct rec; struct tdb_traverse_lock tl = { NULL, 0, 0 }; int ret, count = 0; /* This was in the initializaton, above, but the IRIX compiler * did not like it. crh */ tl.next = tdb->travlocks.next; /* fcntl locks don't stack: beware traverse inside traverse */ tdb->travlocks.next = &tl; /* tdb_next_lock places locks on the record returned, and its chain */ while ((ret = tdb_next_lock(tdb, &tl, &rec)) > 0) { count++; /* now read the full record */ key.dptr = tdb_alloc_read(tdb, tl.off + sizeof(rec), rec.key_len + rec.data_len); if (!key.dptr) { ret = -1; if (tdb_unlock(tdb, tl.hash, F_WRLCK) != 0) goto out; if (unlock_record(tdb, tl.off) != 0) TDB_LOG((tdb, 0, "tdb_traverse: key.dptr == NULL and unlock_record failed!\n")); goto out; } key.dsize = rec.key_len; dbuf.dptr = key.dptr + rec.key_len; dbuf.dsize = rec.data_len; /* Drop chain lock, call out */ if (tdb_unlock(tdb, tl.hash, F_WRLCK) != 0) { ret = -1; goto out; } if (fn && fn(tdb, key, dbuf, state)) { /* They want us to terminate traversal */ ret = count; if (unlock_record(tdb, tl.off) != 0) { TDB_LOG((tdb, 0, "tdb_traverse: unlock_record failed!\n"));; ret = -1; } tdb->travlocks.next = tl.next; SAFE_FREE(key.dptr); return count; } SAFE_FREE(key.dptr); } out: tdb->travlocks.next = tl.next; if (ret < 0) return -1; else return count; } /* find the first entry in the database and return its key */ TDB_DATA tdb_firstkey(TDB_CONTEXT *tdb) { TDB_DATA key; struct list_struct rec; /* release any old lock */ if (unlock_record(tdb, tdb->travlocks.off) != 0) return tdb_null; tdb->travlocks.off = tdb->travlocks.hash = 0; if (tdb_next_lock(tdb, &tdb->travlocks, &rec) <= 0) return tdb_null; /* now read the key */ key.dsize = rec.key_len; key.dptr =tdb_alloc_read(tdb,tdb->travlocks.off+sizeof(rec),key.dsize); if (tdb_unlock(tdb, BUCKET(tdb->travlocks.hash), F_WRLCK) != 0) TDB_LOG((tdb, 0, "tdb_firstkey: error occurred while tdb_unlocking!\n")); return key; } /* find the next entry in the database, returning its key */ TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA oldkey) { u32 oldhash; TDB_DATA key = tdb_null; struct list_struct rec; char *k = NULL; /* Is locked key the old key? If so, traverse will be reliable. */ if (tdb->travlocks.off) { if (tdb_lock(tdb,tdb->travlocks.hash,F_WRLCK)) return tdb_null; if (rec_read(tdb, tdb->travlocks.off, &rec) == -1 || !(k = tdb_alloc_read(tdb,tdb->travlocks.off+sizeof(rec), rec.key_len)) || memcmp(k, oldkey.dptr, oldkey.dsize) != 0) { /* No, it wasn't: unlock it and start from scratch */ if (unlock_record(tdb, tdb->travlocks.off) != 0) return tdb_null; if (tdb_unlock(tdb, tdb->travlocks.hash, F_WRLCK) != 0) return tdb_null; tdb->travlocks.off = 0; } SAFE_FREE(k); } if (!tdb->travlocks.off) { /* No previous element: do normal find, and lock record */ tdb->travlocks.off = tdb_find_lock(tdb, oldkey, F_WRLCK, &rec); if (!tdb->travlocks.off) return tdb_null; tdb->travlocks.hash = BUCKET(rec.full_hash); if (lock_record(tdb, tdb->travlocks.off) != 0) { TDB_LOG((tdb, 0, "tdb_nextkey: lock_record failed (%s)!\n", strerror(errno))); return tdb_null; } } oldhash = tdb->travlocks.hash; /* Grab next record: locks chain and returned record, unlocks old record */ if (tdb_next_lock(tdb, &tdb->travlocks, &rec) > 0) { key.dsize = rec.key_len; key.dptr = tdb_alloc_read(tdb, tdb->travlocks.off+sizeof(rec), key.dsize); /* Unlock the chain of this new record */ if (tdb_unlock(tdb, tdb->travlocks.hash, F_WRLCK) != 0) TDB_LOG((tdb, 0, "tdb_nextkey: WARNING tdb_unlock failed!\n")); } /* Unlock the chain of old record */ if (tdb_unlock(tdb, BUCKET(oldhash), F_WRLCK) != 0) TDB_LOG((tdb, 0, "tdb_nextkey: WARNING tdb_unlock failed!\n")); return key; } /* delete an entry in the database given a key */ int tdb_delete(TDB_CONTEXT *tdb, TDB_DATA key) { tdb_off rec_ptr; struct list_struct rec; int ret; if (!(rec_ptr = tdb_find_lock(tdb, key, F_WRLCK, &rec))) return -1; ret = do_delete(tdb, rec_ptr, &rec); if (tdb_unlock(tdb, BUCKET(rec.full_hash), F_WRLCK) != 0) TDB_LOG((tdb, 0, "tdb_delete: WARNING tdb_unlock failed!\n")); return ret; } /* store an element in the database, replacing any existing element with the same key return 0 on success, -1 on failure */ int tdb_store(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, int flag) { struct list_struct rec; u32 hash; tdb_off rec_ptr; char *p = NULL; int ret = 0; /* find which hash bucket it is in */ hash = tdb_hash(&key); if (!tdb_keylocked(tdb, hash)) return -1; if (tdb_lock(tdb, BUCKET(hash), F_WRLCK) == -1) return -1; /* check for it existing, on insert. */ if (flag == TDB_INSERT) { if (tdb_exists(tdb, key)) { tdb->ecode = TDB_ERR_EXISTS; goto fail; } } else { /* first try in-place update, on modify or replace. */ if (tdb_update(tdb, key, dbuf) == 0) goto out; if (flag == TDB_MODIFY && tdb->ecode == TDB_ERR_NOEXIST) goto fail; } /* reset the error code potentially set by the tdb_update() */ tdb->ecode = TDB_SUCCESS; /* delete any existing record - if it doesn't exist we don't care. Doing this first reduces fragmentation, and avoids coalescing with `allocated' block before it's updated. */ if (flag != TDB_INSERT) tdb_delete(tdb, key); /* Copy key+value *before* allocating free space in case malloc fails and we are left with a dead spot in the tdb. */ if (!(p = (char *)malloc(key.dsize + dbuf.dsize))) { tdb->ecode = TDB_ERR_OOM; goto fail; } memcpy(p, key.dptr, key.dsize); if (dbuf.dsize) memcpy(p+key.dsize, dbuf.dptr, dbuf.dsize); /* now we're into insert / modify / replace of a record which * we know could not be optimised by an in-place store (for * various reasons). */ if (!(rec_ptr = tdb_allocate(tdb, key.dsize + dbuf.dsize, &rec))) goto fail; /* Read hash top into next ptr */ if (ofs_read(tdb, TDB_HASH_TOP(hash), &rec.next) == -1) goto fail; rec.key_len = key.dsize; rec.data_len = dbuf.dsize; rec.full_hash = hash; rec.magic = TDB_MAGIC; /* write out and point the top of the hash chain at it */ if (rec_write(tdb, rec_ptr, &rec) == -1 || tdb_write(tdb, rec_ptr+sizeof(rec), p, key.dsize+dbuf.dsize)==-1 || ofs_write(tdb, TDB_HASH_TOP(hash), &rec_ptr) == -1) { /* Need to tdb_unallocate() here */ goto fail; } out: SAFE_FREE(p); tdb_unlock(tdb, BUCKET(hash), F_WRLCK); return ret; fail: ret = -1; goto out; } /* Attempt to append data to an entry in place - this only works if the new data size is <= the old data size and the key exists. on failure return -1. Record must be locked before calling. */ static int tdb_append_inplace(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA new_dbuf) { struct list_struct rec; tdb_off rec_ptr; /* find entry */ if (!(rec_ptr = tdb_find(tdb, key, tdb_hash(&key), &rec))) return -1; /* Append of 0 is always ok. */ if (new_dbuf.dsize == 0) return 0; /* must be long enough for key, old data + new data and tailer */ if (rec.rec_len < key.dsize + rec.data_len + new_dbuf.dsize + sizeof(tdb_off)) { /* No room. */ tdb->ecode = TDB_SUCCESS; /* Not really an error */ return -1; } if (tdb_write(tdb, rec_ptr + sizeof(rec) + rec.key_len + rec.data_len, new_dbuf.dptr, new_dbuf.dsize) == -1) return -1; /* update size */ rec.data_len += new_dbuf.dsize; return rec_write(tdb, rec_ptr, &rec); } /* Append to an entry. Create if not exist. */ int tdb_append(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA new_dbuf) { struct list_struct rec; u32 hash; tdb_off rec_ptr; char *p = NULL; int ret = 0; size_t new_data_size = 0; /* find which hash bucket it is in */ hash = tdb_hash(&key); if (!tdb_keylocked(tdb, hash)) return -1; if (tdb_lock(tdb, BUCKET(hash), F_WRLCK) == -1) return -1; /* first try in-place. */ if (tdb_append_inplace(tdb, key, new_dbuf) == 0) goto out; /* reset the error code potentially set by the tdb_append_inplace() */ tdb->ecode = TDB_SUCCESS; /* find entry */ if (!(rec_ptr = tdb_find(tdb, key, hash, &rec))) { if (tdb->ecode != TDB_ERR_NOEXIST) goto fail; /* Not found - create. */ ret = tdb_store(tdb, key, new_dbuf, TDB_INSERT); goto out; } new_data_size = rec.data_len + new_dbuf.dsize; /* Copy key+old_value+value *before* allocating free space in case malloc fails and we are left with a dead spot in the tdb. */ if (!(p = (char *)malloc(key.dsize + new_data_size))) { tdb->ecode = TDB_ERR_OOM; goto fail; } /* Copy the key in place. */ memcpy(p, key.dptr, key.dsize); /* Now read the old data into place. */ if (rec.data_len && tdb_read(tdb, rec_ptr + sizeof(rec) + rec.key_len, p + key.dsize, rec.data_len, 0) == -1) goto fail; /* Finally append the new data. */ if (new_dbuf.dsize) memcpy(p+key.dsize+rec.data_len, new_dbuf.dptr, new_dbuf.dsize); /* delete any existing record - if it doesn't exist we don't care. Doing this first reduces fragmentation, and avoids coalescing with `allocated' block before it's updated. */ tdb_delete(tdb, key); if (!(rec_ptr = tdb_allocate(tdb, key.dsize + new_data_size, &rec))) goto fail; /* Read hash top into next ptr */ if (ofs_read(tdb, TDB_HASH_TOP(hash), &rec.next) == -1) goto fail; rec.key_len = key.dsize; rec.data_len = new_data_size; rec.full_hash = hash; rec.magic = TDB_MAGIC; /* write out and point the top of the hash chain at it */ if (rec_write(tdb, rec_ptr, &rec) == -1 || tdb_write(tdb, rec_ptr+sizeof(rec), p, key.dsize+new_data_size)==-1 || ofs_write(tdb, TDB_HASH_TOP(hash), &rec_ptr) == -1) { /* Need to tdb_unallocate() here */ goto fail; } out: SAFE_FREE(p); tdb_unlock(tdb, BUCKET(hash), F_WRLCK); return ret; fail: ret = -1; goto out; } static int tdb_already_open(dev_t device, ino_t ino) { TDB_CONTEXT *i; for (i = tdbs; i; i = i->next) { if (i->device == device && i->inode == ino) { return 1; } } return 0; } /* open the database, creating it if necessary The open_flags and mode are passed straight to the open call on the database file. A flags value of O_WRONLY is invalid. The hash size is advisory, use zero for a default value. Return is NULL on error, in which case errno is also set. Don't try to call tdb_error or tdb_errname, just do strerror(errno). @param name may be NULL for internal databases. */ TDB_CONTEXT *tdb_open(const char *name, int hash_size, int tdb_flags, int open_flags, mode_t mode) { return tdb_open_ex(name, hash_size, tdb_flags, open_flags, mode, NULL); } TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags, int open_flags, mode_t mode, tdb_log_func log_fn) { TDB_CONTEXT *tdb; struct stat st; int rev = 0, locked; unsigned char *vp; u32 vertest; if (!(tdb = calloc(1, sizeof *tdb))) { /* Can't log this */ errno = ENOMEM; goto fail; } tdb->fd = -1; tdb->name = NULL; tdb->map_ptr = NULL; tdb->lockedkeys = NULL; tdb->flags = tdb_flags; tdb->open_flags = open_flags; tdb->log_fn = log_fn; if ((open_flags & O_ACCMODE) == O_WRONLY) { TDB_LOG((tdb, 0, "tdb_open_ex: can't open tdb %s write-only\n", name)); errno = EINVAL; goto fail; } if (hash_size == 0) hash_size = DEFAULT_HASH_SIZE; if ((open_flags & O_ACCMODE) == O_RDONLY) { tdb->read_only = 1; /* read only databases don't do locking or clear if first */ tdb->flags |= TDB_NOLOCK; tdb->flags &= ~TDB_CLEAR_IF_FIRST; } /* internal databases don't mmap or lock, and start off cleared */ if (tdb->flags & TDB_INTERNAL) { tdb->flags |= (TDB_NOLOCK | TDB_NOMMAP); tdb->flags &= ~TDB_CLEAR_IF_FIRST; if (tdb_new_database(tdb, hash_size) != 0) { TDB_LOG((tdb, 0, "tdb_open_ex: tdb_new_database failed!")); goto fail; } goto internal; } if ((tdb->fd = open(name, open_flags, mode)) == -1) { TDB_LOG((tdb, 5, "tdb_open_ex: could not open file %s: %s\n", name, strerror(errno))); goto fail; /* errno set by open(2) */ } /* ensure there is only one process initialising at once */ if (tdb_brlock(tdb, GLOBAL_LOCK, F_WRLCK, F_SETLKW, 0) == -1) { TDB_LOG((tdb, 0, "tdb_open_ex: failed to get global lock on %s: %s\n", name, strerror(errno))); goto fail; /* errno set by tdb_brlock */ } /* we need to zero database if we are the only one with it open */ if ((locked = (tdb_brlock(tdb, ACTIVE_LOCK, F_WRLCK, F_SETLK, 0) == 0)) && (tdb_flags & TDB_CLEAR_IF_FIRST)) { open_flags |= O_CREAT; if (ftruncate(tdb->fd, 0) == -1) { TDB_LOG((tdb, 0, "tdb_open_ex: " "failed to truncate %s: %s\n", name, strerror(errno))); goto fail; /* errno set by ftruncate */ } } if (read(tdb->fd, &tdb->header, sizeof(tdb->header)) != sizeof(tdb->header) || strcmp(tdb->header.magic_food, TDB_MAGIC_FOOD) != 0 || (tdb->header.version != TDB_VERSION && !(rev = (tdb->header.version==TDB_BYTEREV(TDB_VERSION))))) { /* its not a valid database - possibly initialise it */ if (!(open_flags & O_CREAT) || tdb_new_database(tdb, hash_size) == -1) { errno = EIO; /* ie bad format or something */ goto fail; } rev = (tdb->flags & TDB_CONVERT); } vp = (unsigned char *)&tdb->header.version; vertest = (((u32)vp[0]) << 24) | (((u32)vp[1]) << 16) | (((u32)vp[2]) << 8) | (u32)vp[3]; tdb->flags |= (vertest==TDB_VERSION) ? TDB_BIGENDIAN : 0; if (!rev) tdb->flags &= ~TDB_CONVERT; else { tdb->flags |= TDB_CONVERT; convert(&tdb->header, sizeof(tdb->header)); } if (fstat(tdb->fd, &st) == -1) goto fail; /* Is it already in the open list? If so, fail. */ if (tdb_already_open(st.st_dev, st.st_ino)) { TDB_LOG((tdb, 2, "tdb_open_ex: " "%s (%d,%d) is already open in this process\n", name, st.st_dev, st.st_ino)); errno = EBUSY; goto fail; } if (!(tdb->name = (char *)strdup(name))) { errno = ENOMEM; goto fail; } tdb->map_size = st.st_size; tdb->device = st.st_dev; tdb->inode = st.st_ino; tdb->locked = calloc(tdb->header.hash_size+1, sizeof(tdb->locked[0])); if (!tdb->locked) { TDB_LOG((tdb, 2, "tdb_open_ex: " "failed to allocate lock structure for %s\n", name)); errno = ENOMEM; goto fail; } tdb_mmap(tdb); if (locked) { if (!tdb->read_only) if (tdb_clear_spinlocks(tdb) != 0) { TDB_LOG((tdb, 0, "tdb_open_ex: " "failed to clear spinlock\n")); goto fail; } if (tdb_brlock(tdb, ACTIVE_LOCK, F_UNLCK, F_SETLK, 0) == -1) { TDB_LOG((tdb, 0, "tdb_open_ex: " "failed to take ACTIVE_LOCK on %s: %s\n", name, strerror(errno))); goto fail; } } /* leave this lock in place to indicate it's in use */ if (tdb_brlock(tdb, ACTIVE_LOCK, F_RDLCK, F_SETLKW, 0) == -1) goto fail; internal: /* Internal (memory-only) databases skip all the code above to * do with disk files, and resume here by releasing their * global lock and hooking into the active list. */ if (tdb_brlock(tdb, GLOBAL_LOCK, F_UNLCK, F_SETLKW, 0) == -1) goto fail; tdb->next = tdbs; tdbs = tdb; return tdb; fail: { int save_errno = errno; if (!tdb) return NULL; if (tdb->map_ptr) { if (tdb->flags & TDB_INTERNAL) SAFE_FREE(tdb->map_ptr); else tdb_munmap(tdb); } SAFE_FREE(tdb->name); if (tdb->fd != -1) if (close(tdb->fd) != 0) TDB_LOG((tdb, 5, "tdb_open_ex: failed to close tdb->fd on error!\n")); SAFE_FREE(tdb->locked); SAFE_FREE(tdb); errno = save_errno; return NULL; } } /** * Close a database. * * @returns -1 for error; 0 for success. **/ int tdb_close(TDB_CONTEXT *tdb) { TDB_CONTEXT **i; int ret = 0; if (tdb->map_ptr) { if (tdb->flags & TDB_INTERNAL) SAFE_FREE(tdb->map_ptr); else tdb_munmap(tdb); } SAFE_FREE(tdb->name); if (tdb->fd != -1) ret = close(tdb->fd); SAFE_FREE(tdb->locked); SAFE_FREE(tdb->lockedkeys); /* Remove from contexts list */ for (i = &tdbs; *i; i = &(*i)->next) { if (*i == tdb) { *i = tdb->next; break; } } memset(tdb, 0, sizeof(*tdb)); SAFE_FREE(tdb); return ret; } /* lock/unlock entire database */ int tdb_lockall(TDB_CONTEXT *tdb) { u32 i; /* There are no locks on read-only dbs */ if (tdb->read_only) return TDB_ERRCODE(TDB_ERR_LOCK, -1); if (tdb->lockedkeys) return TDB_ERRCODE(TDB_ERR_NOLOCK, -1); for (i = 0; i < tdb->header.hash_size; i++) if (tdb_lock(tdb, i, F_WRLCK)) break; /* If error, release locks we have... */ if (i < tdb->header.hash_size) { u32 j; for ( j = 0; j < i; j++) tdb_unlock(tdb, j, F_WRLCK); return TDB_ERRCODE(TDB_ERR_NOLOCK, -1); } return 0; } void tdb_unlockall(TDB_CONTEXT *tdb) { u32 i; for (i=0; i < tdb->header.hash_size; i++) tdb_unlock(tdb, i, F_WRLCK); } int tdb_lockkeys(TDB_CONTEXT *tdb, u32 number, TDB_DATA keys[]) { u32 i, j, hash; /* Can't lock more keys if already locked */ if (tdb->lockedkeys) return TDB_ERRCODE(TDB_ERR_NOLOCK, -1); if (!(tdb->lockedkeys = malloc(sizeof(u32) * (number+1)))) return TDB_ERRCODE(TDB_ERR_OOM, -1); /* First number in array is # keys */ tdb->lockedkeys[0] = number; /* Insertion sort by bucket */ for (i = 0; i < number; i++) { hash = tdb_hash(&keys[i]); for (j = 0; j < i && BUCKET(tdb->lockedkeys[j+1]) < BUCKET(hash); j++); memmove(&tdb->lockedkeys[j+2], &tdb->lockedkeys[j+1], sizeof(u32) * (i-j)); tdb->lockedkeys[j+1] = hash; } /* Finally, lock in order */ for (i = 0; i < number; i++) if (tdb_lock(tdb, i, F_WRLCK)) break; /* If error, release locks we have... */ if (i < number) { for ( j = 0; j < i; j++) tdb_unlock(tdb, j, F_WRLCK); SAFE_FREE(tdb->lockedkeys); return TDB_ERRCODE(TDB_ERR_NOLOCK, -1); } return 0; } /* Unlock the keys previously locked by tdb_lockkeys() */ void tdb_unlockkeys(TDB_CONTEXT *tdb) { u32 i; if (!tdb->lockedkeys) return; for (i = 0; i < tdb->lockedkeys[0]; i++) tdb_unlock(tdb, tdb->lockedkeys[i+1], F_WRLCK); SAFE_FREE(tdb->lockedkeys); } /* lock/unlock one hash chain. This is meant to be used to reduce contention - it cannot guarantee how many records will be locked */ int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key) { return tdb_lock(tdb, BUCKET(tdb_hash(&key)), F_WRLCK); } int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key) { return tdb_unlock(tdb, BUCKET(tdb_hash(&key)), F_WRLCK); } #if 0 static int tdb_chainlock_read(TDB_CONTEXT *tdb, TDB_DATA key) { return tdb_lock(tdb, BUCKET(tdb_hash(&key)), F_RDLCK); } #endif #if 0 static int tdb_chainunlock_read(TDB_CONTEXT *tdb, TDB_DATA key) { return tdb_unlock(tdb, BUCKET(tdb_hash(&key)), F_RDLCK); } #endif /* register a loging function */ void tdb_logging_function(TDB_CONTEXT *tdb, void (*fn)(TDB_CONTEXT *, int , const char *, ...)) { tdb->log_fn = fn; } /* reopen a tdb - this is used after a fork to ensure that we have an independent seek pointer from our parent and to re-establish locks */ int tdb_reopen(TDB_CONTEXT *tdb) { struct stat st; if (tdb_munmap(tdb) != 0) { TDB_LOG((tdb, 0, "tdb_reopen: munmap failed (%s)\n", strerror(errno))); goto fail; } if (close(tdb->fd) != 0) TDB_LOG((tdb, 0, "tdb_reopen: WARNING closing tdb->fd failed!\n")); tdb->fd = open(tdb->name, tdb->open_flags & ~(O_CREAT|O_TRUNC), 0); if (tdb->fd == -1) { TDB_LOG((tdb, 0, "tdb_reopen: open failed (%s)\n", strerror(errno))); goto fail; } if (fstat(tdb->fd, &st) != 0) { TDB_LOG((tdb, 0, "tdb_reopen: fstat failed (%s)\n", strerror(errno))); goto fail; } if (st.st_ino != tdb->inode || st.st_dev != tdb->device) { TDB_LOG((tdb, 0, "tdb_reopen: file dev/inode has changed!\n")); goto fail; } tdb_mmap(tdb); if (tdb_brlock(tdb, ACTIVE_LOCK, F_RDLCK, F_SETLKW, 0) == -1) { TDB_LOG((tdb, 0, "tdb_reopen: failed to obtain active lock\n")); goto fail; } return 0; fail: tdb_close(tdb); return -1; } /* reopen all tdb's */ int tdb_reopen_all(void) { TDB_CONTEXT *tdb; for (tdb=tdbs; tdb; tdb = tdb->next) { if (tdb_reopen(tdb) != 0) return -1; } return 0; } netatalk-2.2.2/libatalk/tdb/spinlock.h0000644000175200017500000000253711655731127014611 00000000000000#ifndef __SPINLOCK_H__ #define __SPINLOCK_H__ #ifdef HAVE_CONFIG_H #include #endif #include #ifdef USE_SPINLOCKS #define RWLOCK_BIAS 0x1000UL /* OS SPECIFIC */ #define MAX_BUSY_LOOPS 1000 #undef USE_SCHED_YIELD /* ARCH SPECIFIC */ /* We should make sure these are padded to a cache line */ #if defined(SPARC_SPINLOCKS) typedef volatile char spinlock_t; #elif defined(POWERPC_SPINLOCKS) typedef volatile unsigned long spinlock_t; #elif defined(INTEL_SPINLOCKS) typedef volatile int spinlock_t; #elif defined(MIPS_SPINLOCKS) typedef volatile unsigned long spinlock_t; #else #error Need to implement spinlock code in spinlock.h #endif typedef struct { spinlock_t lock; volatile int count; } tdb_rwlock_t; int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type); int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type); int tdb_create_rwlocks(int fd, unsigned int hash_size); int tdb_clear_spinlocks(TDB_CONTEXT *tdb); #else /* !USE_SPINLOCKS */ #if 0 #define tdb_create_rwlocks(fd, hash_size) 0 #define tdb_spinlock(tdb, list, rw_type) (-1) #define tdb_spinunlock(tdb, list, rw_type) (-1) #else int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type); int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type); int tdb_create_rwlocks(int fd, unsigned int hash_size); #endif int tdb_clear_spinlocks(TDB_CONTEXT *tdb); #endif #endif netatalk-2.2.2/libatalk/tdb/spinlock.c0000644000175200017500000001742111655731127014602 00000000000000/* Unix SMB/CIFS implementation. Samba database functions Copyright (C) Anton Blanchard 2001 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define STANDALONE 1 #if HAVE_CONFIG_H #include #endif #if STANDALONE #include #include #include #include #include #include #include #include #include #include "spinlock.h" #define DEBUG #else #include "includes.h" #endif #ifdef USE_SPINLOCKS /* * ARCH SPECIFIC */ #if defined(SPARC_SPINLOCKS) static inline int __spin_trylock(spinlock_t *lock) { unsigned int result; asm volatile("ldstub [%1], %0" : "=r" (result) : "r" (lock) : "memory"); return (result == 0) ? 0 : EBUSY; } static inline void __spin_unlock(spinlock_t *lock) { asm volatile("":::"memory"); *lock = 0; } static inline void __spin_lock_init(spinlock_t *lock) { *lock = 0; } static inline int __spin_is_locked(spinlock_t *lock) { return (*lock != 0); } #elif defined(POWERPC_SPINLOCKS) static inline int __spin_trylock(spinlock_t *lock) { unsigned int result; __asm__ __volatile__( "1: lwarx %0,0,%1\n\ cmpwi 0,%0,0\n\ li %0,0\n\ bne- 2f\n\ li %0,1\n\ stwcx. %0,0,%1\n\ bne- 1b\n\ isync\n\ 2:" : "=&r"(result) : "r"(lock) : "cr0", "memory"); return (result == 1) ? 0 : EBUSY; } static inline void __spin_unlock(spinlock_t *lock) { asm volatile("eieio":::"memory"); *lock = 0; } static inline void __spin_lock_init(spinlock_t *lock) { *lock = 0; } static inline int __spin_is_locked(spinlock_t *lock) { return (*lock != 0); } #elif defined(INTEL_SPINLOCKS) static inline int __spin_trylock(spinlock_t *lock) { int oldval; asm volatile("xchgl %0,%1" : "=r" (oldval), "=m" (*lock) : "0" (0) : "memory"); return oldval > 0 ? 0 : EBUSY; } static inline void __spin_unlock(spinlock_t *lock) { asm volatile("":::"memory"); *lock = 1; } static inline void __spin_lock_init(spinlock_t *lock) { *lock = 1; } static inline int __spin_is_locked(spinlock_t *lock) { return (*lock != 1); } #elif defined(MIPS_SPINLOCKS) static inline unsigned int load_linked(unsigned long addr) { unsigned int res; __asm__ __volatile__("ll\t%0,(%1)" : "=r" (res) : "r" (addr)); return res; } static inline unsigned int store_conditional(unsigned long addr, unsigned int value) { unsigned int res; __asm__ __volatile__("sc\t%0,(%2)" : "=r" (res) : "0" (value), "r" (addr)); return res; } static inline int __spin_trylock(spinlock_t *lock) { unsigned int mw; do { mw = load_linked(lock); if (mw) return EBUSY; } while (!store_conditional(lock, 1)); asm volatile("":::"memory"); return 0; } static inline void __spin_unlock(spinlock_t *lock) { asm volatile("":::"memory"); *lock = 0; } static inline void __spin_lock_init(spinlock_t *lock) { *lock = 0; } static inline int __spin_is_locked(spinlock_t *lock) { return (*lock != 0); } #else #error Need to implement spinlock code in spinlock.c #endif /* * OS SPECIFIC */ static void yield_cpu(void) { struct timespec tm; #ifdef USE_SCHED_YIELD sched_yield(); #else /* Linux will busy loop for delays < 2ms on real time tasks */ tm.tv_sec = 0; tm.tv_nsec = 2000000L + 1; nanosleep(&tm, NULL); #endif } static int this_is_smp(void) { return 0; } /* * GENERIC */ static int smp_machine = 0; static inline void __spin_lock(spinlock_t *lock) { int ntries = 0; while(__spin_trylock(lock)) { while(__spin_is_locked(lock)) { if (smp_machine && ntries++ < MAX_BUSY_LOOPS) continue; yield_cpu(); } } } static void __read_lock(tdb_rwlock_t *rwlock) { int ntries = 0; while(1) { __spin_lock(&rwlock->lock); if (!(rwlock->count & RWLOCK_BIAS)) { rwlock->count++; __spin_unlock(&rwlock->lock); return; } __spin_unlock(&rwlock->lock); while(rwlock->count & RWLOCK_BIAS) { if (smp_machine && ntries++ < MAX_BUSY_LOOPS) continue; yield_cpu(); } } } static void __write_lock(tdb_rwlock_t *rwlock) { int ntries = 0; while(1) { __spin_lock(&rwlock->lock); if (rwlock->count == 0) { rwlock->count |= RWLOCK_BIAS; __spin_unlock(&rwlock->lock); return; } __spin_unlock(&rwlock->lock); while(rwlock->count != 0) { if (smp_machine && ntries++ < MAX_BUSY_LOOPS) continue; yield_cpu(); } } } static void __write_unlock(tdb_rwlock_t *rwlock) { __spin_lock(&rwlock->lock); #ifdef DEBUG if (!(rwlock->count & RWLOCK_BIAS)) fprintf(stderr, "bug: write_unlock\n"); #endif rwlock->count &= ~RWLOCK_BIAS; __spin_unlock(&rwlock->lock); } static void __read_unlock(tdb_rwlock_t *rwlock) { __spin_lock(&rwlock->lock); #ifdef DEBUG if (!rwlock->count) fprintf(stderr, "bug: read_unlock\n"); if (rwlock->count & RWLOCK_BIAS) fprintf(stderr, "bug: read_unlock\n"); #endif rwlock->count--; __spin_unlock(&rwlock->lock); } /* TDB SPECIFIC */ /* lock a list in the database. list -1 is the alloc list */ int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type) { tdb_rwlock_t *rwlocks; if (!tdb->map_ptr) return -1; rwlocks = (tdb_rwlock_t *)((char *)tdb->map_ptr + tdb->header.rwlocks); switch(rw_type) { case F_RDLCK: __read_lock(&rwlocks[list+1]); break; case F_WRLCK: __write_lock(&rwlocks[list+1]); break; default: return TDB_ERRCODE(TDB_ERR_LOCK, -1); } return 0; } /* unlock the database. */ int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type) { tdb_rwlock_t *rwlocks; if (!tdb->map_ptr) return -1; rwlocks = (tdb_rwlock_t *)((char *)tdb->map_ptr + tdb->header.rwlocks); switch(rw_type) { case F_RDLCK: __read_unlock(&rwlocks[list+1]); break; case F_WRLCK: __write_unlock(&rwlocks[list+1]); break; default: return TDB_ERRCODE(TDB_ERR_LOCK, -1); } return 0; } int tdb_create_rwlocks(int fd, unsigned int hash_size) { unsigned size, i; tdb_rwlock_t *rwlocks; size = (hash_size + 1) * sizeof(tdb_rwlock_t); rwlocks = malloc(size); if (!rwlocks) return -1; for(i = 0; i < hash_size+1; i++) { __spin_lock_init(&rwlocks[i].lock); rwlocks[i].count = 0; } /* Write it out (appending to end) */ if (write(fd, rwlocks, size) != size) { free(rwlocks); return -1; } smp_machine = this_is_smp(); free(rwlocks); return 0; } int tdb_clear_spinlocks(TDB_CONTEXT *tdb) { tdb_rwlock_t *rwlocks; unsigned i; if (tdb->header.rwlocks == 0) return 0; if (!tdb->map_ptr) return -1; /* We're mmapped here */ rwlocks = (tdb_rwlock_t *)((char *)tdb->map_ptr + tdb->header.rwlocks); for(i = 0; i < tdb->header.hash_size+1; i++) { __spin_lock_init(&rwlocks[i].lock); rwlocks[i].count = 0; } return 0; } #else int tdb_create_rwlocks(int fd, unsigned int hash_size) { return 0; } int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type) { return -1; } int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type) { return -1; } /* Non-spinlock version: remove spinlock pointer */ int tdb_clear_spinlocks(TDB_CONTEXT *tdb) { tdb_off off = (tdb_off)((char *)&tdb->header.rwlocks - (char *)&tdb->header); tdb->header.rwlocks = 0; if (lseek(tdb->fd, off, SEEK_SET) != off || write(tdb->fd, (void *)&tdb->header.rwlocks, sizeof(tdb->header.rwlocks)) != sizeof(tdb->header.rwlocks)) return -1; return 0; } #endif netatalk-2.2.2/libatalk/vfs/0000777000175200017500000000000011704770423012715 500000000000000netatalk-2.2.2/libatalk/vfs/Makefile.am0000644000175200017500000000025011655731127014665 00000000000000# Makefile.am for libatalk/vfs/ noinst_LTLIBRARIES = libvfs.la libvfs_la_SOURCES = vfs.c unix.c ea.c sys_ea.c ea_sys.c if HAVE_ACLS libvfs_la_SOURCES += acl.c endif netatalk-2.2.2/libatalk/vfs/Makefile.in0000644000175200017500000004006211703521730014672 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libatalk/vfs/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @HAVE_ACLS_TRUE@am__append_1 = acl.c subdir = libatalk/vfs DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libvfs_la_LIBADD = am__libvfs_la_SOURCES_DIST = vfs.c unix.c ea.c sys_ea.c ea_sys.c acl.c @HAVE_ACLS_TRUE@am__objects_1 = acl.lo am_libvfs_la_OBJECTS = vfs.lo unix.lo ea.lo sys_ea.lo ea_sys.lo \ $(am__objects_1) libvfs_la_OBJECTS = $(am_libvfs_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libvfs_la_SOURCES) DIST_SOURCES = $(am__libvfs_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libvfs.la libvfs_la_SOURCES = vfs.c unix.c ea.c sys_ea.c ea_sys.c \ $(am__append_1) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libatalk/vfs/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libatalk/vfs/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libvfs.la: $(libvfs_la_OBJECTS) $(libvfs_la_DEPENDENCIES) $(LINK) $(libvfs_la_OBJECTS) $(libvfs_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ea.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ea_sys.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sys_ea.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/libatalk/vfs/ea_sys.c0000644000175200017500000003332311655731127014267 00000000000000/* $Id: ea_sys.c,v 1.8 2010-04-13 08:05:06 franklahm Exp $ Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #if HAVE_ATTR_XATTR_H #include #elif HAVE_SYS_XATTR_H #include #endif #ifdef HAVE_SYS_EA_H #include #endif #ifdef HAVE_SYS_EXTATTR_H #include #endif #include #include #include #include #include #include #include #include #include #ifndef ENOATTR #define ENOATTR ENODATA #endif /********************************************************************************** * EA VFS funcs for storing EAs in nativa filesystem EAs **********************************************************************************/ /* * Function: sys_get_easize * * Purpose: get size of a native EA * * Arguments: * * vol (r) current volume * rbuf (w) DSI reply buffer * rbuflen (rw) current length of data in reply buffer * uname (r) filename * oflag (r) link and create flag * attruname (r) name of attribute * * Returns: AFP code: AFP_OK on success or appropiate AFP error code * * Effects: * * Copies EA size into rbuf in network order. Increments *rbuflen +4. */ int sys_get_easize(VFS_FUNC_ARGS_EA_GETSIZE) { ssize_t ret; uint32_t attrsize; LOG(log_debug7, logtype_afpd, "sys_getextattr_size(%s): attribute: \"%s\"", uname, attruname); if ((oflag & O_NOFOLLOW) ) { ret = sys_lgetxattr(uname, attruname, rbuf +4, 0); } else { ret = sys_getxattr(uname, attruname, rbuf +4, 0); } if (ret == -1) { memset(rbuf, 0, 4); *rbuflen += 4; switch(errno) { case OPEN_NOFOLLOW_ERRNO: /* its a symlink and client requested O_NOFOLLOW */ LOG(log_debug, logtype_afpd, "sys_getextattr_size(%s): encountered symlink with kXAttrNoFollow", uname); return AFP_OK; case ENOATTR: return AFPERR_MISC; default: LOG(log_error, logtype_afpd, "sys_getextattr_size: error: %s", strerror(errno)); return AFPERR_MISC; } } if (ret > MAX_EA_SIZE) ret = MAX_EA_SIZE; /* Start building reply packet */ LOG(log_debug7, logtype_afpd, "sys_getextattr_size(%s): attribute: \"%s\", size: %u", uname, attruname, ret); /* length of attribute data */ attrsize = htonl((uint32_t)ret); memcpy(rbuf, &attrsize, 4); *rbuflen += 4; ret = AFP_OK; return ret; } /* * Function: sys_get_eacontent * * Purpose: copy native EA into rbuf * * Arguments: * * vol (r) current volume * rbuf (w) DSI reply buffer * rbuflen (rw) current length of data in reply buffer * uname (r) filename * oflag (r) link and create flag * attruname (r) name of attribute * maxreply (r) maximum EA size as of current specs/real-life * * Returns: AFP code: AFP_OK on success or appropiate AFP error code * * Effects: * * Copies EA into rbuf. Increments *rbuflen accordingly. */ int sys_get_eacontent(VFS_FUNC_ARGS_EA_GETCONTENT) { ssize_t ret; uint32_t attrsize; /* Start building reply packet */ maxreply -= MAX_REPLY_EXTRA_BYTES; if (maxreply > MAX_EA_SIZE) maxreply = MAX_EA_SIZE; LOG(log_debug7, logtype_afpd, "sys_getextattr_content(%s): attribute: \"%s\", size: %u", uname, attruname, maxreply); if ((oflag & O_NOFOLLOW) ) { ret = sys_lgetxattr(uname, attruname, rbuf +4, maxreply); } else { ret = sys_getxattr(uname, attruname, rbuf +4, maxreply); } if (ret == -1) { memset(rbuf, 0, 4); *rbuflen += 4; switch(errno) { case OPEN_NOFOLLOW_ERRNO: /* its a symlink and client requested O_NOFOLLOW */ LOG(log_debug, logtype_afpd, "sys_getextattr_content(%s): encountered symlink with kXAttrNoFollow", uname); return AFP_OK; case ENOATTR: return AFPERR_MISC; default: LOG(log_error, logtype_afpd, "sys_getextattr_content(%s): error: %s", attruname, strerror(errno)); return AFPERR_MISC; } } /* remember where we must store length of attribute data in rbuf */ *rbuflen += 4 +ret; attrsize = htonl((uint32_t)ret); memcpy(rbuf, &attrsize, 4); return AFP_OK; } /* * Function: sys_list_eas * * Purpose: copy names of native EAs into attrnamebuf * * Arguments: * * vol (r) current volume * attrnamebuf (w) store names a consecutive C strings here * buflen (rw) length of names in attrnamebuf * uname (r) filename * oflag (r) link and create flag * * Returns: AFP code: AFP_OK on success or appropiate AFP error code * * Effects: * * Copies names of all EAs of uname as consecutive C strings into rbuf. * Increments *rbuflen accordingly. */ int sys_list_eas(VFS_FUNC_ARGS_EA_LIST) { ssize_t attrbuflen = *buflen; int ret, len, nlen; char *buf; char *ptr; buf = malloc(ATTRNAMEBUFSIZ); if (!buf) return AFPERR_MISC; if ((oflag & O_NOFOLLOW)) { ret = sys_llistxattr(uname, buf, ATTRNAMEBUFSIZ); } else { ret = sys_listxattr(uname, buf, ATTRNAMEBUFSIZ); } if (ret == -1) switch(errno) { case OPEN_NOFOLLOW_ERRNO: /* its a symlink and client requested O_NOFOLLOW */ ret = AFPERR_BADTYPE; goto exit; #ifdef HAVE_ATTROPEN /* Solaris */ case ENOATTR: ret = AFP_OK; goto exit; #endif default: LOG(log_error, logtype_afpd, "sys_list_extattr(%s): error opening atttribute dir: %s", uname, strerror(errno)); ret= AFPERR_MISC; goto exit; } ptr = buf; while (ret > 0) { len = strlen(ptr); /* Convert name to CH_UTF8_MAC and directly store in in the reply buffer */ if ( 0 >= ( nlen = convert_string(vol->v_volcharset, CH_UTF8_MAC, ptr, len, attrnamebuf + attrbuflen, 256)) ) { ret = AFPERR_MISC; goto exit; } LOG(log_debug7, logtype_afpd, "sys_list_extattr(%s): attribute: %s", uname, ptr); attrbuflen += nlen + 1; if (attrbuflen > (ATTRNAMEBUFSIZ - 256)) { /* Next EA name could overflow, so bail out with error. FIXME: evantually malloc/memcpy/realloc whatever. Is it worth it ? */ LOG(log_warning, logtype_afpd, "sys_list_extattr(%s): running out of buffer for EA names", uname); ret = AFPERR_MISC; goto exit; } ret -= len +1; ptr += len +1; } ret = AFP_OK; exit: free(buf); *buflen = attrbuflen; return ret; } /* * Function: sys_set_ea * * Purpose: set a native EA * * Arguments: * * vol (r) current volume * uname (r) filename * attruname (r) EA name * ibuf (r) buffer with EA content * attrsize (r) length EA in ibuf * oflag (r) link and create flag * * Returns: AFP code: AFP_OK on success or appropiate AFP error code * * Effects: * */ int sys_set_ea(VFS_FUNC_ARGS_EA_SET) { int attr_flag; int ret; attr_flag = 0; if ((oflag & O_CREAT) ) attr_flag |= XATTR_CREATE; else if ((oflag & O_TRUNC) ) attr_flag |= XATTR_REPLACE; if ((oflag & O_NOFOLLOW) ) { ret = sys_lsetxattr(uname, attruname, ibuf, attrsize,attr_flag); } else { ret = sys_setxattr(uname, attruname, ibuf, attrsize, attr_flag); } if (ret == -1) { switch(errno) { case OPEN_NOFOLLOW_ERRNO: /* its a symlink and client requested O_NOFOLLOW */ LOG(log_debug, logtype_afpd, "sys_set_ea(\"%s/%s\", ea:'%s'): encountered symlink with kXAttrNoFollow", getcwdpath(), uname, attruname); return AFP_OK; case EEXIST: LOG(log_debug, logtype_afpd, "sys_set_ea(\"%s/%s\", ea:'%s'): EA already exists", getcwdpath(), uname, attruname); return AFPERR_EXIST; default: LOG(log_error, logtype_afpd, "sys_set_ea(\"%s/%s\", ea:'%s', size: %u, flags: %s|%s|%s): %s", getcwdpath(), uname, attruname, attrsize, oflag & O_CREAT ? "XATTR_CREATE" : "-", oflag & O_TRUNC ? "XATTR_REPLACE" : "-", oflag & O_NOFOLLOW ? "O_NOFOLLOW" : "-", strerror(errno)); return AFPERR_MISC; } } return AFP_OK; } /* * Function: sys_remove_ea * * Purpose: remove a native EA * * Arguments: * * vol (r) current volume * uname (r) filename * attruname (r) EA name * oflag (r) link and create flag * * Returns: AFP code: AFP_OK on success or appropiate AFP error code * * Effects: * * Removes EA attruname from file uname. */ int sys_remove_ea(VFS_FUNC_ARGS_EA_REMOVE) { int ret; if ((oflag & O_NOFOLLOW) ) { ret = sys_lremovexattr(uname, attruname); } else { ret = sys_removexattr(uname, attruname); } if (ret == -1) { switch(errno) { case OPEN_NOFOLLOW_ERRNO: /* its a symlink and client requested O_NOFOLLOW */ LOG(log_debug, logtype_afpd, "sys_remove_ea(%s/%s): encountered symlink with kXAttrNoFollow", uname); return AFP_OK; case EACCES: LOG(log_debug, logtype_afpd, "sys_remove_ea(%s/%s): error: %s", uname, attruname, strerror(errno)); return AFPERR_ACCESS; default: LOG(log_error, logtype_afpd, "sys_remove_ea(%s/%s): error: %s", uname, attruname, strerror(errno)); return AFPERR_MISC; } } return AFP_OK; } /* * @brief Copy EAs * * @note Supports *at semantics, therfor switches back and forth between sfd and cwd */ int sys_ea_copyfile(VFS_FUNC_ARGS_COPYFILE) { int ret = 0; int cwd = -1; ssize_t size; char *names = NULL, *end_names, *name, *value = NULL; unsigned int setxattr_ENOTSUP = 0; if (sfd != -1) { if ((cwd = open(".", O_RDONLY)) == -1) { LOG(log_error, logtype_afpd, "sys_ea_copyfile: cant open cwd: %s", strerror(errno)); ret = -1; goto getout; } } if (sfd != -1) { if (fchdir(sfd) == -1) { LOG(log_error, logtype_afpd, "sys_ea_copyfile: cant chdir to sfd: %s", strerror(errno)); ret = -1; goto getout; } } size = sys_listxattr(src, NULL, 0); if (size < 0) { if (errno != ENOSYS && errno != ENOTSUP) { ret = -1; } goto getout; } names = malloc(size+1); if (names == NULL) { ret = -1; goto getout; } size = sys_listxattr(src, names, size); if (size < 0) { ret = -1; goto getout; } else { names[size] = '\0'; end_names = names + size; } if (sfd != -1) { if (fchdir(cwd) == -1) { LOG(log_error, logtype_afpd, "sys_ea_copyfile: cant chdir to cwd: %s", strerror(errno)); ret = -1; goto getout; } } for (name = names; name != end_names; name = strchr(name, '\0') + 1) { void *old_value; /* check if this attribute shall be preserved */ if (!*name) continue; if (sfd != -1) { if (fchdir(sfd) == -1) { LOG(log_error, logtype_afpd, "sys_ea_copyfile: cant chdir to sfd: %s", strerror(errno)); ret = -1; goto getout; } } size = sys_getxattr (src, name, NULL, 0); if (size < 0) { ret = -1; continue; } value = realloc(old_value = value, size); if (size != 0 && value == NULL) { free(old_value); ret = -1; } size = sys_getxattr(src, name, value, size); if (size < 0) { ret = -1; continue; } if (sfd != -1) { if (fchdir(cwd) == -1) { LOG(log_error, logtype_afpd, "sys_ea_copyfile: cant chdir to cwd: %s", strerror(errno)); ret = -1; goto getout; } } if (sys_setxattr(dst, name, value, size, 0) != 0) { if (errno == ENOTSUP) setxattr_ENOTSUP++; else { if (errno == ENOSYS) { ret = -1; /* no hope of getting any further */ break; } else { ret = -1; } } } } if (setxattr_ENOTSUP) { errno = ENOTSUP; ret = -1; } getout: if (cwd != -1) close(cwd); free(value); free(names); if (ret == -1) { switch(errno) { case ENOENT: /* no attribute */ break; case EACCES: LOG(log_debug, logtype_afpd, "sys_ea_copyfile(%s, %s): error: %s", src, dst, strerror(errno)); return AFPERR_ACCESS; default: LOG(log_error, logtype_afpd, "sys_ea_copyfile(%s, %s): error: %s", src, dst, strerror(errno)); return AFPERR_MISC; } } return AFP_OK; } netatalk-2.2.2/libatalk/vfs/unix.c0000644000175200017500000002310211655731245013762 00000000000000/* * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* ----------------------------- a dropbox is a folder where w is set but not r eg: rwx-wx-wx or rwx-wx-- rwx----wx (is not asked by a Mac with OS >= 8.0 ?) */ int stickydirmode(const char *name, const mode_t mode, const int dropbox, const mode_t v_umask) { int retval = 0; #ifdef DROPKLUDGE /* Turn on the sticky bit if this is a drop box, also turn off the setgid bit */ if ((dropbox & AFPVOL_DROPBOX)) { int uid; if ( ( (mode & S_IWOTH) && !(mode & S_IROTH)) || ( (mode & S_IWGRP) && !(mode & S_IRGRP)) ) { uid=geteuid(); if ( seteuid(0) < 0) { LOG(log_error, logtype_afpd, "stickydirmode: unable to seteuid root: %s", strerror(errno)); } if ( (retval=chmod_acl( name, ( (DIRBITS | mode | S_ISVTX) & ~v_umask) )) < 0) { LOG(log_error, logtype_afpd, "stickydirmode: chmod \"%s\": %s", fullpathname(name), strerror(errno) ); } else { LOG(log_debug, logtype_afpd, "stickydirmode: chmod \"%s\": %s", fullpathname(name), strerror(retval) ); } seteuid(uid); return retval; } } #endif /* DROPKLUDGE */ /* * Ignore EPERM errors: We may be dealing with a directory that is * group writable, in which case chmod will fail. */ if ( (chmod_acl( name, (DIRBITS | mode) & ~v_umask ) < 0) && errno != EPERM && !(errno == ENOENT && (dropbox & AFPVOL_NOADOUBLE)) ) { LOG(log_error, logtype_afpd, "stickydirmode: chmod \"%s\": %s", fullpathname(name), strerror(errno) ); retval = -1; } return retval; } /* ------------------------- */ int dir_rx_set(mode_t mode) { return (mode & (S_IXUSR | S_IRUSR)) == (S_IXUSR | S_IRUSR); } /* --------------------- */ int setfilmode(const char * name, mode_t mode, struct stat *st, mode_t v_umask) { struct stat sb; mode_t mask = S_IRWXU | S_IRWXG | S_IRWXO; /* rwx for owner group and other, by default */ if (!st) { if (lstat(name, &sb) != 0) return -1; st = &sb; } if (S_ISLNK(st->st_mode)) return 0; /* we don't want to change link permissions */ mode |= st->st_mode & ~mask; /* keep other bits from previous mode */ if ( chmod_acl( name, mode & ~v_umask ) < 0 && errno != EPERM ) { return -1; } return 0; } /* * @brief system rmdir with afp error code. * * Supports *at semantics (cf openat) if HAVE_ATFUNCS. Pass dirfd=-1 to ignore this. */ int netatalk_rmdir_all_errors(int dirfd, const char *name) { int err; #ifdef HAVE_ATFUNCS if (dirfd == -1) dirfd = AT_FDCWD; err = unlinkat(dirfd, name, AT_REMOVEDIR); #else err = rmdir(name); #endif if (err < 0) { switch ( errno ) { case ENOENT : return AFPERR_NOOBJ; case ENOTEMPTY : return AFPERR_DIRNEMPT; case EPERM: case EACCES : return AFPERR_ACCESS; case EROFS: return AFPERR_VLOCK; default : return AFPERR_PARAM; } } return AFP_OK; } /* * @brief System rmdir with afp error code, but ENOENT is not an error. * * Supports *at semantics (cf openat) if HAVE_ATFUNCS. Pass dirfd=-1 to ignore this. */ int netatalk_rmdir(int dirfd, const char *name) { int ret = netatalk_rmdir_all_errors(dirfd, name); if (ret == AFPERR_NOOBJ) return AFP_OK; return ret; } /* ------------------- system unlink with afp error code. ENOENT is not an error. */ int netatalk_unlink(const char *name) { if (unlink(name) < 0) { switch (errno) { case ENOENT : break; case EROFS: return AFPERR_VLOCK; case EPERM: case EACCES : return AFPERR_ACCESS; default : return AFPERR_PARAM; } } return AFP_OK; } /************************************************************************** * *at semnatics support functions (like openat, renameat standard funcs) **************************************************************************/ /* * Supports *at semantics if HAVE_ATFUNCS, pass dirfd=-1 to ignore this */ int copy_file(int dirfd, const char *src, const char *dst, mode_t mode) { int ret = 0; int sfd = -1; int dfd = -1; ssize_t cc; size_t buflen; char filebuf[8192]; #ifdef HAVE_ATFUNCS if (dirfd == -1) dirfd = AT_FDCWD; sfd = openat(dirfd, src, O_RDONLY); #else sfd = open(src, O_RDONLY); #endif if (sfd < 0) { LOG(log_info, logtype_afpd, "copy_file('%s'/'%s'): open '%s' error: %s", src, dst, src, strerror(errno)); return -1; } if ((dfd = open(dst, O_WRONLY | O_CREAT | O_TRUNC, mode)) < 0) { LOG(log_info, logtype_afpd, "copy_file('%s'/'%s'): open '%s' error: %s", src, dst, dst, strerror(errno)); ret = -1; goto exit; } while ((cc = read(sfd, filebuf, sizeof(filebuf)))) { if (cc < 0) { if (errno == EINTR) continue; LOG(log_error, logtype_afpd, "copy_file('%s'/'%s'): read '%s' error: %s", src, dst, src, strerror(errno)); ret = -1; goto exit; } buflen = cc; while (buflen > 0) { if ((cc = write(dfd, filebuf, buflen)) < 0) { if (errno == EINTR) continue; LOG(log_error, logtype_afpd, "copy_file('%s'/'%s'): read '%s' error: %s", src, dst, dst, strerror(errno)); ret = -1; goto exit; } buflen -= cc; } } exit: if (sfd != -1) close(sfd); if (dfd != -1) { int err; err = close(dfd); if (!ret && err) { /* don't bother to report an error if there's already one */ LOG(log_error, logtype_afpd, "copy_file('%s'/'%s'): close '%s' error: %s", src, dst, dst, strerror(errno)); ret = -1; } } return ret; } /* * at wrapper for netatalk_unlink */ int netatalk_unlinkat(int dirfd, const char *name) { #ifdef HAVE_ATFUNCS if (dirfd == -1) dirfd = AT_FDCWD; if (unlinkat(dirfd, name, 0) < 0) { switch (errno) { case ENOENT : break; case EROFS: return AFPERR_VLOCK; case EPERM: case EACCES : return AFPERR_ACCESS; default : return AFPERR_PARAM; } } return AFP_OK; #else return netatalk_unlink(name); #endif /* DEADC0DE */ return 0; } /* * @brief This is equivalent of unix rename() * * unix_rename mulitplexes rename and renameat. If we dont HAVE_ATFUNCS, sfd and dfd * are ignored. * * @param sfd (r) if we HAVE_ATFUNCS, -1 gives AT_FDCWD * @param oldpath (r) guess what * @param dfd (r) same as sfd * @param newpath (r) guess what */ int unix_rename(int sfd, const char *oldpath, int dfd, const char *newpath) { #ifdef HAVE_ATFUNCS if (sfd == -1) sfd = AT_FDCWD; if (dfd == -1) dfd = AT_FDCWD; if (renameat(sfd, oldpath, dfd, newpath) < 0) return -1; #else if (rename(oldpath, newpath) < 0) return -1; #endif /* HAVE_ATFUNCS */ return 0; } /* * @brief stat/fsstatat multiplexer * * statat mulitplexes stat and fstatat. If we dont HAVE_ATFUNCS, dirfd is ignored. * * @param dirfd (r) Only used if HAVE_ATFUNCS, ignored else, -1 gives AT_FDCWD * @param path (r) pathname * @param st (rw) pointer to struct stat */ int statat(int dirfd, const char *path, struct stat *st) { #ifdef HAVE_ATFUNCS if (dirfd == -1) dirfd = AT_FDCWD; return (fstatat(dirfd, path, st, 0)); #else return (stat(path, st)); #endif /* DEADC0DE */ return -1; } /* * @brief lstat/fsstatat multiplexer * * lstatat mulitplexes lstat and fstatat. If we dont HAVE_ATFUNCS, dirfd is ignored. * * @param dirfd (r) Only used if HAVE_ATFUNCS, ignored else, -1 gives AT_FDCWD * @param path (r) pathname * @param st (rw) pointer to struct stat */ int lstatat(int dirfd, const char *path, struct stat *st) { #ifdef HAVE_ATFUNCS if (dirfd == -1) dirfd = AT_FDCWD; return (fstatat(dirfd, path, st, AT_SYMLINK_NOFOLLOW)); #else return (lstat(path, st)); #endif /* DEADC0DE */ return -1; } /* * @brief opendir wrapper for *at semantics support * * opendirat chdirs to dirfd if dirfd != -1 before calling opendir on path. * * @param dirfd (r) if != -1, chdir(dirfd) before opendir(path) * @param path (r) pathname */ DIR *opendirat(int dirfd, const char *path) { DIR *ret; int cwd = -1; if (dirfd != -1) { if (((cwd = open(".", O_RDONLY)) == -1) || (fchdir(dirfd) != 0)) { ret = NULL; goto exit; } } ret = opendir(path); if (dirfd != -1 && fchdir(cwd) != 0) { LOG(log_error, logtype_afpd, "opendirat: cant chdir back. exit!"); exit(EXITERR_SYS); } exit: if (cwd != -1) close(cwd); return ret; } netatalk-2.2.2/libatalk/vfs/acl.c0000644000175200017500000001005611655731245013542 00000000000000/* Copyright (c) 2009 Frank Lahm Copyright (c) 2010 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_SOLARIS_ACLS /* Removes all non-trivial ACLs from object. Returns full AFPERR code. */ int remove_acl_vfs(const char *name) { int ret,i, ace_count, trivial_aces, new_aces_count; ace_t *old_aces = NULL; ace_t *new_aces = NULL; LOG(log_debug9, logtype_afpd, "remove_acl: BEGIN"); /* Get existing ACL and count trivial ACEs */ if ((ace_count = get_nfsv4_acl(name, &old_aces)) == -1) return AFPERR_MISC; trivial_aces = 0; for ( i=0; i < ace_count; i++) { if (old_aces[i].a_flags & (ACE_OWNER | ACE_GROUP | ACE_EVERYONE)) trivial_aces++; } /* malloc buffer for new ACL */ if ((new_aces = malloc(trivial_aces * sizeof(ace_t))) == NULL) { LOG(log_error, logtype_afpd, "remove_acl: malloc %s", strerror(errno)); ret = AFPERR_MISC; goto exit; } /* Now copy the trivial ACEs */ new_aces_count = 0; for (i=0; i < ace_count; i++) { if (old_aces[i].a_flags & (ACE_OWNER | ACE_GROUP | ACE_EVERYONE)) { memcpy(&new_aces[new_aces_count], &old_aces[i], sizeof(ace_t)); new_aces_count++; } } if ( (acl(name, ACE_SETACL, trivial_aces, new_aces)) == 0) ret = AFP_OK; else { LOG(log_error, logtype_afpd, "set_acl: error setting acl: %s", strerror(errno)); if (errno == (EACCES | EPERM)) ret = AFPERR_ACCESS; else if (errno == ENOENT) ret = AFPERR_NOITEM; else ret = AFPERR_MISC; } exit: free(old_aces); free(new_aces); LOG(log_debug9, logtype_afpd, "remove_acl: END"); return ret; } #endif /* HAVE_SOLARIS_ACLS */ #ifdef HAVE_POSIX_ACLS /*! * Remove any ACL_USER, ACL_GROUP, ACL_MASK or ACL_TYPE_DEFAULT ACEs from an object * * @param name (r) filesystem object name * * @returns AFP error code, AFP_OK (= 0) on success, AFPERR_MISC on error */ int remove_acl_vfs(const char *name) { EC_INIT; struct stat st; acl_t acl = NULL; acl_entry_t e; acl_tag_t tag; int entry_id = ACL_FIRST_ENTRY; /* Remove default ACL if it's a dir */ EC_ZERO_LOG_ERR(stat(name, &st), AFPERR_MISC); if (S_ISDIR(st.st_mode)) { EC_NULL_LOG_ERR(acl = acl_init(0), AFPERR_MISC); EC_ZERO_LOG_ERR(acl_set_file(name, ACL_TYPE_DEFAULT, acl), AFPERR_MISC); EC_ZERO_LOG_ERR(acl_free(acl), AFPERR_MISC); acl = NULL; } /* Now get ACL and remove ACL_MASK, ACL_USER or ACL_GROUP entries, then re-set * the ACL again. acl_calc_mask() must not be called because there is no need * for an ACL_MASK entry in a basic ACL. */ EC_NULL_LOG_ERR(acl = acl_get_file(name, ACL_TYPE_ACCESS), AFPERR_MISC); for ( ; acl_get_entry(acl, entry_id, &e) == 1; entry_id = ACL_NEXT_ENTRY) { EC_ZERO_LOG_ERR(acl_get_tag_type(e, &tag), AFPERR_MISC); if (tag == ACL_USER || tag == ACL_GROUP || tag == ACL_MASK) EC_ZERO_LOG_ERR(acl_delete_entry(acl, e), AFPERR_MISC); } EC_ZERO_LOG_ERR(acl_valid(acl), AFPERR_MISC); EC_ZERO_LOG_ERR(acl_set_file(name, ACL_TYPE_ACCESS, acl), AFPERR_MISC); EC_CLEANUP: if (acl) acl_free(acl); EC_EXIT; } #endif /* HAVE_POSIX_ACLS */ netatalk-2.2.2/libatalk/vfs/sys_ea.c0000644000175200017500000004754711655731130014276 00000000000000/* Unix SMB/CIFS implementation. Samba system utilities Copyright (C) Andrew Tridgell 1992-1998 Copyright (C) Jeremy Allison 1998-2005 Copyright (C) Timur Bakeyev 2005 Copyright (C) Bjoern Jacke 2006-2007 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. sys_copyxattr modified from LGPL2.1 libattr copyright Copyright (C) 2001-2002 Silicon Graphics, Inc. All Rights Reserved. Copyright (C) 2001 Andreas Gruenbacher. Samba 3.0.28, modified for netatalk. $Id: sys_ea.c,v 1.6 2009-12-04 10:26:10 franklahm Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #if HAVE_ATTR_XATTR_H #include #elif HAVE_SYS_XATTR_H #include #endif #ifdef HAVE_SYS_EA_H #include #endif #ifdef HAVE_ATTROPEN #include #endif #ifdef HAVE_SYS_EXTATTR_H #include #endif #include #include #include #include #ifndef ENOATTR #define ENOATTR ENODATA #endif /******** Solaris EA helper function prototypes ********/ #ifdef HAVE_ATTROPEN #define SOLARIS_ATTRMODE S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP static int solaris_write_xattr(int attrfd, const char *value, size_t size); static ssize_t solaris_read_xattr(int attrfd, void *value, size_t size); static ssize_t solaris_list_xattr(int attrdirfd, char *list, size_t size); static int solaris_unlinkat(int attrdirfd, const char *name); static int solaris_attropen(const char *path, const char *attrpath, int oflag, mode_t mode); static int solaris_openat(int fildes, const char *path, int oflag, mode_t mode); #endif /************************************************************************** Wrappers for extented attribute calls. Based on the Linux package with support for IRIX and (Net|Free)BSD also. Expand as other systems have them. ****************************************************************************/ static char attr_name[256 +5] = "user."; static const char *prefix(const char *uname) { #if defined(HAVE_ATTROPEN) return uname; #else strlcpy(attr_name +5, uname, 256); return attr_name; #endif } ssize_t sys_getxattr (const char *path, const char *uname, void *value, size_t size) { const char *name = prefix(uname); #if defined(HAVE_GETXATTR) #ifndef XATTR_ADD_OPT return getxattr(path, name, value, size); #else int options = 0; return getxattr(path, name, value, size, 0, options); #endif #elif defined(HAVE_GETEA) return getea(path, name, value, size); #elif defined(HAVE_EXTATTR_GET_FILE) ssize_t retval; /* * The BSD implementation has a nasty habit of silently truncating * the returned value to the size of the buffer, so we have to check * that the buffer is large enough to fit the returned value. */ if((retval = extattr_get_file(path, EXTATTR_NAMESPACE_USER, uname, NULL, 0)) >= 0) { if (size == 0) /* size == 0 means only return size */ return retval; if (retval > size) { errno = ERANGE; return -1; } if ((retval = extattr_get_file(path, EXTATTR_NAMESPACE_USER, uname, value, size)) >= 0) return retval; } LOG(log_maxdebug, logtype_default, "sys_getxattr: extattr_get_file() failed with: %s\n", strerror(errno)); return -1; #elif defined(HAVE_ATTR_GET) int retval, flags = 0; int valuelength = (int)size; char *attrname = strchr(name,'.') + 1; if (strncmp(name, "system", 6) == 0) flags |= ATTR_ROOT; retval = attr_get(path, attrname, (char *)value, &valuelength, flags); return retval ? retval : valuelength; #elif defined(HAVE_ATTROPEN) ssize_t ret = -1; int attrfd = solaris_attropen(path, name, O_RDONLY, 0); if (attrfd >= 0) { ret = solaris_read_xattr(attrfd, value, size); close(attrfd); } return ret; #else errno = ENOSYS; return -1; #endif } ssize_t sys_lgetxattr (const char *path, const char *uname, void *value, size_t size) { const char *name = prefix(uname); #if defined(HAVE_LGETXATTR) return lgetxattr(path, name, value, size); #elif defined(HAVE_GETXATTR) && defined(XATTR_ADD_OPT) int options = XATTR_NOFOLLOW; return getxattr(path, name, value, size, 0, options); #elif defined(HAVE_LGETEA) return lgetea(path, name, value, size); #elif defined(HAVE_EXTATTR_GET_LINK) ssize_t retval; if((retval=extattr_get_link(path, EXTATTR_NAMESPACE_USER, uname, NULL, 0)) >= 0) { if(retval > size) { errno = ERANGE; return -1; } if((retval=extattr_get_link(path, EXTATTR_NAMESPACE_USER, uname, value, size)) >= 0) return retval; } LOG(log_maxdebug, logtype_default, "sys_lgetxattr: extattr_get_link() failed with: %s\n", strerror(errno)); return -1; #elif defined(HAVE_ATTR_GET) int retval, flags = ATTR_DONTFOLLOW; int valuelength = (int)size; char *attrname = strchr(name,'.') + 1; if (strncmp(name, "system", 6) == 0) flags |= ATTR_ROOT; retval = attr_get(path, attrname, (char *)value, &valuelength, flags); return retval ? retval : valuelength; #elif defined(HAVE_ATTROPEN) ssize_t ret = -1; int attrfd = solaris_attropen(path, name, O_RDONLY|AT_SYMLINK_NOFOLLOW, 0); if (attrfd >= 0) { ret = solaris_read_xattr(attrfd, value, size); close(attrfd); } return ret; #else errno = ENOSYS; return -1; #endif } #if defined(HAVE_EXTATTR_LIST_FILE) #define EXTATTR_PREFIX(s) (s), (sizeof((s))-1) static struct { int space; const char *name; size_t len; } extattr[] = { { EXTATTR_NAMESPACE_SYSTEM, EXTATTR_PREFIX("") }, { EXTATTR_NAMESPACE_USER, EXTATTR_PREFIX("") }, }; typedef union { const char *path; int filedes; } extattr_arg; static ssize_t bsd_attr_list (int type, extattr_arg arg, char *list, size_t size) { ssize_t list_size; int i, len; switch(type) { #if defined(HAVE_EXTATTR_LIST_FILE) case 0: list_size = extattr_list_file(arg.path, EXTATTR_NAMESPACE_USER, list, size); break; #endif #if defined(HAVE_EXTATTR_LIST_LINK) case 1: list_size = extattr_list_link(arg.path, EXTATTR_NAMESPACE_USER, list, size); break; #endif #if defined(HAVE_EXTATTR_LIST_FD) case 2: list_size = extattr_list_fd(arg.filedes, EXTATTR_NAMESPACE_USER, list, size); break; #endif default: errno = ENOSYS; return -1; } /* Some error happend. Errno should be set by the previous call */ if(list_size < 0) return -1; /* No attributes */ if(list_size == 0) return 0; /* XXX: Call with an empty buffer may be used to calculate necessary buffer size. Unfortunately, we can't say, how many attributes were returned, so here is the potential problem with the emulation. */ if(list == NULL) return list_size; /* Buffer is too small to fit the results */ if(list_size > size) { errno = ERANGE; return -1; } /* Convert from pascal strings to C strings */ len = list[0]; memmove(list, list + 1, list_size); for(i = len; i < list_size; ) { LOG(log_maxdebug, logtype_afpd, "len: %d, i: %d", len, i); len = list[i]; list[i] = '\0'; i += len + 1; } return list_size; } #endif #if defined(HAVE_ATTR_LIST) && defined(HAVE_SYS_ATTRIBUTES_H) static char attr_buffer[ATTR_MAX_VALUELEN]; static ssize_t irix_attr_list(const char *path, int filedes, char *list, size_t size, int flags) { int retval = 0, index; attrlist_cursor_t *cursor = 0; int total_size = 0; attrlist_t * al = (attrlist_t *)attr_buffer; attrlist_ent_t *ae; size_t ent_size, left = size; char *bp = list; while (True) { if (filedes) retval = attr_listf(filedes, attr_buffer, ATTR_MAX_VALUELEN, flags, cursor); else retval = attr_list(path, attr_buffer, ATTR_MAX_VALUELEN, flags, cursor); if (retval) break; for (index = 0; index < al->al_count; index++) { ae = ATTR_ENTRY(attr_buffer, index); ent_size = strlen(ae->a_name) + sizeof("user."); if (left >= ent_size) { strncpy(bp, "user.", sizeof("user.")); strncat(bp, ae->a_name, ent_size - sizeof("user.")); bp += ent_size; left -= ent_size; } else if (size) { errno = ERANGE; retval = -1; break; } total_size += ent_size; } if (al->al_more == 0) break; } if (retval == 0) { flags |= ATTR_ROOT; cursor = 0; while (True) { if (filedes) retval = attr_listf(filedes, attr_buffer, ATTR_MAX_VALUELEN, flags, cursor); else retval = attr_list(path, attr_buffer, ATTR_MAX_VALUELEN, flags, cursor); if (retval) break; for (index = 0; index < al->al_count; index++) { ae = ATTR_ENTRY(attr_buffer, index); ent_size = strlen(ae->a_name) + sizeof("system."); if (left >= ent_size) { strncpy(bp, "system.", sizeof("system.")); strncat(bp, ae->a_name, ent_size - sizeof("system.")); bp += ent_size; left -= ent_size; } else if (size) { errno = ERANGE; retval = -1; break; } total_size += ent_size; } if (al->al_more == 0) break; } } return (ssize_t)(retval ? retval : total_size); } #endif #if defined(HAVE_LISTXATTR) static ssize_t remove_user(ssize_t ret, char *list, size_t size) { size_t len; char *ptr; char *ptr1; ssize_t ptrsize; if (ret <= 0 || size == 0) return ret; ptrsize = ret; ptr = ptr1 = list; while (ptrsize > 0) { len = strlen(ptr1) +1; ptrsize -= len; if (strncmp(ptr1, "user.",5)) { ptr1 += len; continue; } memmove(ptr, ptr1 +5, len -5); ptr += len -5; ptr1 += len; } return ptr -list; } #endif ssize_t sys_listxattr (const char *path, char *list, size_t size) { #if defined(HAVE_LISTXATTR) ssize_t ret; #ifndef XATTR_ADD_OPT ret = listxattr(path, list, size); #else int options = 0; ret = listxattr(path, list, size, options); #endif return remove_user(ret, list, size); #elif defined(HAVE_LISTEA) return listea(path, list, size); #elif defined(HAVE_EXTATTR_LIST_FILE) extattr_arg arg; arg.path = path; return bsd_attr_list(0, arg, list, size); #elif defined(HAVE_ATTR_LIST) && defined(HAVE_SYS_ATTRIBUTES_H) return irix_attr_list(path, 0, list, size, 0); #elif defined(HAVE_ATTROPEN) ssize_t ret = -1; int attrdirfd = solaris_attropen(path, ".", O_RDONLY, 0); if (attrdirfd >= 0) { ret = solaris_list_xattr(attrdirfd, list, size); close(attrdirfd); } return ret; #else errno = ENOSYS; return -1; #endif } ssize_t sys_llistxattr (const char *path, char *list, size_t size) { #if defined(HAVE_LLISTXATTR) ssize_t ret; ret = llistxattr(path, list, size); return remove_user(ret, list, size); #elif defined(HAVE_LISTXATTR) && defined(XATTR_ADD_OPT) ssize_t ret; int options = XATTR_NOFOLLOW; ret = listxattr(path, list, size, options); return remove_user(ret, list, size); #elif defined(HAVE_LLISTEA) return llistea(path, list, size); #elif defined(HAVE_EXTATTR_LIST_LINK) extattr_arg arg; arg.path = path; return bsd_attr_list(1, arg, list, size); #elif defined(HAVE_ATTR_LIST) && defined(HAVE_SYS_ATTRIBUTES_H) return irix_attr_list(path, 0, list, size, ATTR_DONTFOLLOW); #elif defined(HAVE_ATTROPEN) ssize_t ret = -1; int attrdirfd = solaris_attropen(path, ".", O_RDONLY|AT_SYMLINK_NOFOLLOW, 0); if (attrdirfd >= 0) { ret = solaris_list_xattr(attrdirfd, list, size); close(attrdirfd); } return ret; #else errno = ENOSYS; return -1; #endif } int sys_removexattr (const char *path, const char *uname) { const char *name = prefix(uname); #if defined(HAVE_REMOVEXATTR) #ifndef XATTR_ADD_OPT return removexattr(path, name); #else int options = 0; return removexattr(path, name, options); #endif #elif defined(HAVE_REMOVEEA) return removeea(path, name); #elif defined(HAVE_EXTATTR_DELETE_FILE) return extattr_delete_file(path, EXTATTR_NAMESPACE_USER, uname); #elif defined(HAVE_ATTR_REMOVE) int flags = 0; char *attrname = strchr(name,'.') + 1; if (strncmp(name, "system", 6) == 0) flags |= ATTR_ROOT; return attr_remove(path, attrname, flags); #elif defined(HAVE_ATTROPEN) int ret = -1; int attrdirfd = solaris_attropen(path, ".", O_RDONLY, 0); if (attrdirfd >= 0) { ret = solaris_unlinkat(attrdirfd, name); close(attrdirfd); } return ret; #else errno = ENOSYS; return -1; #endif } int sys_lremovexattr (const char *path, const char *uname) { const char *name = prefix(uname); #if defined(HAVE_LREMOVEXATTR) return lremovexattr(path, name); #elif defined(HAVE_REMOVEXATTR) && defined(XATTR_ADD_OPT) int options = XATTR_NOFOLLOW; return removexattr(path, name, options); #elif defined(HAVE_LREMOVEEA) return lremoveea(path, name); #elif defined(HAVE_EXTATTR_DELETE_LINK) return extattr_delete_link(path, EXTATTR_NAMESPACE_USER, uname); #elif defined(HAVE_ATTR_REMOVE) int flags = ATTR_DONTFOLLOW; char *attrname = strchr(name,'.') + 1; if (strncmp(name, "system", 6) == 0) flags |= ATTR_ROOT; return attr_remove(path, attrname, flags); #elif defined(HAVE_ATTROPEN) int ret = -1; int attrdirfd = solaris_attropen(path, ".", O_RDONLY|AT_SYMLINK_NOFOLLOW, 0); if (attrdirfd >= 0) { ret = solaris_unlinkat(attrdirfd, name); close(attrdirfd); } return ret; #else errno = ENOSYS; return -1; #endif } int sys_setxattr (const char *path, const char *uname, const void *value, size_t size, int flags) { const char *name = prefix(uname); #if defined(HAVE_SETXATTR) #ifndef XATTR_ADD_OPT return setxattr(path, name, value, size, flags); #else int options = 0; return setxattr(path, name, value, size, 0, options); #endif #elif defined(HAVE_SETEA) return setea(path, name, value, size, flags); #elif defined(HAVE_EXTATTR_SET_FILE) int retval = 0; if (flags) { /* Check attribute existence */ retval = extattr_get_file(path, EXTATTR_NAMESPACE_USER, uname, NULL, 0); if (retval < 0) { /* REPLACE attribute, that doesn't exist */ if (flags & XATTR_REPLACE && errno == ENOATTR) { errno = ENOATTR; return -1; } /* Ignore other errors */ } else { /* CREATE attribute, that already exists */ if (flags & XATTR_CREATE) { errno = EEXIST; return -1; } } } retval = extattr_set_file(path, EXTATTR_NAMESPACE_USER, uname, value, size); return (retval < 0) ? -1 : 0; #elif defined(HAVE_ATTR_SET) int myflags = 0; char *attrname = strchr(name,'.') + 1; if (strncmp(name, "system", 6) == 0) myflags |= ATTR_ROOT; if (flags & XATTR_CREATE) myflags |= ATTR_CREATE; if (flags & XATTR_REPLACE) myflags |= ATTR_REPLACE; return attr_set(path, attrname, (const char *)value, size, myflags); #elif defined(HAVE_ATTROPEN) int ret = -1; int myflags = O_RDWR; int attrfd; if (flags & XATTR_CREATE) myflags |= O_EXCL; if (!(flags & XATTR_REPLACE)) myflags |= O_CREAT; attrfd = solaris_attropen(path, name, myflags, (mode_t) SOLARIS_ATTRMODE); if (attrfd >= 0) { ret = solaris_write_xattr(attrfd, value, size); close(attrfd); } return ret; #else errno = ENOSYS; return -1; #endif } int sys_lsetxattr (const char *path, const char *uname, const void *value, size_t size, int flags) { const char *name = prefix(uname); #if defined(HAVE_LSETXATTR) return lsetxattr(path, name, value, size, flags); #elif defined(HAVE_SETXATTR) && defined(XATTR_ADD_OPT) int options = XATTR_NOFOLLOW; return setxattr(path, name, value, size, 0, options); #elif defined(LSETEA) return lsetea(path, name, value, size, flags); #elif defined(HAVE_EXTATTR_SET_LINK) int retval = 0; if (flags) { /* Check attribute existence */ retval = extattr_get_link(path, EXTATTR_NAMESPACE_USER, uname, NULL, 0); if (retval < 0) { /* REPLACE attribute, that doesn't exist */ if (flags & XATTR_REPLACE && errno == ENOATTR) { errno = ENOATTR; return -1; } /* Ignore other errors */ } else { /* CREATE attribute, that already exists */ if (flags & XATTR_CREATE) { errno = EEXIST; return -1; } } } retval = extattr_set_link(path, EXTATTR_NAMESPACE_USER, uname, value, size); return (retval < 0) ? -1 : 0; #elif defined(HAVE_ATTR_SET) int myflags = ATTR_DONTFOLLOW; char *attrname = strchr(name,'.') + 1; if (strncmp(name, "system", 6) == 0) myflags |= ATTR_ROOT; if (flags & XATTR_CREATE) myflags |= ATTR_CREATE; if (flags & XATTR_REPLACE) myflags |= ATTR_REPLACE; return attr_set(path, attrname, (const char *)value, size, myflags); #elif defined(HAVE_ATTROPEN) int ret = -1; int myflags = O_RDWR | AT_SYMLINK_NOFOLLOW; int attrfd; if (flags & XATTR_CREATE) myflags |= O_EXCL; if (!(flags & XATTR_REPLACE)) myflags |= O_CREAT; attrfd = solaris_attropen(path, name, myflags, (mode_t) SOLARIS_ATTRMODE); if (attrfd >= 0) { ret = solaris_write_xattr(attrfd, value, size); close(attrfd); } return ret; #else errno = ENOSYS; return -1; #endif } /************************************************************************** helper functions for Solaris' EA support ****************************************************************************/ #ifdef HAVE_ATTROPEN static ssize_t solaris_read_xattr(int attrfd, void *value, size_t size) { struct stat sbuf; if (fstat(attrfd, &sbuf) == -1) { return -1; } /* This is to return the current size of the named extended attribute */ if (size == 0) { return sbuf.st_size; } /* check size and read xattr */ if (sbuf.st_size > size) { return -1; } return read(attrfd, value, sbuf.st_size); } static ssize_t solaris_list_xattr(int attrdirfd, char *list, size_t size) { ssize_t len = 0; DIR *dirp; struct dirent *de; int newfd = dup(attrdirfd); /* CAUTION: The originating file descriptor should not be used again following the call to fdopendir(). For that reason we dup() the file descriptor here to make things more clear. */ dirp = fdopendir(newfd); while ((de = readdir(dirp))) { size_t listlen; if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, "..") || !strcmp(de->d_name, "SUNWattr_ro") || !strcmp(de->d_name, "SUNWattr_rw")) { /* we don't want "." and ".." here: */ LOG(log_maxdebug, logtype_default, "skipped EA %s\n",de->d_name); continue; } listlen = strlen(de->d_name); if (size == 0) { /* return the current size of the list of extended attribute names*/ len += listlen + 1; } else { /* check size and copy entry + nul into list. */ if ((len + listlen + 1) > size) { errno = ERANGE; len = -1; break; } else { strcpy(list + len, de->d_name); len += listlen; list[len] = '\0'; ++len; } } } if (closedir(dirp) == -1) { LOG(log_error, logtype_default, "closedir dirp: %s",strerror(errno)); return -1; } return len; } static int solaris_unlinkat(int attrdirfd, const char *name) { if (unlinkat(attrdirfd, name, 0) == -1) { return -1; } return 0; } static int solaris_attropen(const char *path, const char *attrpath, int oflag, mode_t mode) { int filedes = attropen(path, attrpath, oflag, mode); if (filedes == -1) { if (errno != ENOENT) LOG(log_error, logtype_default, "attropen(\"%s\", ea:'%s'): %s", path, attrpath, strerror(errno)); errno = ENOATTR; } return filedes; } static int solaris_openat(int fildes, const char *path, int oflag, mode_t mode) { int filedes = openat(fildes, path, oflag, mode); if (filedes == -1) { LOG(log_error, logtype_default, "openat(\"%s\"): %s", path, strerror(errno)); } return filedes; } static int solaris_write_xattr(int attrfd, const char *value, size_t size) { if ((ftruncate(attrfd, 0) == 0) && (write(attrfd, value, size) == size)) { return 0; } else { LOG(log_error, logtype_default, "solaris_write_xattr: %s", strerror(errno)); return -1; } } #endif /*HAVE_ATTROPEN*/ netatalk-2.2.2/libatalk/vfs/ea.c0000644000175200017500000014326711655731245013403 00000000000000/* Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* * Store Extended Attributes inside .AppleDouble folders as follows: * * filename "fileWithEAs" with EAs "testEA1" and "testEA2" * * - create header with with the format struct adouble_ea_ondisk, the file is written to * ".AppleDouble/fileWithEAs::EA" * - store EAs in files "fileWithEAs::EA::testEA1" and "fileWithEAs::EA::testEA2" */ /* * Build mode for EA header from file mode */ static inline mode_t ea_header_mode(mode_t mode) { /* Same as ad_hf_mode(mode) */ mode &= ~(S_IXUSR | S_IXGRP | S_IXOTH); /* Owner must be able to open, read and w-lock it, in order to chmod from eg 0000 -> 0xxxx*/ mode |= S_IRUSR | S_IWUSR; return mode; } /* * Build mode for EA file from file mode */ static inline mode_t ea_mode(mode_t mode) { /* Same as ad_hf_mode(mode) */ mode &= ~(S_IXUSR | S_IXGRP | S_IXOTH); return mode; } /* Taken form afpd/desktop.c */ static char *mtoupath(const struct vol *vol, const char *mpath) { static char upath[ MAXPATHLEN + 2]; /* for convert_charset dest_len parameter +2 */ const char *m; char *u; size_t inplen; size_t outlen; uint16_t flags = CONV_ESCAPEHEX | CONV_ALLOW_COLON; if (!mpath) return NULL; if ( *mpath == '\0' ) { return( "." ); } m = mpath; u = upath; inplen = strlen(m); outlen = MAXPATHLEN; if ((size_t)-1 == (outlen = convert_charset(CH_UTF8_MAC, vol->v_volcharset, vol->v_maccharset, m, inplen, u, outlen, &flags)) ) { return NULL; } return( upath ); } /* * Function: unpack_header * * Purpose: unpack and verify header file data buffer at ea->ea_data into struct ea * * Arguments: * * ea (rw) handle to struct ea * * Returns: 0 on success, -1 on error * * Effects: * * Verifies magic and version. */ static int unpack_header(struct ea * restrict ea) { int ret = 0; unsigned int count = 0; uint32_t uint32; char *buf; /* Check magic and version */ buf = ea->ea_data; if (*(uint32_t *)buf != htonl(EA_MAGIC)) { LOG(log_error, logtype_afpd, "unpack_header: wrong magic 0x%08x", *(uint32_t *)buf); ret = -1; goto exit; } buf += 4; if (*(uint16_t *)buf != htons(EA_VERSION)) { LOG(log_error, logtype_afpd, "unpack_header: wrong version 0x%04x", *(uint16_t *)buf); ret = -1; goto exit; } buf += 2; /* Get EA count */ ea->ea_count = ntohs(*(uint16_t *)buf); LOG(log_debug, logtype_afpd, "unpack_header: number of EAs: %u", ea->ea_count); buf += 2; if (ea->ea_count == 0) return 0; /* Allocate storage for the ea_entries array */ ea->ea_entries = malloc(sizeof(struct ea_entry) * ea->ea_count); if ( ! ea->ea_entries) { LOG(log_error, logtype_afpd, "unpack_header: OOM"); ret = -1; goto exit; } buf = ea->ea_data + EA_HEADER_SIZE; while (count < ea->ea_count) { memcpy(&uint32, buf, 4); /* EA size */ buf += 4; (*(ea->ea_entries))[count].ea_size = ntohl(uint32); (*(ea->ea_entries))[count].ea_name = strdup(buf); if (! (*(ea->ea_entries))[count].ea_name) { LOG(log_error, logtype_afpd, "unpack_header: OOM"); ret = -1; goto exit; } (*(ea->ea_entries))[count].ea_namelen = strlen((*(ea->ea_entries))[count].ea_name); buf += (*(ea->ea_entries))[count].ea_namelen + 1; LOG(log_maxdebug, logtype_afpd, "unpack_header: entry no:%u,\"%s\", size: %u, namelen: %u", count, (*(ea->ea_entries))[count].ea_name, (*(ea->ea_entries))[count].ea_size, (*(ea->ea_entries))[count].ea_namelen); count++; } exit: return ret; } /* * Function: pack_header * * Purpose: pack everything from struct ea into buffer at ea->ea_data * * Arguments: * * ea (rw) handle to struct ea * * Returns: 0 on success, -1 on error * * Effects: * * adjust ea->ea_count in case an ea entry deletetion is detected */ static int pack_header(struct ea * restrict ea) { unsigned int count = 0, eacount = 0; uint16_t uint16; uint32_t uint32; size_t bufsize = EA_HEADER_SIZE; char *buf = ea->ea_data + EA_HEADER_SIZE; LOG(log_debug, logtype_afpd, "pack_header('%s'): ea_count: %u, ea_size: %u", ea->filename, ea->ea_count, ea->ea_size); if (ea->ea_count == 0) /* nothing to do, magic, version and count are still valid in buffer */ return 0; while(count < ea->ea_count) { /* the names */ /* Check if its a deleted entry */ if ( ! ((*ea->ea_entries)[count].ea_name)) { count++; continue; } bufsize += (*(ea->ea_entries))[count].ea_namelen + 1; count++; eacount++; } bufsize += (eacount * 4); /* header + ea_size for each EA */ if (bufsize > ea->ea_size) { /* we must realloc */ if ( ! (buf = realloc(ea->ea_data, bufsize)) ) { LOG(log_error, logtype_afpd, "pack_header: OOM"); return -1; } ea->ea_data = buf; } ea->ea_size = bufsize; /* copy count */ uint16 = htons(eacount); memcpy(ea->ea_data + EA_COUNT_OFF, &uint16, 2); count = 0; buf = ea->ea_data + EA_HEADER_SIZE; while (count < ea->ea_count) { /* Check if its a deleted entry */ if ( ! ((*ea->ea_entries)[count].ea_name)) { count++; continue; } /* First: EA size */ uint32 = htonl((*(ea->ea_entries))[count].ea_size); memcpy(buf, &uint32, 4); buf += 4; /* Second: EA name as C-string */ strcpy(buf, (*(ea->ea_entries))[count].ea_name); buf += (*(ea->ea_entries))[count].ea_namelen + 1; LOG(log_maxdebug, logtype_afpd, "pack_header: entry no:%u,\"%s\", size: %u, namelen: %u", count, (*(ea->ea_entries))[count].ea_name, (*(ea->ea_entries))[count].ea_size, (*(ea->ea_entries))[count].ea_namelen); count++; } ea->ea_count = eacount; LOG(log_debug, logtype_afpd, "pack_header('%s'): ea_count: %u, ea_size: %u", ea->filename, ea->ea_count, ea->ea_size); return 0; } /* * Function: ea_addentry * * Purpose: add one EA into ea->ea_entries[] * * Arguments: * * ea (rw) pointer to struct ea * attruname (r) name of EA * attrsize (r) size of ea * bitmap (r) bitmap from FP func * * Returns: new number of EA entries, -1 on error * * Effects: * * Grow array ea->ea_entries[]. If ea->ea_entries is still NULL, start allocating. * Otherwise realloc and put entry at the end. Increments ea->ea_count. */ static int ea_addentry(struct ea * restrict ea, const char * restrict attruname, size_t attrsize, int bitmap) { int ea_existed = 0; unsigned int count = 0; void *tmprealloc; /* First check if an EA of the requested name already exist */ if (ea->ea_count > 0) { while (count < ea->ea_count) { if (strcmp(attruname, (*ea->ea_entries)[count].ea_name) == 0) { ea_existed = 1; LOG(log_debug, logtype_afpd, "ea_addentry('%s', bitmap:0x%x): exists", attruname, bitmap); if (bitmap & kXAttrCreate) /* its like O_CREAT|O_EXCL -> fail */ return -1; (*(ea->ea_entries))[count].ea_size = attrsize; return 0; } count++; } } if ((bitmap & kXAttrReplace) && ! ea_existed) /* replace was requested, but EA didn't exist */ return -1; if (ea->ea_count == 0) { ea->ea_entries = malloc(sizeof(struct ea_entry)); if ( ! ea->ea_entries) { LOG(log_error, logtype_afpd, "ea_addentry: OOM"); return -1; } } else if (! ea_existed) { tmprealloc = realloc(ea->ea_entries, sizeof(struct ea_entry) * (ea->ea_count + 1)); if ( ! tmprealloc) { LOG(log_error, logtype_afpd, "ea_addentry: OOM"); return -1; } ea->ea_entries = tmprealloc; } /* We've grown the array, now store the entry */ (*(ea->ea_entries))[ea->ea_count].ea_size = attrsize; (*(ea->ea_entries))[ea->ea_count].ea_name = strdup(attruname); if ( ! (*(ea->ea_entries))[ea->ea_count].ea_name) { LOG(log_error, logtype_afpd, "ea_addentry: OOM"); goto error; } (*(ea->ea_entries))[ea->ea_count].ea_namelen = strlen(attruname); ea->ea_count++; return ea->ea_count; error: if (ea->ea_count == 0 && ea->ea_entries) { /* We just allocated storage but had an error somewhere -> free storage*/ free(ea->ea_entries); ea->ea_entries = NULL; } ea->ea_count = 0; return -1; } /* * Function: create_ea_header * * Purpose: create EA header file, only called from ea_open * * Arguments: * * uname (r) filename for which we have to create a header * ea (rw) ea handle with already allocated storage pointed to * by ea->ea_data * * Returns: fd of open header file on success, -1 on error, errno semantics: * EEXIST: open with O_CREAT | O_EXCL failed * * Effects: * * Creates EA header file and initialize ea->ea_data buffer. * Possibe race condition with other afpd processes: * we were called because header file didn't exist in eg. ea_open. We then * try to create a file with O_CREAT | O_EXCL, but the whole process in not atomic. * What do we do then? Someone else is in the process of creating the header too, but * it might not have finished it. That means we cant just open, read and use it! * We therefor currently just break with an error. * On return the header file is still r/w locked. */ static int create_ea_header(const char * restrict uname, struct ea * restrict ea) { int fd = -1, err = 0; char *ptr; if ((fd = open(uname, O_RDWR | O_CREAT | O_EXCL, 0666 & ~ea->vol->v_umask)) == -1) { LOG(log_error, logtype_afpd, "ea_create: open race condition with ea header for file: %s", uname); return -1; } /* lock it */ if ((write_lock(fd, 0, SEEK_SET, 0)) != 0) { LOG(log_error, logtype_afpd, "ea_create: lock race condition with ea header for file: %s", uname); err = -1; goto exit; } /* Now init it */ ptr = ea->ea_data; *(uint32_t *)ptr = htonl(EA_MAGIC); ptr += EA_MAGIC_LEN; *(uint16_t *)ptr = htons(EA_VERSION); ptr += EA_VERSION_LEN; *(uint16_t *)ptr = 0; /* count */ ea->ea_size = EA_HEADER_SIZE; ea->ea_inited = EA_INITED; exit: if (err != 0) { close(fd); fd = -1; } return fd; } /* * Function: write_ea * * Purpose: write an EA to disk * * Arguments: * * ea (r) struct ea handle * attruname (r) EA name * ibuf (r) buffer with EA content * attrsize (r) size of EA * * Returns: 0 on success, -1 on error * * Effects: * * Creates/overwrites EA file. * */ static int write_ea(const struct ea * restrict ea, const char * restrict attruname, const char * restrict ibuf, size_t attrsize) { int fd = -1, ret = AFP_OK; struct stat st; char *eaname; if ((eaname = ea_path(ea, attruname, 1)) == NULL) { LOG(log_error, logtype_afpd, "write_ea('%s'): ea_path error", attruname); return AFPERR_MISC; } LOG(log_maxdebug, logtype_afpd, "write_ea('%s')", eaname); /* Check if it exists, remove if yes*/ if ((stat(eaname, &st)) == 0) { if ((unlink(eaname)) != 0) { if (errno == EACCES) return AFPERR_ACCESS; else return AFPERR_MISC; } } if ((fd = open(eaname, O_RDWR | O_CREAT | O_EXCL, 0666 & ~ea->vol->v_umask)) == -1) { LOG(log_error, logtype_afpd, "write_ea: open race condition: %s", eaname); return -1; } /* lock it */ if ((write_lock(fd, 0, SEEK_SET, 0)) != 0) { LOG(log_error, logtype_afpd, "write_ea: open race condition: %s", eaname); ret = -1; goto exit; } if (write(fd, ibuf, attrsize) != (ssize_t)attrsize) { LOG(log_error, logtype_afpd, "write_ea('%s'): write: %s", eaname, strerror(errno)); ret = -1; goto exit; } exit: if (fd != -1) close(fd); /* and unlock */ return ret; } /* * Function: ea_delentry * * Purpose: delete one EA from ea->ea_entries[] * * Arguments: * * ea (rw) pointer to struct ea * attruname (r) EA name * * Returns: new number of EA entries, -1 on error * * Effects: * * Remove entry from ea->ea_entries[]. Decrement ea->ea_count. * Marks it as unused just by freeing name and setting it to NULL. * ea_close and pack_buffer must honor this. */ static int ea_delentry(struct ea * restrict ea, const char * restrict attruname) { int ret = 0; unsigned int count = 0; if (ea->ea_count == 0) { LOG(log_error, logtype_afpd, "ea_delentry('%s'): illegal ea_count of 0 on deletion", attruname); return -1; } while (count < ea->ea_count) { /* search matching EA */ if ((*ea->ea_entries)[count].ea_name && strcmp(attruname, (*ea->ea_entries)[count].ea_name) == 0) { free((*ea->ea_entries)[count].ea_name); (*ea->ea_entries)[count].ea_name = NULL; LOG(log_debug, logtype_afpd, "ea_delentry('%s'): deleted no %u/%u", attruname, count + 1, ea->ea_count); break; } count++; } return ret; } /* * Function: delete_ea_file * * Purpose: delete EA file from disk * * Arguments: * * ea (r) struct ea handle * attruname (r) EA name * * Returns: 0 on success, -1 on error */ static int delete_ea_file(const struct ea * restrict ea, const char *eaname) { int ret = 0; char *eafile; struct stat st; if ((eafile = ea_path(ea, eaname, 1)) == NULL) { LOG(log_error, logtype_afpd, "delete_ea_file('%s'): ea_path error", eaname); return -1; } /* Check if it exists, remove if yes*/ if ((stat(eafile, &st)) == 0) { if ((unlink(eafile)) != 0) { LOG(log_error, logtype_afpd, "delete_ea_file('%s'): unlink: %s", eafile, strerror(errno)); ret = -1; } else LOG(log_debug, logtype_afpd, "delete_ea_file('%s'): success", eafile); } return ret; } /************************************************************************************* * ea_path, ea_open and ea_close are only global so that dbd can call them *************************************************************************************/ /* * Function: ea_path * * Purpose: return name of ea header filename * * Arguments: * * ea (r) ea handle * eaname (r) name of EA or NULL * macname (r) if != 0 call mtoupath on eaname * * Returns: pointer to name in static buffer, NULL on error * * Effects: * * Calls ad_open, copies buffer, appends "::EA" and if supplied append eanme * Files: "file" -> "file/.AppleDouble/file::EA" * Dirs: "dir" -> "dir/.AppleDouble/.Parent::EA" * "file" with EA "myEA" -> "file/.AppleDouble/file::EA:myEA" */ char *ea_path(const struct ea * restrict ea, const char * restrict eaname, int macname) { char *adname; static char pathbuf[MAXPATHLEN + 1]; /* get name of a adouble file from uname */ adname = ea->vol->ad_path(ea->filename, (ea->ea_flags & EA_DIR) ? ADFLAGS_DIR : 0); /* copy it so we can work with it */ strlcpy(pathbuf, adname, MAXPATHLEN + 1); /* append "::EA" */ strlcat(pathbuf, "::EA", MAXPATHLEN + 1); if (eaname) { strlcat(pathbuf, "::", MAXPATHLEN + 1); if (macname) if ((eaname = mtoupath(ea->vol, eaname)) == NULL) return NULL; strlcat(pathbuf, eaname, MAXPATHLEN + 1); } return pathbuf; } /* * Function: ea_open * * Purpose: open EA header file, create if it doesnt exits and called with O_CREATE * * Arguments: * * vol (r) current volume * uname (r) filename for which we have to open a header * flags (r) EA_CREATE: create if it doesn't exist (without it won't be created) * EA_RDONLY: open read only * EA_RDWR: open read/write * Eiterh EA_RDONLY or EA_RDWR MUST be requested * ea (w) pointer to a struct ea that we fill * * Returns: 0 on success * -1 on misc error with errno = EFAULT * -2 if no EA header exists with errno = ENOENT * * Effects: * * opens header file and stores fd in ea->ea_fd. Size of file is put into ea->ea_size. * number of EAs is stored in ea->ea_count. flags are remembered in ea->ea_flags. * file is either read or write locked depending on the open flags. * When you're done with struct ea you must call ea_close on it. */ int ea_open(const struct vol * restrict vol, const char * restrict uname, eaflags_t eaflags, struct ea * restrict ea) { int ret = 0; char *eaname; struct stat st; /* Enforce usage rules! */ if ( ! (eaflags & (EA_RDONLY | EA_RDWR))) { LOG(log_error, logtype_afpd, "ea_open: called without EA_RDONLY | EA_RDWR", uname); return -1; } /* Set it all to 0 */ memset(ea, 0, sizeof(struct ea)); ea->vol = vol; /* ea_close needs it */ ea->ea_flags = eaflags; ea->dirfd = -1; /* no *at (cf openat) semantics by default */ /* Dont care for errors, eg when removing the file is already gone */ if (!stat(uname, &st) && S_ISDIR(st.st_mode)) ea->ea_flags |= EA_DIR; if ( ! (ea->filename = strdup(uname))) { LOG(log_error, logtype_afpd, "ea_open: OOM"); return -1; } eaname = ea_path(ea, NULL, 0); LOG(log_maxdebug, logtype_afpd, "ea_open: ea_path: %s", eaname); /* Check if it exists, if not create it if EA_CREATE is in eaflags */ if ((stat(eaname, &st)) != 0) { if (errno == ENOENT) { /* It doesnt exist */ if ( ! (eaflags & EA_CREATE)) { /* creation was not requested, so return with error */ ret = -2; goto exit; } /* Now create a header file */ /* malloc buffer for minimal on disk data */ ea->ea_data = malloc(EA_HEADER_SIZE); if (! ea->ea_data) { LOG(log_error, logtype_afpd, "ea_open: OOM"); ret = -1; goto exit; } /* create it */ ea->ea_fd = create_ea_header(eaname, ea); if (ea->ea_fd == -1) { ret = -1; goto exit; } return 0; } else {/* errno != ENOENT */ ret = -1; goto exit; } } /* header file exists, so read and parse it */ /* malloc buffer where we read disk file into */ if (st.st_size < EA_HEADER_SIZE) { LOG(log_error, logtype_afpd, "ea_open('%s'): bogus EA header file", eaname); ret = -1; goto exit; } ea->ea_size = st.st_size; ea->ea_data = malloc(st.st_size); if (! ea->ea_data) { LOG(log_error, logtype_afpd, "ea_open: OOM"); ret = -1; goto exit; } /* Now lock, open and read header file from disk */ if ((ea->ea_fd = open(eaname, (ea->ea_flags & EA_RDWR) ? O_RDWR : O_RDONLY)) == -1) { LOG(log_error, logtype_afpd, "ea_open('%s'): error: %s", eaname, strerror(errno)); ret = -1; goto exit; } /* lock it */ if (ea->ea_flags & EA_RDONLY) { /* read lock */ if ((read_lock(ea->ea_fd, 0, SEEK_SET, 0)) != 0) { LOG(log_error, logtype_afpd, "ea_open: lock error on header: %s", eaname); ret = -1; goto exit; } } else { /* EA_RDWR */ /* write lock */ if ((write_lock(ea->ea_fd, 0, SEEK_SET, 0)) != 0) { LOG(log_error, logtype_afpd, "ea_open: lock error on header: %s", eaname); ret = -1; goto exit; } } /* read it */ if (read(ea->ea_fd, ea->ea_data, ea->ea_size) != (ssize_t)ea->ea_size) { LOG(log_error, logtype_afpd, "ea_open: short read on header: %s", eaname); ret = -1; goto exit; } if ((unpack_header(ea)) != 0) { LOG(log_error, logtype_afpd, "ea_open: error unpacking header for: %s", eaname); ret = -1; goto exit; } exit: switch (ret) { case 0: ea->ea_inited = EA_INITED; break; case -1: errno = EFAULT; /* force some errno distinguishable from ENOENT */ /* fall through */ case -2: if (ea->ea_data) { free(ea->ea_data); ea->ea_data = NULL; } if (ea->ea_fd) { close(ea->ea_fd); ea->ea_fd = -1; } break; } return ret; } /* * Function: ea_openat * * Purpose: openat like wrapper for ea_open, takes a additional file descriptor * * Arguments: * * vol (r) current volume * sfd (r) openat like file descriptor * uname (r) filename for which we have to open a header * flags (r) EA_CREATE: create if it doesn't exist (without it won't be created) * EA_RDONLY: open read only * EA_RDWR: open read/write * Eiterh EA_RDONLY or EA_RDWR MUST be requested * ea (w) pointer to a struct ea that we fill * * Returns: 0 on success * -1 on misc error with errno = EFAULT * -2 if no EA header exists with errno = ENOENT * * Effects: * * opens header file and stores fd in ea->ea_fd. Size of file is put into ea->ea_size. * number of EAs is stored in ea->ea_count. flags are remembered in ea->ea_flags. * file is either read or write locked depending on the open flags. * When you're done with struct ea you must call ea_close on it. */ int ea_openat(const struct vol * restrict vol, int dirfd, const char * restrict uname, eaflags_t eaflags, struct ea * restrict ea) { int ret = 0; int cwdfd = -1; if (dirfd != -1) { if (((cwdfd = open(".", O_RDONLY)) == -1) || (fchdir(dirfd) != 0)) { ret = -1; goto exit; } } ret = ea_open(vol, uname, eaflags, ea); ea->dirfd = dirfd; if (dirfd != -1) { if (fchdir(cwdfd) != 0) { LOG(log_error, logtype_afpd, "ea_openat: cant chdir back, exiting"); exit(EXITERR_SYS); } } exit: if (cwdfd != -1) close(cwdfd); return ret; } /* * Function: ea_close * * Purpose: flushes and closes an ea handle * * Arguments: * * ea (rw) pointer to ea handle * * Returns: 0 on success, -1 on error * * Effects: * * Flushes and then closes and frees all resouces held by ea handle. * Pack data in ea into ea_data, then write ea_data to disk */ int ea_close(struct ea * restrict ea) { int ret = 0; unsigned int count = 0; char *eaname; struct stat st; LOG(log_debug, logtype_afpd, "ea_close('%s')", ea->filename); if (ea->ea_inited != EA_INITED) { LOG(log_warning, logtype_afpd, "ea_close('%s'): non initialized ea", ea->filename); return 0; } /* pack header and write it to disk if it was opened EA_RDWR*/ if (ea->ea_flags & EA_RDWR) { if ((pack_header(ea)) != 0) { LOG(log_error, logtype_afpd, "ea_close: pack header"); ret = -1; } else { if (ea->ea_count == 0) { /* Check if EA header exists and remove it */ eaname = ea_path(ea, NULL, 0); if ((lstatat(ea->dirfd, eaname, &st)) == 0) { if ((netatalk_unlinkat(ea->dirfd, eaname)) != 0) { LOG(log_error, logtype_afpd, "ea_close('%s'): unlink: %s", eaname, strerror(errno)); ret = -1; } else LOG(log_debug, logtype_afpd, "ea_close(unlink '%s'): success", eaname); } else { /* stat error */ if (errno != ENOENT) { LOG(log_error, logtype_afpd, "ea_close('%s'): stat: %s", eaname, strerror(errno)); ret = -1; } } } else { /* ea->ea_count > 0 */ if ((lseek(ea->ea_fd, 0, SEEK_SET)) == -1) { LOG(log_error, logtype_afpd, "ea_close: lseek: %s", strerror(errno)); ret = -1; goto exit; } if ((ftruncate(ea->ea_fd, 0)) == -1) { LOG(log_error, logtype_afpd, "ea_close: ftruncate: %s", strerror(errno)); ret = -1; goto exit; } if (write(ea->ea_fd, ea->ea_data, ea->ea_size) != (ssize_t)ea->ea_size) { LOG(log_error, logtype_afpd, "ea_close: write: %s", strerror(errno)); ret = -1; } } } } exit: /* free names */ while(count < ea->ea_count) { if ( (*ea->ea_entries)[count].ea_name ) { free((*ea->ea_entries)[count].ea_name); (*ea->ea_entries)[count].ea_name = NULL; } count++; } ea->ea_count = 0; if (ea->filename) { free(ea->filename); ea->filename = NULL; } if (ea->ea_entries) { free(ea->ea_entries); ea->ea_entries = NULL; } if (ea->ea_data) { free(ea->ea_data); ea->ea_data = NULL; } if (ea->ea_fd != -1) { close(ea->ea_fd); /* also releases the fcntl lock */ ea->ea_fd = -1; } return 0; } /************************************************************************************ * VFS funcs called from afp_ea* funcs ************************************************************************************/ /* * Function: get_easize * * Purpose: get size of an EA * * Arguments: * * vol (r) current volume * rbuf (w) DSI reply buffer * rbuflen (rw) current length of data in reply buffer * uname (r) filename * oflag (r) link and create flag * attruname (r) name of attribute * * Returns: AFP code: AFP_OK on success or appropiate AFP error code * * Effects: * * Copies EA size into rbuf in network order. Increments *rbuflen +4. */ int get_easize(VFS_FUNC_ARGS_EA_GETSIZE) { int ret = AFPERR_MISC; unsigned int count = 0; uint32_t uint32; struct ea ea; LOG(log_debug, logtype_afpd, "get_easize: file: %s", uname); if ((ea_open(vol, uname, EA_RDONLY, &ea)) != 0) { if (errno != ENOENT) LOG(log_error, logtype_afpd, "get_easize: error calling ea_open for file: %s", uname); memset(rbuf, 0, 4); *rbuflen += 4; return ret; } while (count < ea.ea_count) { if (strcmp(attruname, (*ea.ea_entries)[count].ea_name) == 0) { uint32 = htonl((*ea.ea_entries)[count].ea_size); memcpy(rbuf, &uint32, 4); *rbuflen += 4; ret = AFP_OK; LOG(log_debug, logtype_afpd, "get_easize(\"%s\"): size: %u", attruname, (*ea.ea_entries)[count].ea_size); break; } count++; } if ((ea_close(&ea)) != 0) { LOG(log_error, logtype_afpd, "get_easize: error closing ea handle for file: %s", uname); return AFPERR_MISC; } return ret; } /* * Function: get_eacontent * * Purpose: copy EA into rbuf * * Arguments: * * vol (r) current volume * rbuf (w) DSI reply buffer * rbuflen (rw) current length of data in reply buffer * uname (r) filename * oflag (r) link and create flag * attruname (r) name of attribute * maxreply (r) maximum EA size as of current specs/real-life * * Returns: AFP code: AFP_OK on success or appropiate AFP error code * * Effects: * * Copies EA into rbuf. Increments *rbuflen accordingly. */ int get_eacontent(VFS_FUNC_ARGS_EA_GETCONTENT) { int ret = AFPERR_MISC, fd = -1; unsigned int count = 0; uint32_t uint32; size_t toread; struct ea ea; char *eafile; LOG(log_debug, logtype_afpd, "get_eacontent('%s/%s')", uname, attruname); if ((ea_open(vol, uname, EA_RDONLY, &ea)) != 0) { if (errno != ENOENT) LOG(log_error, logtype_afpd, "get_eacontent('%s'): ea_open error", uname); memset(rbuf, 0, 4); *rbuflen += 4; return ret; } while (count < ea.ea_count) { if (strcmp(attruname, (*ea.ea_entries)[count].ea_name) == 0) { if ( (eafile = ea_path(&ea, attruname, 1)) == NULL) { ret = AFPERR_MISC; break; } if ((fd = open(eafile, O_RDONLY)) == -1) { LOG(log_error, logtype_afpd, "get_eacontent('%s'): open error: %s", uname, strerror(errno)); ret = AFPERR_MISC; break; } /* Check how much the client wants, give him what we think is right */ maxreply -= MAX_REPLY_EXTRA_BYTES; if (maxreply > MAX_EA_SIZE) maxreply = MAX_EA_SIZE; toread = (maxreply < (*ea.ea_entries)[count].ea_size) ? maxreply : (*ea.ea_entries)[count].ea_size; LOG(log_debug, logtype_afpd, "get_eacontent('%s'): sending %u bytes", attruname, toread); /* Put length of EA data in reply buffer */ uint32 = htonl(toread); memcpy(rbuf, &uint32, 4); rbuf += 4; *rbuflen += 4; if (read(fd, rbuf, toread) != (ssize_t)toread) { LOG(log_error, logtype_afpd, "get_eacontent('%s/%s'): short read", uname, attruname); close(fd); ret = AFPERR_MISC; break; } *rbuflen += toread; close(fd); ret = AFP_OK; break; } count++; } if ((ea_close(&ea)) != 0) { LOG(log_error, logtype_afpd, "get_eacontent('%s'): error closing ea handle", uname); return AFPERR_MISC; } return ret; } /* * Function: list_eas * * Purpose: copy names of EAs into attrnamebuf * * Arguments: * * vol (r) current volume * attrnamebuf (w) store names a consecutive C strings here * buflen (rw) length of names in attrnamebuf * uname (r) filename * oflag (r) link and create flag * * Returns: AFP code: AFP_OK on success or appropiate AFP error code * * Effects: * * Copies names of all EAs of uname as consecutive C strings into rbuf. * Increments *buflen accordingly. */ int list_eas(VFS_FUNC_ARGS_EA_LIST) { unsigned int count = 0; int attrbuflen = *buflen, ret = AFP_OK, len; char *buf = attrnamebuf; struct ea ea; LOG(log_debug, logtype_afpd, "list_eas: file: %s", uname); if ((ea_open(vol, uname, EA_RDONLY, &ea)) != 0) { if (errno != ENOENT) { LOG(log_error, logtype_afpd, "list_eas: error calling ea_open for file: %s", uname); return AFPERR_MISC; } else return AFP_OK; } while (count < ea.ea_count) { /* Convert name to CH_UTF8_MAC and directly store in in the reply buffer */ if ( ( len = convert_string(vol->v_volcharset, CH_UTF8_MAC, (*ea.ea_entries)[count].ea_name, (*ea.ea_entries)[count].ea_namelen, buf + attrbuflen, 255)) <= 0 ) { ret = AFPERR_MISC; goto exit; } if (len == 255) /* convert_string didn't 0-terminate */ attrnamebuf[attrbuflen + 255] = 0; LOG(log_debug7, logtype_afpd, "list_eas(%s): EA: %s", uname, (*ea.ea_entries)[count].ea_name); attrbuflen += len + 1; if (attrbuflen > (ATTRNAMEBUFSIZ - 256)) { /* Next EA name could overflow, so bail out with error. FIXME: evantually malloc/memcpy/realloc whatever. Is it worth it ? */ LOG(log_warning, logtype_afpd, "list_eas(%s): running out of buffer for EA names", uname); ret = AFPERR_MISC; goto exit; } count++; } exit: *buflen = attrbuflen; if ((ea_close(&ea)) != 0) { LOG(log_error, logtype_afpd, "list_eas: error closing ea handle for file: %s", uname); return AFPERR_MISC; } return ret; } /* * Function: set_ea * * Purpose: set a Solaris native EA * * Arguments: * * vol (r) current volume * uname (r) filename * attruname (r) EA name * ibuf (r) buffer with EA content * attrsize (r) length EA in ibuf * oflag (r) link and create flag * * Returns: AFP code: AFP_OK on success or appropiate AFP error code * * Effects: * * Copies names of all EAs of uname as consecutive C strings into rbuf. * Increments *rbuflen accordingly. */ int set_ea(VFS_FUNC_ARGS_EA_SET) { int ret = AFP_OK; struct ea ea; LOG(log_debug, logtype_afpd, "set_ea: file: %s", uname); if ((ea_open(vol, uname, EA_CREATE | EA_RDWR, &ea)) != 0) { LOG(log_error, logtype_afpd, "set_ea('%s'): ea_open error", uname); return AFPERR_MISC; } if ((ea_addentry(&ea, attruname, attrsize, oflag)) == -1) { LOG(log_error, logtype_afpd, "set_ea('%s'): ea_addentry error", uname); ret = AFPERR_MISC; goto exit; } if ((write_ea(&ea, attruname, ibuf, attrsize)) != 0) { LOG(log_error, logtype_afpd, "set_ea('%s'): write_ea error", uname); ret = AFPERR_MISC; goto exit; } exit: if ((ea_close(&ea)) != 0) { LOG(log_error, logtype_afpd, "set_ea('%s'): ea_close error", uname); ret = AFPERR_MISC; goto exit; } return ret; } /* * Function: remove_ea * * Purpose: remove a EA from a file * * Arguments: * * vol (r) current volume * uname (r) filename * attruname (r) EA name * oflag (r) link and create flag * * Returns: AFP code: AFP_OK on success or appropiate AFP error code * * Effects: * * Removes EA attruname from file uname. */ int remove_ea(VFS_FUNC_ARGS_EA_REMOVE) { int ret = AFP_OK; struct ea ea; LOG(log_debug, logtype_afpd, "remove_ea('%s/%s')", uname, attruname); if ((ea_open(vol, uname, EA_RDWR, &ea)) != 0) { LOG(log_error, logtype_afpd, "remove_ea('%s'): ea_open error", uname); return AFPERR_MISC; } if ((ea_delentry(&ea, attruname)) == -1) { LOG(log_error, logtype_afpd, "remove_ea('%s'): ea_delentry error", uname); ret = AFPERR_MISC; goto exit; } if ((delete_ea_file(&ea, attruname)) != 0) { LOG(log_error, logtype_afpd, "remove_ea('%s'): delete_ea error", uname); ret = AFPERR_MISC; goto exit; } exit: if ((ea_close(&ea)) != 0) { LOG(log_error, logtype_afpd, "remove_ea('%s'): ea_close error", uname); ret = AFPERR_MISC; goto exit; } return ret; } /****************************************************************************************** * EA VFS funcs that deal with file/dir cp/mv/rm ******************************************************************************************/ int ea_deletefile(VFS_FUNC_ARGS_DELETEFILE) { unsigned int count = 0; int ret = AFP_OK; int cwd = -1; struct ea ea; LOG(log_debug, logtype_afpd, "ea_deletefile('%s')", file); /* Open EA stuff */ if ((ea_openat(vol, dirfd, file, EA_RDWR, &ea)) != 0) { if (errno == ENOENT) /* no EA files, nothing to do */ return AFP_OK; else { LOG(log_error, logtype_afpd, "ea_deletefile('%s'): error calling ea_open", file); return AFPERR_MISC; } } if (dirfd != -1) { if (((cwd = open(".", O_RDONLY)) == -1) || (fchdir(dirfd) != 0)) { ret = AFPERR_MISC; goto exit; } } while (count < ea.ea_count) { if ((delete_ea_file(&ea, (*ea.ea_entries)[count].ea_name)) != 0) { ret = AFPERR_MISC; continue; } free((*ea.ea_entries)[count].ea_name); (*ea.ea_entries)[count].ea_name = NULL; count++; } /* ea_close removes the EA header file for us because all names are NULL */ if ((ea_close(&ea)) != 0) { LOG(log_error, logtype_afpd, "ea_deletefile('%s'): error closing ea handle", file); ret = AFPERR_MISC; } if (dirfd != -1 && fchdir(cwd) != 0) { LOG(log_error, logtype_afpd, "ea_deletefile: cant chdir back. exit!"); exit(EXITERR_SYS); } exit: if (cwd != -1) close(cwd); return ret; } int ea_renamefile(VFS_FUNC_ARGS_RENAMEFILE) { unsigned int count = 0; int ret = AFP_OK; size_t easize; char srceapath[ MAXPATHLEN + 1]; char *eapath; char *eaname; struct ea srcea; struct ea dstea; struct adouble ad; LOG(log_debug, logtype_afpd, "ea_renamefile('%s'/'%s')", src, dst); /* Open EA stuff */ if ((ea_openat(vol, dirfd, src, EA_RDWR, &srcea)) != 0) { if (errno == ENOENT) /* no EA files, nothing to do */ return AFP_OK; else { LOG(log_error, logtype_afpd, "ea_renamefile('%s'/'%s'): ea_open error: '%s'", src, dst, src); return AFPERR_MISC; } } if ((ea_open(vol, dst, EA_RDWR | EA_CREATE, &dstea)) != 0) { if (errno == ENOENT) { /* Possibly the .AppleDouble folder didn't exist, we create it and try again */ ad_init(&ad, vol->v_adouble, vol->v_ad_options); if ((ad_open(dst, ADFLAGS_HF, O_RDWR | O_CREAT, 0666, &ad)) != 0) { LOG(log_error, logtype_afpd, "ea_renamefile('%s/%s'): ad_open error: '%s'", src, dst, dst); ret = AFPERR_MISC; goto exit; } ad_close(&ad, ADFLAGS_HF); if ((ea_open(vol, dst, EA_RDWR | EA_CREATE, &dstea)) != 0) { ret = AFPERR_MISC; goto exit; } } } /* Loop through all EAs: */ while (count < srcea.ea_count) { /* Move EA */ eaname = (*srcea.ea_entries)[count].ea_name; easize = (*srcea.ea_entries)[count].ea_size; /* Build src and dst paths for rename() */ if ((eapath = ea_path(&srcea, eaname, 1)) == NULL) { ret = AFPERR_MISC; goto exit; } strcpy(srceapath, eapath); if ((eapath = ea_path(&dstea, eaname, 1)) == NULL) { ret = AFPERR_MISC; goto exit; } LOG(log_maxdebug, logtype_afpd, "ea_renamefile('%s/%s'): moving EA '%s' to '%s'", src, dst, srceapath, eapath); /* Add EA to dstea */ if ((ea_addentry(&dstea, eaname, easize, 0)) == -1) { LOG(log_error, logtype_afpd, "ea_renamefile('%s/%s'): moving EA '%s' to '%s'", src, dst, srceapath, eapath); ret = AFPERR_MISC; goto exit; } /* Remove EA entry from srcea */ if ((ea_delentry(&srcea, eaname)) == -1) { LOG(log_error, logtype_afpd, "ea_renamefile('%s/%s'): moving EA '%s' to '%s'", src, dst, srceapath, eapath); ea_delentry(&dstea, eaname); ret = AFPERR_MISC; goto exit; } /* Now rename the EA */ if ((unix_rename(dirfd, srceapath, -1, eapath)) < 0) { LOG(log_error, logtype_afpd, "ea_renamefile('%s/%s'): moving EA '%s' to '%s'", src, dst, srceapath, eapath); ret = AFPERR_MISC; goto exit; } count++; } exit: ea_close(&srcea); ea_close(&dstea); return ret; } int ea_copyfile(VFS_FUNC_ARGS_COPYFILE) { unsigned int count = 0; int ret = AFP_OK; size_t easize; char srceapath[ MAXPATHLEN + 1]; char *eapath; char *eaname; struct ea srcea; struct ea dstea; struct adouble ad; LOG(log_debug, logtype_afpd, "ea_copyfile('%s'/'%s')", src, dst); /* Open EA stuff */ if ((ea_openat(vol, sfd, src, EA_RDWR, &srcea)) != 0) { if (errno == ENOENT) /* no EA files, nothing to do */ return AFP_OK; else { LOG(log_error, logtype_afpd, "ea_copyfile('%s'/'%s'): ea_open error: '%s'", src, dst, src); return AFPERR_MISC; } } if ((ea_open(vol, dst, EA_RDWR | EA_CREATE, &dstea)) != 0) { if (errno == ENOENT) { /* Possibly the .AppleDouble folder didn't exist, we create it and try again */ ad_init(&ad, vol->v_adouble, vol->v_ad_options); if ((ad_open(dst, ADFLAGS_HF, O_RDWR | O_CREAT, 0666, &ad)) != 0) { LOG(log_error, logtype_afpd, "ea_copyfile('%s/%s'): ad_open error: '%s'", src, dst, dst); ret = AFPERR_MISC; goto exit; } ad_close(&ad, ADFLAGS_HF); if ((ea_open(vol, dst, EA_RDWR | EA_CREATE, &dstea)) != 0) { ret = AFPERR_MISC; goto exit; } } } /* Loop through all EAs: */ while (count < srcea.ea_count) { /* Copy EA */ eaname = (*srcea.ea_entries)[count].ea_name; easize = (*srcea.ea_entries)[count].ea_size; /* Build src and dst paths for copy_file() */ if ((eapath = ea_path(&srcea, eaname, 1)) == NULL) { ret = AFPERR_MISC; goto exit; } strcpy(srceapath, eapath); if ((eapath = ea_path(&dstea, eaname, 1)) == NULL) { ret = AFPERR_MISC; goto exit; } LOG(log_maxdebug, logtype_afpd, "ea_copyfile('%s/%s'): copying EA '%s' to '%s'", src, dst, srceapath, eapath); /* Add EA to dstea */ if ((ea_addentry(&dstea, eaname, easize, 0)) == -1) { LOG(log_error, logtype_afpd, "ea_copyfile('%s/%s'): ea_addentry('%s') error", src, dst, eaname); ret = AFPERR_MISC; goto exit; } /* Now copy the EA */ if ((copy_file(sfd, srceapath, eapath, (0666 & ~vol->v_umask))) < 0) { LOG(log_error, logtype_afpd, "ea_copyfile('%s/%s'): copying EA '%s' to '%s'", src, dst, srceapath, eapath); ret = AFPERR_MISC; goto exit; } count++; } exit: ea_close(&srcea); ea_close(&dstea); return ret; } int ea_chown(VFS_FUNC_ARGS_CHOWN) { unsigned int count = 0; int ret = AFP_OK; char *eaname; struct ea ea; LOG(log_debug, logtype_afpd, "ea_chown('%s')", path); /* Open EA stuff */ if ((ea_open(vol, path, EA_RDWR, &ea)) != 0) { if (errno == ENOENT) /* no EA files, nothing to do */ return AFP_OK; else { LOG(log_error, logtype_afpd, "ea_chown('%s'): error calling ea_open", path); return AFPERR_MISC; } } if ((lchown(ea_path(&ea, NULL, 0), uid, gid)) != 0) { switch (errno) { case EPERM: case EACCES: ret = AFPERR_ACCESS; goto exit; default: ret = AFPERR_MISC; goto exit; } } while (count < ea.ea_count) { if ((eaname = ea_path(&ea, (*ea.ea_entries)[count].ea_name, 1)) == NULL) { ret = AFPERR_MISC; goto exit; } if ((lchown(eaname, uid, gid)) != 0) { switch (errno) { case EPERM: case EACCES: ret = AFPERR_ACCESS; goto exit; default: ret = AFPERR_MISC; goto exit; } continue; } count++; } exit: if ((ea_close(&ea)) != 0) { LOG(log_error, logtype_afpd, "ea_chown('%s'): error closing ea handle", path); return AFPERR_MISC; } return ret; } int ea_chmod_file(VFS_FUNC_ARGS_SETFILEMODE) { unsigned int count = 0; int ret = AFP_OK; const char *eaname; struct ea ea; LOG(log_debug, logtype_afpd, "ea_chmod_file('%s')", name); /* Open EA stuff */ if ((ea_open(vol, name, EA_RDWR, &ea)) != 0) { if (errno == ENOENT) /* no EA files, nothing to do */ return AFP_OK; else return AFPERR_MISC; } /* Set mode on EA header file */ if ((setfilmode(ea_path(&ea, NULL, 0), ea_header_mode(mode), NULL, vol->v_umask)) != 0) { LOG(log_error, logtype_afpd, "ea_chmod_file('%s'): %s", ea_path(&ea, NULL, 0), strerror(errno)); switch (errno) { case EPERM: case EACCES: ret = AFPERR_ACCESS; goto exit; default: ret = AFPERR_MISC; goto exit; } } /* Set mode on EA files */ while (count < ea.ea_count) { if ((eaname = ea_path(&ea, (*ea.ea_entries)[count].ea_name, 1)) == NULL) { ret = AFPERR_MISC; goto exit; } if ((setfilmode(eaname, ea_mode(mode), NULL, vol->v_umask)) != 0) { LOG(log_error, logtype_afpd, "ea_chmod_file('%s'): %s", eaname, strerror(errno)); switch (errno) { case EPERM: case EACCES: ret = AFPERR_ACCESS; goto exit; default: ret = AFPERR_MISC; goto exit; } continue; } count++; } exit: if ((ea_close(&ea)) != 0) { LOG(log_error, logtype_afpd, "ea_chmod_file('%s'): error closing ea handle", name); return AFPERR_MISC; } return ret; } int ea_chmod_dir(VFS_FUNC_ARGS_SETDIRUNIXMODE) { int ret = AFP_OK; unsigned int count = 0; uid_t uid; const char *eaname; const char *eaname_safe = NULL; struct ea ea; LOG(log_debug, logtype_afpd, "ea_chmod_dir('%s')", name); /* .AppleDouble already might be inaccesible, so we must run as id 0 */ uid = geteuid(); if (seteuid(0)) { LOG(log_error, logtype_afpd, "ea_chmod_dir('%s'): seteuid: %s", name, strerror(errno)); return AFPERR_MISC; } /* Open EA stuff */ if ((ea_open(vol, name, EA_RDWR, &ea)) != 0) { /* ENOENT --> no EA files, nothing to do */ if (errno != ENOENT) ret = AFPERR_MISC; if (seteuid(uid) < 0) { LOG(log_error, logtype_afpd, "can't seteuid back: %s", strerror(errno)); exit(EXITERR_SYS); } return ret; } /* Set mode on EA header */ if ((setfilmode(ea_path(&ea, NULL, 0), ea_header_mode(mode), NULL, vol->v_umask)) != 0) { LOG(log_error, logtype_afpd, "ea_chmod_dir('%s'): %s", ea_path(&ea, NULL, 0), strerror(errno)); switch (errno) { case EPERM: case EACCES: ret = AFPERR_ACCESS; goto exit; default: ret = AFPERR_MISC; goto exit; } } /* Set mode on EA files */ while (count < ea.ea_count) { eaname = (*ea.ea_entries)[count].ea_name; /* * Be careful with EA names from the EA header! * Eg NFS users might have access to them, can inject paths using ../ or /..... * FIXME: * Until the EA code escapes / in EA name requests from the client, these therefor wont work. */ if ((eaname_safe = strrchr(eaname, '/'))) { LOG(log_warning, logtype_afpd, "ea_chmod_dir('%s'): contains a slash", eaname); eaname = eaname_safe; } if ((eaname = ea_path(&ea, eaname, 1)) == NULL) { ret = AFPERR_MISC; goto exit; } if ((setfilmode(eaname, ea_mode(mode), NULL, vol->v_umask)) != 0) { LOG(log_error, logtype_afpd, "ea_chmod_dir('%s'): %s", eaname, strerror(errno)); switch (errno) { case EPERM: case EACCES: ret = AFPERR_ACCESS; goto exit; default: ret = AFPERR_MISC; goto exit; } continue; } count++; } exit: if (seteuid(uid) < 0) { LOG(log_error, logtype_afpd, "can't seteuid back: %s", strerror(errno)); exit(EXITERR_SYS); } if ((ea_close(&ea)) != 0) { LOG(log_error, logtype_afpd, "ea_chmod_dir('%s'): error closing ea handle", name); return AFPERR_MISC; } return ret; } netatalk-2.2.2/libatalk/vfs/vfs.c0000644000175200017500000010445011655731245013603 00000000000000/* Copyright (c) 2004 Didier Gautheron Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct perm { uid_t uid; gid_t gid; }; typedef int (*rf_loop)(struct dirent *, char *, void *, int , mode_t ); /* ----------------------------- */ static int for_each_adouble(const char *from, const char *name, rf_loop fn, void *data, int flag, mode_t v_umask) { char buf[ MAXPATHLEN + 1]; char *m; DIR *dp; struct dirent *de; int ret; if (NULL == ( dp = opendir( name)) ) { if (!flag) { LOG(log_error, logtype_afpd, "%s: opendir %s: %s", from, fullpathname(name),strerror(errno) ); return -1; } return 0; } strlcpy( buf, name, sizeof(buf)); strlcat( buf, "/", sizeof(buf) ); m = strchr( buf, '\0' ); ret = 0; while ((de = readdir(dp))) { if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, "..")) { continue; } strlcat(buf, de->d_name, sizeof(buf)); if (fn && (ret = fn(de, buf, data, flag, v_umask))) { closedir(dp); return ret; } *m = 0; } closedir(dp); return ret; } /******************************************************************************* * classic adouble format *******************************************************************************/ static int netatalk_name(const char *name) { return strcasecmp(name,".AppleDouble") && strcasecmp(name,".AppleDB") && strcasecmp(name,".AppleDesktop"); } static int validupath_adouble(VFS_FUNC_ARGS_VALIDUPATH) { if (name[0] != '.') return 1; if (!(vol->v_flags & AFPVOL_USEDOTS)) return 0; return netatalk_name(name) && strcasecmp(name,".Parent"); } /* ----------------- */ static int RF_chown_adouble(VFS_FUNC_ARGS_CHOWN) { struct stat st; char *ad_p; ad_p = vol->ad_path(path, ADFLAGS_HF ); if ( stat( ad_p, &st ) < 0 ) return 0; /* ignore */ return chown( ad_p, uid, gid ); } /* ----------------- */ static int RF_renamedir_adouble(VFS_FUNC_ARGS_RENAMEDIR) { return 0; } /* ----------------- */ static int deletecurdir_adouble_loop(struct dirent *de, char *name, void *data _U_, int flag _U_, mode_t v_umask) { struct stat st; int err; /* bail if the file exists in the current directory. * note: this will not fail with dangling symlinks */ if (stat(de->d_name, &st) == 0) return AFPERR_DIRNEMPT; if ((err = netatalk_unlink(name))) return err; return 0; } static int RF_deletecurdir_adouble(VFS_FUNC_ARGS_DELETECURDIR) { int err; /* delete stray .AppleDouble files. this happens to get .Parent files as well. */ if ((err = for_each_adouble("deletecurdir", ".AppleDouble", deletecurdir_adouble_loop, NULL, 1, vol->v_umask))) return err; return netatalk_rmdir(-1, ".AppleDouble" ); } /* ----------------- */ static int adouble_setfilmode(const char * name, mode_t mode, struct stat *st, mode_t v_umask) { return setfilmode(name, ad_hf_mode(mode), st, v_umask); } static int RF_setfilmode_adouble(VFS_FUNC_ARGS_SETFILEMODE) { return adouble_setfilmode(vol->ad_path(name, ADFLAGS_HF ), mode, st, vol->v_umask); } /* ----------------- */ static int RF_setdirunixmode_adouble(VFS_FUNC_ARGS_SETDIRUNIXMODE) { char *adouble = vol->ad_path(name, ADFLAGS_DIR ); int dropbox = vol->v_flags; if (dir_rx_set(mode)) { if (stickydirmode(ad_dir(adouble), DIRBITS | mode, dropbox, vol->v_umask) < 0 ) return -1; } if (adouble_setfilmode(vol->ad_path(name, ADFLAGS_DIR ), mode, st, vol->v_umask) < 0) return -1; if (!dir_rx_set(mode)) { if (stickydirmode(ad_dir(adouble), DIRBITS | mode, dropbox, vol->v_umask) < 0 ) return -1 ; } return 0; } /* ----------------- */ static int setdirmode_adouble_loop(struct dirent *de _U_, char *name, void *data, int flag, mode_t v_umask) { mode_t hf_mode = *(mode_t *)data; struct stat st; if ( stat( name, &st ) < 0 ) { if (flag) return 0; LOG(log_error, logtype_afpd, "setdirmode: stat %s: %s", name, strerror(errno) ); } else if (!S_ISDIR(st.st_mode)) { if (setfilmode(name, hf_mode , &st, v_umask) < 0) { /* FIXME what do we do then? */ } } return 0; } static int RF_setdirmode_adouble(VFS_FUNC_ARGS_SETDIRMODE) { int dropbox = vol->v_flags; mode_t hf_mode = ad_hf_mode(mode); char *adouble = vol->ad_path(name, ADFLAGS_DIR ); char *adouble_p = ad_dir(adouble); if (dir_rx_set(mode)) { if (stickydirmode(ad_dir(adouble), DIRBITS | mode, dropbox, vol->v_umask) < 0) return -1; } if (for_each_adouble("setdirmode", adouble_p, setdirmode_adouble_loop, &hf_mode, vol_noadouble(vol), vol->v_umask)) return -1; if (!dir_rx_set(mode)) { if (stickydirmode(ad_dir(adouble), DIRBITS | mode, dropbox, vol->v_umask) < 0) return -1 ; } return 0; } /* ----------------- */ static int setdirowner_adouble_loop(struct dirent *de _U_, char *name, void *data, int flag _U_, mode_t v_umask _U_) { struct perm *owner = data; if ( chown( name, owner->uid, owner->gid ) < 0 && errno != EPERM ) { LOG(log_debug, logtype_afpd, "setdirowner: chown %d/%d %s: %s", owner->uid, owner->gid, fullpathname(name), strerror(errno) ); /* return ( -1 ); Sometimes this is okay */ } return 0; } static int RF_setdirowner_adouble(VFS_FUNC_ARGS_SETDIROWNER) { int noadouble = vol_noadouble(vol); char *adouble_p; struct stat st; struct perm owner; owner.uid = uid; owner.gid = gid; adouble_p = ad_dir(vol->ad_path(name, ADFLAGS_DIR )); if (for_each_adouble("setdirowner", adouble_p, setdirowner_adouble_loop, &owner, noadouble, vol->v_umask)) return -1; /* * We cheat: we know that chown doesn't do anything. */ if ( stat( ".AppleDouble", &st ) < 0) { if (errno == ENOENT && noadouble) return 0; LOG(log_error, logtype_afpd, "setdirowner: stat %s: %s", fullpathname(".AppleDouble"), strerror(errno) ); return -1; } if ( gid && gid != st.st_gid && chown( ".AppleDouble", uid, gid ) < 0 && errno != EPERM ) { LOG(log_debug, logtype_afpd, "setdirowner: chown %d/%d %s: %s", uid, gid,fullpathname(".AppleDouble"), strerror(errno) ); /* return ( -1 ); Sometimes this is okay */ } return 0; } /* ----------------- */ static int RF_deletefile_adouble(VFS_FUNC_ARGS_DELETEFILE) { return netatalk_unlinkat(dirfd, vol->ad_path(file, ADFLAGS_HF)); } /* ----------------- */ static int RF_renamefile_adouble(VFS_FUNC_ARGS_RENAMEFILE) { char adsrc[ MAXPATHLEN + 1]; int err = 0; strcpy( adsrc, vol->ad_path(src, 0 )); if (unix_rename(dirfd, adsrc, -1, vol->ad_path(dst, 0 )) < 0) { struct stat st; err = errno; if (errno == ENOENT) { struct adouble ad; if (lstatat(dirfd, adsrc, &st)) /* source has no ressource fork, */ return 0; /* We are here because : * -there's no dest folder. * -there's no .AppleDouble in the dest folder. * if we use the struct adouble passed in parameter it will not * create .AppleDouble if the file is already opened, so we * use a diff one, it's not a pb,ie it's not the same file, yet. */ ad_init(&ad, vol->v_adouble, vol->v_ad_options); if (!ad_open(dst, ADFLAGS_HF, O_RDWR | O_CREAT, 0666, &ad)) { ad_close(&ad, ADFLAGS_HF); if (!unix_rename(dirfd, adsrc, -1, vol->ad_path(dst, 0 )) ) err = 0; else err = errno; } else { /* it's something else, bail out */ err = errno; } } } if (err) { errno = err; return -1; } return 0; } static int RF_copyfile_adouble(VFS_FUNC_ARGS_COPYFILE) /* const struct vol *vol, int sfd, const char *src, const char *dst */ { EC_INIT; bstring s = NULL, d = NULL; char *dup1 = NULL; char *dup2 = NULL; char *dup3 = NULL; char *dup4 = NULL; const char *name = NULL; const char *dir = NULL; struct stat st; EC_ZERO(stat(dst, &st)); if (S_ISDIR(st.st_mode)) { /* build src path to AppleDouble file*/ EC_NULL(s = bfromcstr(src)); EC_ZERO(bcatcstr(s, "/.AppleDouble/.Parent")); /* build dst path to AppleDouble file*/ EC_NULL(d = bfromcstr(dst)); EC_ZERO(bcatcstr(d, "/.AppleDouble/.Parent")); } else { /* get basename */ /* build src path to AppleDouble file*/ EC_NULL(dup1 = strdup(src)); EC_NULL(name = basename(strdup(dup1))); EC_NULL(dup2 = strdup(src)); EC_NULL(dir = dirname(dup2)); EC_NULL(s = bfromcstr(dir)); EC_ZERO(bcatcstr(s, "/.AppleDouble/")); EC_ZERO(bcatcstr(s, name)); /* build dst path to AppleDouble file*/ EC_NULL(dup4 = strdup(dst)); EC_NULL(name = basename(strdup(dup4))); EC_NULL(dup3 = strdup(dst)); EC_NULL(dir = dirname(dup3)); EC_NULL(d = bfromcstr(dir)); EC_ZERO(bcatcstr(d, "/.AppleDouble/")); EC_ZERO(bcatcstr(d, name)); } EC_ZERO(copy_file(sfd, cfrombstr(s), cfrombstr(d), 0666)); EC_CLEANUP: bdestroy(s); bdestroy(d); if (dup1) free(dup1); if (dup2) free(dup2); if (dup3) free(dup3); if (dup4) free(dup4); EC_EXIT; } #ifdef HAVE_SOLARIS_ACLS static int RF_solaris_acl(VFS_FUNC_ARGS_ACL) { static char buf[ MAXPATHLEN + 1]; struct stat st; int len; if ((stat(path, &st)) != 0) return -1; if (S_ISDIR(st.st_mode)) { len = snprintf(buf, MAXPATHLEN, "%s/.AppleDouble",path); if (len < 0 || len >= MAXPATHLEN) return -1; /* set acl on .AppleDouble dir first */ if ((acl(buf, cmd, count, aces)) != 0) return -1; /* now set ACL on ressource fork */ if ((acl(vol->ad_path(path, ADFLAGS_DIR), cmd, count, aces)) != 0) return -1; } else /* set ACL on ressource fork */ if ((acl(vol->ad_path(path, ADFLAGS_HF), cmd, count, aces)) != 0) return -1; return 0; } static int RF_solaris_remove_acl(VFS_FUNC_ARGS_REMOVE_ACL) { int ret; static char buf[ MAXPATHLEN + 1]; int len; if (dir) { len = snprintf(buf, MAXPATHLEN, "%s/.AppleDouble",path); if (len < 0 || len >= MAXPATHLEN) return AFPERR_MISC; /* remove ACL from .AppleDouble/.Parent first */ if ((ret = remove_acl_vfs(vol->ad_path(path, ADFLAGS_DIR))) != AFP_OK) return ret; /* now remove from .AppleDouble dir */ if ((ret = remove_acl_vfs(buf)) != AFP_OK) return ret; } else /* remove ACL from ressource fork */ if ((ret = remove_acl_vfs(vol->ad_path(path, ADFLAGS_HF))) != AFP_OK) return ret; return AFP_OK; } #endif #ifdef HAVE_POSIX_ACLS static int RF_posix_acl(VFS_FUNC_ARGS_ACL) { EC_INIT; static char buf[ MAXPATHLEN + 1]; struct stat st; int len; if (S_ISDIR(st.st_mode)) { len = snprintf(buf, MAXPATHLEN, "%s/.AppleDouble",path); if (len < 0 || len >= MAXPATHLEN) EC_FAIL; /* set acl on .AppleDouble dir first */ EC_ZERO_LOG(acl_set_file(buf, type, acl)); if (type == ACL_TYPE_ACCESS) /* set ACL on ressource fork (".Parent") too */ EC_ZERO_LOG(acl_set_file(vol->ad_path(path, ADFLAGS_DIR), type, acl)); } else { /* set ACL on ressource fork */ EC_ZERO_LOG(acl_set_file(vol->ad_path(path, ADFLAGS_HF), type, acl)); } EC_CLEANUP: if (ret != 0) return AFPERR_MISC; return AFP_OK; } static int RF_posix_remove_acl(VFS_FUNC_ARGS_REMOVE_ACL) { EC_INIT; static char buf[ MAXPATHLEN + 1]; int len; if (dir) { len = snprintf(buf, MAXPATHLEN, "%s/.AppleDouble",path); if (len < 0 || len >= MAXPATHLEN) return AFPERR_MISC; /* remove ACL from .AppleDouble/.Parent first */ EC_ZERO_LOG_ERR(remove_acl_vfs(vol->ad_path(path, ADFLAGS_DIR)), AFPERR_MISC); /* now remove from .AppleDouble dir */ EC_ZERO_LOG_ERR(remove_acl_vfs(buf), AFPERR_MISC); } else { /* remove ACL from ressource fork */ EC_ZERO_LOG_ERR(remove_acl_vfs(vol->ad_path(path, ADFLAGS_HF)), AFPERR_MISC); } EC_CLEANUP: EC_EXIT; } #endif /********************************************************************************* * sfm adouble format *********************************************************************************/ static int ads_chown_loop(struct dirent *de _U_, char *name, void *data, int flag _U_, mode_t v_umask _U_) { struct perm *owner = data; if (chown( name , owner->uid, owner->gid ) < 0) { return -1; } return 0; } static int RF_chown_ads(VFS_FUNC_ARGS_CHOWN) { struct stat st; char *ad_p; struct perm owner; owner.uid = uid; owner.gid = gid; ad_p = ad_dir(vol->ad_path(path, ADFLAGS_HF )); if ( stat( ad_p, &st ) < 0 ) { /* ignore */ return 0; } if (chown( ad_p, uid, gid ) < 0) { return -1; } return for_each_adouble("chown_ads", ad_p, ads_chown_loop, &owner, 1, vol->v_umask); } /* --------------------------------- */ static int deletecurdir_ads1_loop(struct dirent *de _U_, char *name, void *data _U_, int flag _U_, mode_t v_umask _U_) { return netatalk_unlink(name); } static int ads_delete_rf(char *name) { int err; if ((err = for_each_adouble("deletecurdir", name, deletecurdir_ads1_loop, NULL, 1, 0))) return err; /* FIXME * it's a problem for a nfs mounted folder, there's .nfsxxx around * for linux the following line solve it. * but it could fail if rm .nfsxxx create a new .nfsyyy :( */ if ((err = for_each_adouble("deletecurdir", name, deletecurdir_ads1_loop, NULL, 1, 0))) return err; return netatalk_rmdir(-1, name); } static int deletecurdir_ads_loop(struct dirent *de, char *name, void *data _U_, int flag _U_, mode_t v_umask _U_) { struct stat st; /* bail if the file exists in the current directory. * note: this will not fail with dangling symlinks */ if (stat(de->d_name, &st) == 0) { return AFPERR_DIRNEMPT; } return ads_delete_rf(name); } static int RF_deletecurdir_ads(VFS_FUNC_ARGS_DELETECURDIR) { int err; /* delete stray .AppleDouble files. this happens to get .Parent files as well. */ if ((err = for_each_adouble("deletecurdir", ".AppleDouble", deletecurdir_ads_loop, NULL, 1, 0))) return err; return netatalk_rmdir(-1, ".AppleDouble" ); } /* ------------------- */ struct set_mode { mode_t mode; struct stat *st; }; static int ads_setfilmode_loop(struct dirent *de _U_, char *name, void *data, int flag _U_, mode_t v_umask) { struct set_mode *param = data; return setfilmode(name, param->mode, param->st, v_umask); } static int ads_setfilmode(const char * name, mode_t mode, struct stat *st, mode_t v_umask) { mode_t file_mode = ad_hf_mode(mode); mode_t dir_mode = file_mode; struct set_mode param; if ((dir_mode & (S_IRUSR | S_IWUSR ))) dir_mode |= S_IXUSR; if ((dir_mode & (S_IRGRP | S_IWGRP ))) dir_mode |= S_IXGRP; if ((dir_mode & (S_IROTH | S_IWOTH ))) dir_mode |= S_IXOTH; /* change folder */ dir_mode |= DIRBITS; if (dir_rx_set(dir_mode)) { if (chmod_acl( name, dir_mode ) < 0) return -1; } param.st = st; param.mode = file_mode; if (for_each_adouble("setfilmode_ads", name, ads_setfilmode_loop, ¶m, 0, v_umask) < 0) return -1; if (!dir_rx_set(dir_mode)) { if (chmod_acl( name, dir_mode ) < 0) return -1; } return 0; } static int RF_setfilmode_ads(VFS_FUNC_ARGS_SETFILEMODE) { return ads_setfilmode(ad_dir(vol->ad_path(name, ADFLAGS_HF )), mode, st, vol->v_umask); } /* ------------------- */ static int RF_setdirunixmode_ads(VFS_FUNC_ARGS_SETDIRUNIXMODE) { char *adouble = vol->ad_path(name, ADFLAGS_DIR ); char ad_p[ MAXPATHLEN + 1]; int dropbox = vol->v_flags; strlcpy(ad_p,ad_dir(adouble), MAXPATHLEN + 1); if (dir_rx_set(mode)) { /* .AppleDouble */ if (stickydirmode(ad_dir(ad_p), DIRBITS | mode, dropbox, vol->v_umask) < 0) return -1; /* .AppleDouble/.Parent */ if (stickydirmode(ad_p, DIRBITS | mode, dropbox, vol->v_umask) < 0) return -1; } if (ads_setfilmode(ad_dir(vol->ad_path(name, ADFLAGS_DIR)), mode, st, vol->v_umask) < 0) return -1; if (!dir_rx_set(mode)) { if (stickydirmode(ad_p, DIRBITS | mode, dropbox, vol->v_umask) < 0) return -1 ; if (stickydirmode(ad_dir(ad_p), DIRBITS | mode, dropbox, vol->v_umask) < 0) return -1; } return 0; } /* ------------------- */ struct dir_mode { mode_t mode; int dropbox; }; static int setdirmode_ads_loop(struct dirent *de _U_, char *name, void *data, int flag, mode_t v_umask) { struct dir_mode *param = data; int ret = 0; /* 0 ignore error, -1 */ if (dir_rx_set(param->mode)) { if (stickydirmode(name, DIRBITS | param->mode, param->dropbox, v_umask) < 0) { if (flag) { return 0; } return ret; } } if (ads_setfilmode(name, param->mode, NULL, v_umask) < 0) return ret; if (!dir_rx_set(param->mode)) { if (stickydirmode(name, DIRBITS | param->mode, param->dropbox, v_umask) < 0) { if (flag) { return 0; } return ret; } } return 0; } static int RF_setdirmode_ads(VFS_FUNC_ARGS_SETDIRMODE) { char *adouble = vol->ad_path(name, ADFLAGS_DIR ); char ad_p[ MAXPATHLEN + 1]; struct dir_mode param; param.mode = mode; param.dropbox = vol->v_flags; strlcpy(ad_p,ad_dir(adouble), sizeof(ad_p)); if (dir_rx_set(mode)) { /* .AppleDouble */ if (stickydirmode(ad_dir(ad_p), DIRBITS | mode, param.dropbox, vol->v_umask) < 0) return -1; } if (for_each_adouble("setdirmode_ads", ad_dir(ad_p), setdirmode_ads_loop, ¶m, vol_noadouble(vol), vol->v_umask)) return -1; if (!dir_rx_set(mode)) { if (stickydirmode(ad_dir(ad_p), DIRBITS | mode, param.dropbox, vol->v_umask) < 0 ) return -1; } return 0; } /* ------------------- */ static int setdirowner_ads1_loop(struct dirent *de _U_, char *name, void *data, int flag _U_, mode_t v_umask _U_) { struct perm *owner = data; if ( chown( name, owner->uid, owner->gid ) < 0 && errno != EPERM ) { LOG(log_debug, logtype_afpd, "setdirowner: chown %d/%d %s: %s", owner->uid, owner->gid, fullpathname(name), strerror(errno) ); /* return ( -1 ); Sometimes this is okay */ } return 0; } static int setdirowner_ads_loop(struct dirent *de _U_, char *name, void *data, int flag, mode_t v_umask _U_) { struct perm *owner = data; if (for_each_adouble("setdirowner", name, setdirowner_ads1_loop, data, flag, 0) < 0) return -1; if ( chown( name, owner->uid, owner->gid ) < 0 && errno != EPERM ) { LOG(log_debug, logtype_afpd, "setdirowner: chown %d/%d %s: %s", owner->uid, owner->gid, fullpathname(name), strerror(errno) ); /* return ( -1 ); Sometimes this is okay */ } return 0; } static int RF_setdirowner_ads(VFS_FUNC_ARGS_SETDIROWNER) { int noadouble = vol_noadouble(vol); char adouble_p[ MAXPATHLEN + 1]; struct stat st; struct perm owner; owner.uid = uid; owner.gid = gid; strlcpy(adouble_p, ad_dir(vol->ad_path(name, ADFLAGS_DIR )), sizeof(adouble_p)); if (for_each_adouble("setdirowner", ad_dir(adouble_p), setdirowner_ads_loop, &owner, noadouble, 0)) return -1; /* * We cheat: we know that chown doesn't do anything. */ if ( stat( ".AppleDouble", &st ) < 0) { if (errno == ENOENT && noadouble) return 0; LOG(log_error, logtype_afpd, "setdirowner: stat %s: %s", fullpathname(".AppleDouble"), strerror(errno) ); return -1; } if ( gid && gid != st.st_gid && chown( ".AppleDouble", uid, gid ) < 0 && errno != EPERM ) { LOG(log_debug, logtype_afpd, "setdirowner: chown %d/%d %s: %s", uid, gid,fullpathname(".AppleDouble"), strerror(errno) ); /* return ( -1 ); Sometimes this is okay */ } return 0; } /* ------------------- */ static int RF_deletefile_ads(VFS_FUNC_ARGS_DELETEFILE) { int ret = 0; int cwd = -1; char *ad_p; ad_p = ad_dir(vol->ad_path(file, ADFLAGS_HF )); if (dirfd != -1) { if (((cwd = open(".", O_RDONLY)) == -1) || (fchdir(dirfd) != 0)) { ret = AFPERR_MISC; goto exit; } } ret = ads_delete_rf(ad_p); if (dirfd != -1 && fchdir(cwd) != 0) { LOG(log_error, logtype_afpd, "RF_deletefile_ads: cant chdir back. exit!"); exit(EXITERR_SYS); } exit: if (cwd != -1) close(cwd); return ret; } /* --------------------------- */ static int RF_renamefile_ads(VFS_FUNC_ARGS_RENAMEFILE) { char adsrc[ MAXPATHLEN + 1]; int err = 0; strcpy( adsrc, ad_dir(vol->ad_path(src, 0 ))); if (unix_rename(dirfd, adsrc, -1, ad_dir(vol->ad_path(dst, 0 ))) < 0) { struct stat st; err = errno; if (errno == ENOENT) { struct adouble ad; if (lstatat(dirfd, adsrc, &st)) /* source has no ressource fork, */ return 0; /* We are here because : * -there's no dest folder. * -there's no .AppleDouble in the dest folder. * if we use the struct adouble passed in parameter it will not * create .AppleDouble if the file is already opened, so we * use a diff one, it's not a pb,ie it's not the same file, yet. */ ad_init(&ad, vol->v_adouble, vol->v_ad_options); if (!ad_open(dst, ADFLAGS_HF, O_RDWR | O_CREAT, 0666, &ad)) { ad_close(&ad, ADFLAGS_HF); /* We must delete it */ RF_deletefile_ads(vol, -1, dst ); if (!unix_rename(dirfd, adsrc, -1, ad_dir(vol->ad_path(dst, 0 ))) ) err = 0; else err = errno; } else { /* it's something else, bail out */ err = errno; } } } if (err) { errno = err; return -1; } return 0; } /************************************************************************* * osx adouble format ************************************************************************/ static int validupath_osx(VFS_FUNC_ARGS_VALIDUPATH) { return strncmp(name,"._", 2) && ( (vol->v_flags & AFPVOL_USEDOTS) ? netatalk_name(name): name[0] != '.'); } /* ---------------- */ static int RF_renamedir_osx(VFS_FUNC_ARGS_RENAMEDIR) { /* We simply move the corresponding ad file as well */ char tempbuf[258]="._"; return unix_rename(dirfd, vol->ad_path(oldpath,0), -1, strcat(tempbuf,newpath)); } /* ---------------- */ static int RF_deletecurdir_osx(VFS_FUNC_ARGS_DELETECURDIR) { return netatalk_unlink( vol->ad_path(".",0) ); } /* ---------------- */ static int RF_setdirunixmode_osx(VFS_FUNC_ARGS_SETDIRUNIXMODE) { return adouble_setfilmode(vol->ad_path(name, ADFLAGS_DIR ), mode, st, vol->v_umask); } /* ---------------- */ static int RF_setdirmode_osx(VFS_FUNC_ARGS_SETDIRMODE) { return 0; } /* ---------------- */ static int RF_setdirowner_osx(VFS_FUNC_ARGS_SETDIROWNER) { return 0; } /* ---------------- */ static int RF_renamefile_osx(VFS_FUNC_ARGS_RENAMEFILE) { char adsrc[ MAXPATHLEN + 1]; int err = 0; strcpy( adsrc, vol->ad_path(src, 0 )); if (unix_rename(dirfd, adsrc, -1, vol->ad_path(dst, 0 )) < 0) { struct stat st; err = errno; if (errno == ENOENT && lstatat(dirfd, adsrc, &st)) /* source has no ressource fork, */ return 0; errno = err; return -1; } return 0; } /******************************************************************************************** * VFS chaining ********************************************************************************************/ /* * Up until we really start stacking many VFS modules on top of one another or use * dynamic module loading like we do for UAMs, up until then we just stack VFS modules * via an fixed size array. * All VFS funcs must return AFP_ERR codes. When a func in the chain returns an error * this error code will be returned to the caller, BUT the chain in followed and all * following funcs are called in order to give them a chance. */ /* * Define most VFS funcs with macros as they all do the same. * Only "ad_path" and "validupath" will NOT do stacking and only * call the func from the first module. */ #define VFS_MFUNC(name, args, vars) \ static int vfs_ ## name(args) \ { \ int i = 0, ret = AFP_OK, err; \ while (vol->vfs_modules[i]) { \ if (vol->vfs_modules[i]->vfs_ ## name) { \ err = vol->vfs_modules[i]->vfs_ ## name (vars); \ if ((ret == AFP_OK) && (err != AFP_OK)) \ ret = err; \ } \ i ++; \ } \ return ret; \ } VFS_MFUNC(chown, VFS_FUNC_ARGS_CHOWN, VFS_FUNC_VARS_CHOWN) VFS_MFUNC(renamedir, VFS_FUNC_ARGS_RENAMEDIR, VFS_FUNC_VARS_RENAMEDIR) VFS_MFUNC(deletecurdir, VFS_FUNC_ARGS_DELETECURDIR, VFS_FUNC_VARS_DELETECURDIR) VFS_MFUNC(setfilmode, VFS_FUNC_ARGS_SETFILEMODE, VFS_FUNC_VARS_SETFILEMODE) VFS_MFUNC(setdirmode, VFS_FUNC_ARGS_SETDIRMODE, VFS_FUNC_VARS_SETDIRMODE) VFS_MFUNC(setdirunixmode, VFS_FUNC_ARGS_SETDIRUNIXMODE, VFS_FUNC_VARS_SETDIRUNIXMODE) VFS_MFUNC(setdirowner, VFS_FUNC_ARGS_SETDIROWNER, VFS_FUNC_VARS_SETDIROWNER) VFS_MFUNC(deletefile, VFS_FUNC_ARGS_DELETEFILE, VFS_FUNC_VARS_DELETEFILE) VFS_MFUNC(renamefile, VFS_FUNC_ARGS_RENAMEFILE, VFS_FUNC_VARS_RENAMEFILE) VFS_MFUNC(copyfile, VFS_FUNC_ARGS_COPYFILE, VFS_FUNC_VARS_COPYFILE) #ifdef HAVE_ACLS VFS_MFUNC(acl, VFS_FUNC_ARGS_ACL, VFS_FUNC_VARS_ACL) VFS_MFUNC(remove_acl, VFS_FUNC_ARGS_REMOVE_ACL, VFS_FUNC_VARS_REMOVE_ACL) #endif VFS_MFUNC(ea_getsize, VFS_FUNC_ARGS_EA_GETSIZE, VFS_FUNC_VARS_EA_GETSIZE) VFS_MFUNC(ea_getcontent, VFS_FUNC_ARGS_EA_GETCONTENT, VFS_FUNC_VARS_EA_GETCONTENT) VFS_MFUNC(ea_list, VFS_FUNC_ARGS_EA_LIST, VFS_FUNC_VARS_EA_LIST) VFS_MFUNC(ea_set, VFS_FUNC_ARGS_EA_SET, VFS_FUNC_VARS_EA_SET) VFS_MFUNC(ea_remove, VFS_FUNC_ARGS_EA_REMOVE, VFS_FUNC_VARS_EA_REMOVE) static int vfs_validupath(VFS_FUNC_ARGS_VALIDUPATH) { return vol->vfs_modules[0]->vfs_validupath(VFS_FUNC_VARS_VALIDUPATH); } /* * These function pointers get called from the lib users via vol->vfs->func. * These funcs are defined via the macros above. */ static struct vfs_ops vfs_master_funcs = { vfs_validupath, vfs_chown, vfs_renamedir, vfs_deletecurdir, vfs_setfilmode, vfs_setdirmode, vfs_setdirunixmode, vfs_setdirowner, vfs_deletefile, vfs_renamefile, vfs_copyfile, #ifdef HAVE_ACLS vfs_acl, vfs_remove_acl, #endif vfs_ea_getsize, vfs_ea_getcontent, vfs_ea_list, vfs_ea_set, vfs_ea_remove }; /* * Primary adouble modules: default, osx, sfm */ static struct vfs_ops netatalk_adouble = { /* vfs_validupath: */ validupath_adouble, /* vfs_chown: */ RF_chown_adouble, /* vfs_renamedir: */ RF_renamedir_adouble, /* vfs_deletecurdir: */ RF_deletecurdir_adouble, /* vfs_setfilmode: */ RF_setfilmode_adouble, /* vfs_setdirmode: */ RF_setdirmode_adouble, /* vfs_setdirunixmode:*/ RF_setdirunixmode_adouble, /* vfs_setdirowner: */ RF_setdirowner_adouble, /* vfs_deletefile: */ RF_deletefile_adouble, /* vfs_renamefile: */ RF_renamefile_adouble, /* vfs_copyfile: */ RF_copyfile_adouble, NULL }; static struct vfs_ops netatalk_adouble_osx = { /* vfs_validupath: */ validupath_osx, /* vfs_chown: */ RF_chown_adouble, /* vfs_renamedir: */ RF_renamedir_osx, /* vfs_deletecurdir: */ RF_deletecurdir_osx, /* vfs_setfilmode: */ RF_setfilmode_adouble, /* vfs_setdirmode: */ RF_setdirmode_osx, /* vfs_setdirunixmode:*/ RF_setdirunixmode_osx, /* vfs_setdirowner: */ RF_setdirowner_osx, /* vfs_deletefile: */ RF_deletefile_adouble, /* vfs_renamefile: */ RF_renamefile_osx, /* vfs_copyfile: */ NULL, NULL }; /* samba sfm format. ad_path shouldn't be set her */ static struct vfs_ops netatalk_adouble_sfm = { /* vfs_validupath: */ validupath_adouble, /* vfs_chown: */ RF_chown_ads, /* vfs_renamedir: */ RF_renamedir_adouble, /* vfs_deletecurdir: */ RF_deletecurdir_ads, /* vfs_setfilmode: */ RF_setfilmode_ads, /* vfs_setdirmode: */ RF_setdirmode_ads, /* vfs_setdirunixmode:*/ RF_setdirunixmode_ads, /* vfs_setdirowner: */ RF_setdirowner_ads, /* vfs_deletefile: */ RF_deletefile_ads, /* vfs_renamefile: */ RF_renamefile_ads, /* vfs_copyfile: */ NULL, NULL }; /* * Secondary vfs modules for Extended Attributes */ static struct vfs_ops netatalk_ea_adouble = { /* vfs_validupath: */ NULL, /* vfs_chown: */ ea_chown, /* vfs_renamedir: */ NULL, /* ok */ /* vfs_deletecurdir: */ NULL, /* ok */ /* vfs_setfilmode: */ ea_chmod_file, /* vfs_setdirmode: */ NULL, /* ok */ /* vfs_setdirunixmode:*/ ea_chmod_dir, /* vfs_setdirowner: */ NULL, /* ok */ /* vfs_deletefile: */ ea_deletefile, /* vfs_renamefile: */ ea_renamefile, /* vfs_copyfile */ ea_copyfile, #ifdef HAVE_ACLS /* vfs_acl: */ NULL, /* vfs_remove_acl */ NULL, #endif /* vfs_getsize */ get_easize, /* vfs_getcontent */ get_eacontent, /* vfs_list */ list_eas, /* vfs_set */ set_ea, /* vfs_remove */ remove_ea }; static struct vfs_ops netatalk_ea_sys = { /* validupath: */ NULL, /* rf_chown: */ NULL, /* rf_renamedir: */ NULL, /* rf_deletecurdir: */ NULL, /* rf_setfilmode: */ NULL, /* rf_setdirmode: */ NULL, /* rf_setdirunixmode: */ NULL, /* rf_setdirowner: */ NULL, /* rf_deletefile: */ NULL, /* rf_renamefile: */ NULL, /* vfs_copyfile: */ sys_ea_copyfile, #ifdef HAVE_ACLS /* rf_acl: */ NULL, /* rf_remove_acl */ NULL, #endif /* ea_getsize */ sys_get_easize, /* ea_getcontent */ sys_get_eacontent, /* ea_list */ sys_list_eas, /* ea_set */ sys_set_ea, /* ea_remove */ sys_remove_ea }; /* * Tertiary VFS modules for ACLs */ #ifdef HAVE_SOLARIS_ACLS static struct vfs_ops netatalk_solaris_acl_adouble = { /* validupath: */ NULL, /* rf_chown: */ NULL, /* rf_renamedir: */ NULL, /* rf_deletecurdir: */ NULL, /* rf_setfilmode: */ NULL, /* rf_setdirmode: */ NULL, /* rf_setdirunixmode: */ NULL, /* rf_setdirowner: */ NULL, /* rf_deletefile: */ NULL, /* rf_renamefile: */ NULL, /* vfs_copyfile */ NULL, /* rf_acl: */ RF_solaris_acl, /* rf_remove_acl */ RF_solaris_remove_acl, NULL }; #endif #ifdef HAVE_POSIX_ACLS static struct vfs_ops netatalk_posix_acl_adouble = { /* validupath: */ NULL, /* rf_chown: */ NULL, /* rf_renamedir: */ NULL, /* rf_deletecurdir: */ NULL, /* rf_setfilmode: */ NULL, /* rf_setdirmode: */ NULL, /* rf_setdirunixmode: */ NULL, /* rf_setdirowner: */ NULL, /* rf_deletefile: */ NULL, /* rf_renamefile: */ NULL, /* vfs_copyfile */ NULL, /* rf_acl: */ RF_posix_acl, /* rf_remove_acl */ RF_posix_remove_acl, NULL }; #endif /* ---------------- */ void initvol_vfs(struct vol *vol) { vol->vfs = &vfs_master_funcs; /* Default adouble stuff */ if (vol->v_adouble == AD_VERSION2_OSX) { vol->vfs_modules[0] = &netatalk_adouble_osx; vol->ad_path = ad_path_osx; } else if (vol->v_adouble == AD_VERSION1_SFM) { vol->vfs_modules[0] = &netatalk_adouble_sfm; vol->ad_path = ad_path_sfm; } else { vol->vfs_modules[0] = &netatalk_adouble; vol->ad_path = ad_path; } /* Extended Attributes */ if (vol->v_vfs_ea == AFPVOL_EA_SYS) { LOG(log_debug, logtype_afpd, "initvol_vfs: enabling EA support with native EAs"); vol->vfs_modules[1] = &netatalk_ea_sys; } else if (vol->v_vfs_ea == AFPVOL_EA_AD) { LOG(log_debug, logtype_afpd, "initvol_vfs: enabling EA support with adouble files"); vol->vfs_modules[1] = &netatalk_ea_adouble; } else { LOG(log_debug, logtype_afpd, "initvol_vfs: volume without EA support"); } /* ACLs */ #ifdef HAVE_SOLARIS_ACLS vol->vfs_modules[2] = &netatalk_solaris_acl_adouble; #endif #ifdef HAVE_POSIX_ACLS vol->vfs_modules[2] = &netatalk_posix_acl_adouble; #endif } netatalk-2.2.2/depcomp0000755000175200017500000004271311661232413011626 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2007-03-29.01 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software # Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: netatalk-2.2.2/configure0000755000175200017500000440371111703521733012166 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="etc/afpd/main.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_list= ac_subst_vars='GREP PERL PS SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias NETATALK_VERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA am__isrc CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S SED EGREP ECHO AR RANLIB DSYMUTIL NMEDIT CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBADD_DL LIBOBJS PTHREAD_LIBS AFS_LIBS AFS_CFLAGS PKGCONFDIR SERVERTEXT ICONV_CFLAGS ICONV_LIBS BUILD_DBD_DAEMON_TRUE BUILD_DBD_DAEMON_FALSE USE_CDB_BACKEND_TRUE USE_CDB_BACKEND_FALSE USE_LAST_BACKEND_TRUE USE_LAST_BACKEND_FALSE USE_TDB_BACKEND_TRUE USE_TDB_BACKEND_FALSE DEFAULT_CNID_SCHEME compiled_backends QUOTA_LIBS SLP_LIBS SLP_CFLAGS PKG_CONFIG AVAHI_CFLAGS AVAHI_LIBS AVAHI_TPOLL_CFLAGS AVAHI_TPOLL_LIBS ZEROCONF_LIBS ZEROCONF_CFLAGS PAMDIR PAM_CFLAGS PAM_LIBS PAM_DIRECTIVE PAM_AUTH PAM_ACCOUNT PAM_PASSWORD PAM_SESSION WRAP_LIBS CUPS_CONFIG CUPS_CFLAGS CUPS_LDFLAGS CUPS_LIBS USE_SPOOLDIR_TRUE USE_SPOOLDIR_FALSE SPOOLDIR UAMS_PATH COMPILE_KERNEL_GCC COMPILE_64BIT_KMODULE KCFLAGS KLDFLAGS LIBGCRYPT_CONFIG LIBGCRYPT_CFLAGS LIBGCRYPT_LIBS SSL_CFLAGS SSL_LIBS BDB_CFLAGS BDB_LIBS BDB_BIN BDB_PATH CRYPT_LIBS KRB5_CONFIG GSSAPI_LIBS GSSAPI_CFLAGS USE_GSSAPI_TRUE USE_GSSAPI_FALSE ACL_LIBS WEBMIN_PATH WEBMIN_VERSION WEBMIN_USER WEBMIN_PASS WEBMIN_PORT OVERWRITE_CONFIG SOLARIS_MODULE_TRUE SOLARIS_MODULE_FALSE COMPILE_TIMELORD_TRUE COMPILE_TIMELORD_FALSE COMPILE_A2BOOT_TRUE COMPILE_A2BOOT_FALSE HAVE_LIBGCRYPT_TRUE HAVE_LIBGCRYPT_FALSE HAVE_OPENSSL_TRUE HAVE_OPENSSL_FALSE HAVE_ACLS_TRUE HAVE_ACLS_FALSE HAVE_LDAP_TRUE HAVE_LDAP_FALSE USE_DHX_TRUE USE_DHX_FALSE USE_DHX2_TRUE USE_DHX2_FALSE USE_RANDNUM_TRUE USE_RANDNUM_FALSE USE_KERBEROS_TRUE USE_KERBEROS_FALSE USE_PAM_SO_TRUE USE_PAM_SO_FALSE USE_PAM_TRUE USE_PAM_FALSE BUILD_PAM_TRUE BUILD_PAM_FALSE USE_PGP_TRUE USE_PGP_FALSE DEFAULT_HOOK_TRUE DEFAULT_HOOK_FALSE USE_NETBSD_TRUE USE_NETBSD_FALSE USE_REDHAT_SYSV_TRUE USE_REDHAT_SYSV_FALSE USE_SUSE_SYSV_TRUE USE_SUSE_SYSV_FALSE USE_SHADOWPW_TRUE USE_SHADOWPW_FALSE USE_TRU64_TRUE USE_TRU64_FALSE USE_SOLARIS_TRUE USE_SOLARIS_FALSE USE_GENTOO_TRUE USE_GENTOO_FALSE USE_DEBIAN_TRUE USE_DEBIAN_FALSE USE_SYSTEMD_TRUE USE_SYSTEMD_FALSE USE_UNDEF_TRUE USE_UNDEF_FALSE USE_BDB_TRUE USE_BDB_FALSE USE_APPLETALK_TRUE USE_APPLETALK_FALSE HAVE_ATFUNCS_TRUE HAVE_ATFUNCS_FALSE LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP F77 FFLAGS PKG_CONFIG AVAHI_CFLAGS AVAHI_LIBS AVAHI_TPOLL_CFLAGS AVAHI_TPOLL_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-admin-group disable admin group --enable-afs enable AFS support --enable-ddp enable DDP (AppleTalk) --enable-debug1 enable debug code --enable-debug enable verbose debug code --enable-debugging disable SIGALRM timers and DSI tickles (eg for debugging with gdb/dbx/...) --disable-largefile omit support for large files --enable-dropkludge enable the experimental dropbox fix (INSECURE!) --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) --enable-quota Turn on quota support (default=auto) --enable-srvloc[=DIR] enable Server Location Protocol (SLP) support --enable-zeroconf[=DIR] enable Zeroconf support [auto] --disable-shell-check disable checking for a valid shell --disable-tcp-wrappers disable TCP wrappers support --disable-locking disable system locking --enable-redhat obsoleted --enable-redhat-sysv use redhat-style sysv (upstart) configuration --enable-redhat-systemd use redhat-style systemd (>=Fedora15) configuration --enable-suse obsoleted --enable-suse-sysv use suse-style sysv configuration --enable-suse-systemd use suse-style systemd (>=openSUSE12.1) configuration --enable-gentoo use gentoo-style sysv configuration --enable-netbsd use NetBSD-style rc.d configuration --enable-debian use debian-style sysv configuration --enable-systemd use general systemd configuration --enable-timelord enable compilation of timelord server --enable-a2boot enable compilation of Apple2 boot server --enable-cups Turn on CUPS support (default=auto) --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility --disable-sendfile disable sendfile syscall --enable-pgp-uam enable build of PGP UAM module --enable-krb4-uam enable build of Kerberos v4 UAM module --enable-krbV-uam enable build of Kerberos V UAM module --enable-overwrite overwrite configuration files during installation Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-pkgconfdir=DIR package specific configuration in DIR [SYSCONF/netatalk] --with-message-dir=PATH path to server message files [PKGCONF/msg] --with-cracklib=DICT enable/set location of cracklib dictionary --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib and BASEDIR/include [default=auto] --with-cnid-dbd-backend build CNID with Database Daemon Data Store [yes] --with-cnid-cdb-backend build CNID with Concurrent BDB Data Store [no] --with-cnid-last-backend build LAST CNID scheme [yes] --with-cnid-tdb-backend build TDB CNID scheme [yes] --with-cnid-default-backend=val set default DID scheme [dbd] --with-pam[=PATH] specify path to PAM installation [auto] --with-shadow enable shadow password support [auto] --with-uams-path=PATH path to UAMs [PKGCONF/uams] --with-spooldir=PATH path for spooldir used for CUPS support (LOCALSTATEDIR/spool/netatalk) --with-libgcrypt-dir=PATH path where LIBGCRYPT is installed (optional). Must contain lib and include dirs. --with-ssl-dir=PATH specify path to OpenSSL installation (must contain lib and include dirs) --with-bdb=PATH specify path to Berkeley DB installation[auto] --with-gssapi[=PATH] path to GSSAPI for Kerberos V UAM [auto] --with-ldap LDAP support (default=auto) --with-acls Include ACL support (default=auto) --with-webmin=PATH path where webmin is installed [$PKGCONFDIR/webmin] --with-webminuser=NAME name for the webmin admin user --with-webminversion=VERSION Webmin version to fetch from sf.net [1.490] --with-webminpass=PASSWORD password for the webmin admin user --with-webminport=PORT TCP port for webmin Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags PKG_CONFIG path to pkg-config utility AVAHI_CFLAGS C compiler flags for AVAHI, overriding pkg-config AVAHI_LIBS linker flags for AVAHI, overriding pkg-config AVAHI_TPOLL_CFLAGS C compiler flags for AVAHI_TPOLL, overriding pkg-config AVAHI_TPOLL_LIBS linker flags for AVAHI_TPOLL, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi ac_header_list="$ac_header_list utime.h" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu NETATALK_VERSION=`cat $srcdir/VERSION` ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 echo "$as_me: error: invalid value of canonical target" >&2;} { (exit 1); exit 1; }; };; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- am__api_version='1.10' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=netatalk VERSION=${NETATALK_VERSION} cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" { echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C99" >&5 echo $ECHO_N "checking for $CC option to accept ISO C99... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c99+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -c99 -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c99=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c99" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c99" >&6; } ;; esac # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6; } fi { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi { echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done fi SED=$lt_cv_path_SED { echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6; } test x$GREP = x && # Extract the first word of "grep$EXEEXT", so it can be a program name with args. set dummy grep$EXEEXT; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GREP in [\\/]* | ?:[\\/]*) ac_cv_path_GREP="$GREP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="grep$EXEEXT" ;; esac fi GREP=$ac_cv_path_GREP if test -n "$GREP"; then { echo "$as_me:$LINENO: result: $GREP" >&5 echo "${ECHO_T}$GREP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test x$GREP = x && { { echo "$as_me:$LINENO: error: no acceptable grep found in \$PATH" >&5 echo "$as_me: error: no acceptable grep found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi { echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac { echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi { echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6; } NM="$lt_cv_path_NM" { echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 4915 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then { echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_F77" && break done if test "x$ac_ct_F77" = x; then F77="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac F77=$ac_ct_F77 fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= { echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments { echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } else { echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6; } fi # Check for command to grab the raw symbol name followed by C symbol from nm. { echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux* | k*bsd*-gnu) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6; } else { echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6; } fi { echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_DSYMUTIL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 echo "${ECHO_T}$DSYMUTIL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_NMEDIT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { echo "$as_me:$LINENO: result: $NMEDIT" >&5 echo "${ECHO_T}$NMEDIT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 echo "${ECHO_T}$ac_ct_NMEDIT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi { echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6; } if test "${lt_cv_apple_cc_single_mod+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. echo "int foo(void){return 1;}" > conftest.c $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib ${wl}-single_module conftest.c if test -f libconftest.dylib; then lt_cv_apple_cc_single_mod=yes rm -rf libconftest.dylib* fi rm conftest.c fi fi { echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6; } { echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6; } if test "${lt_cv_ld_exported_symbols_list+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_cv_ld_exported_symbols_list=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; } case $host_os in rhapsody* | darwin1.[0123]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil="~$DSYMUTIL \$lib || :" else _lt_dsymutil= fi ;; esac enable_dlopen=yes enable_win32_dll=no # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic was given. if test "${with_pic+set}" = set; then withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm -r conftest* lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7967: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7971: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8257: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8261: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8361: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8365: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs=no else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`echo $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" fi sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" fi sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6; } if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= { echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi ;; *) { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) { echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shl_load || defined __stub___shl_load choke me #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else { echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_dlopen || defined __stub___dlopen choke me #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which library types will actually be built { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6; } # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ compiler_lib_search_dirs \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ fix_srcfile_path \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" # Check whether --with-tags was given. if test "${with_tags+set}" = set; then withval=$with_tags; tagnames="$withval" fi if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= compiler_lib_search_dirs_CXX= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" if test "$GXX" = yes ; then output_verbose_link_cmd='echo' archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' else ld_shlibs_CXX=no fi ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext compiler_lib_search_dirs_CXX= if test -n "$compiler_lib_search_path_CXX"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13239: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13243: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13343: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:13347: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" fi sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" fi sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ compiler_lib_search_dirs_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm -r conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6; } GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; rdos*) lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:14941: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:14945: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_F77" >&6; } if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_static_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_F77=yes fi else lt_cv_prog_compiler_static_works_F77=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works_F77" >&6; } if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15045: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:15049: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_F77=no fi ;; interix[3-9]*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs_F77=no else ld_shlibs_F77=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_F77="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_F77="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs_F77=no fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_F77='${wl}-z,text' allow_undefined_flag_F77='${wl}-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" fi sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" fi sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6; } if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ compiler_lib_search_dirs_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ fix_srcfile_path_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm -r conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_cmds lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:17265: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:17269: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-Bstatic' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' lt_prog_compiler_wl_GCJ='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' lt_prog_compiler_wl_GCJ='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; rdos*) lt_prog_compiler_static_GCJ='-non_shared' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:17555: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:17559: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_GCJ" >&6; } if test x"$lt_cv_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_static_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works_GCJ=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_GCJ=yes fi else lt_cv_prog_compiler_static_works_GCJ=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works_GCJ" >&6; } if test x"$lt_cv_prog_compiler_static_works_GCJ" = xyes; then : else lt_prog_compiler_static_GCJ= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:17659: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:17663: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_GCJ=no fi ;; interix[3-9]*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs_GCJ=no else ld_shlibs_GCJ=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_GCJ=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ='$convenience' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_GCJ="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_GCJ="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_GCJ="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; *) hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs_GCJ=no fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_GCJ='${wl}-z,text' allow_undefined_flag_GCJ='${wl}-z,nodefs' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } test "$ld_shlibs_GCJ" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ pic_flag=$lt_prog_compiler_pic_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" fi sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" fi sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6; } if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ compiler_lib_search_dirs_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ fix_srcfile_path_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm -r conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ compiler_lib_search_dirs_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ fix_srcfile_path_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion test "x$PERL" = x && # Extract the first word of "perl$EXEEXT", so it can be a program name with args. set dummy perl$EXEEXT; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PERL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="perl$EXEEXT" ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { echo "$as_me:$LINENO: result: $PERL" >&5 echo "${ECHO_T}$PERL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test "x$PERL" = x && { { echo "$as_me:$LINENO: error: no acceptable Perl found in \$PATH" >&5 echo "$as_me: error: no acceptable Perl found in \$PATH" >&2;} { (exit 1); exit 1; }; } test x$GREP = x && # Extract the first word of "grep$EXEEXT", so it can be a program name with args. set dummy grep$EXEEXT; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GREP in [\\/]* | ?:[\\/]*) ac_cv_path_GREP="$GREP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="grep$EXEEXT" ;; esac fi GREP=$ac_cv_path_GREP if test -n "$GREP"; then { echo "$as_me:$LINENO: result: $GREP" >&5 echo "${ECHO_T}$GREP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test x$GREP = x && { { echo "$as_me:$LINENO: error: no acceptable grep found in \$PATH" >&5 echo "$as_me: error: no acceptable grep found in \$PATH" >&2;} { (exit 1); exit 1; }; } test x$PS = x && # Extract the first word of "ps$EXEEXT", so it can be a program name with args. set dummy ps$EXEEXT; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PS in [\\/]* | ?:[\\/]*) ac_cv_path_PS="$PS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PS="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PS" && ac_cv_path_PS="ps$EXEEXT" ;; esac fi PS=$ac_cv_path_PS if test -n "$PS"; then { echo "$as_me:$LINENO: result: $PS" >&5 echo "${ECHO_T}$PS" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test x$PS = x && { { echo "$as_me:$LINENO: error: no acceptable ps found in \$PATH" >&5 echo "$as_me: error: no acceptable ps found in \$PATH" >&2;} { (exit 1); exit 1; }; } if test "x$CC" != xcc; then { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; } fi set dummy $CC; ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } cat >>confdefs.h <<\_ACEOF #define NO_MINUS_C_MINUS_O 1 _ACEOF fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi { echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; } if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_WAIT_H 1 _ACEOF fi for ac_header in fcntl.h limits.h stdint.h strings.h time.h sys/param.h sys/fcntl.h sys/file.h sys/ioctl.h sys/time.h sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h mntent.h syslog.h unistd.h termios.h sys/termios.h netdb.h sgtty.h ufs/quota.h mount.h statfs.h sys/types.h dlfcn.h errno.h sys/errno.h sys/uio.h langinfo.h locale.h sys/filio.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_sys_cdefs_h+set}" = set; then { echo "$as_me:$LINENO: checking for sys/cdefs.h" >&5 echo $ECHO_N "checking for sys/cdefs.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_cdefs_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_cdefs_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_cdefs_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking sys/cdefs.h usability" >&5 echo $ECHO_N "checking sys/cdefs.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking sys/cdefs.h presence" >&5 echo $ECHO_N "checking sys/cdefs.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: sys/cdefs.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/cdefs.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/cdefs.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/cdefs.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/cdefs.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/cdefs.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/cdefs.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/cdefs.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/cdefs.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/cdefs.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/cdefs.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/cdefs.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/cdefs.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/cdefs.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/cdefs.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/cdefs.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for sys/cdefs.h" >&5 echo $ECHO_N "checking for sys/cdefs.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_cdefs_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_cdefs_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_cdefs_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_cdefs_h" >&6; } fi if test $ac_cv_header_sys_cdefs_h = yes; then : else { echo "$as_me:$LINENO: result: enabling generic cdefs.h from tree" >&5 echo "${ECHO_T}enabling generic cdefs.h from tree" >&6; } CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS" fi for ac_header in sys/mount.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef HAVE_SYS_PARAM_H #include #endif #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi { echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 echo "${ECHO_T}$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF #define uid_t int _ACEOF cat >>confdefs.h <<\_ACEOF #define gid_t int _ACEOF fi { echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6; } if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { echo "$as_me:$LINENO: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; } if test "${ac_cv_type_mode_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef mode_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mode_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6; } if test $ac_cv_type_mode_t = yes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi { echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6; } if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi { echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef pid_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi { echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef size_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6; } if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static struct stat ac_aggr; if (ac_aggr.st_rdev) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static struct stat ac_aggr; if (sizeof ac_aggr.st_rdev) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_rdev=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6; } if test $ac_cv_member_struct_stat_st_rdev = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_RDEV 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_ST_RDEV 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } if test "${ac_cv_struct_tm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 echo "${ECHO_T}$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF #define TM_IN_SYS_TIME 1 _ACEOF fi LIBADD_DL= ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shl_load || defined __stub___shl_load choke me #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } if test $ac_cv_func_shl_load = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SHL_LOAD 1 _ACEOF else { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } if test $ac_cv_lib_dld_shl_load = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SHL_LOAD 1 _ACEOF LIBADD_DL="$LIBADD_DL -ldld" else { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBDL 1 _ACEOF LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_DLFCN_H # include #endif int main () { dlopen(0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBDL 1 _ACEOF libltdl_cv_func_dlopen="yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } if test $ac_cv_lib_svld_dlopen = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBDL 1 _ACEOF LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes" else { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } if test $ac_cv_lib_dld_dld_link = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DLD 1 _ACEOF LIBADD_DL="$LIBADD_DL -ldld" else { echo "$as_me:$LINENO: checking for _dyld_func_lookup" >&5 echo $ECHO_N "checking for _dyld_func_lookup... $ECHO_C" >&6; } if test "${ac_cv_func__dyld_func_lookup+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define _dyld_func_lookup to an innocuous variant, in case declares _dyld_func_lookup. For example, HP-UX 11i declares gettimeofday. */ #define _dyld_func_lookup innocuous__dyld_func_lookup /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _dyld_func_lookup (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef _dyld_func_lookup /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char _dyld_func_lookup (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub__dyld_func_lookup || defined __stub____dyld_func_lookup choke me #endif int main () { return _dyld_func_lookup (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func__dyld_func_lookup=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func__dyld_func_lookup=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func__dyld_func_lookup" >&5 echo "${ECHO_T}$ac_cv_func__dyld_func_lookup" >&6; } if test $ac_cv_func__dyld_func_lookup = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DYLD 1 _ACEOF fi fi fi fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi fi fi if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes then lt_save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DL" for ac_func in dlerror do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done LIBS="$lt_save_LIBS" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu for ac_func in dlopen dlsym dlclose do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for _ prefix in compiled symbols" >&5 echo $ECHO_N "checking for _ prefix in compiled symbols... $ECHO_C" >&6; } if test "${ac_cv_sys_symbol_underscore+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. ac_nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then ac_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&5 fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "configure: failed program was:" >&5 cat conftest.c >&5 fi rm -rf conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_sys_symbol_underscore" >&5 echo "${ECHO_T}$ac_cv_sys_symbol_underscore" >&6; } if test x"$ac_cv_sys_symbol_underscore" = xyes; then if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then { echo "$as_me:$LINENO: checking whether we have to add an underscore for dlsym" >&5 echo $ECHO_N "checking whether we have to add an underscore for dlsym... $ECHO_C" >&6; } if test "${libltdl_cv_need_uscore+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else libltdl_cv_need_uscore=unknown save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DL" if test "$cross_compiling" = yes; then : libltdl_cv_need_uscore=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) libltdl_cv_need_uscore=no ;; x$lt_dlneed_uscore) libltdl_cv_need_uscore=yes ;; x$lt_dlunknown|x*) ;; esac else : # compilation failed fi fi rm -fr conftest* LIBS="$save_LIBS" fi { echo "$as_me:$LINENO: result: $libltdl_cv_need_uscore" >&5 echo "${ECHO_T}$libltdl_cv_need_uscore" >&6; } fi fi if test x"$libltdl_cv_need_uscore" = xyes; then cat >>confdefs.h <<\_ACEOF #define NEED_USCORE 1 _ACEOF fi if test x"$libltdl_cv_need_uscore" = xyes; then cat >>confdefs.h <<\_ACEOF #define DLSYM_PREPEND_UNDERSCORE 1 _ACEOF fi { echo "$as_me:$LINENO: checking type of array argument to getgroups" >&5 echo $ECHO_N "checking type of array argument to getgroups... $ECHO_C" >&6; } if test "${ac_cv_type_getgroups+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_type_getgroups=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Thanks to Mike Rendell for this test. */ $ac_includes_default #define NGID 256 #undef MAX #define MAX(x, y) ((x) > (y) ? (x) : (y)) int main () { gid_t gidset[NGID]; int i, n; union { gid_t gval; long int lval; } val; val.lval = -1; for (i = 0; i < NGID; i++) gidset[i] = val.gval; n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1, gidset); /* Exit non-zero if getgroups seems to require an array of ints. This happens when gid_t is short int but getgroups modifies an array of ints. */ return n > 0 && gidset[n] != val.gval; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_getgroups=gid_t else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_type_getgroups=int fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_type_getgroups = cross; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "getgroups.*int.*gid_t" >/dev/null 2>&1; then ac_cv_type_getgroups=gid_t else ac_cv_type_getgroups=int fi rm -f conftest* fi fi { echo "$as_me:$LINENO: result: $ac_cv_type_getgroups" >&5 echo "${ECHO_T}$ac_cv_type_getgroups" >&6; } cat >>confdefs.h <<_ACEOF #define GETGROUPS_T $ac_cv_type_getgroups _ACEOF if test $ac_cv_c_compiler_gnu = yes; then { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi { echo "$as_me:$LINENO: checking for working memcmp" >&5 echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6; } if test "${ac_cv_func_memcmp_working+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_memcmp_working=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = '\100', c1 = '\200', c2 = '\201'; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) return 1; /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) return 1; } return 0; } ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_memcmp_working=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_memcmp_working=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac { echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 echo $ECHO_N "checking whether sys/types.h defines makedev... $ECHO_C" >&6; } if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return makedev(0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_header_sys_types_h_makedev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_types_h_makedev=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 echo "${ECHO_T}$ac_cv_header_sys_types_h_makedev" >&6; } if test $ac_cv_header_sys_types_h_makedev = no; then if test "${ac_cv_header_sys_mkdev_h+set}" = set; then { echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_mkdev_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 echo $ECHO_N "checking sys/mkdev.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 echo $ECHO_N "checking sys/mkdev.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_mkdev_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_mkdev_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; } fi if test $ac_cv_header_sys_mkdev_h = yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_MKDEV 1 _ACEOF fi if test $ac_cv_header_sys_mkdev_h = no; then if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then { echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 echo $ECHO_N "checking sys/sysmacros.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 echo $ECHO_N "checking sys/sysmacros.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_sysmacros_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; } fi if test $ac_cv_header_sys_sysmacros_h = yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_SYSMACROS 1 _ACEOF fi fi fi for ac_header in stdlib.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for working mmap" >&5 echo $ECHO_N "checking for working mmap... $ECHO_C" >&6; } if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #if !defined STDC_HEADERS && !defined HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # ifdef HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; int i, pagesize; int fd; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) return 1; for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) return 1; if (write (fd, data, pagesize) != pagesize) return 1; close (fd); /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) return 1; data2 = (char *) malloc (2 * pagesize); if (!data2) return 1; data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) return 1; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) return 1; /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) return 1; if (read (fd, data3, pagesize) != pagesize) return 1; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) return 1; close (fd); return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 _ACEOF fi rm -f conftest.mmap { echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_signal=int else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_header in $ac_header_list do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking whether utime accepts a null argument" >&5 echo $ECHO_N "checking whether utime accepts a null argument... $ECHO_C" >&6; } if test "${ac_cv_func_utime_null+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f conftest.data; >conftest.data # Sequent interprets utime(file, 0) to mean use start of epoch. Wrong. if test "$cross_compiling" = yes; then ac_cv_func_utime_null=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #ifdef HAVE_UTIME_H # include #endif int main () { struct stat s, t; return ! (stat ("conftest.data", &s) == 0 && utime ("conftest.data", 0) == 0 && stat ("conftest.data", &t) == 0 && t.st_mtime >= s.st_mtime && t.st_mtime - s.st_mtime < 120); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_utime_null=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_utime_null=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_utime_null" >&5 echo "${ECHO_T}$ac_cv_func_utime_null" >&6; } if test $ac_cv_func_utime_null = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_UTIME_NULL 1 _ACEOF fi rm -f conftest.data { echo "$as_me:$LINENO: checking for wait3 that fills in rusage" >&5 echo $ECHO_N "checking for wait3 that fills in rusage... $ECHO_C" >&6; } if test "${ac_cv_func_wait3_rusage+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_wait3_rusage=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include #include #include /* HP-UX has wait3 but does not fill in rusage at all. */ int main () { struct rusage r; int i; /* Use a field that we can force nonzero -- voluntary context switches. For systems like NeXT and OSF/1 that don't set it, also use the system CPU time. And page faults (I/O) for Linux. */ r.ru_nvcsw = 0; r.ru_stime.tv_sec = 0; r.ru_stime.tv_usec = 0; r.ru_majflt = r.ru_minflt = 0; switch (fork ()) { case 0: /* Child. */ sleep(1); /* Give up the CPU. */ _exit(0); break; case -1: /* What can we do? */ _exit(0); break; default: /* Parent. */ wait3(&i, 0, &r); /* Avoid "text file busy" from rm on fast HP-UX machines. */ sleep(2); return (r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0 && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0); } } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_wait3_rusage=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_wait3_rusage=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_wait3_rusage" >&5 echo "${ECHO_T}$ac_cv_func_wait3_rusage" >&6; } if test $ac_cv_func_wait3_rusage = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WAIT3 1 _ACEOF fi for ac_func in getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strcasestr strstr strtoul strchr memcpy do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in backtrace_symbols setlocale nl_langinfo strlcpy strlcat setlinebuf dirfd pselect access pread pwrite do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64 do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_neta_haveatfuncs=yes for ac_func in openat renameat fstatat unlinkat do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else ac_neta_haveatfuncs=no fi done if test x"$ac_neta_haveatfuncs" = x"yes" ; then cat >>confdefs.h <<\_ACEOF #define _ATFILE_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_ATFUNCS 1 _ACEOF fi { echo "$as_me:$LINENO: checking for struct tm.tm_gmtoff" >&5 echo $ECHO_N "checking for struct tm.tm_gmtoff... $ECHO_C" >&6; } if test "${ac_cv_member_struct_tm_tm_gmtoff+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static struct tm ac_aggr; if (ac_aggr.tm_gmtoff) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_gmtoff=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static struct tm ac_aggr; if (sizeof ac_aggr.tm_gmtoff) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_gmtoff=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_gmtoff=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_gmtoff" >&5 echo "${ECHO_T}$ac_cv_member_struct_tm_tm_gmtoff" >&6; } if test $ac_cv_member_struct_tm_tm_gmtoff = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_GMTOFF 1 _ACEOF fi { echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; } if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_gethostbyname || defined __stub___gethostbyname choke me #endif int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; } if test $ac_cv_func_gethostbyname = yes; then : else { echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; } if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; } if test $ac_cv_lib_nsl_gethostbyname = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi fi { echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6; } if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_connect || defined __stub___connect choke me #endif int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6; } if test $ac_cv_func_connect = yes; then : else { echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6; } if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_socket_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6; } if test $ac_cv_lib_socket_connect = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi fi { echo "$as_me:$LINENO: checking for library containing pthread_sigmask" >&5 echo $ECHO_N "checking for library containing pthread_sigmask... $ECHO_C" >&6; } if test "${ac_cv_search_pthread_sigmask+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_sigmask (); int main () { return pthread_sigmask (); ; return 0; } _ACEOF for ac_lib in '' pthread; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_pthread_sigmask=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_pthread_sigmask+set}" = set; then break fi done if test "${ac_cv_search_pthread_sigmask+set}" = set; then : else ac_cv_search_pthread_sigmask=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_pthread_sigmask" >&5 echo "${ECHO_T}$ac_cv_search_pthread_sigmask" >&6; } ac_res=$ac_cv_search_pthread_sigmask if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else { { echo "$as_me:$LINENO: error: cannot find pthread_sigmask in libc or libpthread" >&5 echo "$as_me: error: cannot find pthread_sigmask in libc or libpthread" >&2;} { (exit 1); exit 1; }; } fi if test x"$ac_cv_search_pthread_sigmask" != x"none required" ; then PTHREAD_LIBS=$ac_cv_search_pthread_sigmask fi cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache for ac_func in snprintf vsnprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdarg.h varargs.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in strerror do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for errno" >&5 echo $ECHO_N "checking for errno... $ECHO_C" >&6; } if test "${ac_cv_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { extern int errno; return (errno); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_errno=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_errno=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_errno" >&5 echo "${ECHO_T}$ac_cv_errno" >&6; } if test "$ac_cv_errno" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ERRNO 1 _ACEOF { echo "$as_me:$LINENO: checking for errno declaration" >&5 echo $ECHO_N "checking for errno declaration... $ECHO_C" >&6; } if test "${ac_cv_decl_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_ERRNO_H #include #endif int main () { return(sys_nerr); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_decl_errno=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_decl_errno=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_decl_errno" >&5 echo "${ECHO_T}$ac_cv_decl_errno" >&6; } if test "$ac_cv_decl_errno" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DECL_ERRNO 1 _ACEOF fi; fi { echo "$as_me:$LINENO: checking for sys_nerr" >&5 echo $ECHO_N "checking for sys_nerr... $ECHO_C" >&6; } if test "${ac_cv_sys_nerr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { extern int sys_nerr; return (sys_nerr); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_sys_nerr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_sys_nerr=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_sys_nerr" >&5 echo "${ECHO_T}$ac_cv_sys_nerr" >&6; } if test "$ac_cv_sys_nerr" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_NERR 1 _ACEOF { echo "$as_me:$LINENO: checking for sys_nerr declaration" >&5 echo $ECHO_N "checking for sys_nerr declaration... $ECHO_C" >&6; } if test "${ac_cv_decl_sys_nerr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif int main () { return(sys_nerr); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_decl_sys_nerr_def=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_decl_sys_nerr_def=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_decl_sys_nerr" >&5 echo "${ECHO_T}$ac_cv_decl_sys_nerr" >&6; } if test "$ac_cv_decl_sys_nerr" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DECL_SYS_NERR 1 _ACEOF fi fi { echo "$as_me:$LINENO: checking for sys_errlist array" >&5 echo $ECHO_N "checking for sys_errlist array... $ECHO_C" >&6; } if test "${ac_cv_sys_errlist+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { extern char *sys_errlist[]; sys_errlist[0]; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_sys_errlist=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_sys_errlist=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_sys_errlist" >&5 echo "${ECHO_T}$ac_cv_sys_errlist" >&6; } if test "$ac_cv_sys_errlist" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_ERRLIST 1 _ACEOF { echo "$as_me:$LINENO: checking for sys_errlist declaration" >&5 echo $ECHO_N "checking for sys_errlist declaration... $ECHO_C" >&6; } if test "${ac_cv_sys_errlist_def+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif int main () { char *s = sys_errlist[0]; return(*s); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_decl_sys_errlist=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_decl_sys_errlist=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_sys_errlist_def" >&5 echo "${ECHO_T}$ac_cv_sys_errlist_def" >&6; } if test "$ac_cv_decl_sys_errlist" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DECL_SYS_ERRLIST 1 _ACEOF fi fi { echo "$as_me:$LINENO: checking for long long" >&5 echo $ECHO_N "checking for long long... $ECHO_C" >&6; } if test "${ac_cv_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { printf("%d",sizeof(long long)); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_long_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_long_long" >&5 echo "${ECHO_T}$ac_cv_long_long" >&6; } if test $ac_cv_long_long = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONG_LONG 1 _ACEOF fi { echo "$as_me:$LINENO: checking for long double" >&5 echo $ECHO_N "checking for long double... $ECHO_C" >&6; } if test "${ac_cv_long_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { printf("%d",sizeof(long double)); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_long_double=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_long_double=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_long_double" >&5 echo "${ECHO_T}$ac_cv_long_double" >&6; } if test $ac_cv_long_double = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONG_DOUBLE 1 _ACEOF fi { echo "$as_me:$LINENO: checking for quad_t" >&5 echo $ECHO_N "checking for quad_t... $ECHO_C" >&6; } if test "${ac_cv_quad_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { printf("%d",sizeof(quad_t)); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_quad_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_quad_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_quad_t" >&5 echo "${ECHO_T}$ac_cv_quad_t" >&6; } if test $ac_cv_quad_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_QUAD_T 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether to check for 64bit libraries" >&5 echo $ECHO_N "checking whether to check for 64bit libraries... $ECHO_C" >&6; } # Test if the compiler is in 64bit mode echo 'int i;' > conftest.$ac_ext atalk_cv_cc_64bit_output=no if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *"ELF 64"*) atalk_cv_cc_64bit_output=yes ;; esac fi rm -rf conftest* case $host_cpu:$atalk_cv_cc_64bit_output in powerpc64:yes | s390x:yes | sparc*:yes | x86_64:yes | i386:yes) case $target_os in solaris2*) { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } atalk_libname="lib/64" ;; *bsd* | dragonfly*) { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } atalk_libname="lib" ;; *) { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } atalk_libname="lib64" ;; esac ;; *:*) { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } atalk_libname="lib" ;; esac netatalk_cv_admin_group=yes { echo "$as_me:$LINENO: checking for administrative group support" >&5 echo $ECHO_N "checking for administrative group support... $ECHO_C" >&6; } # Check whether --enable-admin-group was given. if test "${enable_admin_group+set}" = set; then enableval=$enable_admin_group; if test x"$enableval" = x"no"; then cat >>confdefs.h <<\_ACEOF #define ADMIN_GRP 0 _ACEOF netatalk_cv_admin_group=no { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } else cat >>confdefs.h <<\_ACEOF #define ADMIN_GRP 1 _ACEOF { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } fi else cat >>confdefs.h <<\_ACEOF #define ADMIN_GRP 1 _ACEOF { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } fi AFS_LIBS= AFS_CFLAGS= netatalk_cv_afs=no # Check whether --enable-afs was given. if test "${enable_afs+set}" = set; then enableval=$enable_afs; if test "x$enableval" = "xyes"; then { echo "$as_me:$LINENO: checking for pioctl in -lafsauthent" >&5 echo $ECHO_N "checking for pioctl in -lafsauthent... $ECHO_C" >&6; } if test "${ac_cv_lib_afsauthent_pioctl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lafsauthent $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pioctl (); int main () { return pioctl (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_afsauthent_pioctl=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_afsauthent_pioctl=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_afsauthent_pioctl" >&5 echo "${ECHO_T}$ac_cv_lib_afsauthent_pioctl" >&6; } if test $ac_cv_lib_afsauthent_pioctl = yes; then netatalk_cv_afs=yes else { { echo "$as_me:$LINENO: error: AFS installation not found" >&5 echo "$as_me: error: AFS installation not found" >&2;} { (exit 1); exit 1; }; } fi AFS_LIBS=-lresolv -lafsrpc -lafsauthent cat >>confdefs.h <<\_ACEOF #define AFS 1 _ACEOF fi fi { echo "$as_me:$LINENO: checking whether to enable AFS support" >&5 echo $ECHO_N "checking whether to enable AFS support... $ECHO_C" >&6; } if test x"$netatalk_cv_afs" = x"yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi PKGCONFDIR="${sysconfdir}/netatalk" # Check whether --with-pkgconfdir was given. if test "${with_pkgconfdir+set}" = set; then withval=$with_pkgconfdir; if test "x$withval" != "x"; then PKGCONFDIR="$withval" fi fi SERVERTEXT="${PKGCONFDIR}/msg" # Check whether --with-message-dir was given. if test "${with_message_dir+set}" = set; then withval=$with_message_dir; if test x"$withval" = x"no"; then { echo "$as_me:$LINENO: WARNING: *** message-dir is mandatory and cannot be disabled, using default ***" >&5 echo "$as_me: WARNING: *** message-dir is mandatory and cannot be disabled, using default ***" >&2;} elif test "x$withval" != "x" && test x"$withval" != x"yes"; then SERVERTEXT="$withval" fi fi netatalk_cv_with_cracklib=no # Check whether --with-cracklib was given. if test "${with_cracklib+set}" = set; then withval=$with_cracklib; if test "x$withval" != "xno" ; then cracklib="$withval" { echo "$as_me:$LINENO: checking for main in -lcrack" >&5 echo $ECHO_N "checking for main in -lcrack... $ECHO_C" >&6; } if test "${ac_cv_lib_crack_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrack $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_crack_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_crack_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_crack_main" >&5 echo "${ECHO_T}$ac_cv_lib_crack_main" >&6; } if test $ac_cv_lib_crack_main = yes; then cat >>confdefs.h <<\_ACEOF #define USE_CRACKLIB 1 _ACEOF LIBS="$LIBS -lcrack" if test "$cracklib" = "yes"; then cracklib="/usr/$atalk_libname/cracklib_dict" fi cat >>confdefs.h <<_ACEOF #define _PATH_CRACKLIB "$cracklib" _ACEOF { echo "$as_me:$LINENO: result: setting cracklib dictionary to $cracklib" >&5 echo "${ECHO_T}setting cracklib dictionary to $cracklib" >&6; } netatalk_cv_with_cracklib=yes else { { echo "$as_me:$LINENO: error: cracklib not found!" >&5 echo "$as_me: error: cracklib not found!" >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: checking for cracklib support" >&5 echo $ECHO_N "checking for cracklib support... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $netatalk_cv_with_cracklib" >&5 echo "${ECHO_T}$netatalk_cv_with_cracklib" >&6; } netatalk_cv_ddp_enabled=no { echo "$as_me:$LINENO: checking whether to enable DDP" >&5 echo $ECHO_N "checking whether to enable DDP... $ECHO_C" >&6; } # Check whether --enable-ddp was given. if test "${enable_ddp+set}" = set; then enableval=$enable_ddp; if test "$enableval" = "yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } netatalk_cv_ddp_enabled=yes else { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define NO_DDP 1 _ACEOF fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } cat >>confdefs.h <<\_ACEOF #define NO_DDP 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether to enable debug code" >&5 echo $ECHO_N "checking whether to enable debug code... $ECHO_C" >&6; } # Check whether --enable-debug1 was given. if test "${enable_debug1+set}" = set; then enableval=$enable_debug1; if test "$enableval" != "no"; then if test "$enableval" = "yes"; then cat >>confdefs.h <<\_ACEOF #define DEBUG1 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define DEBUG1 $enableval _ACEOF fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi { echo "$as_me:$LINENO: checking whether to enable verbose debug code" >&5 echo $ECHO_N "checking whether to enable verbose debug code... $ECHO_C" >&6; } # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then enableval=$enable_debug; if test "$enableval" != "no"; then if test "$enableval" = "yes"; then cat >>confdefs.h <<\_ACEOF #define DEBUG 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define DEBUG $enableval _ACEOF fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } cat >>confdefs.h <<\_ACEOF #define NDEBUG 1 _ACEOF fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } cat >>confdefs.h <<\_ACEOF #define NDEBUG 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether to enable debugging with debuggers" >&5 echo $ECHO_N "checking whether to enable debugging with debuggers... $ECHO_C" >&6; } # Check whether --enable-debugging was given. if test "${enable_debugging+set}" = set; then enableval=$enable_debugging; if test "$enableval" != "no"; then if test "$enableval" = "yes"; then cat >>confdefs.h <<\_ACEOF #define DEBUGGING 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define DEBUGGING $enableval _ACEOF fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then enableval=$enable_largefile; fi if test "$enable_largefile" != no; then wx_largefile=no { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include int main () { typedef struct { unsigned int field: sizeof(off_t) == 8; } wxlf; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=64 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_sys_file_offset_bits=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } if test "$ac_cv_sys_file_offset_bits" != no; then wx_largefile=yes cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF fi if test "x$wx_largefile" != "xyes"; then { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGE_FILES 1 #include int main () { typedef struct { unsigned int field: sizeof(off_t) == 8; } wxlf; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=1 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_sys_large_files=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } if test "$ac_cv_sys_large_files" != no; then wx_largefile=yes cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF fi fi { echo "$as_me:$LINENO: checking for 64 bit off_t" >&5 echo $ECHO_N "checking for 64 bit off_t... $ECHO_C" >&6; } if test "${netatalk_cv_SIZEOF_OFF_T+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then netatalk_cv_SIZEOF_OFF_T=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include main() { exit((sizeof(off_t) == 8) ? 0 : 1); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then netatalk_cv_SIZEOF_OFF_T=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) netatalk_cv_SIZEOF_OFF_T=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $netatalk_cv_SIZEOF_OFF_T" >&5 echo "${ECHO_T}$netatalk_cv_SIZEOF_OFF_T" >&6; } { echo "$as_me:$LINENO: checking if large file support is available" >&5 echo $ECHO_N "checking if large file support is available... $ECHO_C" >&6; } if test "x$netatalk_cv_SIZEOF_OFF_T" != "xno"; then cat >>confdefs.h <<\_ACEOF #define HAVE_LARGEFILE_SUPPORT _ACEOF { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } : else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } { { echo "$as_me:$LINENO: error: AFP 3.x support requires Large File Support." >&5 echo "$as_me: error: AFP 3.x support requires Large File Support." >&2;} { (exit 1); exit 1; }; } fi fi saved_CPPFLAGS="$CPPFLAGS" savedcflags="$CFLAGS" savedldflags="$LDFLAGS" ICONV_CFLAGS="" ICONV_LIBS="" # Check whether --with-libiconv was given. if test "${with_libiconv+set}" = set; then withval=$with_libiconv; case "$withval" in no) ;; yes) ;; *) ICONV_CFLAGS="-I$withval/include" ICONV_LIBS="-L$withval/$atalk_libname" ;; esac else withval="no" fi CFLAGS="$ICONV_CFLAGS $CFLAGS" LDFLAGS="$LDFLAGS $ICONV_LIBS -liconv" { echo "$as_me:$LINENO: checking for libiconv" >&5 echo $ECHO_N "checking for libiconv... $ECHO_C" >&6; } if test "${netatalk_cv_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then netatalk_cv_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 netatalk_cv_iconv=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $netatalk_cv_iconv" >&5 echo "${ECHO_T}$netatalk_cv_iconv" >&6; } if test x"$netatalk_cv_iconv" = x"yes"; then ICONV_LIBS="$ICONV_LIBS -liconv" else CFLAGS="$savedcflags" LDFLAGS="$savedldflags" ICONV_LIBS="" ICONV_CFLAGS="" if test x"$withval" != x"no"; then { { echo "$as_me:$LINENO: error: libiconv not found" >&5 echo "$as_me: error: libiconv not found" >&2;} { (exit 1); exit 1; }; } fi fi ac_new_flags="" for i in $ICONV_CFLAGS; do case $i in -I/usr/include|-I/usr/include/) ;; *) ac_new_flags="$ac_new_flags $i" ;; esac done ICONV_CFLAGS=$ac_new_flags ac_new_flags="" for i in $ICONV_LIBS; do case $i in -L/usr/lib|-L/usr/lib/|-L/usr|-L/usr/) ;; *) ac_new_flags="$ac_new_flags $i" ;; esac done ICONV_LIBS=$ac_new_flags { echo "$as_me:$LINENO: checking for working iconv" >&5 echo $ECHO_N "checking for working iconv... $ECHO_C" >&6; } if test "${netatalk_cv_HAVE_USABLE_ICONV+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then netatalk_cv_HAVE_USABLE_ICONV=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ \ #include main() { iconv_t cd = iconv_open("ASCII", "UTF-8"); if (cd == 0 || cd == (iconv_t)-1) return -1; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then netatalk_cv_HAVE_USABLE_ICONV=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) netatalk_cv_HAVE_USABLE_ICONV=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $netatalk_cv_HAVE_USABLE_ICONV" >&5 echo "${ECHO_T}$netatalk_cv_HAVE_USABLE_ICONV" >&6; } if test x"$netatalk_cv_HAVE_USABLE_ICONV" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_USABLE_ICONV 1 _ACEOF fi if test x"$netatalk_cv_HAVE_USABLE_ICONV" = x"yes"; then if test "${am_cv_proto_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ \ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then am_cv_proto_iconv_arg1="" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_proto_iconv_arg1="const" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi if test x"$netatalk_cv_HAVE_USABLE_ICONV" = x"yes"; then { echo "$as_me:$LINENO: checking whether iconv supports UCS-2-INTERNAL" >&5 echo $ECHO_N "checking whether iconv supports UCS-2-INTERNAL... $ECHO_C" >&6; } if test "${netatalk_cv_HAVE_UCS2INTERNAL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then netatalk_cv_HAVEUCS2INTERNAL=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ \ #include int main() { iconv_t cd = iconv_open("ASCII", "UCS-2-INTERNAL"); if (cd == 0 || cd == (iconv_t)-1) return -1; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then netatalk_cv_HAVE_UCS2INTERNAL=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) netatalk_cv_HAVE_UCS2INTERNAL=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $netatalk_cv_HAVE_UCS2INTERNAL" >&5 echo "${ECHO_T}$netatalk_cv_HAVE_UCS2INTERNAL" >&6; } if test x"$netatalk_cv_HAVE_UCS2INTERNAL" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_UCS2INTERNAL 1 _ACEOF fi fi CFLAGS="$savedcflags" LDFLAGS="$savedldflags" CPPFLAGS="$saved_CPPFLAGS" netatalk_cv_dropkludge=no { echo "$as_me:$LINENO: checking whether to enable experimental dropbox support" >&5 echo $ECHO_N "checking whether to enable experimental dropbox support... $ECHO_C" >&6; } # Check whether --enable-dropkludge was given. if test "${enable_dropkludge+set}" = set; then enableval=$enable_dropkludge; if test "$enableval" = "yes"; then cat >>confdefs.h <<\_ACEOF #define DROPKLUDGE 1 _ACEOF { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } netatalk_cv_dropkludge=yes else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi netatalk_cv_force_uidgid=no { echo "$as_me:$LINENO: checking whether to enable forcing of uid/gid per volume" >&5 echo $ECHO_N "checking whether to enable forcing of uid/gid per volume... $ECHO_C" >&6; } # Check whether --enable-force-uidgid was given. if test "${enable_force_uidgid+set}" = set; then enableval=$enable_force_uidgid; if test "$enableval" = "yes"; then cat >>confdefs.h <<\_ACEOF #define FORCE_UIDGID 1 _ACEOF { echo "$as_me:$LINENO: result: enabling forcing of uid/gid per volume" >&5 echo "${ECHO_T}enabling forcing of uid/gid per volume" >&6; } { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } netatalk_cv_force_uidgid=yes else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi bdb_required=no bdb_required=no compiled_backends="" { echo "$as_me:$LINENO: checking whether or not to use Database Daemon CNID backend" >&5 echo $ECHO_N "checking whether or not to use Database Daemon CNID backend... $ECHO_C" >&6; } # Check whether --with-cnid-dbd-backend was given. if test "${with_cnid_dbd_backend+set}" = set; then withval=$with_cnid_dbd_backend; if test x"$withval" = x"no"; then use_dbd_backend=no { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } else use_dbd_backend=yes { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } fi else use_dbd_backend=yes { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } fi if test $use_dbd_backend = yes; then compiled_backends="$compiled_backends dbd" cat >>confdefs.h <<\_ACEOF #define CNID_BACKEND_DBD 1 _ACEOF if test x"$DEFAULT_CNID_SCHEME" = x; then DEFAULT_CNID_SCHEME=dbd fi bdb_required=yes fi if test x"$use_dbd_backend" = x"yes"; then BUILD_DBD_DAEMON_TRUE= BUILD_DBD_DAEMON_FALSE='#' else BUILD_DBD_DAEMON_TRUE='#' BUILD_DBD_DAEMON_FALSE= fi { echo "$as_me:$LINENO: checking whether or not to use BDB Concurrent Data Store" >&5 echo $ECHO_N "checking whether or not to use BDB Concurrent Data Store... $ECHO_C" >&6; } # Check whether --with-cnid-cdb-backend was given. if test "${with_cnid_cdb_backend+set}" = set; then withval=$with_cnid_cdb_backend; if test x"$withval" = x"no"; then use_cdb_backend=no else use_cdb_backend=yes fi else use_cdb_backend=no fi if test $use_cdb_backend = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define CNID_BACKEND_CDB 1 _ACEOF if test x"$DEFAULT_CNID_SCHEME" = x; then DEFAULT_CNID_SCHEME=cdb fi bdb_required=yes compiled_backends="$compiled_backends cdb" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test x"$use_cdb_backend" = x"yes"; then USE_CDB_BACKEND_TRUE= USE_CDB_BACKEND_FALSE='#' else USE_CDB_BACKEND_TRUE='#' USE_CDB_BACKEND_FALSE= fi { echo "$as_me:$LINENO: checking whether or not to use LAST DID scheme" >&5 echo $ECHO_N "checking whether or not to use LAST DID scheme... $ECHO_C" >&6; } # Check whether --with-cnid-last-backend was given. if test "${with_cnid_last_backend+set}" = set; then withval=$with_cnid_last_backend; if test x"$withval" = x"no"; then use_last_backend=no else use_last_backend=yes fi else use_last_backend=yes fi if test $use_last_backend = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define CNID_BACKEND_LAST 1 _ACEOF if test x"$DEFAULT_CNID_SCHEME" = x; then DEFAULT_CNID_SCHEME=last fi compiled_backends="$compiled_backends last" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test x"$use_last_backend" = x"yes"; then USE_LAST_BACKEND_TRUE= USE_LAST_BACKEND_FALSE='#' else USE_LAST_BACKEND_TRUE='#' USE_LAST_BACKEND_FALSE= fi { echo "$as_me:$LINENO: checking whether or not to use TDB DID scheme" >&5 echo $ECHO_N "checking whether or not to use TDB DID scheme... $ECHO_C" >&6; } # Check whether --with-cnid-tdb-backend was given. if test "${with_cnid_tdb_backend+set}" = set; then withval=$with_cnid_tdb_backend; if test x"$withval" = x"no"; then use_tdb_backend=no else use_tdb_backend=yes fi else use_tdb_backend=yes fi if test $use_tdb_backend = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define CNID_BACKEND_TDB 1 _ACEOF if test x"$DEFAULT_CNID_SCHEME" = x; then DEFAULT_CNID_SCHEME=tdb fi compiled_backends="$compiled_backends tdb" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test x"$use_tdb_backend" = x"yes"; then USE_TDB_BACKEND_TRUE= USE_TDB_BACKEND_FALSE='#' else USE_TDB_BACKEND_TRUE='#' USE_TDB_BACKEND_FALSE= fi { echo "$as_me:$LINENO: checking default DID scheme" >&5 echo $ECHO_N "checking default DID scheme... $ECHO_C" >&6; } # Check whether --with-cnid-default-backend was given. if test "${with_cnid_default_backend+set}" = set; then withval=$with_cnid_default_backend; if test x"$withval" = x; then { echo "$as_me:$LINENO: result: ignored" >&5 echo "${ECHO_T}ignored" >&6; } else DEFAULT_CNID_SCHEME=$withval { echo "$as_me:$LINENO: result: $DEFAULT_CNID_SCHEME" >&5 echo "${ECHO_T}$DEFAULT_CNID_SCHEME" >&6; } fi else { echo "$as_me:$LINENO: result: $DEFAULT_CNID_SCHEME" >&5 echo "${ECHO_T}$DEFAULT_CNID_SCHEME" >&6; } fi if test x"$DEFAULT_CNID_SCHEME" = x; then { { echo "$as_me:$LINENO: error: No DID schemes compiled in " >&5 echo "$as_me: error: No DID schemes compiled in " >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking whether default CNID scheme has been activated" >&5 echo $ECHO_N "checking whether default CNID scheme has been activated... $ECHO_C" >&6; } found_scheme=no for scheme in $compiled_backends ; do if test x"$scheme" = x"$DEFAULT_CNID_SCHEME"; then found_scheme=yes fi done if test x"$found_scheme" = x"no"; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } { { echo "$as_me:$LINENO: error: Specified default CNID scheme $DEFAULT_CNID_SCHEME was not selected for compilation" >&5 echo "$as_me: error: Specified default CNID scheme $DEFAULT_CNID_SCHEME was not selected for compilation" >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } fi cat >>confdefs.h <<_ACEOF #define DEFAULT_CNID_SCHEME "$DEFAULT_CNID_SCHEME" _ACEOF if test "x$bdb_required" = "xyes"; then bdb_required=yes else bdb_required=no fi # Check whether --enable-quota was given. if test "${enable_quota+set}" = set; then enableval=$enable_quota; fi if test x$enable_quota != xno; then QUOTA_LIBS="" netatalk_cv_quotasupport="yes" { echo "$as_me:$LINENO: checking for main in -lrpcsvc" >&5 echo $ECHO_N "checking for main in -lrpcsvc... $ECHO_C" >&6; } if test "${ac_cv_lib_rpcsvc_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrpcsvc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_rpcsvc_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_rpcsvc_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_rpcsvc_main" >&5 echo "${ECHO_T}$ac_cv_lib_rpcsvc_main" >&6; } if test $ac_cv_lib_rpcsvc_main = yes; then QUOTA_LIBS="-lrpcsvc" fi for ac_header in rpc/rpc.h rpc/pmap_prot.h rpcsvc/rquota.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else QUOTA_LIBS="" netatalk_cv_quotasupport="no" cat >>confdefs.h <<\_ACEOF #define NO_QUOTA_SUPPORT 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for getfsquota in -lquota" >&5 echo $ECHO_N "checking for getfsquota in -lquota... $ECHO_C" >&6; } if test "${ac_cv_lib_quota_getfsquota+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lquota -lprop -lrpcsvc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getfsquota (); int main () { return getfsquota (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_quota_getfsquota=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_quota_getfsquota=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_quota_getfsquota" >&5 echo "${ECHO_T}$ac_cv_lib_quota_getfsquota" >&6; } if test $ac_cv_lib_quota_getfsquota = yes; then QUOTA_LIBS="-lquota -lprop -lrpcsvc" cat >>confdefs.h <<\_ACEOF #define HAVE_LIBQUOTA 1 _ACEOF fi else netatalk_cv_quotasupport="no" cat >>confdefs.h <<\_ACEOF #define NO_QUOTA_SUPPORT 1 _ACEOF fi SLP_LIBS="" SLP_CFLAGS="" found_slp=no srvlocdir="" # Check whether --enable-srvloc was given. if test "${enable_srvloc+set}" = set; then enableval=$enable_srvloc; srvloc=$enableval else srvloc=no fi [ -n "$atalk_libname" ] || { { echo "$as_me:$LINENO: error: internal error, atalk_libname undefined" >&5 echo "$as_me: error: internal error, atalk_libname undefined" >&2;} { (exit 1); exit 1; }; } if test "x$srvloc" != "xno"; then savedcppflags="$CPPFLAGS" savedldflags="$LDFLAGS" if test "x$srvloc" = "xyes" ; then srvlocdir="/usr" else srvlocdir="$srvloc" fi CPPFLAGS="$CPPFLAGS -I$srvlocdir/include" LDFLAGS="$LDFLAGS -L$srvlocdir/$atalk_libname" { echo "$as_me:$LINENO: checking for slp.h" >&5 echo $ECHO_N "checking for slp.h... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } found_slp=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f conftest.err conftest.$ac_ext if test "x$found_slp" = "xyes"; then { echo "$as_me:$LINENO: checking for SLPOpen in -lslp" >&5 echo $ECHO_N "checking for SLPOpen in -lslp... $ECHO_C" >&6; } if test "${ac_cv_lib_slp_SLPOpen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lslp $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SLPOpen (); int main () { return SLPOpen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_slp_SLPOpen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_slp_SLPOpen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_slp_SLPOpen" >&5 echo "${ECHO_T}$ac_cv_lib_slp_SLPOpen" >&6; } if test $ac_cv_lib_slp_SLPOpen = yes; then SLP_LIBS="-L$srvlocdir/$atalk_libname -lslp" SLP_CFLAGS="-I$srvlocdir/include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } found_slp=no fi fi CPPFLAGS="$savedcppflags" LDFLAGS="$savedldflags" fi netatalk_cv_srvloc=no { echo "$as_me:$LINENO: checking whether to enable srvloc (SLP) support" >&5 echo $ECHO_N "checking whether to enable srvloc (SLP) support... $ECHO_C" >&6; } if test "x$found_slp" = "xyes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define USE_SRVLOC 1 _ACEOF netatalk_cv_srvloc=yes else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } if test "x$srvloc" != "xno" -a "x$srvloc" != "xyes"; then { { echo "$as_me:$LINENO: error: SLP installation not found" >&5 echo "$as_me: error: SLP installation not found" >&2;} { (exit 1); exit 1; }; } fi fi ac_new_flags="" for i in $SLP_LIBS; do case $i in -L/usr/lib|-L/usr/lib/|-L/usr|-L/usr/) ;; *) ac_new_flags="$ac_new_flags $i" ;; esac done SLP_LIBS=$ac_new_flags ac_new_flags="" for i in $SLP_CFLAGS; do case $i in -I/usr/include|-I/usr/include/) ;; *) ac_new_flags="$ac_new_flags $i" ;; esac done SLP_CFLAGS=$ac_new_flags if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } PKG_CONFIG="" fi fi ZEROCONF_LIBS="" ZEROCONF_CFLAGS="" found_zeroconf=no zeroconf_dir="" # Check whether --enable-zeroconf was given. if test "${enable_zeroconf+set}" = set; then enableval=$enable_zeroconf; zeroconf=$enableval else zeroconf=try fi [ -n "$atalk_libname" ] || { { echo "$as_me:$LINENO: error: internal error, atalk_libname undefined" >&5 echo "$as_me: error: internal error, atalk_libname undefined" >&2;} { (exit 1); exit 1; }; } if test "x$zeroconf" != "xno"; then savedcppflags="$CPPFLAGS" savedldflags="$LDFLAGS" if test "x$zeroconf" = "xyes" -o "x$zeroconf" = "xtry"; then zeroconf_dir="/usr" else zeroconf_dir="$zeroconf" fi # mDNS support using Avahi if test "${ac_cv_header_avahi_client_client_h+set}" = set; then { echo "$as_me:$LINENO: checking for avahi-client/client.h" >&5 echo $ECHO_N "checking for avahi-client/client.h... $ECHO_C" >&6; } if test "${ac_cv_header_avahi_client_client_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_avahi_client_client_h" >&5 echo "${ECHO_T}$ac_cv_header_avahi_client_client_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking avahi-client/client.h usability" >&5 echo $ECHO_N "checking avahi-client/client.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking avahi-client/client.h presence" >&5 echo $ECHO_N "checking avahi-client/client.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: avahi-client/client.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: avahi-client/client.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: avahi-client/client.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: avahi-client/client.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: avahi-client/client.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: avahi-client/client.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: avahi-client/client.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: avahi-client/client.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: avahi-client/client.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: avahi-client/client.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: avahi-client/client.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: avahi-client/client.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: avahi-client/client.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: avahi-client/client.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: avahi-client/client.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: avahi-client/client.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for avahi-client/client.h" >&5 echo $ECHO_N "checking for avahi-client/client.h... $ECHO_C" >&6; } if test "${ac_cv_header_avahi_client_client_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_avahi_client_client_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_avahi_client_client_h" >&5 echo "${ECHO_T}$ac_cv_header_avahi_client_client_h" >&6; } fi if test $ac_cv_header_avahi_client_client_h = yes; then { echo "$as_me:$LINENO: checking for avahi_client_new in -lavahi-client" >&5 echo $ECHO_N "checking for avahi_client_new in -lavahi-client... $ECHO_C" >&6; } if test "${ac_cv_lib_avahi_client_avahi_client_new+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lavahi-client $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char avahi_client_new (); int main () { return avahi_client_new (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_avahi_client_avahi_client_new=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_avahi_client_avahi_client_new=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_avahi_client_avahi_client_new" >&5 echo "${ECHO_T}$ac_cv_lib_avahi_client_avahi_client_new" >&6; } if test $ac_cv_lib_avahi_client_avahi_client_new = yes; then cat >>confdefs.h <<\_ACEOF #define USE_ZEROCONF 1 _ACEOF fi fi case "$ac_cv_lib_avahi_client_avahi_client_new" in yes) pkg_failed=no { echo "$as_me:$LINENO: checking for AVAHI" >&5 echo $ECHO_N "checking for AVAHI... $ECHO_C" >&6; } if test -n "$PKG_CONFIG"; then if test -n "$AVAHI_CFLAGS"; then pkg_cv_AVAHI_CFLAGS="$AVAHI_CFLAGS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \" avahi-client >= 0.6 \"") >&5 ($PKG_CONFIG --exists --print-errors " avahi-client >= 0.6 ") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_AVAHI_CFLAGS=`$PKG_CONFIG --cflags " avahi-client >= 0.6 " 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$AVAHI_LIBS"; then pkg_cv_AVAHI_LIBS="$AVAHI_LIBS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \" avahi-client >= 0.6 \"") >&5 ($PKG_CONFIG --exists --print-errors " avahi-client >= 0.6 ") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_AVAHI_LIBS=`$PKG_CONFIG --libs " avahi-client >= 0.6 " 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then AVAHI_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors " avahi-client >= 0.6 "` else AVAHI_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors " avahi-client >= 0.6 "` fi # Put the nasty error message in config.log where it belongs echo "$AVAHI_PKG_ERRORS" >&5 { { echo "$as_me:$LINENO: error: Package requirements ( avahi-client >= 0.6 ) were not met: $AVAHI_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables AVAHI_CFLAGS and AVAHI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 echo "$as_me: error: Package requirements ( avahi-client >= 0.6 ) were not met: $AVAHI_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables AVAHI_CFLAGS and AVAHI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables AVAHI_CFLAGS and AVAHI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&5 echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables AVAHI_CFLAGS and AVAHI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else AVAHI_CFLAGS=$pkg_cv_AVAHI_CFLAGS AVAHI_LIBS=$pkg_cv_AVAHI_LIBS { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } : fi pkg_failed=no { echo "$as_me:$LINENO: checking for AVAHI_TPOLL" >&5 echo $ECHO_N "checking for AVAHI_TPOLL... $ECHO_C" >&6; } if test -n "$PKG_CONFIG"; then if test -n "$AVAHI_TPOLL_CFLAGS"; then pkg_cv_AVAHI_TPOLL_CFLAGS="$AVAHI_TPOLL_CFLAGS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \" avahi-client >= 0.6.4 \"") >&5 ($PKG_CONFIG --exists --print-errors " avahi-client >= 0.6.4 ") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_AVAHI_TPOLL_CFLAGS=`$PKG_CONFIG --cflags " avahi-client >= 0.6.4 " 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$AVAHI_TPOLL_LIBS"; then pkg_cv_AVAHI_TPOLL_LIBS="$AVAHI_TPOLL_LIBS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \" avahi-client >= 0.6.4 \"") >&5 ($PKG_CONFIG --exists --print-errors " avahi-client >= 0.6.4 ") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_AVAHI_TPOLL_LIBS=`$PKG_CONFIG --libs " avahi-client >= 0.6.4 " 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then AVAHI_TPOLL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors " avahi-client >= 0.6.4 "` else AVAHI_TPOLL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors " avahi-client >= 0.6.4 "` fi # Put the nasty error message in config.log where it belongs echo "$AVAHI_TPOLL_PKG_ERRORS" >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } { echo "$as_me:$LINENO: WARNING: This Avahi implementation is not supporting threaded poll objects. Maybe this is not what you want." >&5 echo "$as_me: WARNING: This Avahi implementation is not supporting threaded poll objects. Maybe this is not what you want." >&2;} elif test $pkg_failed = untried; then { echo "$as_me:$LINENO: WARNING: This Avahi implementation is not supporting threaded poll objects. Maybe this is not what you want." >&5 echo "$as_me: WARNING: This Avahi implementation is not supporting threaded poll objects. Maybe this is not what you want." >&2;} else AVAHI_TPOLL_CFLAGS=$pkg_cv_AVAHI_TPOLL_CFLAGS AVAHI_TPOLL_LIBS=$pkg_cv_AVAHI_TPOLL_LIBS { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_AVAHI_THREADED_POLL 1 _ACEOF fi ZEROCONF_LIBS="$AVAHI_LIBS" ZEROCONF_CFLAGS="$AVAHI_CFLAGS" cat >>confdefs.h <<\_ACEOF #define HAVE_AVAHI 1 _ACEOF found_zeroconf=yes ;; esac CPPFLAGS="$savedcppflags" LDFLAGS="$savedldflags" fi netatalk_cv_zeroconf=no { echo "$as_me:$LINENO: checking whether to enable Zerconf support" >&5 echo $ECHO_N "checking whether to enable Zerconf support... $ECHO_C" >&6; } if test "x$found_zeroconf" = "xyes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define USE_ZEROCONF 1 _ACEOF netatalk_cv_zeroconf=yes else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } if test "x$zeroconf" != "xno" -a "x$zeroconf" != "xtry"; then { { echo "$as_me:$LINENO: error: Zeroconf installation not found" >&5 echo "$as_me: error: Zeroconf installation not found" >&2;} { (exit 1); exit 1; }; } fi fi ac_new_flags="" for i in $ZEROCONF_LIBS; do case $i in -L/usr/lib|-L/usr/lib/|-L/usr|-L/usr/) ;; *) ac_new_flags="$ac_new_flags $i" ;; esac done ZEROCONF_LIBS=$ac_new_flags ac_new_flags="" for i in $ZEROCONF_CFLAGS; do case $i in -I/usr/include|-I/usr/include/) ;; *) ac_new_flags="$ac_new_flags $i" ;; esac done ZEROCONF_CFLAGS=$ac_new_flags netatalk_cv_use_pam=no # Check whether --with-pam was given. if test "${with_pam+set}" = set; then withval=$with_pam; require_pam="yes" if test "x$withval" = "xno"; then PAMDIR="NONE" require_pam="never" elif test "x$withval" = "xyes"; then PAMDIR="NONE" else PAMDIR="$withval" fi else PAMDIR="NONE";require_pam="no" fi { echo "$as_me:$LINENO: checking for PAM installation directory" >&5 echo $ECHO_N "checking for PAM installation directory... $ECHO_C" >&6; } if test "$host_os" != "solaris"; then if test "x$PAMDIR" = "xNONE" -a "x$require_pam" != "xnever"; then pam_paths="/ /usr/ /usr/local/" for path in $pam_paths; do if test -d "${path}etc/pam.d"; then PAMDIR="$path" break fi done fi if test "x$PAMDIR" != "xNONE"; then { echo "$as_me:$LINENO: result: yes (path: ${PAMDIR}etc/pam.d)" >&5 echo "${ECHO_T}yes (path: ${PAMDIR}etc/pam.d)" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: /etc/pam.conf (solaris)" >&5 echo "${ECHO_T}/etc/pam.conf (solaris)" >&6; } fi pam_found="no" if test "x$require_pam" != "xnever"; then savedCFLAGS="$CFLAGS" savedLDFLAGS="$LDFLAGS" savedLIBS="$LIBS" if test "x$PAMDIR" != "xNONE" -a "x$PAMDIR" != "x/"; then PAM_CFLAGS="-I${PAMDIR}include" PAM_LDFLAGS="-L${PAMDIR}lib" LDFLAGS="$LDFLAGS $PAM_LDFLAGS" CFLAGS="$CFLAGS $PAM_CFLAGS" fi for ac_header in security/pam_appl.h pam/pam_appl.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test x"$ac_cv_header_security_pam_appl_h" = x"no" -a x"$ac_cv_header_pam_pam_appl_h" = x"no"; then pam_found=no else { echo "$as_me:$LINENO: checking for pam_set_item in -lpam" >&5 echo $ECHO_N "checking for pam_set_item in -lpam... $ECHO_C" >&6; } if test "${ac_cv_lib_pam_pam_set_item+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpam $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pam_set_item (); int main () { return pam_set_item (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pam_pam_set_item=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pam_pam_set_item=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pam_pam_set_item" >&5 echo "${ECHO_T}$ac_cv_lib_pam_pam_set_item" >&6; } if test $ac_cv_lib_pam_pam_set_item = yes; then PAM_LIBS="$PAM_LDFLAGS -lpam" pam_found="yes" fi fi CFLAGS="$savedCFLAGS" LDFLAGS="$savedLDFLAGS" LIBS="$savedLIBS" fi netatalk_cv_install_pam=yes if test x"$pam_found" = "xyes" -a "x$PAMDIR" = "xNONE"; then { echo "$as_me:$LINENO: WARNING: PAM support can be compiled, but the install location for the netatalk.pamd file could not be determined. Either install this file by hand or specify the install path." >&5 echo "$as_me: WARNING: PAM support can be compiled, but the install location for the netatalk.pamd file could not be determined. Either install this file by hand or specify the install path." >&2;} netatalk_cv_install_pam=no else { echo "$as_me:$LINENO: checking for includable common PAM config" >&5 echo $ECHO_N "checking for includable common PAM config... $ECHO_C" >&6; } pampath="${PAMDIR}etc/pam.d" if test -f "$pampath/common-auth" ; then PAM_DIRECTIVE=include PAM_AUTH=common-auth PAM_ACCOUNT=common-account PAM_PASSWORD=common-password PAM_SESSION=common-session elif test -f "$pampath/system-auth" ; then PAM_DIRECTIVE=include PAM_AUTH=system-auth PAM_ACCOUNT=system-auth PAM_PASSWORD=system-auth PAM_SESSION=system-auth elif test -f "$pampath/system" ; then PAM_DIRECTIVE=include PAM_AUTH=system PAM_ACCOUNT=system PAM_PASSWORD=system PAM_SESSION=system else PAM_DIRECTIVE=required PAM_AUTH=pam_unix.so PAM_ACCOUNT=pam_unix.so PAM_PASSWORD="pam_unix.so use_authtok" PAM_SESSION=pam_unix.so fi if test "x$PAM_DIRECTIVE" != "xrequired" ; then { echo "$as_me:$LINENO: result: yes ($PAM_DIRECTIVE $PAM_AUTH)" >&5 echo "${ECHO_T}yes ($PAM_DIRECTIVE $PAM_AUTH)" >&6; } else { echo "$as_me:$LINENO: result: no (using defaut pam_unix.so)" >&5 echo "${ECHO_T}no (using defaut pam_unix.so)" >&6; } fi fi { echo "$as_me:$LINENO: checking whether to enable PAM support" >&5 echo $ECHO_N "checking whether to enable PAM support... $ECHO_C" >&6; } if test "x$pam_found" = "xno"; then netatalk_cv_install_pam=no if test "x$require_pam" = "xyes"; then { { echo "$as_me:$LINENO: error: PAM support missing" >&5 echo "$as_me: error: PAM support missing" >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi : else { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } use_pam_so=yes compile_pam=yes netatalk_cv_use_pam=yes cat >>confdefs.h <<\_ACEOF #define USE_PAM 1 _ACEOF fi ac_new_flags="" for i in $PAM_LIBS; do case $i in -L/usr/lib|-L/usr/lib/|-L/usr|-L/usr/) ;; *) ac_new_flags="$ac_new_flags $i" ;; esac done PAM_LIBS=$ac_new_flags ac_new_flags="" for i in $PAM_CFLAGS; do case $i in -I/usr/include|-I/usr/include/) ;; *) ac_new_flags="$ac_new_flags $i" ;; esac done PAM_CFLAGS=$ac_new_flags netatalk_cv_use_shadowpw=no # Check whether --with-shadow was given. if test "${with_shadow+set}" = set; then withval=$with_shadow; netatalk_cv_use_shadowpw="$withval" else netatalk_cv_use_shadowpw=auto fi if test "x$netatalk_cv_use_shadowpw" != "xno"; then if test "${ac_cv_header_shadow_h+set}" = set; then { echo "$as_me:$LINENO: checking for shadow.h" >&5 echo $ECHO_N "checking for shadow.h... $ECHO_C" >&6; } if test "${ac_cv_header_shadow_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_shadow_h" >&5 echo "${ECHO_T}$ac_cv_header_shadow_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking shadow.h usability" >&5 echo $ECHO_N "checking shadow.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking shadow.h presence" >&5 echo $ECHO_N "checking shadow.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: shadow.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: shadow.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: shadow.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: shadow.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: shadow.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: shadow.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: shadow.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: shadow.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: shadow.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: shadow.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: shadow.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: shadow.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: shadow.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: shadow.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: shadow.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: shadow.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for shadow.h" >&5 echo $ECHO_N "checking for shadow.h... $ECHO_C" >&6; } if test "${ac_cv_header_shadow_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_shadow_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_shadow_h" >&5 echo "${ECHO_T}$ac_cv_header_shadow_h" >&6; } fi if test x"$ac_cv_header_shadow_h" = x"yes"; then netatalk_cv_use_shadowpw=yes cat >>confdefs.h <<\_ACEOF #define SHADOWPW 1 _ACEOF else if test "x$shadowpw" = "xyes"; then { { echo "$as_me:$LINENO: error: shadow support not available" >&5 echo "$as_me: error: shadow support not available" >&2;} { (exit 1); exit 1; }; } else netatalk_cv_use_shadowpw=no fi fi fi { echo "$as_me:$LINENO: checking whether shadow support should be enabled" >&5 echo $ECHO_N "checking whether shadow support should be enabled... $ECHO_C" >&6; } if test "x$netatalk_cv_use_shadowpw" = "xyes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi netatalk_cv_use_shellcheck=yes { echo "$as_me:$LINENO: checking whether checking for a valid shell should be enabled" >&5 echo $ECHO_N "checking whether checking for a valid shell should be enabled... $ECHO_C" >&6; } # Check whether --enable-shell-check was given. if test "${enable_shell_check+set}" = set; then enableval=$enable_shell_check; if test "$enableval" = "no"; then cat >>confdefs.h <<\_ACEOF #define DISABLE_SHELLCHECK 1 _ACEOF { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } netatalk_cv_use_shellcheck=no else { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } fi else { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } fi check=maybe # Check whether --enable-tcp-wrappers was given. if test "${enable_tcp_wrappers+set}" = set; then enableval=$enable_tcp_wrappers; if test "x$enableval" = "xno"; then wrapcheck=no else wrapcheck=yes fi fi enable=no netatalk_cv_tcpwrap=no if test "x$wrapcheck" != "xno"; then saved_LIBS=$LIBS W_LIBS="-lwrap" LIBS="$LIBS $W_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int allow_severity = 0; int deny_severity = 0; int main () { hosts_access(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then netatalk_cv_tcpwrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$saved_LIBS W_LIBS="-lwrap -lnsl" LIBS="$LIBS $W_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int allow_severity = 0; int deny_severity = 0; int main () { hosts_access(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then netatalk_cv_tcpwrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 netatalk_cv_tcpwrap=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$saved_LIBS fi { echo "$as_me:$LINENO: checking whether to enable the TCP wrappers" >&5 echo $ECHO_N "checking whether to enable the TCP wrappers... $ECHO_C" >&6; } if test "x$netatalk_cv_tcpwrap" = "xyes"; then cat >>confdefs.h <<\_ACEOF #define TCPWRAP 1 _ACEOF WRAP_LIBS=$W_LIBS { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else if test "x$wrapcheck" = "xyes"; then { { echo "$as_me:$LINENO: error: libwrap not found" >&5 echo "$as_me: error: libwrap not found" >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi { echo "$as_me:$LINENO: checking whether system (fcntl) locking should be disabled" >&5 echo $ECHO_N "checking whether system (fcntl) locking should be disabled... $ECHO_C" >&6; } # Check whether --enable-locking was given. if test "${enable_locking+set}" = set; then enableval=$enable_locking; if test "$enableval" = "no"; then cat >>confdefs.h <<\_ACEOF #define DISABLE_LOCKING 1 _ACEOF { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Check whether --enable-redhat was given. if test "${enable_redhat+set}" = set; then enableval=$enable_redhat; echo "ERROR: --enable-redhat is obsoleted. Use --enable-redhat-sysv or --enable-redhat-systemd." exit 1 fi # Check whether --enable-redhat-sysv was given. if test "${enable_redhat_sysv+set}" = set; then enableval=$enable_redhat_sysv; if test "$enableval" = "yes"; then sysv_style=redhat-sysv fi { echo "$as_me:$LINENO: result: enabling redhat-style sysv support" >&5 echo "${ECHO_T}enabling redhat-style sysv support" >&6; } fi # Check whether --enable-redhat-systemd was given. if test "${enable_redhat_systemd+set}" = set; then enableval=$enable_redhat_systemd; if test "$enableval" = "yes"; then sysv_style=redhat-systemd fi { echo "$as_me:$LINENO: result: enabling redhat-style systemd support" >&5 echo "${ECHO_T}enabling redhat-style systemd support" >&6; } fi # Check whether --enable-suse was given. if test "${enable_suse+set}" = set; then enableval=$enable_suse; echo "ERROR: --enable-suse is obsoleted. Use --enable-suse-sysv or --enable-suse-systemd." exit 1 fi # Check whether --enable-suse-sysv was given. if test "${enable_suse_sysv+set}" = set; then enableval=$enable_suse_sysv; if test "$enableval" = "yes"; then sysv_style=suse-sysv fi { echo "$as_me:$LINENO: result: enabling suse-style sysv support" >&5 echo "${ECHO_T}enabling suse-style sysv support" >&6; } fi # Check whether --enable-suse-systemd was given. if test "${enable_suse_systemd+set}" = set; then enableval=$enable_suse_systemd; if test "$enableval" = "yes"; then sysv_style=suse-systemd fi { echo "$as_me:$LINENO: result: enabling suse-style systemd support" >&5 echo "${ECHO_T}enabling suse-style systemd support" >&6; } fi # Check whether --enable-gentoo was given. if test "${enable_gentoo+set}" = set; then enableval=$enable_gentoo; if test "$enableval" = "yes"; then sysv_style=gentoo fi { echo "$as_me:$LINENO: result: enabling gentoo-style sysv support" >&5 echo "${ECHO_T}enabling gentoo-style sysv support" >&6; } fi # Check whether --enable-netbsd was given. if test "${enable_netbsd+set}" = set; then enableval=$enable_netbsd; if test "x$enableval" = "xyes"; then sysv_style=netbsd fi { echo "$as_me:$LINENO: result: enabling NetBSD-style rc.d support" >&5 echo "${ECHO_T}enabling NetBSD-style rc.d support" >&6; } fi # Check whether --enable-debian was given. if test "${enable_debian+set}" = set; then enableval=$enable_debian; if test "$enableval" = "yes"; then sysv_style=debian fi { echo "$as_me:$LINENO: result: enabling debian-style sysv support" >&5 echo "${ECHO_T}enabling debian-style sysv support" >&6; } fi # Check whether --enable-systemd was given. if test "${enable_systemd+set}" = set; then enableval=$enable_systemd; if test "$enableval" = "yes"; then sysv_style=systemd fi { echo "$as_me:$LINENO: result: enabling general systemd support" >&5 echo "${ECHO_T}enabling general systemd support" >&6; } fi { echo "$as_me:$LINENO: checking whether timelord should be compiled" >&5 echo $ECHO_N "checking whether timelord should be compiled... $ECHO_C" >&6; } compile_timelord=no # Check whether --enable-timelord was given. if test "${enable_timelord+set}" = set; then enableval=$enable_timelord; compile_timelord="$enableval" else compile_timelord="no" fi { echo "$as_me:$LINENO: result: $compile_timelord" >&5 echo "${ECHO_T}$compile_timelord" >&6; } { echo "$as_me:$LINENO: checking whether a2boot should be compiled" >&5 echo $ECHO_N "checking whether a2boot should be compiled... $ECHO_C" >&6; } compile_a2boot=no # Check whether --enable-a2boot was given. if test "${enable_a2boot+set}" = set; then enableval=$enable_a2boot; compile_a2boot="$enableval" else compile_a2boot="no" fi { echo "$as_me:$LINENO: result: $compile_a2boot" >&5 echo "${ECHO_T}$compile_a2boot" >&6; } # Check whether --with-uams-path was given. if test "${with_uams_path+set}" = set; then withval=$with_uams_path; uams_path="$withval" else uams_path="${PKGCONFDIR}/uams" fi spool_required=no netatalk_cv_use_cups=no # Check whether --enable-cups was given. if test "${enable_cups+set}" = set; then enableval=$enable_cups; fi if test x$enable_cups != xno; then # Extract the first word of "cups-config", so it can be a program name with args. set dummy cups-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_CUPS_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CUPS_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_CUPS_CONFIG="$CUPS_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CUPS_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi CUPS_CONFIG=$ac_cv_path_CUPS_CONFIG if test -n "$CUPS_CONFIG"; then { echo "$as_me:$LINENO: result: $CUPS_CONFIG" >&5 echo "${ECHO_T}$CUPS_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$CUPS_CONFIG" != x; then cat >>confdefs.h <<\_ACEOF #define HAVE_CUPS 1 _ACEOF CUPS_CFLAGS="`$CUPS_CONFIG --cflags`" CUPS_LDFLAGS="`$CUPS_CONFIG --ldflags`" CUPS_LIBS="`$CUPS_CONFIG --libs`" CUPS_VERSION="`$CUPS_CONFIG --version`" cat >>confdefs.h <<_ACEOF #define CUPS_API_VERSION "`$CUPS_CONFIG --api-version`" _ACEOF { echo "$as_me:$LINENO: checking CUPS version" >&5 echo $ECHO_N "checking CUPS version... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $CUPS_VERSION" >&5 echo "${ECHO_T}$CUPS_VERSION" >&6; } netatalk_cv_use_cups=yes if test x"$netatalk_cv_HAVE_USABLE_ICONV" = x"no" ; then { echo "$as_me:$LINENO: WARNING: *** Warning: iconv not found on your system, using simple ascii mapping***" >&5 echo "$as_me: WARNING: *** Warning: iconv not found on your system, using simple ascii mapping***" >&2;} fi spool_required="yes" elif test x"$enable_cups" = "xyes"; then { { echo "$as_me:$LINENO: error: *** CUPS not found. You might need to specify the path to cups-config ***" >&5 echo "$as_me: error: *** CUPS not found. You might need to specify the path to cups-config ***" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: checking whether CUPS support can be enabled" >&5 echo $ECHO_N "checking whether CUPS support can be enabled... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $netatalk_cv_use_cups" >&5 echo "${ECHO_T}$netatalk_cv_use_cups" >&6; } # Check whether --with-spooldir was given. if test "${with_spooldir+set}" = set; then withval=$with_spooldir; if test "$withval" = "no"; then if test x"$spool_required" = x"yes"; then { { echo "$as_me:$LINENO: error: *** CUPS support requires a spooldir ***" >&5 echo "$as_me: error: *** CUPS support requires a spooldir ***" >&2;} { (exit 1); exit 1; }; } else cat >>confdefs.h <<\_ACEOF #define DISABLE_SPOOL 1 _ACEOF { echo "$as_me:$LINENO: result: spool disabled" >&5 echo "${ECHO_T}spool disabled" >&6; } fi elif test "$withval" != "yes"; then SPOOLDIR="$withval" { echo "$as_me:$LINENO: result: spooldir set to $withval" >&5 echo "${ECHO_T}spooldir set to $withval" >&6; } else SPOOLDIR="${localstatedir}/spool/netatalk" { echo "$as_me:$LINENO: result: spool set to default" >&5 echo "${ECHO_T}spool set to default" >&6; } fi else SPOOLDIR="${localstatedir}/spool/netatalk" fi if test x"$spool_required" = x"yes"; then USE_SPOOLDIR_TRUE= USE_SPOOLDIR_FALSE='#' else USE_SPOOLDIR_TRUE='#' USE_SPOOLDIR_FALSE= fi { echo "$as_me:$LINENO: checking to see if we can add '__attribute__((unused))' to CFLAGS" >&5 echo $ECHO_N "checking to see if we can add '__attribute__((unused))' to CFLAGS... $ECHO_C" >&6; } if test x$GCC != x ; then CFLAGS="-D_U_=\"__attribute__((unused))\" $CFLAGS" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else CFLAGS="-D_U_=\"\" $CFLAGS" { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi { echo "$as_me:$LINENO: checking whether to use Filesystem Hierarchy Standard (FHS) compatibility" >&5 echo $ECHO_N "checking whether to use Filesystem Hierarchy Standard (FHS) compatibility... $ECHO_C" >&6; } # Check whether --enable-fhs was given. if test "${enable_fhs+set}" = set; then enableval=$enable_fhs; if test "$enableval" = "yes"; then uams_path="${libdir}/netatalk" sysconfdir="/etc" PKGCONFDIR=${sysconfdir}/netatalk SERVERTEXT="${PKGCONFDIR}/msg" use_pam_so=yes mandir="/usr/share/man" cat >>confdefs.h <<\_ACEOF #define FHS_COMPATIBILITY 1 _ACEOF { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi UAMS_PATH="${uams_path}" LIBS="$LIBS -L\$(top_srcdir)/libatalk" CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys" cat >>confdefs.h <<\_ACEOF #define OPEN_NOFOLLOW_ERRNO ELOOP _ACEOF case "$host_os" in *aix*) this_os=aix ;; *kfreebsd*-gnu) this_os=kfreebsd-gnu ;; *freebsd*) this_os=freebsd ;; *hpux11*) this_os=hpux11 ;; *irix*) this_os=irix ;; *linux*) this_os=linux ;; *osx*) this_os=macosx ;; *darwin*) this_os=macosx ;; *netbsd*) this_os=netbsd ;; *openbsd*) this_os=openbsd ;; *osf*) this_os=tru64 ;; *solaris*) this_os=solaris ;; esac case "$host_cpu" in i386|i486|i586|i686|k7) this_cpu=x86 ;; alpha) this_cpu=alpha ;; mips) this_cpu=mips ;; powerpc|ppc) this_cpu=ppc ;; esac case "$this_os" in linux) cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF ;; kfreebsd-gnu) cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF ;; esac if test x"$this_os" = "xaix"; then { echo "$as_me:$LINENO: result: * AIX specific configuration" >&5 echo "${ECHO_T} * AIX specific configuration" >&6; } cat >>confdefs.h <<\_ACEOF #define NO_STRUCT_TM_GMTOFF 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_32BIT_LONGS 1 _ACEOF fi if test x"$this_os" = "xfreebsd"; then { echo "$as_me:$LINENO: result: * FreeBSD specific configuration" >&5 echo "${ECHO_T} * FreeBSD specific configuration" >&6; } cat >>confdefs.h <<\_ACEOF #define BSD4_4 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define FREEBSD 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define OPEN_NOFOLLOW_ERRNO EMLINK _ACEOF fi if test x"$this_os" = "xkfreebsd-gnu"; then { echo "$as_me:$LINENO: result: * GNU/kFreeBSD specific configuration" >&5 echo "${ECHO_T} * GNU/kFreeBSD specific configuration" >&6; } cat >>confdefs.h <<\_ACEOF #define BSD4_4 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define FREEBSD 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define OPEN_NOFOLLOW_ERRNO EMLINK _ACEOF fi if test x"$this_os" = "xhpux11"; then { echo "$as_me:$LINENO: result: * HP-UX 11 specific configuration" >&5 echo "${ECHO_T} * HP-UX 11 specific configuration" >&6; } cat >>confdefs.h <<\_ACEOF #define _ISOC9X_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define NO_STRUCT_TM_GMTOFF 1 _ACEOF fi if test x"$this_os" = "xirix"; then { echo "$as_me:$LINENO: result: * IRIX specific configuration" >&5 echo "${ECHO_T} * IRIX specific configuration" >&6; } cat >>confdefs.h <<\_ACEOF #define NO_STRUCT_TM_GMTOFF 1 _ACEOF fi if test x"$this_os" = "xlinux"; then { echo "$as_me:$LINENO: result: * Linux specific configuration" >&5 echo "${ECHO_T} * Linux specific configuration" >&6; } { echo "$as_me:$LINENO: checking for struct atalk_addr" >&5 echo $ECHO_N "checking for struct atalk_addr... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include struct atalk_addr foo; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_have_atalk_addr=yes { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$ac_have_atalk_addr" = "xyes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_ATALK_ADDR 1 _ACEOF fi # AC_CHECK_HEADERS(sys/quota.h linux/quota.h) # AC_CHECK_FUNC(quotactl,, # AC_DEFINE(NEED_QUOTACTL_WRAPPER, 1, [Define if the quotactl wrapper is needed]) # AC_MSG_RESULT([enabling quotactl wrapper]) # ) # For quotas on Linux XFS filesystems # For linux > 2.5.56 for ac_header in linux/dqblk_xfs.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else for ac_header in linux/xqm.h linux/xfs_fs.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi done cat >>confdefs.h <<\_ACEOF #define HAVE_BROKEN_DBTOB 1 _ACEOF if test x"$this_cpu" = "xalpha"; then { echo "$as_me:$LINENO: result: enabling gcc memcpy bug workaround" >&5 echo "${ECHO_T}enabling gcc memcpy bug workaround" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_GCC_MEMCPY_BUG 1 _ACEOF fi need_dash_r=no fi if test x"$this_os" = "xmacosx"; then { echo "$as_me:$LINENO: result: * Mac OSX specific configuration" >&5 echo "${ECHO_T} * Mac OSX specific configuration" >&6; } cat >>confdefs.h <<\_ACEOF #define BSD4_4 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_2ARG_DBTOB 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define NO_DDP 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define NO_QUOTA_SUPPORT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define MACOSX_SERVER 1 _ACEOF fi if test x"$this_os" = "xnetbsd"; then { echo "$as_me:$LINENO: result: * NetBSD specific configuration" >&5 echo "${ECHO_T} * NetBSD specific configuration" >&6; } cat >>confdefs.h <<\_ACEOF #define BSD4_4 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define NETBSD 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define OPEN_NOFOLLOW_ERRNO EFTYPE _ACEOF CFLAGS="-I\$(top_srcdir)/sys/netbsd $CFLAGS" need_dash_r=yes cat >>confdefs.h <<\_ACEOF #define UAM_DHX 1 _ACEOF fi if test x"$this_os" = "xopenbsd"; then { echo "$as_me:$LINENO: result: * OpenBSD specific configuration" >&5 echo "${ECHO_T} * OpenBSD specific configuration" >&6; } cat >>confdefs.h <<\_ACEOF #define BSD4_4 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define UAM_DHX 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define NO_DDP 1 _ACEOF fi if test x"$this_os" = "xsolaris"; then { echo "$as_me:$LINENO: result: * Solaris specific configuration" >&5 echo "${ECHO_T} * Solaris specific configuration" >&6; } cat >>confdefs.h <<\_ACEOF #define __svr4__ 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _ISOC9X_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define NO_STRUCT_TM_GMTOFF 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define SOLARIS 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _XOPEN_SOURCE 600 _ACEOF cat >>confdefs.h <<\_ACEOF #define __EXTENSIONS__ 1 _ACEOF CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS" need_dash_r=yes sysv_style=solaris solaris_module=no { echo "$as_me:$LINENO: checking if we can build Solaris kernel module" >&5 echo $ECHO_N "checking if we can build Solaris kernel module... $ECHO_C" >&6; } if test -x /usr/ccs/bin/ld && test x"$netatalk_cv_ddp_enabled" = x"yes" ; then solaris_module=yes fi { echo "$as_me:$LINENO: result: $solaris_module" >&5 echo "${ECHO_T}$solaris_module" >&6; } COMPILE_64BIT_KMODULE=no KCFLAGS="" KLDFLAGS="" COMPILE_KERNEL_GCC=no if test "$solaris_module" = "yes"; then { echo "$as_me:$LINENO: checking if we have to build a 64bit kernel module" >&5 echo $ECHO_N "checking if we have to build a 64bit kernel module... $ECHO_C" >&6; } # check for isainfo, if not found it has to be a 32 bit kernel (<=2.6) if test -x /usr/bin/isainfo; then # check for 64 bit platform if isainfo -kv | grep '^64-bit'; then COMPILE_64BIT_KMODULE=yes fi fi { echo "$as_me:$LINENO: result: $COMPILE_64BIT_KMODULE" >&5 echo "${ECHO_T}$COMPILE_64BIT_KMODULE" >&6; } if test "${GCC}" = yes; then COMPILE_KERNEL_GCC=yes if test "$COMPILE_64BIT_KMODULE" = yes; then { echo "$as_me:$LINENO: checking if we can build a 64bit kernel module" >&5 echo $ECHO_N "checking if we can build a 64bit kernel module... $ECHO_C" >&6; } case `$CC --version 2>/dev/null` in [12].* | 3.0.*) COMPILE_64BIT_KMODULE=no COMPILE_KERNEL_GCC=no solaris_module=no;; *) # use for 64 bit KCFLAGS="-m64" #KLDFLAGS="-melf64_sparc" KLDFLAGS="-64";; esac { echo "$as_me:$LINENO: result: $COMPILE_64BIT_KMODULE" >&5 echo "${ECHO_T}$COMPILE_64BIT_KMODULE" >&6; } else KCFLAGS="" KLDFLAGS="" fi KCFLAGS="$KCFLAGS -D_KERNEL -Wall -Wstrict-prototypes" else if test "$COMPILE_64BIT_KMODULE" = yes; then # use Sun CC (for a 64-bit kernel, uncomment " -xarch=v9 -xregs=no%appl ") KCFLAGS="-xarch=v9 -xregs=no%appl" KLDFLAGS="-64" else KCFLAGS="" KLDFLAGS="" fi KCFLAGS="-D_KERNEL $KCFLAGS -mno-app-regs -munaligned-doubles -fpcc-struct-return" fi { echo "$as_me:$LINENO: checking for timeout_id_t" >&5 echo $ECHO_N "checking for timeout_id_t... $ECHO_C" >&6; } if test "${netatalk_cv_HAVE_TIMEOUT_ID_T+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ \ #include #include int main () { \ timeout_id_t dummy; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then netatalk_cv_HAVE_TIMEOUT_ID_T=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 netatalk_cv_HAVE_TIMEOUT_ID_T=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $netatalk_cv_HAVE_TIMEOUT_ID_T" >&5 echo "${ECHO_T}$netatalk_cv_HAVE_TIMEOUT_ID_T" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_TIMEOUT_ID_T test x"$netatalk_cv_HAVE_TIMEOUT_ID" = x"yes" _ACEOF fi fi if test x"$this_os" = "xtru64"; then { echo "$as_me:$LINENO: result: * Tru64 specific configuration" >&5 echo "${ECHO_T} * Tru64 specific configuration" >&6; } cat >>confdefs.h <<\_ACEOF #define NO_DDP 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_64BIT_LONGS 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define USE_OLD_RQUOTA 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define TRU64 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _OSF_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _XOPEN_SOURCE_EXTENDED 1 _ACEOF { echo "$as_me:$LINENO: checking for set_auth_parameters in -lsecurity" >&5 echo $ECHO_N "checking for set_auth_parameters in -lsecurity... $ECHO_C" >&6; } if test "${ac_cv_lib_security_set_auth_parameters+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsecurity $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char set_auth_parameters (); int main () { return set_auth_parameters (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_security_set_auth_parameters=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_security_set_auth_parameters=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_security_set_auth_parameters" >&5 echo "${ECHO_T}$ac_cv_lib_security_set_auth_parameters" >&6; } if test $ac_cv_lib_security_set_auth_parameters = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSECURITY 1 _ACEOF LIBS="-lsecurity $LIBS" fi CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS" need_dash_r=no sysv_style=tru64 fi netatalk_cv_search_sendfile=yes # Check whether --enable-sendfile was given. if test "${enable_sendfile+set}" = set; then enableval=$enable_sendfile; if test x"$enableval" = x"no"; then netatalk_cv_search_sendfile=no fi fi if test x"$netatalk_cv_search_sendfile" = x"yes"; then case "$host_os" in *linux*) cat >>confdefs.h <<\_ACEOF #define SENDFILE_FLAVOR_LINUX 1 _ACEOF { echo "$as_me:$LINENO: checking for sendfile" >&5 echo $ECHO_N "checking for sendfile... $ECHO_C" >&6; } if test "${ac_cv_func_sendfile+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define sendfile to an innocuous variant, in case declares sendfile. For example, HP-UX 11i declares gettimeofday. */ #define sendfile innocuous_sendfile /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sendfile (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef sendfile /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sendfile (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_sendfile || defined __stub___sendfile choke me #endif int main () { return sendfile (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_sendfile=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_sendfile=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_sendfile" >&5 echo "${ECHO_T}$ac_cv_func_sendfile" >&6; } if test $ac_cv_func_sendfile = yes; then netatalk_cv_HAVE_SENDFILE=yes fi ;; *solaris*) cat >>confdefs.h <<\_ACEOF #define SENDFILE_FLAVOR_SOLARIS 1 _ACEOF { echo "$as_me:$LINENO: checking for library containing sendfile" >&5 echo $ECHO_N "checking for library containing sendfile... $ECHO_C" >&6; } if test "${ac_cv_search_sendfile+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sendfile (); int main () { return sendfile (); ; return 0; } _ACEOF for ac_lib in '' sendfile; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_sendfile=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_sendfile+set}" = set; then break fi done if test "${ac_cv_search_sendfile+set}" = set; then : else ac_cv_search_sendfile=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_sendfile" >&5 echo "${ECHO_T}$ac_cv_search_sendfile" >&6; } ac_res=$ac_cv_search_sendfile if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { echo "$as_me:$LINENO: checking for sendfile" >&5 echo $ECHO_N "checking for sendfile... $ECHO_C" >&6; } if test "${ac_cv_func_sendfile+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define sendfile to an innocuous variant, in case declares sendfile. For example, HP-UX 11i declares gettimeofday. */ #define sendfile innocuous_sendfile /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sendfile (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef sendfile /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sendfile (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_sendfile || defined __stub___sendfile choke me #endif int main () { return sendfile (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_sendfile=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_sendfile=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_sendfile" >&5 echo "${ECHO_T}$ac_cv_func_sendfile" >&6; } if test $ac_cv_func_sendfile = yes; then netatalk_cv_HAVE_SENDFILE=yes fi ;; *freebsd*) cat >>confdefs.h <<\_ACEOF #define SENDFILE_FLAVOR_BSD 1 _ACEOF { echo "$as_me:$LINENO: checking for sendfile" >&5 echo $ECHO_N "checking for sendfile... $ECHO_C" >&6; } if test "${ac_cv_func_sendfile+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define sendfile to an innocuous variant, in case declares sendfile. For example, HP-UX 11i declares gettimeofday. */ #define sendfile innocuous_sendfile /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sendfile (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef sendfile /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sendfile (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_sendfile || defined __stub___sendfile choke me #endif int main () { return sendfile (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_sendfile=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_sendfile=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_sendfile" >&5 echo "${ECHO_T}$ac_cv_func_sendfile" >&6; } if test $ac_cv_func_sendfile = yes; then netatalk_cv_HAVE_SENDFILE=yes fi ;; *) ;; esac if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define WITH_SENDFILE 1 _ACEOF fi fi # Check whether --with-libgcrypt-dir was given. if test "${with_libgcrypt_dir+set}" = set; then withval=$with_libgcrypt_dir; libgcrypt_config_prefix="$withval" else libgcrypt_config_prefix="" fi if test x$libgcrypt_config_prefix != x ; then if test x${LIBGCRYPT_CONFIG+set} != xset ; then LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config fi fi ok=no if test x$libgcrypt_config_prefix != xno ; then # Extract the first word of "libgcrypt-config", so it can be a program name with args. set dummy libgcrypt-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_LIBGCRYPT_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $LIBGCRYPT_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LIBGCRYPT_CONFIG="$LIBGCRYPT_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LIBGCRYPT_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_LIBGCRYPT_CONFIG" && ac_cv_path_LIBGCRYPT_CONFIG="no" ;; esac fi LIBGCRYPT_CONFIG=$ac_cv_path_LIBGCRYPT_CONFIG if test -n "$LIBGCRYPT_CONFIG"; then { echo "$as_me:$LINENO: result: $LIBGCRYPT_CONFIG" >&5 echo "${ECHO_T}$LIBGCRYPT_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi tmp=1:1.2.3 if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` min_libgcrypt_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` else req_libgcrypt_api=0 min_libgcrypt_version="$tmp" fi { echo "$as_me:$LINENO: checking for LIBGCRYPT - version >= $min_libgcrypt_version" >&5 echo $ECHO_N "checking for LIBGCRYPT - version >= $min_libgcrypt_version... $ECHO_C" >&6; } if test "$LIBGCRYPT_CONFIG" != "no" ; then req_major=`echo $min_libgcrypt_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` req_minor=`echo $min_libgcrypt_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'` req_micro=`echo $min_libgcrypt_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'` libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version` major=`echo $libgcrypt_config_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'` minor=`echo $libgcrypt_config_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'` micro=`echo $libgcrypt_config_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'` if test "$major" -gt "$req_major"; then ok=yes else if test "$major" -eq "$req_major"; then if test "$minor" -gt "$req_minor"; then ok=yes else if test "$minor" -eq "$req_minor"; then if test "$micro" -ge "$req_micro"; then ok=yes fi fi fi fi fi fi if test $ok = yes; then { echo "$as_me:$LINENO: result: yes ($libgcrypt_config_version)" >&5 echo "${ECHO_T}yes ($libgcrypt_config_version)" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test $ok = yes; then # If we have a recent libgcrypt, we should also check that the # API is compatible if test "$req_libgcrypt_api" -gt 0 ; then tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then { echo "$as_me:$LINENO: checking libgcrypt API version" >&5 echo $ECHO_N "checking libgcrypt API version... $ECHO_C" >&6; } if test "$req_libgcrypt_api" -eq "$tmp" ; then { echo "$as_me:$LINENO: result: okay" >&5 echo "${ECHO_T}okay" >&6; } else ok=no { echo "$as_me:$LINENO: result: does not match. want=$req_libgcrypt_api got=$tmp" >&5 echo "${ECHO_T}does not match. want=$req_libgcrypt_api got=$tmp" >&6; } fi fi fi fi if test $ok = yes; then # Opensolaris 11/08 provided libgcrypt doesn't have CAST5, # so we better check the general case { echo "$as_me:$LINENO: checking libgcrypt hast CAST5 API" >&5 echo $ECHO_N "checking libgcrypt hast CAST5 API... $ECHO_C" >&6; } cast=`$LIBGCRYPT_CONFIG --algorithms 2>/dev/null | grep cast5 | sed 's/\(.*\)\(cast5\)\(.*\)/\2/'` if test x$cast = xcast5 ; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } echo "*** Detected libgcryt without CAST5 ***" echo "*** Please install/build another one and point to it with ***" echo "*** --with-libgcrypt-dir= ***" ok=no fi fi if test $ok = yes; then LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` neta_cv_compile_dhx2=yes neta_cv_have_libgcrypt=yes { echo "$as_me:$LINENO: Enabling DHX2 UAM" >&5 echo "$as_me: Enabling DHX2 UAM" >&6;} cat >>confdefs.h <<\_ACEOF #define HAVE_LIBGCRYPT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define UAM_DHX2 1 _ACEOF else LIBGCRYPT_CFLAGS="" LIBGCRYPT_LIBS="" : fi # Check whether --with-ssl-dir was given. if test "${with_ssl_dir+set}" = set; then withval=$with_ssl_dir; if test "x$withval" = "xno"; then tryssl=no elif test "x$withval" = "xyes"; then tryssl=yes tryssldir= else tryssl=yes tryssldir="$withval" fi else tryssl=yes fi SSL_CFLAGS="" SSL_LIBS="" saved_LIBS=$LIBS saved_CFLAGS=$CFLAGS neta_cv_have_openssl=no [ -n "$atalk_libname" ] || { { echo "$as_me:$LINENO: error: internal error, atalk_libname undefined" >&5 echo "$as_me: error: internal error, atalk_libname undefined" >&2;} { (exit 1); exit 1; }; } if test "$tryssl" = "yes"; then { echo "$as_me:$LINENO: checking for SSL" >&5 echo $ECHO_N "checking for SSL... $ECHO_C" >&6; } for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/$atalk_libname/openssl /usr/local/ssl /usr/$atalk_libname/ssl /usr/local /usr/pkg /opt /opt/openssl /usr/local/ssl ; do if test -f "$ssldir/include/openssl/cast.h" ; then SSL_CFLAGS="$SSL_CFLAGS -I$ssldir/include -I$ssldir/include/openssl" SSL_LIBS="$SSL_LIBS -L$ssldir/$atalk_libname -L$ssldir -lcrypto" if test "x$need_dash_r" = "xyes"; then SSL_LIBS="$SSL_LIBS -R$ssldir/$atalk_libname -R$ssldir" fi { echo "$as_me:$LINENO: result: $ssldir (enabling RANDNUM and DHX support)" >&5 echo "${ECHO_T}$ssldir (enabling RANDNUM and DHX support)" >&6; } CFLAGS="$CFLAGS $SSL_CFLAGS" LIBS="$LIBS $SSL_LIBS" { echo "$as_me:$LINENO: checking for main in -lcrypto" >&5 echo $ECHO_N "checking for main in -lcrypto... $ECHO_C" >&6; } if test "${ac_cv_lib_crypto_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_crypto_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_crypto_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_main" >&5 echo "${ECHO_T}$ac_cv_lib_crypto_main" >&6; } if test $ac_cv_lib_crypto_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPTO 1 _ACEOF LIBS="-lcrypto $LIBS" fi { echo "$as_me:$LINENO: checking for main in -ldes" >&5 echo $ECHO_N "checking for main in -ldes... $ECHO_C" >&6; } if test "${ac_cv_lib_des_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldes $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_des_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_des_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_des_main" >&5 echo "${ECHO_T}$ac_cv_lib_des_main" >&6; } if test $ac_cv_lib_des_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDES 1 _ACEOF LIBS="-ldes $LIBS" fi cat >>confdefs.h <<\_ACEOF #define OPENSSL_DHX 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define UAM_DHX 1 _ACEOF neta_cv_have_openssl=yes neta_cv_compile_dhx=yes CFLAGS=$saved_CFLAGS LIBS=$saved_LIBS break fi done if test "x$neta_cv_have_openssl" = "xno"; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi ac_new_flags="" for i in $SSL_CFLAGS; do case $i in -I/usr/include|-I/usr/include/) ;; *) ac_new_flags="$ac_new_flags $i" ;; esac done SSL_CFLAGS=$ac_new_flags ac_new_flags="" for i in $SSL_LIBS; do case $i in -L/usr/lib|-L/usr/lib/|-L/usr|-L/usr/) ;; *) ac_new_flags="$ac_new_flags $i" ;; esac done SSL_LIBS=$ac_new_flags LIBS=$saved_LIBS if test "x$bdb_required" = "xyes"; then trybdbdir="" dobdbsearch=yes bdb_search_dirs="/usr/local /usr" search_subdirs="/ /db5 /db5.1 /db51 /db5.0 /db50 /db4.8 /db48 /db4.7 /db47 /db4.6 /db46 /db4" bdbfound=no savedcflags="$CFLAGS" savedldflags="$LDFLAGS" savedcppflags="$CPPFLAGS" savedlibs="$LIBS" saved_shlibpath_var=$shlibpath_var DB_MAJOR_REQ=4 DB_MINOR_REQ=6 DB_PATCH_REQ=0 [ -n "$atalk_libname" ] || { { echo "$as_me:$LINENO: error: internal error, atalk_libname undefined" >&5 echo "$as_me: error: internal error, atalk_libname undefined" >&2;} { (exit 1); exit 1; }; } saved_atalk_libname=$atalk_libname cat >>confdefs.h <<_ACEOF #define DB_MAJOR_REQ ${DB_MAJOR_REQ} _ACEOF cat >>confdefs.h <<_ACEOF #define DB_MINOR_REQ ${DB_MINOR_REQ} _ACEOF cat >>confdefs.h <<_ACEOF #define DB_PATCH_REQ ${DB_PATCH_REQ} _ACEOF # Check whether --with-bdb was given. if test "${with_bdb+set}" = set; then withval=$with_bdb; if test "x$withval" = "xno"; then dobdbsearch=no elif test "x$withval" = "xyes"; then dobdbsearch=yes else bdb_search_dirs="$withval" fi fi if test "x$dobdbsearch" = "xyes"; then for bdbdir in $bdb_search_dirs; do if test $bdbfound = "yes"; then break; fi for subdir in ${search_subdirs}; do { echo "$as_me:$LINENO: checking for Berkeley DB headers in ${bdbdir}/include${subdir}" >&5 echo $ECHO_N "checking for Berkeley DB headers in ${bdbdir}/include${subdir}... $ECHO_C" >&6; } if test -f "${bdbdir}/include${subdir}/db.h" ; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } { echo "$as_me:$LINENO: checking ${bdbdir}/include${subdir}/db.h version >= ${DB_MAJOR_REQ}.${DB_MINOR_REQ}.${DB_PATCH_REQ}" >&5 echo $ECHO_N "checking ${bdbdir}/include${subdir}/db.h version >= ${DB_MAJOR_REQ}.${DB_MINOR_REQ}.${DB_PATCH_REQ}... $ECHO_C" >&6; } atalk_cv_bdb_MAJOR=`grep DB_VERSION_MAJOR "${bdbdir}/include${subdir}/db.h" | cut -f 3` atalk_cv_bdb_MINOR=`grep DB_VERSION_MINOR "${bdbdir}/include${subdir}/db.h" | cut -f 3` if test $atalk_cv_bdb_MAJOR -gt $DB_MAJOR_REQ ; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } atalk_cv_bdbheader=yes elif test $DB_MAJOR_REQ -gt $atalk_cv_bdb_MAJOR ; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } atalk_cv_bdbheader=no elif test $DB_MINOR_REQ -gt $atalk_cv_bdb_MINOR ; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } atalk_cv_bdbheader=no else { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } atalk_cv_bdbheader=yes fi if test ${atalk_cv_bdbheader} != "no"; then bdblibdir="${bdbdir}/${atalk_libname}" bdbbindir="${bdbdir}/bin" CPPFLAGS="-I${bdbdir}/include${subdir} $CPPFLAGS" LDFLAGS="-L$bdblibdir $LDFLAGS" eval export $shlibpath_var=$bdblibdir atalk_cv_bdb_version=no maj=$atalk_cv_bdb_MAJOR min=$atalk_cv_bdb_MINOR atalk_cv_bdb_try_libs="db$maj$min db$maj.$min db-$maj$min db-$maj.$min db$maj-$maj.$min db" for lib in $atalk_cv_bdb_try_libs ; do LIBS="-l$lib $savedlibs" { echo "$as_me:$LINENO: checking Berkeley DB library (-l$lib)" >&5 echo $ECHO_N "checking Berkeley DB library (-l$lib)... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then bdblibs=`ls $bdblibdir/lib$lib.* 2>/dev/null` for bdblib in $bdblibs ; do echo "Testing for lib file $bdblib" >&5 if test -f "$bdblib" ; then { echo "$as_me:$LINENO: result: yes (cross-compiling)" >&5 echo "${ECHO_T}yes (cross-compiling)" >&6; } atalk_cv_bdb_version="yes" atalk_cv_lib_db="-l$lib" break fi done if test "x$atalk_cv_bdb_version" = "xyes" ; then break fi { echo "$as_me:$LINENO: result: no (cross-compiling)" >&5 echo "${ECHO_T}no (cross-compiling)" >&6; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main(void) { int major, minor, patch; char *version_str; version_str = db_version(&major, &minor, &patch); if ((major*100 + minor*10 + patch) < (DB_MAJOR_REQ*100 + DB_MINOR_REQ*10 + DB_PATCH_REQ)) { printf("linking wrong library version (%d.%d.%d), ",major, minor, patch); return (2); } if ( major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR || patch != DB_VERSION_PATCH) { printf("header/library version mismatch (%d.%d.%d/%d.%d.%d), ", DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, major, minor, patch); return (3); } printf("%d.%d.%d ... ",major, minor, patch); return (0); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } atalk_cv_bdb_version="yes" atalk_cv_lib_db="-l$lib" break else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi done LIBS="$savedlibs" eval export $shlibpath_var=$saved_shlibpath_var if test x"${atalk_cv_bdb_version}" = x"yes"; then BDB_CFLAGS="-I${bdbdir}/include${subdir}" BDB_LIBS="-L${bdblibdir} ${atalk_cv_lib_db}" BDB_BIN="$bdbbindir" BDB_PATH="$bdbdir" bdbfound=yes break; fi if test x"$atalk_libname" != x"lib" ; then bdblibdir="${bdbdir}/lib" bdbbindir="${bdbdir}/bin" CPPFLAGS="-I${bdbdir}/include${subdir} $CPPFLAGS" LDFLAGS="-L$bdblibdir $LDFLAGS" eval export $shlibpath_var=$bdblibdir atalk_cv_bdb_version=no maj=$atalk_cv_bdb_MAJOR min=$atalk_cv_bdb_MINOR atalk_cv_bdb_try_libs="db$maj$min db$maj.$min db-$maj$min db-$maj.$min db$maj-$maj.$min db" for lib in $atalk_cv_bdb_try_libs ; do LIBS="-l$lib $savedlibs" { echo "$as_me:$LINENO: checking Berkeley DB library (-l$lib)" >&5 echo $ECHO_N "checking Berkeley DB library (-l$lib)... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then bdblibs=`ls $bdblibdir/lib$lib.* 2>/dev/null` for bdblib in $bdblibs ; do echo "Testing for lib file $bdblib" >&5 if test -f "$bdblib" ; then { echo "$as_me:$LINENO: result: yes (cross-compiling)" >&5 echo "${ECHO_T}yes (cross-compiling)" >&6; } atalk_cv_bdb_version="yes" atalk_cv_lib_db="-l$lib" break fi done if test "x$atalk_cv_bdb_version" = "xyes" ; then break fi { echo "$as_me:$LINENO: result: no (cross-compiling)" >&5 echo "${ECHO_T}no (cross-compiling)" >&6; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main(void) { int major, minor, patch; char *version_str; version_str = db_version(&major, &minor, &patch); if ((major*100 + minor*10 + patch) < (DB_MAJOR_REQ*100 + DB_MINOR_REQ*10 + DB_PATCH_REQ)) { printf("linking wrong library version (%d.%d.%d), ",major, minor, patch); return (2); } if ( major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR || patch != DB_VERSION_PATCH) { printf("header/library version mismatch (%d.%d.%d/%d.%d.%d), ", DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, major, minor, patch); return (3); } printf("%d.%d.%d ... ",major, minor, patch); return (0); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } atalk_cv_bdb_version="yes" atalk_cv_lib_db="-l$lib" break else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi done LIBS="$savedlibs" eval export $shlibpath_var=$saved_shlibpath_var if test x"${atalk_cv_bdb_version}" = x"yes"; then BDB_CFLAGS="-I${bdbdir}/include${subdir}" BDB_LIBS="-L${bdblibdir} ${atalk_cv_lib_db}" BDB_BIN="$bdbbindir" BDB_PATH="$bdbdir" bdbfound=yes break; fi fi fi CFLAGS="$savedcflags" LDFLAGS="$savedldflags" CPPFLAGS="$savedcppflags" LIBS="$savedlibs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi done done fi CFLAGS="$savedcflags" LDFLAGS="$savedldflags" CPPFLAGS="$savedcppflags" LIBS="$savedlibs" atalk_libname=$saved_atalk_libname if test "x$bdbfound" = "xyes"; then : else { echo "$as_me:$LINENO: result: " >&5 echo "${ECHO_T}" >&6; } { echo "$as_me:$LINENO: result: Make sure you have the required Berkeley DB libraries AND headers installed." >&5 echo "${ECHO_T}Make sure you have the required Berkeley DB libraries AND headers installed." >&6; } { echo "$as_me:$LINENO: result: You can download the latest version from http://www.sleepycat.com." >&5 echo "${ECHO_T}You can download the latest version from http://www.sleepycat.com." >&6; } { echo "$as_me:$LINENO: result: If you have installed BDB in a non standard location use the" >&5 echo "${ECHO_T}If you have installed BDB in a non standard location use the" >&6; } { echo "$as_me:$LINENO: result: --with-bdb=/path/to/bdb configure option and make sure" >&5 echo "${ECHO_T}--with-bdb=/path/to/bdb configure option and make sure" >&6; } { echo "$as_me:$LINENO: result: your linker is configured to check for libraries there." >&5 echo "${ECHO_T}your linker is configured to check for libraries there." >&6; } { { echo "$as_me:$LINENO: error: Berkeley DB library required but not found!" >&5 echo "$as_me: error: Berkeley DB library required but not found!" >&2;} { (exit 1); exit 1; }; } fi ac_new_flags="" for i in $BDB_CFLAGS; do case $i in -I/usr/include|-I/usr/include/) ;; *) ac_new_flags="$ac_new_flags $i" ;; esac done BDB_CFLAGS=$ac_new_flags ac_new_flags="" for i in $BDB_LIBS; do case $i in -L/usr/lib|-L/usr/lib/|-L/usr|-L/usr/) ;; *) ac_new_flags="$ac_new_flags $i" ;; esac done BDB_LIBS=$ac_new_flags fi saveLIBS=$LIBS LIBS="" CRYPT_LIBS="" for ac_header in crypt.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for main in -lcrypt" >&5 echo $ECHO_N "checking for main in -lcrypt... $ECHO_C" >&6; } if test "${ac_cv_lib_crypt_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_crypt_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_crypt_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_main" >&5 echo "${ECHO_T}$ac_cv_lib_crypt_main" >&6; } if test $ac_cv_lib_crypt_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPT 1 _ACEOF LIBS="-lcrypt $LIBS" fi CRYPT_LIBS=$LIBS LIBS=$saveLIBS { echo "$as_me:$LINENO: checking whether the PGP UAM should be build" >&5 echo $ECHO_N "checking whether the PGP UAM should be build... $ECHO_C" >&6; } # Check whether --enable-pgp-uam was given. if test "${enable_pgp_uam+set}" = set; then enableval=$enable_pgp_uam; if test "$enableval" = "yes"; then if test "x$neta_cv_have_openssl" = "xyes"; then cat >>confdefs.h <<\_ACEOF #define UAM_PGP 1 _ACEOF compile_pgp=yes { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi { echo "$as_me:$LINENO: checking whether the Kerberos IV UAM should be build" >&5 echo $ECHO_N "checking whether the Kerberos IV UAM should be build... $ECHO_C" >&6; } # Check whether --enable-krb4-uam was given. if test "${enable_krb4_uam+set}" = set; then enableval=$enable_krb4_uam; if test "$enableval" = "yes"; then cat >>confdefs.h <<\_ACEOF #define UAM_KRB4 1 _ACEOF compile_kerberos=yes { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi netatalk_cv_build_krb5_uam=no # Check whether --enable-krbV-uam was given. if test "${enable_krbV_uam+set}" = set; then enableval=$enable_krbV_uam; if test x"$enableval" = x"yes"; then FOUND_GSSAPI=no GSSAPI_LIBS="" GSSAPI_CFLAGS="" # Check whether --with-gssapi was given. if test "${with_gssapi+set}" = set; then withval=$with_gssapi; compilegssapi=$withval else compilegssapi=auto fi if test x"$compilegssapi" != x"no"; then if test "x$compilegssapi" != "xyes" -a "x$compilegssapi" != "xauto"; then GSSAPI_CFLAGS="-I$withval/include" GSSAPI_CPPFLAGS="-I$withval/include" GSSAPI_LDFLAGS="-L$withval/${atalk_libname}" FOUND_GSSAPI=yes { echo "$as_me:$LINENO: checking checking for GSSAPI support in" >&5 echo $ECHO_N "checking checking for GSSAPI support in... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $compilegssapi" >&5 echo "${ECHO_T}$compilegssapi" >&6; } fi # Do no harm to the values of CFLAGS and LIBS while testing for # Kerberos support. ac_save_CFLAGS=$CFLAGS ac_save_CPPFLAGS=$CPPFLAGS ac_save_LDFLAGS=$LDFLAGS ac_save_LIBS=$LIBS if test x$FOUND_GSSAPI = x"no"; then ################################################# # check for krb5-config from recent MIT and Heimdal kerberos 5 # Extract the first word of "krb5-config", so it can be a program name with args. set dummy krb5-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_KRB5_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $KRB5_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_KRB5_CONFIG="$KRB5_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_KRB5_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi KRB5_CONFIG=$ac_cv_path_KRB5_CONFIG if test -n "$KRB5_CONFIG"; then { echo "$as_me:$LINENO: result: $KRB5_CONFIG" >&5 echo "${ECHO_T}$KRB5_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi { echo "$as_me:$LINENO: checking for working krb5-config" >&5 echo $ECHO_N "checking for working krb5-config... $ECHO_C" >&6; } if test -x "$KRB5_CONFIG"; then ac_save_CFLAGS=$CFLAGS CFLAGS="";export CFLAGS ac_save_LDFLAGS=$LDFLAGS LDFLAGS="";export LDFLAGS GSSAPI_LIBS="`$KRB5_CONFIG --libs gssapi`" GSSAPI_CFLAGS="`$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`" GSSAPI_CPPFLAGS="`$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`" CFLAGS=$ac_save_CFLAGS;export CFLAGS LDFLAGS=$ac_save_LDFLAGS;export LDFLAGS FOUND_GSSAPI=yes { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no. Fallback to previous krb5 detection strategy" >&5 echo "${ECHO_T}no. Fallback to previous krb5 detection strategy" >&6; } fi fi if test x$FOUND_GSSAPI = x"no"; then ################################################# # see if this box has the SuSE location for the heimdal krb implementation { echo "$as_me:$LINENO: checking for /usr/include/heimdal" >&5 echo $ECHO_N "checking for /usr/include/heimdal... $ECHO_C" >&6; } if test -d /usr/include/heimdal; then if test -f /usr/lib/heimdal/lib/libkrb5.a; then GSSAPI_CFLAGS="-I/usr/include/heimdal" GSSAPI_CPPFLAGS="-I/usr/include/heimdal" GSSAPI_LDFLAGS="-L/usr/lib/heimdal/lib" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } FOUND_GSSAPI=yes else GSSAPI_CFLAGS="-I/usr/include/heimdal" GSSAPI_CPPFLAGS="-I/usr/include/heimdal" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } FOUND_GSSAPI=yes fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test x$FOUND_GSSAPI = x"no"; then ################################################# # see if this box has the RedHat location for kerberos { echo "$as_me:$LINENO: checking for /usr/kerberos" >&5 echo $ECHO_N "checking for /usr/kerberos... $ECHO_C" >&6; } if test -d /usr/kerberos -a -f /usr/kerberos/lib/libkrb5.a; then GSSAPI_LDFLAGS="-L/usr/kerberos/lib" GSSAPI_CFLAGS="-I/usr/kerberos/include" GSSAPI_CPPFLAGS="-I/usr/kerberos/include" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi CFLAGS="$CFLAGS $GSSAPI_CFLAGS" CPPFLAGS="$CPPFLAGS $GSSAPI_CPPFLAGS" LDFLAGS="$LDFLAGS $GSSAPI_LDFLAGS" LIBS="$LIBS $GSSAPI_LIBS" # check for gssapi headers gss_headers_found=no for ac_header in gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h gssapi/gssapi_krb5.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF gss_headers_found=yes fi done if test x"$gss_headers_found" = x"no"; then { { echo "$as_me:$LINENO: error: GSSAPI installation not found, headers missing" >&5 echo "$as_me: error: GSSAPI installation not found, headers missing" >&2;} { (exit 1); exit 1; }; } fi # check for libs { echo "$as_me:$LINENO: checking for gss_display_status in -lgssapi" >&5 echo $ECHO_N "checking for gss_display_status in -lgssapi... $ECHO_C" >&6; } if test "${ac_cv_lib_gssapi_gss_display_status+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgssapi $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gss_display_status (); int main () { return gss_display_status (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_gssapi_gss_display_status=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_gssapi_gss_display_status=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_gssapi_gss_display_status" >&5 echo "${ECHO_T}$ac_cv_lib_gssapi_gss_display_status" >&6; } if test $ac_cv_lib_gssapi_gss_display_status = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBGSSAPI 1 _ACEOF LIBS="-lgssapi $LIBS" fi { echo "$as_me:$LINENO: checking for gss_display_status in -lgssapi_krb5" >&5 echo $ECHO_N "checking for gss_display_status in -lgssapi_krb5... $ECHO_C" >&6; } if test "${ac_cv_lib_gssapi_krb5_gss_display_status+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgssapi_krb5 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gss_display_status (); int main () { return gss_display_status (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_gssapi_krb5_gss_display_status=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_gssapi_krb5_gss_display_status=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_gssapi_krb5_gss_display_status" >&5 echo "${ECHO_T}$ac_cv_lib_gssapi_krb5_gss_display_status" >&6; } if test $ac_cv_lib_gssapi_krb5_gss_display_status = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBGSSAPI_KRB5 1 _ACEOF LIBS="-lgssapi_krb5 $LIBS" fi { echo "$as_me:$LINENO: checking for gss_display_status in -lgss" >&5 echo $ECHO_N "checking for gss_display_status in -lgss... $ECHO_C" >&6; } if test "${ac_cv_lib_gss_gss_display_status+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgss $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gss_display_status (); int main () { return gss_display_status (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_gss_gss_display_status=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_gss_gss_display_status=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_gss_gss_display_status" >&5 echo "${ECHO_T}$ac_cv_lib_gss_gss_display_status" >&6; } if test $ac_cv_lib_gss_gss_display_status = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBGSS 1 _ACEOF LIBS="-lgss $LIBS" fi # check for functions { echo "$as_me:$LINENO: checking for gss_acquire_cred" >&5 echo $ECHO_N "checking for gss_acquire_cred... $ECHO_C" >&6; } if test "${ac_cv_func_gss_acquire_cred+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gss_acquire_cred to an innocuous variant, in case declares gss_acquire_cred. For example, HP-UX 11i declares gettimeofday. */ #define gss_acquire_cred innocuous_gss_acquire_cred /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gss_acquire_cred (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gss_acquire_cred /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gss_acquire_cred (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_gss_acquire_cred || defined __stub___gss_acquire_cred choke me #endif int main () { return gss_acquire_cred (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_gss_acquire_cred=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gss_acquire_cred=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_gss_acquire_cred" >&5 echo "${ECHO_T}$ac_cv_func_gss_acquire_cred" >&6; } if test $ac_cv_func_gss_acquire_cred = yes; then : else { { echo "$as_me:$LINENO: error: GSSAPI: required function gss_acquire_cred missing" >&5 echo "$as_me: error: GSSAPI: required function gss_acquire_cred missing" >&2;} { (exit 1); exit 1; }; } fi # Heimdal/MIT compatibility fix if test "$ac_cv_header_gssapi_h" = "yes"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "GSS_C_NT_HOSTBASED_SERVICE" >/dev/null 2>&1; then cat >>confdefs.h <<\_ACEOF #define HAVE_GSS_C_NT_HOSTBASED_SERVICE 1 _ACEOF fi rm -f conftest* else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "GSS_C_NT_HOSTBASED_SERVICE" >/dev/null 2>&1; then cat >>confdefs.h <<\_ACEOF #define HAVE_GSS_C_NT_HOSTBASED_SERVICE 1 _ACEOF fi rm -f conftest* fi { echo "$as_me:$LINENO: checking whether GSSAPI support is used" >&5 echo $ECHO_N "checking whether GSSAPI support is used... $ECHO_C" >&6; } if test x"$ac_cv_func_gss_acquire_cred" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_GSSAPI 1 _ACEOF { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GSSAPI_LIBS="$LDFLAGS $LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } if test x"$compilegssapi" = x"yes"; then { { echo "$as_me:$LINENO: error: GSSAPI installation not found" >&5 echo "$as_me: error: GSSAPI installation not found" >&2;} { (exit 1); exit 1; }; } fi GSSAPI_LIBS="" fi LIBS="$ac_save_LIBS" CFLAGS="$ac_save_CFLAGS" LDFLAGS="$ac_save_LDFLAGS" CPPFLAGS="$ac_save_CPPFLAGS" fi if test x"$ac_cv_func_gss_acquire_cred" = x"yes"; then netatalk_cv_build_krb5_uam=yes else { { echo "$as_me:$LINENO: error: need GSSAPI to build Kerberos V UAM" >&5 echo "$as_me: error: need GSSAPI to build Kerberos V UAM" >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: checking whether Kerberos V UAM should be build" >&5 echo $ECHO_N "checking whether Kerberos V UAM should be build... $ECHO_C" >&6; } if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then USE_GSSAPI_TRUE= USE_GSSAPI_FALSE='#' else USE_GSSAPI_TRUE='#' USE_GSSAPI_FALSE= fi { echo "$as_me:$LINENO: checking whether configuration files should be overwritten" >&5 echo $ECHO_N "checking whether configuration files should be overwritten... $ECHO_C" >&6; } # Check whether --enable-overwrite was given. if test "${enable_overwrite+set}" = set; then enableval=$enable_overwrite; OVERWRITE_CONFIG="${enable_overwrite}" else OVERWRITE_CONFIG="no" fi { echo "$as_me:$LINENO: result: $OVERWRITE_CONFIG" >&5 echo "${ECHO_T}$OVERWRITE_CONFIG" >&6; } { echo "$as_me:$LINENO: checking for LDAP (necessary for client-side ACL visibility)" >&5 echo $ECHO_N "checking for LDAP (necessary for client-side ACL visibility)... $ECHO_C" >&6; } # Check whether --with-ldap was given. if test "${with_ldap+set}" = set; then withval=$with_ldap; case "$withval" in yes|no) with_ldap="$withval" ;; *) with_ldap=auto ;; esac fi { echo "$as_me:$LINENO: result: $with_ldap" >&5 echo "${ECHO_T}$with_ldap" >&6; } if test x"$with_ldap" != x"no" ; then if test "${ac_cv_header_ldap_h+set}" = set; then { echo "$as_me:$LINENO: checking for ldap.h" >&5 echo $ECHO_N "checking for ldap.h... $ECHO_C" >&6; } if test "${ac_cv_header_ldap_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_ldap_h" >&5 echo "${ECHO_T}$ac_cv_header_ldap_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking ldap.h usability" >&5 echo $ECHO_N "checking ldap.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking ldap.h presence" >&5 echo $ECHO_N "checking ldap.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: ldap.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: ldap.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: ldap.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: ldap.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: ldap.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: ldap.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: ldap.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: ldap.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: ldap.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: ldap.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: ldap.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: ldap.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: ldap.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: ldap.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: ldap.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: ldap.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for ldap.h" >&5 echo $ECHO_N "checking for ldap.h... $ECHO_C" >&6; } if test "${ac_cv_header_ldap_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_ldap_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_ldap_h" >&5 echo "${ECHO_T}$ac_cv_header_ldap_h" >&6; } fi if test $ac_cv_header_ldap_h = yes; then with_ldap=yes else if test x"$with_ldap" = x"yes" ; then { { echo "$as_me:$LINENO: error: Missing LDAP headers" >&5 echo "$as_me: error: Missing LDAP headers" >&2;} { (exit 1); exit 1; }; } fi with_ldap=no fi { echo "$as_me:$LINENO: checking for ldap_init in -lldap" >&5 echo $ECHO_N "checking for ldap_init in -lldap... $ECHO_C" >&6; } if test "${ac_cv_lib_ldap_ldap_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lldap $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ldap_init (); int main () { return ldap_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ldap_ldap_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ldap_ldap_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_init" >&5 echo "${ECHO_T}$ac_cv_lib_ldap_ldap_init" >&6; } if test $ac_cv_lib_ldap_ldap_init = yes; then with_ldap=yes else if test x"$with_ldap" = x"yes" ; then { { echo "$as_me:$LINENO: error: Missing LDAP library" >&5 echo "$as_me: error: Missing LDAP library" >&2;} { (exit 1); exit 1; }; } fi with_ldap=no fi fi if test x"$with_ldap" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_LDAP 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether to support ACLs" >&5 echo $ECHO_N "checking whether to support ACLs... $ECHO_C" >&6; } # Check whether --with-acls was given. if test "${with_acls+set}" = set; then withval=$with_acls; case "$withval" in yes|no) with_acl_support="$withval" ;; *) with_acl_support=auto ;; esac else with_acl_support=auto fi { echo "$as_me:$LINENO: result: $with_acl_support" >&5 echo "${ECHO_T}$with_acl_support" >&6; } if test x"$with_acl_support" = x"no"; then { echo "$as_me:$LINENO: result: Disabling ACL support" >&5 echo "${ECHO_T}Disabling ACL support" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_NO_ACLS 1 _ACEOF else with_acl_support=yes fi if test x"$with_acl_support" = x"yes" ; then { echo "$as_me:$LINENO: checking whether ACL support is available:" >&5 echo "$as_me: checking whether ACL support is available:" >&6;} case "$host_os" in *sysv5*) { echo "$as_me:$LINENO: Using UnixWare ACLs" >&5 echo "$as_me: Using UnixWare ACLs" >&6;} cat >>confdefs.h <<\_ACEOF #define HAVE_UNIXWARE_ACLS 1 _ACEOF ;; *solaris*) { echo "$as_me:$LINENO: Using solaris ACLs" >&5 echo "$as_me: Using solaris ACLs" >&6;} cat >>confdefs.h <<\_ACEOF #define HAVE_SOLARIS_ACLS 1 _ACEOF ACL_LIBS="$ACL_LIBS -lsec" ;; *hpux*) { echo "$as_me:$LINENO: Using HPUX ACLs" >&5 echo "$as_me: Using HPUX ACLs" >&6;} cat >>confdefs.h <<\_ACEOF #define HAVE_HPUX_ACLS 1 _ACEOF ;; *irix*) { echo "$as_me:$LINENO: Using IRIX ACLs" >&5 echo "$as_me: Using IRIX ACLs" >&6;} cat >>confdefs.h <<\_ACEOF #define HAVE_IRIX_ACLS 1 _ACEOF ;; *aix*) { echo "$as_me:$LINENO: Using AIX ACLs" >&5 echo "$as_me: Using AIX ACLs" >&6;} cat >>confdefs.h <<\_ACEOF #define HAVE_AIX_ACLS 1 _ACEOF ;; *osf*) { echo "$as_me:$LINENO: Using Tru64 ACLs" >&5 echo "$as_me: Using Tru64 ACLs" >&6;} cat >>confdefs.h <<\_ACEOF #define HAVE_TRU64_ACLS 1 _ACEOF ACL_LIBS="$ACL_LIBS -lpacl" ;; *darwin*) { echo "$as_me:$LINENO: ACLs on Darwin currently not supported" >&5 echo "$as_me: ACLs on Darwin currently not supported" >&6;} cat >>confdefs.h <<\_ACEOF #define HAVE_NO_ACLS 1 _ACEOF ;; *) { echo "$as_me:$LINENO: checking for acl_get_file in -lacl" >&5 echo $ECHO_N "checking for acl_get_file in -lacl... $ECHO_C" >&6; } if test "${ac_cv_lib_acl_acl_get_file+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lacl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char acl_get_file (); int main () { return acl_get_file (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_acl_acl_get_file=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_acl_acl_get_file=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_acl_acl_get_file" >&5 echo "${ECHO_T}$ac_cv_lib_acl_acl_get_file" >&6; } if test $ac_cv_lib_acl_acl_get_file = yes; then ACL_LIBS="$ACL_LIBS -lacl" fi case "$host_os" in *linux*) { echo "$as_me:$LINENO: checking for getxattr in -lattr" >&5 echo $ECHO_N "checking for getxattr in -lattr... $ECHO_C" >&6; } if test "${ac_cv_lib_attr_getxattr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lattr $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getxattr (); int main () { return getxattr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_attr_getxattr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_attr_getxattr=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_attr_getxattr" >&5 echo "${ECHO_T}$ac_cv_lib_attr_getxattr" >&6; } if test $ac_cv_lib_attr_getxattr = yes; then ACL_LIBS="$ACL_LIBS -lattr" fi ;; esac { echo "$as_me:$LINENO: checking for POSIX ACL support" >&5 echo $ECHO_N "checking for POSIX ACL support... $ECHO_C" >&6; } if test "${netatalk_cv_HAVE_POSIX_ACLS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else acl_LIBS=$LIBS LIBS="$LIBS $ACL_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry(acl, entry_id, entry_p); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then netatalk_cv_HAVE_POSIX_ACLS=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 netatalk_cv_HAVE_POSIX_ACLS=no with_acl_support=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$acl_LIBS fi { echo "$as_me:$LINENO: result: $netatalk_cv_HAVE_POSIX_ACLS" >&5 echo "${ECHO_T}$netatalk_cv_HAVE_POSIX_ACLS" >&6; } if test x"$netatalk_cv_HAVE_POSIX_ACLS" = x"yes"; then { echo "$as_me:$LINENO: Using POSIX ACLs" >&5 echo "$as_me: Using POSIX ACLs" >&6;} cat >>confdefs.h <<\_ACEOF #define HAVE_POSIX_ACLS 1 _ACEOF { echo "$as_me:$LINENO: checking for acl_get_perm_np" >&5 echo $ECHO_N "checking for acl_get_perm_np... $ECHO_C" >&6; } if test "${netatalk_cv_HAVE_ACL_GET_PERM_NP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else acl_LIBS=$LIBS LIBS="$LIBS $ACL_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np(permset_d, perm); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then netatalk_cv_HAVE_ACL_GET_PERM_NP=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 netatalk_cv_HAVE_ACL_GET_PERM_NP=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$acl_LIBS fi { echo "$as_me:$LINENO: result: $netatalk_cv_HAVE_ACL_GET_PERM_NP" >&5 echo "${ECHO_T}$netatalk_cv_HAVE_ACL_GET_PERM_NP" >&6; } if test x"$netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_ACL_GET_PERM_NP 1 _ACEOF fi { echo "$as_me:$LINENO: checking for acl_from_mode" >&5 echo $ECHO_N "checking for acl_from_mode... $ECHO_C" >&6; } if test "${netatalk_cv_HAVE_ACL_FROM_MODE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else acl_LIBS=$LIBS LIBS="$LIBS $ACL_LIBS" for ac_func in acl_from_mode do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF netatalk_cv_HAVE_ACL_FROM_MODE=yes else netatalk_cv_HAVE_ACL_FROM_MODE=no fi done LIBS=$acl_LIBS fi { echo "$as_me:$LINENO: result: $netatalk_cv_HAVE_ACL_FROM_MODE" >&5 echo "${ECHO_T}$netatalk_cv_HAVE_ACL_FROM_MODE" >&6; } if test x"netatalk_cv_HAVE_ACL_FROM_MODE" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_ACL_FROM_MODE 1 _ACEOF fi else { echo "$as_me:$LINENO: ACL support is not avaliable" >&5 echo "$as_me: ACL support is not avaliable" >&6;} cat >>confdefs.h <<\_ACEOF #define HAVE_NO_ACLS 1 _ACEOF fi ;; esac fi if test x"$with_acl_support" = x"yes" ; then for ac_header in acl/libacl.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done cat >>confdefs.h <<\_ACEOF #define HAVE_ACLS 1 _ACEOF fi neta_cv_eas="ad" neta_cv_eas_sys_found=no neta_cv_eas_sys_not_found=no for ac_header in sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done case "$this_os" in *osf*) { echo "$as_me:$LINENO: checking for library containing getproplist" >&5 echo $ECHO_N "checking for library containing getproplist... $ECHO_C" >&6; } if test "${ac_cv_search_getproplist+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getproplist (); int main () { return getproplist (); ; return 0; } _ACEOF for ac_lib in '' proplist; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_getproplist=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_getproplist+set}" = set; then break fi done if test "${ac_cv_search_getproplist+set}" = set; then : else ac_cv_search_getproplist=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_getproplist" >&5 echo "${ECHO_T}$ac_cv_search_getproplist" >&6; } ac_res=$ac_cv_search_getproplist if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi for ac_func in getproplist fgetproplist setproplist fsetproplist do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF neta_cv_eas_sys_found=yes else neta_cv_eas_sys_not_found=yes fi done for ac_func in delproplist fdelproplist add_proplist_entry get_proplist_entry do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else neta_cv_eas_sys_not_found=yes fi done for ac_func in sizeof_proplist_entry do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else neta_cv_eas_sys_not_found=yes fi done ;; *solaris*) for ac_func in attropen do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF neta_cv_eas_sys_found=yes else neta_cv_eas_sys_not_found=yes fi done ;; 'freebsd') for ac_func in extattr_delete_fd extattr_delete_file extattr_delete_link do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF neta_cv_eas_sys_found=yes else neta_cv_eas_sys_not_found=yes fi done for ac_func in extattr_get_fd extattr_get_file extattr_get_link do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else neta_cv_eas_sys_not_found=yes fi done for ac_func in extattr_list_fd extattr_list_file extattr_list_link do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else neta_cv_eas_sys_not_found=yes fi done for ac_func in extattr_set_fd extattr_set_file extattr_set_link do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else neta_cv_eas_sys_not_found=yes fi done ;; *freebsd4* | *dragonfly* ) cat >>confdefs.h <<\_ACEOF #define BROKEN_EXTATTR 1 _ACEOF ;; *) { echo "$as_me:$LINENO: checking for library containing getxattr" >&5 echo $ECHO_N "checking for library containing getxattr... $ECHO_C" >&6; } if test "${ac_cv_search_getxattr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getxattr (); int main () { return getxattr (); ; return 0; } _ACEOF for ac_lib in '' attr; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_getxattr=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_getxattr+set}" = set; then break fi done if test "${ac_cv_search_getxattr+set}" = set; then : else ac_cv_search_getxattr=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_getxattr" >&5 echo "${ECHO_T}$ac_cv_search_getxattr" >&6; } ac_res=$ac_cv_search_getxattr if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi if test "x$neta_cv_eas_sys_found" != "xyes" ; then for ac_func in getxattr lgetxattr fgetxattr listxattr llistxattr do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF neta_cv_eas_sys_found=yes else neta_cv_eas_sys_not_found=yes fi done for ac_func in flistxattr removexattr lremovexattr fremovexattr do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else neta_cv_eas_sys_not_found=yes fi done for ac_func in setxattr lsetxattr fsetxattr do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else neta_cv_eas_sys_not_found=yes fi done fi if test "x$neta_cv_eas_sys_found" != "xyes" ; then for ac_func in getea fgetea lgetea listea flistea llistea do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF neta_cv_eas_sys_found=yes else neta_cv_eas_sys_not_found=yes fi done for ac_func in removeea fremoveea lremoveea setea fsetea lsetea do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else neta_cv_eas_sys_not_found=yes fi done fi if test "x$neta_cv_eas_sys_found" != "xyes" ; then for ac_func in attr_get attr_list attr_set attr_remove do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else neta_cv_eas_sys_not_found=yes fi done for ac_func in attr_getf attr_listf attr_setf attr_removef do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else neta_cv_eas_sys_not_found=yes fi done fi ;; esac # Do xattr functions take additional options like on Darwin? if test x"$ac_cv_func_getxattr" = x"yes" ; then { echo "$as_me:$LINENO: checking whether xattr interface takes additional options" >&5 echo $ECHO_N "checking whether xattr interface takes additional options... $ECHO_C" >&6; } if test "${smb_attr_cv_xattr_add_opt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else old_LIBS=$LIBS LIBS="$LIBS $ACL_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if HAVE_ATTR_XATTR_H #include #elif HAVE_SYS_XATTR_H #include #endif int main () { getxattr(0, 0, 0, 0, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smb_attr_cv_xattr_add_opt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $smb_attr_cv_xattr_add_opt" >&5 echo "${ECHO_T}$smb_attr_cv_xattr_add_opt" >&6; } if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define XATTR_ADD_OPT 1 _ACEOF fi fi if test "x$neta_cv_eas_sys_found" = "xyes" ; then if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then neta_cv_eas="$neta_cv_eas | sys" fi fi cat >>confdefs.h <<_ACEOF #define EA_MODULES "$neta_cv_eas" _ACEOF { echo "$as_me:$LINENO: checking if the realpath function allows a NULL argument" >&5 echo $ECHO_N "checking if the realpath function allows a NULL argument... $ECHO_C" >&6; } if test "${neta_cv_REALPATH_TAKES_NULL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then neta_cv_REALPATH_TAKES_NULL=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include void exit_on_core(int ignored) { exit(1); } main() { char *newpath; signal(SIGSEGV, exit_on_core); newpath = realpath("/tmp", NULL); exit((newpath != NULL) ? 0 : 1); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then neta_cv_REALPATH_TAKES_NULL=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) neta_cv_REALPATH_TAKES_NULL=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $neta_cv_REALPATH_TAKES_NULL" >&5 echo "${ECHO_T}$neta_cv_REALPATH_TAKES_NULL" >&6; } if test x"$neta_cv_REALPATH_TAKES_NULL" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define REALPATH_TAKES_NULL 1 _ACEOF fi # Check whether --with-webmin was given. if test "${with_webmin+set}" = set; then withval=$with_webmin; if test "x$withval" = "xyes"; then webminpath="$PKGCONFDIR" elif test "x$withval" = "xno"; then webminpath="" else webminpath="$withval" fi fi # Check whether --with-webminuser was given. if test "${with_webminuser+set}" = set; then withval=$with_webminuser; if test "x$withval" = "xyes"; then webminuser="" elif test "x$withval" = "xno"; then webminuser="" else webminuser="$withval" fi fi # Check whether --with-webminversion was given. if test "${with_webminversion+set}" = set; then withval=$with_webminversion; if test "x$withval" = "xyes"; then webminversion="1.490" elif test "x$withval" = "xno"; then webminversions="1.490" else webminversion="$withval" fi fi # Check whether --with-webminpass was given. if test "${with_webminpass+set}" = set; then withval=$with_webminpass; if test "x$withval" = "xyes"; then webminpass="" elif test "x$withval" = "xno"; then webminpass="" else webminpass="$withval" fi fi # Check whether --with-webminport was given. if test "${with_webminport+set}" = set; then withval=$with_webminport; if test "x$withval" = "xyes"; then webminport="" elif test "x$withval" = "xno"; then webminport="" else webminport="$withval" fi fi { echo "$as_me:$LINENO: checking if webmin administration shall be installed" >&5 echo $ECHO_N "checking if webmin administration shall be installed... $ECHO_C" >&6; } if test "x$webminpath" != "x" && test "x$webminuser" != "x" && test "x$webminpass" != "x" && test "x$webminport" != "x" && test "x$webminversion" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } { echo "$as_me:$LINENO: checking if neccessary Perl module 'Net::SSLeay' is installed" >&5 echo $ECHO_N "checking if neccessary Perl module 'Net::SSLeay' is installed... $ECHO_C" >&6; } $ac_cv_path_PERL -e 'use Net::SSLeay' >/dev/null 2>/dev/null if test "$?" != "0" ; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } webminpath="" else { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } { echo "$as_me:$LINENO: Installing Webmin in \"$webminpath/webmin\"" >&5 echo "$as_me: Installing Webmin in \"$webminpath/webmin\"" >&6;} fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi WEBMIN_PATH=$webminpath WEBMIN_VERSION=$webminversion WEBMIN_USER=$webminuser WEBMIN_PASS=$webminpass WEBMIN_PORT=$webminport if test x$solaris_module = xyes; then SOLARIS_MODULE_TRUE= SOLARIS_MODULE_FALSE='#' else SOLARIS_MODULE_TRUE='#' SOLARIS_MODULE_FALSE= fi if test x$compile_timelord = xyes; then COMPILE_TIMELORD_TRUE= COMPILE_TIMELORD_FALSE='#' else COMPILE_TIMELORD_TRUE='#' COMPILE_TIMELORD_FALSE= fi if test x$compile_a2boot = xyes; then COMPILE_A2BOOT_TRUE= COMPILE_A2BOOT_FALSE='#' else COMPILE_A2BOOT_TRUE='#' COMPILE_A2BOOT_FALSE= fi if test x$neta_cv_have_libgcrypt = xyes; then HAVE_LIBGCRYPT_TRUE= HAVE_LIBGCRYPT_FALSE='#' else HAVE_LIBGCRYPT_TRUE='#' HAVE_LIBGCRYPT_FALSE= fi if test x$neta_cv_have_openssl = xyes; then HAVE_OPENSSL_TRUE= HAVE_OPENSSL_FALSE='#' else HAVE_OPENSSL_TRUE='#' HAVE_OPENSSL_FALSE= fi if test x"$with_acl_support" = x"yes"; then HAVE_ACLS_TRUE= HAVE_ACLS_FALSE='#' else HAVE_ACLS_TRUE='#' HAVE_ACLS_FALSE= fi if test x"$with_ldap" = x"yes"; then HAVE_LDAP_TRUE= HAVE_LDAP_FALSE='#' else HAVE_LDAP_TRUE='#' HAVE_LDAP_FALSE= fi if test x$neta_cv_compile_dhx = xyes; then USE_DHX_TRUE= USE_DHX_FALSE='#' else USE_DHX_TRUE='#' USE_DHX_FALSE= fi if test x$neta_cv_compile_dhx2 = xyes; then USE_DHX2_TRUE= USE_DHX2_FALSE='#' else USE_DHX2_TRUE='#' USE_DHX2_FALSE= fi if test x$neta_cv_have_openssl = xyes; then USE_RANDNUM_TRUE= USE_RANDNUM_FALSE='#' else USE_RANDNUM_TRUE='#' USE_RANDNUM_FALSE= fi if test x$compile_kerberos = xyes; then USE_KERBEROS_TRUE= USE_KERBEROS_FALSE='#' else USE_KERBEROS_TRUE='#' USE_KERBEROS_FALSE= fi if test x$use_pam_so = xyes; then USE_PAM_SO_TRUE= USE_PAM_SO_FALSE='#' else USE_PAM_SO_TRUE='#' USE_PAM_SO_FALSE= fi if test x$netatalk_cv_install_pam = xyes; then USE_PAM_TRUE= USE_PAM_FALSE='#' else USE_PAM_TRUE='#' USE_PAM_FALSE= fi if test x$compile_pam = xyes; then BUILD_PAM_TRUE= BUILD_PAM_FALSE='#' else BUILD_PAM_TRUE='#' BUILD_PAM_FALSE= fi if test x$compile_pgp = xyes; then USE_PGP_TRUE= USE_PGP_FALSE='#' else USE_PGP_TRUE='#' USE_PGP_FALSE= fi if test x$neta_cv_have_libgcrypt != xyes && test x$neta_cv_have_openssl != xyes; then DEFAULT_HOOK_TRUE= DEFAULT_HOOK_FALSE='#' else DEFAULT_HOOK_TRUE='#' DEFAULT_HOOK_FALSE= fi if test x$sysv_style = xnetbsd; then USE_NETBSD_TRUE= USE_NETBSD_FALSE='#' else USE_NETBSD_TRUE='#' USE_NETBSD_FALSE= fi if test x$sysv_style = xredhat-sysv; then USE_REDHAT_SYSV_TRUE= USE_REDHAT_SYSV_FALSE='#' else USE_REDHAT_SYSV_TRUE='#' USE_REDHAT_SYSV_FALSE= fi if test x$sysv_style = xsuse-sysv; then USE_SUSE_SYSV_TRUE= USE_SUSE_SYSV_FALSE='#' else USE_SUSE_SYSV_TRUE='#' USE_SUSE_SYSV_FALSE= fi if test x$shadowpw = xyes; then USE_SHADOWPW_TRUE= USE_SHADOWPW_FALSE='#' else USE_SHADOWPW_TRUE='#' USE_SHADOWPW_FALSE= fi if test x$sysv_style = xtru64; then USE_TRU64_TRUE= USE_TRU64_FALSE='#' else USE_TRU64_TRUE='#' USE_TRU64_FALSE= fi if test x$sysv_style = xsolaris; then USE_SOLARIS_TRUE= USE_SOLARIS_FALSE='#' else USE_SOLARIS_TRUE='#' USE_SOLARIS_FALSE= fi if test x$sysv_style = xgentoo; then USE_GENTOO_TRUE= USE_GENTOO_FALSE='#' else USE_GENTOO_TRUE='#' USE_GENTOO_FALSE= fi if test x$sysv_style = xdebian; then USE_DEBIAN_TRUE= USE_DEBIAN_FALSE='#' else USE_DEBIAN_TRUE='#' USE_DEBIAN_FALSE= fi if test x$sysv_style = xsystemd || test x$sysv_style = xredhat-systemd || test x$sysv_style = xsuse-systemd; then USE_SYSTEMD_TRUE= USE_SYSTEMD_FALSE='#' else USE_SYSTEMD_TRUE='#' USE_SYSTEMD_FALSE= fi if test x$sysv_style = x; then USE_UNDEF_TRUE= USE_UNDEF_FALSE='#' else USE_UNDEF_TRUE='#' USE_UNDEF_FALSE= fi if test x$bdb_required = xyes; then USE_BDB_TRUE= USE_BDB_FALSE='#' else USE_BDB_TRUE='#' USE_BDB_FALSE= fi if test x$netatalk_cv_ddp_enabled = xyes; then USE_APPLETALK_TRUE= USE_APPLETALK_FALSE='#' else USE_APPLETALK_TRUE='#' USE_APPLETALK_FALSE= fi if test x"$ac_neta_haveatfuncs" = x"yes"; then HAVE_ATFUNCS_TRUE= HAVE_ATFUNCS_FALSE='#' else HAVE_ATFUNCS_TRUE='#' HAVE_ATFUNCS_FALSE= fi ac_config_files="$ac_config_files Makefile bin/Makefile bin/ad/Makefile bin/adv1tov2/Makefile bin/aecho/Makefile bin/afppasswd/Makefile bin/cnid/Makefile bin/cnid/cnid2_create bin/getzones/Makefile bin/megatron/Makefile bin/misc/Makefile bin/nbp/Makefile bin/pap/Makefile bin/psorder/Makefile bin/uniconv/Makefile config/Makefile config/pam/Makefile contrib/Makefile contrib/macusers/Makefile contrib/macusers/macusers contrib/misc/Makefile contrib/printing/Makefile contrib/shell_utils/Makefile contrib/shell_utils/apple_dump contrib/shell_utils/asip-status.pl contrib/timelord/Makefile contrib/a2boot/Makefile distrib/Makefile distrib/config/Makefile distrib/config/netatalk-config distrib/initscripts/Makefile distrib/m4/Makefile distrib/systemd/Makefile doc/Makefile etc/Makefile etc/afpd/Makefile etc/atalkd/Makefile etc/cnid_dbd/Makefile etc/uams/Makefile etc/uams/uams_krb4/Makefile etc/papd/Makefile etc/psf/Makefile include/Makefile include/atalk/Makefile libatalk/Makefile libatalk/acl/Makefile libatalk/adouble/Makefile libatalk/asp/Makefile libatalk/atp/Makefile libatalk/bstring/Makefile libatalk/cnid/Makefile libatalk/cnid/cdb/Makefile libatalk/cnid/last/Makefile libatalk/cnid/dbd/Makefile libatalk/cnid/tdb/Makefile libatalk/compat/Makefile libatalk/dsi/Makefile libatalk/nbp/Makefile libatalk/netddp/Makefile libatalk/util/Makefile libatalk/tdb/Makefile libatalk/unicode/Makefile libatalk/unicode/charsets/Makefile libatalk/vfs/Makefile macros/Makefile man/Makefile man/man1/Makefile man/man3/Makefile man/man4/Makefile man/man5/Makefile man/man8/Makefile sys/Makefile sys/generic/Makefile sys/generic/sys/Makefile sys/netatalk/Makefile sys/netbsd/Makefile sys/netbsd/netatalk/Makefile sys/solaris/Makefile sys/sunos/Makefile sys/ultrix/Makefile test/Makefile test/afpd/Makefile" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_DBD_DAEMON_TRUE}" && test -z "${BUILD_DBD_DAEMON_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILD_DBD_DAEMON\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"BUILD_DBD_DAEMON\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_CDB_BACKEND_TRUE}" && test -z "${USE_CDB_BACKEND_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_CDB_BACKEND\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_CDB_BACKEND\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_LAST_BACKEND_TRUE}" && test -z "${USE_LAST_BACKEND_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_LAST_BACKEND\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_LAST_BACKEND\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_TDB_BACKEND_TRUE}" && test -z "${USE_TDB_BACKEND_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_TDB_BACKEND\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_TDB_BACKEND\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_SPOOLDIR_TRUE}" && test -z "${USE_SPOOLDIR_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_SPOOLDIR\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_SPOOLDIR\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_GSSAPI_TRUE}" && test -z "${USE_GSSAPI_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_GSSAPI\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_GSSAPI\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${SOLARIS_MODULE_TRUE}" && test -z "${SOLARIS_MODULE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"SOLARIS_MODULE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"SOLARIS_MODULE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COMPILE_TIMELORD_TRUE}" && test -z "${COMPILE_TIMELORD_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COMPILE_TIMELORD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COMPILE_TIMELORD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${COMPILE_A2BOOT_TRUE}" && test -z "${COMPILE_A2BOOT_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"COMPILE_A2BOOT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"COMPILE_A2BOOT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_LIBGCRYPT_TRUE}" && test -z "${HAVE_LIBGCRYPT_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_LIBGCRYPT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_LIBGCRYPT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_OPENSSL_TRUE}" && test -z "${HAVE_OPENSSL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_OPENSSL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_OPENSSL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_ACLS_TRUE}" && test -z "${HAVE_ACLS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_ACLS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_ACLS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_LDAP_TRUE}" && test -z "${HAVE_LDAP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_LDAP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_LDAP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_DHX_TRUE}" && test -z "${USE_DHX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_DHX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_DHX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_DHX2_TRUE}" && test -z "${USE_DHX2_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_DHX2\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_DHX2\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_RANDNUM_TRUE}" && test -z "${USE_RANDNUM_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_RANDNUM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_RANDNUM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_KERBEROS_TRUE}" && test -z "${USE_KERBEROS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_KERBEROS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_KERBEROS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_PAM_SO_TRUE}" && test -z "${USE_PAM_SO_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_PAM_SO\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_PAM_SO\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_PAM_TRUE}" && test -z "${USE_PAM_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_PAM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_PAM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_PAM_TRUE}" && test -z "${BUILD_PAM_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILD_PAM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"BUILD_PAM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_PGP_TRUE}" && test -z "${USE_PGP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_PGP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_PGP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${DEFAULT_HOOK_TRUE}" && test -z "${DEFAULT_HOOK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"DEFAULT_HOOK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"DEFAULT_HOOK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_NETBSD_TRUE}" && test -z "${USE_NETBSD_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_NETBSD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_NETBSD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_REDHAT_SYSV_TRUE}" && test -z "${USE_REDHAT_SYSV_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_REDHAT_SYSV\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_REDHAT_SYSV\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_SUSE_SYSV_TRUE}" && test -z "${USE_SUSE_SYSV_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_SUSE_SYSV\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_SUSE_SYSV\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_SHADOWPW_TRUE}" && test -z "${USE_SHADOWPW_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_SHADOWPW\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_SHADOWPW\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_TRU64_TRUE}" && test -z "${USE_TRU64_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_TRU64\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_TRU64\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_SOLARIS_TRUE}" && test -z "${USE_SOLARIS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_SOLARIS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_SOLARIS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_GENTOO_TRUE}" && test -z "${USE_GENTOO_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_GENTOO\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_GENTOO\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_DEBIAN_TRUE}" && test -z "${USE_DEBIAN_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_DEBIAN\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_DEBIAN\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_SYSTEMD_TRUE}" && test -z "${USE_SYSTEMD_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_SYSTEMD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_SYSTEMD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_UNDEF_TRUE}" && test -z "${USE_UNDEF_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_UNDEF\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_UNDEF\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_BDB_TRUE}" && test -z "${USE_BDB_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_BDB\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_BDB\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_APPLETALK_TRUE}" && test -z "${USE_APPLETALK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_APPLETALK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_APPLETALK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_ATFUNCS_TRUE}" && test -z "${HAVE_ATFUNCS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_ATFUNCS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_ATFUNCS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; "bin/ad/Makefile") CONFIG_FILES="$CONFIG_FILES bin/ad/Makefile" ;; "bin/adv1tov2/Makefile") CONFIG_FILES="$CONFIG_FILES bin/adv1tov2/Makefile" ;; "bin/aecho/Makefile") CONFIG_FILES="$CONFIG_FILES bin/aecho/Makefile" ;; "bin/afppasswd/Makefile") CONFIG_FILES="$CONFIG_FILES bin/afppasswd/Makefile" ;; "bin/cnid/Makefile") CONFIG_FILES="$CONFIG_FILES bin/cnid/Makefile" ;; "bin/cnid/cnid2_create") CONFIG_FILES="$CONFIG_FILES bin/cnid/cnid2_create" ;; "bin/getzones/Makefile") CONFIG_FILES="$CONFIG_FILES bin/getzones/Makefile" ;; "bin/megatron/Makefile") CONFIG_FILES="$CONFIG_FILES bin/megatron/Makefile" ;; "bin/misc/Makefile") CONFIG_FILES="$CONFIG_FILES bin/misc/Makefile" ;; "bin/nbp/Makefile") CONFIG_FILES="$CONFIG_FILES bin/nbp/Makefile" ;; "bin/pap/Makefile") CONFIG_FILES="$CONFIG_FILES bin/pap/Makefile" ;; "bin/psorder/Makefile") CONFIG_FILES="$CONFIG_FILES bin/psorder/Makefile" ;; "bin/uniconv/Makefile") CONFIG_FILES="$CONFIG_FILES bin/uniconv/Makefile" ;; "config/Makefile") CONFIG_FILES="$CONFIG_FILES config/Makefile" ;; "config/pam/Makefile") CONFIG_FILES="$CONFIG_FILES config/pam/Makefile" ;; "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;; "contrib/macusers/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/macusers/Makefile" ;; "contrib/macusers/macusers") CONFIG_FILES="$CONFIG_FILES contrib/macusers/macusers" ;; "contrib/misc/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/misc/Makefile" ;; "contrib/printing/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/printing/Makefile" ;; "contrib/shell_utils/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/shell_utils/Makefile" ;; "contrib/shell_utils/apple_dump") CONFIG_FILES="$CONFIG_FILES contrib/shell_utils/apple_dump" ;; "contrib/shell_utils/asip-status.pl") CONFIG_FILES="$CONFIG_FILES contrib/shell_utils/asip-status.pl" ;; "contrib/timelord/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/timelord/Makefile" ;; "contrib/a2boot/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/a2boot/Makefile" ;; "distrib/Makefile") CONFIG_FILES="$CONFIG_FILES distrib/Makefile" ;; "distrib/config/Makefile") CONFIG_FILES="$CONFIG_FILES distrib/config/Makefile" ;; "distrib/config/netatalk-config") CONFIG_FILES="$CONFIG_FILES distrib/config/netatalk-config" ;; "distrib/initscripts/Makefile") CONFIG_FILES="$CONFIG_FILES distrib/initscripts/Makefile" ;; "distrib/m4/Makefile") CONFIG_FILES="$CONFIG_FILES distrib/m4/Makefile" ;; "distrib/systemd/Makefile") CONFIG_FILES="$CONFIG_FILES distrib/systemd/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; "etc/afpd/Makefile") CONFIG_FILES="$CONFIG_FILES etc/afpd/Makefile" ;; "etc/atalkd/Makefile") CONFIG_FILES="$CONFIG_FILES etc/atalkd/Makefile" ;; "etc/cnid_dbd/Makefile") CONFIG_FILES="$CONFIG_FILES etc/cnid_dbd/Makefile" ;; "etc/uams/Makefile") CONFIG_FILES="$CONFIG_FILES etc/uams/Makefile" ;; "etc/uams/uams_krb4/Makefile") CONFIG_FILES="$CONFIG_FILES etc/uams/uams_krb4/Makefile" ;; "etc/papd/Makefile") CONFIG_FILES="$CONFIG_FILES etc/papd/Makefile" ;; "etc/psf/Makefile") CONFIG_FILES="$CONFIG_FILES etc/psf/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "include/atalk/Makefile") CONFIG_FILES="$CONFIG_FILES include/atalk/Makefile" ;; "libatalk/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/Makefile" ;; "libatalk/acl/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/acl/Makefile" ;; "libatalk/adouble/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/adouble/Makefile" ;; "libatalk/asp/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/asp/Makefile" ;; "libatalk/atp/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/atp/Makefile" ;; "libatalk/bstring/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/bstring/Makefile" ;; "libatalk/cnid/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/cnid/Makefile" ;; "libatalk/cnid/cdb/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/cnid/cdb/Makefile" ;; "libatalk/cnid/last/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/cnid/last/Makefile" ;; "libatalk/cnid/dbd/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/cnid/dbd/Makefile" ;; "libatalk/cnid/tdb/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/cnid/tdb/Makefile" ;; "libatalk/compat/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/compat/Makefile" ;; "libatalk/dsi/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/dsi/Makefile" ;; "libatalk/nbp/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/nbp/Makefile" ;; "libatalk/netddp/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/netddp/Makefile" ;; "libatalk/util/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/util/Makefile" ;; "libatalk/tdb/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/tdb/Makefile" ;; "libatalk/unicode/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/unicode/Makefile" ;; "libatalk/unicode/charsets/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/unicode/charsets/Makefile" ;; "libatalk/vfs/Makefile") CONFIG_FILES="$CONFIG_FILES libatalk/vfs/Makefile" ;; "macros/Makefile") CONFIG_FILES="$CONFIG_FILES macros/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "man/man1/Makefile") CONFIG_FILES="$CONFIG_FILES man/man1/Makefile" ;; "man/man3/Makefile") CONFIG_FILES="$CONFIG_FILES man/man3/Makefile" ;; "man/man4/Makefile") CONFIG_FILES="$CONFIG_FILES man/man4/Makefile" ;; "man/man5/Makefile") CONFIG_FILES="$CONFIG_FILES man/man5/Makefile" ;; "man/man8/Makefile") CONFIG_FILES="$CONFIG_FILES man/man8/Makefile" ;; "sys/Makefile") CONFIG_FILES="$CONFIG_FILES sys/Makefile" ;; "sys/generic/Makefile") CONFIG_FILES="$CONFIG_FILES sys/generic/Makefile" ;; "sys/generic/sys/Makefile") CONFIG_FILES="$CONFIG_FILES sys/generic/sys/Makefile" ;; "sys/netatalk/Makefile") CONFIG_FILES="$CONFIG_FILES sys/netatalk/Makefile" ;; "sys/netbsd/Makefile") CONFIG_FILES="$CONFIG_FILES sys/netbsd/Makefile" ;; "sys/netbsd/netatalk/Makefile") CONFIG_FILES="$CONFIG_FILES sys/netbsd/netatalk/Makefile" ;; "sys/solaris/Makefile") CONFIG_FILES="$CONFIG_FILES sys/solaris/Makefile" ;; "sys/sunos/Makefile") CONFIG_FILES="$CONFIG_FILES sys/sunos/Makefile" ;; "sys/ultrix/Makefile") CONFIG_FILES="$CONFIG_FILES sys/ultrix/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "test/afpd/Makefile") CONFIG_FILES="$CONFIG_FILES test/afpd/Makefile" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF GREP!$GREP$ac_delim PERL!$PERL$ac_delim PS!$PS$ac_delim SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim NETATALK_VERSION!$NETATALK_VERSION$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim target!$target$ac_delim target_cpu!$target_cpu$ac_delim target_vendor!$target_vendor$ac_delim target_os!$target_os$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim MAINT!$MAINT$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim DEPDIR!$DEPDIR$ac_delim am__include!$am__include$ac_delim am__quote!$am__quote$ac_delim AMDEP_TRUE!$AMDEP_TRUE$ac_delim AMDEP_FALSE!$AMDEP_FALSE$ac_delim AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim CCDEPMODE!$CCDEPMODE$ac_delim am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim LN_S!$LN_S$ac_delim SED!$SED$ac_delim EGREP!$EGREP$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF ECHO!$ECHO$ac_delim AR!$AR$ac_delim RANLIB!$RANLIB$ac_delim DSYMUTIL!$DSYMUTIL$ac_delim NMEDIT!$NMEDIT$ac_delim CPP!$CPP$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim CXXDEPMODE!$CXXDEPMODE$ac_delim am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim CXXCPP!$CXXCPP$ac_delim F77!$F77$ac_delim FFLAGS!$FFLAGS$ac_delim ac_ct_F77!$ac_ct_F77$ac_delim LIBTOOL!$LIBTOOL$ac_delim LIBADD_DL!$LIBADD_DL$ac_delim LIBOBJS!$LIBOBJS$ac_delim PTHREAD_LIBS!$PTHREAD_LIBS$ac_delim AFS_LIBS!$AFS_LIBS$ac_delim AFS_CFLAGS!$AFS_CFLAGS$ac_delim PKGCONFDIR!$PKGCONFDIR$ac_delim SERVERTEXT!$SERVERTEXT$ac_delim ICONV_CFLAGS!$ICONV_CFLAGS$ac_delim ICONV_LIBS!$ICONV_LIBS$ac_delim BUILD_DBD_DAEMON_TRUE!$BUILD_DBD_DAEMON_TRUE$ac_delim BUILD_DBD_DAEMON_FALSE!$BUILD_DBD_DAEMON_FALSE$ac_delim USE_CDB_BACKEND_TRUE!$USE_CDB_BACKEND_TRUE$ac_delim USE_CDB_BACKEND_FALSE!$USE_CDB_BACKEND_FALSE$ac_delim USE_LAST_BACKEND_TRUE!$USE_LAST_BACKEND_TRUE$ac_delim USE_LAST_BACKEND_FALSE!$USE_LAST_BACKEND_FALSE$ac_delim USE_TDB_BACKEND_TRUE!$USE_TDB_BACKEND_TRUE$ac_delim USE_TDB_BACKEND_FALSE!$USE_TDB_BACKEND_FALSE$ac_delim DEFAULT_CNID_SCHEME!$DEFAULT_CNID_SCHEME$ac_delim compiled_backends!$compiled_backends$ac_delim QUOTA_LIBS!$QUOTA_LIBS$ac_delim SLP_LIBS!$SLP_LIBS$ac_delim SLP_CFLAGS!$SLP_CFLAGS$ac_delim PKG_CONFIG!$PKG_CONFIG$ac_delim AVAHI_CFLAGS!$AVAHI_CFLAGS$ac_delim AVAHI_LIBS!$AVAHI_LIBS$ac_delim AVAHI_TPOLL_CFLAGS!$AVAHI_TPOLL_CFLAGS$ac_delim AVAHI_TPOLL_LIBS!$AVAHI_TPOLL_LIBS$ac_delim ZEROCONF_LIBS!$ZEROCONF_LIBS$ac_delim ZEROCONF_CFLAGS!$ZEROCONF_CFLAGS$ac_delim PAMDIR!$PAMDIR$ac_delim PAM_CFLAGS!$PAM_CFLAGS$ac_delim PAM_LIBS!$PAM_LIBS$ac_delim PAM_DIRECTIVE!$PAM_DIRECTIVE$ac_delim PAM_AUTH!$PAM_AUTH$ac_delim PAM_ACCOUNT!$PAM_ACCOUNT$ac_delim PAM_PASSWORD!$PAM_PASSWORD$ac_delim PAM_SESSION!$PAM_SESSION$ac_delim WRAP_LIBS!$WRAP_LIBS$ac_delim CUPS_CONFIG!$CUPS_CONFIG$ac_delim CUPS_CFLAGS!$CUPS_CFLAGS$ac_delim CUPS_LDFLAGS!$CUPS_LDFLAGS$ac_delim CUPS_LIBS!$CUPS_LIBS$ac_delim USE_SPOOLDIR_TRUE!$USE_SPOOLDIR_TRUE$ac_delim USE_SPOOLDIR_FALSE!$USE_SPOOLDIR_FALSE$ac_delim SPOOLDIR!$SPOOLDIR$ac_delim UAMS_PATH!$UAMS_PATH$ac_delim COMPILE_KERNEL_GCC!$COMPILE_KERNEL_GCC$ac_delim COMPILE_64BIT_KMODULE!$COMPILE_64BIT_KMODULE$ac_delim KCFLAGS!$KCFLAGS$ac_delim KLDFLAGS!$KLDFLAGS$ac_delim LIBGCRYPT_CONFIG!$LIBGCRYPT_CONFIG$ac_delim LIBGCRYPT_CFLAGS!$LIBGCRYPT_CFLAGS$ac_delim LIBGCRYPT_LIBS!$LIBGCRYPT_LIBS$ac_delim SSL_CFLAGS!$SSL_CFLAGS$ac_delim SSL_LIBS!$SSL_LIBS$ac_delim BDB_CFLAGS!$BDB_CFLAGS$ac_delim BDB_LIBS!$BDB_LIBS$ac_delim BDB_BIN!$BDB_BIN$ac_delim BDB_PATH!$BDB_PATH$ac_delim CRYPT_LIBS!$CRYPT_LIBS$ac_delim KRB5_CONFIG!$KRB5_CONFIG$ac_delim GSSAPI_LIBS!$GSSAPI_LIBS$ac_delim GSSAPI_CFLAGS!$GSSAPI_CFLAGS$ac_delim USE_GSSAPI_TRUE!$USE_GSSAPI_TRUE$ac_delim USE_GSSAPI_FALSE!$USE_GSSAPI_FALSE$ac_delim ACL_LIBS!$ACL_LIBS$ac_delim WEBMIN_PATH!$WEBMIN_PATH$ac_delim WEBMIN_VERSION!$WEBMIN_VERSION$ac_delim WEBMIN_USER!$WEBMIN_USER$ac_delim WEBMIN_PASS!$WEBMIN_PASS$ac_delim WEBMIN_PORT!$WEBMIN_PORT$ac_delim OVERWRITE_CONFIG!$OVERWRITE_CONFIG$ac_delim SOLARIS_MODULE_TRUE!$SOLARIS_MODULE_TRUE$ac_delim SOLARIS_MODULE_FALSE!$SOLARIS_MODULE_FALSE$ac_delim COMPILE_TIMELORD_TRUE!$COMPILE_TIMELORD_TRUE$ac_delim COMPILE_TIMELORD_FALSE!$COMPILE_TIMELORD_FALSE$ac_delim COMPILE_A2BOOT_TRUE!$COMPILE_A2BOOT_TRUE$ac_delim COMPILE_A2BOOT_FALSE!$COMPILE_A2BOOT_FALSE$ac_delim HAVE_LIBGCRYPT_TRUE!$HAVE_LIBGCRYPT_TRUE$ac_delim HAVE_LIBGCRYPT_FALSE!$HAVE_LIBGCRYPT_FALSE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF HAVE_OPENSSL_TRUE!$HAVE_OPENSSL_TRUE$ac_delim HAVE_OPENSSL_FALSE!$HAVE_OPENSSL_FALSE$ac_delim HAVE_ACLS_TRUE!$HAVE_ACLS_TRUE$ac_delim HAVE_ACLS_FALSE!$HAVE_ACLS_FALSE$ac_delim HAVE_LDAP_TRUE!$HAVE_LDAP_TRUE$ac_delim HAVE_LDAP_FALSE!$HAVE_LDAP_FALSE$ac_delim USE_DHX_TRUE!$USE_DHX_TRUE$ac_delim USE_DHX_FALSE!$USE_DHX_FALSE$ac_delim USE_DHX2_TRUE!$USE_DHX2_TRUE$ac_delim USE_DHX2_FALSE!$USE_DHX2_FALSE$ac_delim USE_RANDNUM_TRUE!$USE_RANDNUM_TRUE$ac_delim USE_RANDNUM_FALSE!$USE_RANDNUM_FALSE$ac_delim USE_KERBEROS_TRUE!$USE_KERBEROS_TRUE$ac_delim USE_KERBEROS_FALSE!$USE_KERBEROS_FALSE$ac_delim USE_PAM_SO_TRUE!$USE_PAM_SO_TRUE$ac_delim USE_PAM_SO_FALSE!$USE_PAM_SO_FALSE$ac_delim USE_PAM_TRUE!$USE_PAM_TRUE$ac_delim USE_PAM_FALSE!$USE_PAM_FALSE$ac_delim BUILD_PAM_TRUE!$BUILD_PAM_TRUE$ac_delim BUILD_PAM_FALSE!$BUILD_PAM_FALSE$ac_delim USE_PGP_TRUE!$USE_PGP_TRUE$ac_delim USE_PGP_FALSE!$USE_PGP_FALSE$ac_delim DEFAULT_HOOK_TRUE!$DEFAULT_HOOK_TRUE$ac_delim DEFAULT_HOOK_FALSE!$DEFAULT_HOOK_FALSE$ac_delim USE_NETBSD_TRUE!$USE_NETBSD_TRUE$ac_delim USE_NETBSD_FALSE!$USE_NETBSD_FALSE$ac_delim USE_REDHAT_SYSV_TRUE!$USE_REDHAT_SYSV_TRUE$ac_delim USE_REDHAT_SYSV_FALSE!$USE_REDHAT_SYSV_FALSE$ac_delim USE_SUSE_SYSV_TRUE!$USE_SUSE_SYSV_TRUE$ac_delim USE_SUSE_SYSV_FALSE!$USE_SUSE_SYSV_FALSE$ac_delim USE_SHADOWPW_TRUE!$USE_SHADOWPW_TRUE$ac_delim USE_SHADOWPW_FALSE!$USE_SHADOWPW_FALSE$ac_delim USE_TRU64_TRUE!$USE_TRU64_TRUE$ac_delim USE_TRU64_FALSE!$USE_TRU64_FALSE$ac_delim USE_SOLARIS_TRUE!$USE_SOLARIS_TRUE$ac_delim USE_SOLARIS_FALSE!$USE_SOLARIS_FALSE$ac_delim USE_GENTOO_TRUE!$USE_GENTOO_TRUE$ac_delim USE_GENTOO_FALSE!$USE_GENTOO_FALSE$ac_delim USE_DEBIAN_TRUE!$USE_DEBIAN_TRUE$ac_delim USE_DEBIAN_FALSE!$USE_DEBIAN_FALSE$ac_delim USE_SYSTEMD_TRUE!$USE_SYSTEMD_TRUE$ac_delim USE_SYSTEMD_FALSE!$USE_SYSTEMD_FALSE$ac_delim USE_UNDEF_TRUE!$USE_UNDEF_TRUE$ac_delim USE_UNDEF_FALSE!$USE_UNDEF_FALSE$ac_delim USE_BDB_TRUE!$USE_BDB_TRUE$ac_delim USE_BDB_FALSE!$USE_BDB_FALSE$ac_delim USE_APPLETALK_TRUE!$USE_APPLETALK_TRUE$ac_delim USE_APPLETALK_FALSE!$USE_APPLETALK_FALSE$ac_delim HAVE_ATFUNCS_TRUE!$HAVE_ATFUNCS_TRUE$ac_delim HAVE_ATFUNCS_FALSE!$HAVE_ATFUNCS_FALSE$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 51; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-3.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_arg=$ac_file _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; "default":C) chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_* ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi { echo "$as_me:$LINENO: result: Using libraries:" >&5 echo "${ECHO_T}Using libraries:" >&6; } { echo "$as_me:$LINENO: result: LIBS = $LIBS" >&5 echo "${ECHO_T} LIBS = $LIBS" >&6; } { echo "$as_me:$LINENO: result: CFLAGS = $CFLAGS" >&5 echo "${ECHO_T} CFLAGS = $CFLAGS" >&6; } if test x"$neta_cv_have_openssl" = x"yes"; then { echo "$as_me:$LINENO: result: SSL:" >&5 echo "${ECHO_T} SSL:" >&6; } { echo "$as_me:$LINENO: result: LIBS = $SSL_LIBS" >&5 echo "${ECHO_T} LIBS = $SSL_LIBS" >&6; } { echo "$as_me:$LINENO: result: CFLAGS = $SSL_CFLAGS" >&5 echo "${ECHO_T} CFLAGS = $SSL_CFLAGS" >&6; } fi if test x"$neta_cv_have_libgcrypt" = x"yes"; then { echo "$as_me:$LINENO: result: LIBGCRYPT:" >&5 echo "${ECHO_T} LIBGCRYPT:" >&6; } { echo "$as_me:$LINENO: result: LIBS = $LIBGCRYPT_LIBS" >&5 echo "${ECHO_T} LIBS = $LIBGCRYPT_LIBS" >&6; } { echo "$as_me:$LINENO: result: CFLAGS = $LIBGCRYPT_CFLAGS" >&5 echo "${ECHO_T} CFLAGS = $LIBGCRYPT_CFLAGS" >&6; } fi if test x"$netatalk_cv_use_pam" = x"yes"; then { echo "$as_me:$LINENO: result: PAM:" >&5 echo "${ECHO_T} PAM:" >&6; } { echo "$as_me:$LINENO: result: LIBS = $PAM_LIBS" >&5 echo "${ECHO_T} LIBS = $PAM_LIBS" >&6; } { echo "$as_me:$LINENO: result: CFLAGS = $PAM_CFLAGS" >&5 echo "${ECHO_T} CFLAGS = $PAM_CFLAGS" >&6; } fi if test x"$netatalk_cv_use_pam" = x"yes"; then { echo "$as_me:$LINENO: result: WRAP:" >&5 echo "${ECHO_T} WRAP:" >&6; } { echo "$as_me:$LINENO: result: LIBS = $WRAP_LIBS" >&5 echo "${ECHO_T} LIBS = $WRAP_LIBS" >&6; } { echo "$as_me:$LINENO: result: CFLAGS = $WRAP_CFLAGS" >&5 echo "${ECHO_T} CFLAGS = $WRAP_CFLAGS" >&6; } fi if test x"$bdb_required" = x"yes"; then { echo "$as_me:$LINENO: result: BDB:" >&5 echo "${ECHO_T} BDB:" >&6; } { echo "$as_me:$LINENO: result: LIBS = $BDB_LIBS" >&5 echo "${ECHO_T} LIBS = $BDB_LIBS" >&6; } { echo "$as_me:$LINENO: result: CFLAGS = $BDB_CFLAGS" >&5 echo "${ECHO_T} CFLAGS = $BDB_CFLAGS" >&6; } fi if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then { echo "$as_me:$LINENO: result: GSSAPI:" >&5 echo "${ECHO_T} GSSAPI:" >&6; } { echo "$as_me:$LINENO: result: LIBS = $GSSAPI_LIBS" >&5 echo "${ECHO_T} LIBS = $GSSAPI_LIBS" >&6; } { echo "$as_me:$LINENO: result: CFLAGS = $GSSAPI_CFLAGS" >&5 echo "${ECHO_T} CFLAGS = $GSSAPI_CFLAGS" >&6; } fi if test x"$netatalk_cv_srvloc" = x"yes"; then { echo "$as_me:$LINENO: result: SRVLOC:" >&5 echo "${ECHO_T} SRVLOC:" >&6; } { echo "$as_me:$LINENO: result: LIBS = $SLP_LIBS" >&5 echo "${ECHO_T} LIBS = $SLP_LIBS" >&6; } { echo "$as_me:$LINENO: result: CFLAGS = $SLP_CFLAGS" >&5 echo "${ECHO_T} CFLAGS = $SLP_CFLAGS" >&6; } fi if test x"$netatalk_cv_use_cups" = x"yes"; then { echo "$as_me:$LINENO: result: CUPS:" >&5 echo "${ECHO_T} CUPS:" >&6; } { echo "$as_me:$LINENO: result: LIBS = $CUPS_LIBS" >&5 echo "${ECHO_T} LIBS = $CUPS_LIBS" >&6; } { echo "$as_me:$LINENO: result: CFLAGS = $CUPS_CFLAGS" >&5 echo "${ECHO_T} CFLAGS = $CUPS_CFLAGS" >&6; } fi { echo "$as_me:$LINENO: result: Configure summary:" >&5 echo "${ECHO_T}Configure summary:" >&6; } { echo "$as_me:$LINENO: result: Install style:" >&5 echo "${ECHO_T} Install style:" >&6; } if test "x$sysv_style" != "x"; then { echo "$as_me:$LINENO: result: $sysv_style" >&5 echo "${ECHO_T} $sysv_style" >&6; } else { echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T} none" >&6; } fi { echo "$as_me:$LINENO: result: AFP:" >&5 echo "${ECHO_T} AFP:" >&6; } { echo "$as_me:$LINENO: result: Large file support (>2GB) for AFP3: $wx_largefile" >&5 echo "${ECHO_T} Large file support (>2GB) for AFP3: $wx_largefile" >&6; } { echo "$as_me:$LINENO: result: Extended Attributes: $neta_cv_eas" >&5 echo "${ECHO_T} Extended Attributes: $neta_cv_eas" >&6; } { echo "$as_me:$LINENO: result: CNID:" >&5 echo "${ECHO_T} CNID:" >&6; } { echo "$as_me:$LINENO: result: backends: $compiled_backends" >&5 echo "${ECHO_T} backends: $compiled_backends" >&6; } { echo "$as_me:$LINENO: result: UAMS:" >&5 echo "${ECHO_T} UAMS:" >&6; } uams_using_options="" if test x"$netatalk_cv_use_pam" != x"no"; then uams_using_options="PAM" fi if test "x$netatalk_cv_use_shadowpw" = "xyes"; then uams_using_options="$uams_using_options SHADOW" fi if test "x$neta_cv_compile_dhx" = "xyes"; then { echo "$as_me:$LINENO: result: DHX ($uams_using_options)" >&5 echo "${ECHO_T} DHX ($uams_using_options)" >&6; } fi if test "x$neta_cv_compile_dhx2" = "xyes"; then { echo "$as_me:$LINENO: result: DHX2 ($uams_using_options)" >&5 echo "${ECHO_T} DHX2 ($uams_using_options)" >&6; } fi if test "x$neta_cv_have_openssl" = "xyes"; then { echo "$as_me:$LINENO: result: RANDNUM (afppasswd)" >&5 echo "${ECHO_T} RANDNUM (afppasswd)" >&6; } fi if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then { echo "$as_me:$LINENO: result: Kerberos V" >&5 echo "${ECHO_T} Kerberos V" >&6; } fi if test x"$compile_kerberos" = x"yes"; then { echo "$as_me:$LINENO: result: Kerberos IV" >&5 echo "${ECHO_T} Kerberos IV" >&6; } fi if test x"$compile_pgp" = x"yes"; then { echo "$as_me:$LINENO: result: PGP" >&5 echo "${ECHO_T} PGP" >&6; } fi { echo "$as_me:$LINENO: result: clrtxt ($uams_using_options)" >&5 echo "${ECHO_T} clrtxt ($uams_using_options)" >&6; } { echo "$as_me:$LINENO: result: guest" >&5 echo "${ECHO_T} guest" >&6; } { echo "$as_me:$LINENO: result: Options:" >&5 echo "${ECHO_T} Options:" >&6; } { echo "$as_me:$LINENO: result: DDP (AppleTalk) support: $netatalk_cv_ddp_enabled" >&5 echo "${ECHO_T} DDP (AppleTalk) support: $netatalk_cv_ddp_enabled" >&6; } if test "x$netatalk_cv_ddp_enabled" = "xyes"; then { echo "$as_me:$LINENO: result: CUPS support: $netatalk_cv_use_cups" >&5 echo "${ECHO_T} CUPS support: $netatalk_cv_use_cups" >&6; } { echo "$as_me:$LINENO: result: Apple 2 boot support: $compile_a2boot" >&5 echo "${ECHO_T} Apple 2 boot support: $compile_a2boot" >&6; } fi { echo "$as_me:$LINENO: result: SLP support: $netatalk_cv_srvloc" >&5 echo "${ECHO_T} SLP support: $netatalk_cv_srvloc" >&6; } { echo "$as_me:$LINENO: result: Zeroconf support: $netatalk_cv_zeroconf" >&5 echo "${ECHO_T} Zeroconf support: $netatalk_cv_zeroconf" >&6; } { echo "$as_me:$LINENO: result: tcp wrapper support: $netatalk_cv_tcpwrap" >&5 echo "${ECHO_T} tcp wrapper support: $netatalk_cv_tcpwrap" >&6; } { echo "$as_me:$LINENO: result: quota support: $netatalk_cv_quotasupport" >&5 echo "${ECHO_T} quota support: $netatalk_cv_quotasupport" >&6; } { echo "$as_me:$LINENO: result: admin group support: $netatalk_cv_admin_group" >&5 echo "${ECHO_T} admin group support: $netatalk_cv_admin_group" >&6; } { echo "$as_me:$LINENO: result: valid shell check: $netatalk_cv_use_shellcheck" >&5 echo "${ECHO_T} valid shell check: $netatalk_cv_use_shellcheck" >&6; } { echo "$as_me:$LINENO: result: cracklib support: $netatalk_cv_with_cracklib" >&5 echo "${ECHO_T} cracklib support: $netatalk_cv_with_cracklib" >&6; } { echo "$as_me:$LINENO: result: dropbox kludge: $netatalk_cv_dropkludge" >&5 echo "${ECHO_T} dropbox kludge: $netatalk_cv_dropkludge" >&6; } { echo "$as_me:$LINENO: result: force volume uid/gid: $netatalk_cv_force_uidgid" >&5 echo "${ECHO_T} force volume uid/gid: $netatalk_cv_force_uidgid" >&6; } { echo "$as_me:$LINENO: result: ACL support: $with_acl_support" >&5 echo "${ECHO_T} ACL support: $with_acl_support" >&6; } { echo "$as_me:$LINENO: result: LDAP support: $with_ldap" >&5 echo "${ECHO_T} LDAP support: $with_ldap" >&6; } if test x"$use_pam_so" = x"yes" -a x"$netatalk_cv_install_pam" = x"no"; then { echo "$as_me:$LINENO: result: " >&5 echo "${ECHO_T}" >&6; } { echo "$as_me:$LINENO: WARNING: PAM support was configured for your system, but the netatalk PAM configuration file" >&5 echo "$as_me: WARNING: PAM support was configured for your system, but the netatalk PAM configuration file" >&2;} { echo "$as_me:$LINENO: WARNING: cannot be installed. Please install the config/netatalk.pamd file manually." >&5 echo "$as_me: WARNING: cannot be installed. Please install the config/netatalk.pamd file manually." >&2;} { echo "$as_me:$LINENO: WARNING: If you're running Solaris or BSD you'll have to edit /etc/pam.conf to get PAM working." >&5 echo "$as_me: WARNING: If you're running Solaris or BSD you'll have to edit /etc/pam.conf to get PAM working." >&2;} { echo "$as_me:$LINENO: WARNING: You can also re-run configure and specify --without-pam to disable PAM support." >&5 echo "$as_me: WARNING: You can also re-run configure and specify --without-pam to disable PAM support." >&2;} fi netatalk-2.2.2/distrib/0000777000175200017500000000000011704770431011773 500000000000000netatalk-2.2.2/distrib/Makefile.am0000644000175200017500000000010411664405712013740 00000000000000# Makefile.am for distrib/ SUBDIRS = config initscripts m4 systemd netatalk-2.2.2/distrib/config/0000777000175200017500000000000011704770431013240 500000000000000netatalk-2.2.2/distrib/config/Makefile.am0000644000175200017500000000007611655731126015216 00000000000000# Makefile for distrib/config/ bin_SCRIPTS = netatalk-config netatalk-2.2.2/distrib/config/Makefile.in0000644000175200017500000003052511703521725015225 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile for distrib/config/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = distrib/config DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/netatalk-config.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = netatalk-config am__installdirs = "$(DESTDIR)$(bindir)" binSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ bin_SCRIPTS = netatalk-config all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign distrib/config/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign distrib/config/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh netatalk-config: $(top_builddir)/config.status $(srcdir)/netatalk-config.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binSCRIPTS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-binSCRIPTS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/distrib/config/netatalk-config.in0000644000175200017500000000775011655731126016566 00000000000000#!/bin/sh # netatalk-config af_libs= af_cflags= prefix=@prefix@ exec_prefix=@exec_prefix@ ## ## Define usage() ## usage() { cat <&2 fi # at least one option should be selected case "$1" in --*) ;; *) usage 1 1>&2 ;; esac # grab all -- arguments while test $# -gt 0; do case "$1" in -*=*) af_optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) af_optarg= ;; esac case $1 in --help) usage 0 0>&2 ;; --cflags) af_echo_cflags=yes ;; --libs) af_echo_libs_L=yes af_echo_libs_l=yes ;; --libs-dirs) af_echo_libs_L=yes ;; --libs-names) af_echo_libs_l=yes ;; --macros*) echo -I @prefix@/include/netatalk/macros exit ;; --prefix=*) prefix=$af_optarg af_prefix_set=yes ;; --prefix) af_echo_prefix=yes ;; --exec_prefix=*) exec_prefix=$af_optarg af_exec_prefix_set=yes ;; --exec_prefix) af_echo_exec_prefix=yes ;; --version) af_echo_version=yes ;; --*) usage 1 1>&2 ;; *) break ;; esac shift done # if we have a default library use it if test $# -eq 0; then if test "X$af_lib_default" != "X"; then af_lib__AF_LIB_DEFAULT=yes return fi fi while test $# -gt 0; do case $1 in netatalk) af_lib_netatalk=yes ;; *) usage 1 1>&2 ;; esac shift done } print_result() { if test "X$af_echo_cflags" = "Xyes"; then af_all_flags="$af_cflags" fi if test "X$af_echo_libs_L" = "Xyes" || test "X$af_echo_libs_l" = "Xyes"; then af_all_flags="$af_all_flags $af_libs" fi if test -z "$af_all_flags" || test "X$af_all_flags" = "X "; then exit 1 fi # Straight out any possible duplicates, but be careful to # get `-lfoo -lbar -lbaz' for `-lfoo -lbaz -lbar -lbaz' af_other_flags= af_lib_L_flags= af_rev_libs= for i in $af_all_flags; do case "$i" in # a library, save it for later, in reverse order -l*) af_rev_libs="$i $af_rev_libs" ;; -L*|-R*) if test "X$af_echo_libs_L" = "Xyes"; then case " $af_lib_L_flags " in *\ $i\ *) ;; # already there *) af_lib_L_flags="$af_lib_L_flags $i" ;; # add it to output esac fi;; *) case " $af_other_flags " in *\ $i\ *) ;; # already there *) af_other_flags="$af_other_flags $i" ;; # add it to output esac ;; esac done af_ord_libs= if test "X$af_echo_libs_l" = "Xyes"; then for i in $af_rev_libs; do case " $af_ord_libs " in *\ $i\ *) ;; # already there *) af_ord_libs="$i $af_ord_libs" ;; # add it to output in reverse order esac done fi echo $af_other_flags $af_lib_L_flags $af_ord_libs } ## ## Main Body ## parse $* ## ## Initialize names ## if test "X$af_echo_prefix" = "Xyes"; then echo $prefix fi if test "X$af_echo_exec_prefix" = "Xyes"; then echo $exec_prefix fi if test "X$af_echo_version" = "Xyes"; then echo @NETATALK_VERSION@ exit 0 fi ## ## Libraries ## #dummy because this should always be selected if test "@includedir@" != /usr/include ; then includes="-I@includedir@" fi if test "@libdir@" != /usr/lib ; then libs="-L@libdir@" fi af_cflags="$af_cflags $includes" af_libs="$libs -latalk" print_result exit 0 netatalk-2.2.2/distrib/Makefile.in0000644000175200017500000004130611703521724013756 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for distrib/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = distrib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = config initscripts m4 systemd all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign distrib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign distrib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/distrib/m4/0000777000175200017500000000000011704770431012313 500000000000000netatalk-2.2.2/distrib/m4/Makefile.am0000644000175200017500000000016211655731126014265 00000000000000# Makefile for distrib/m4/ m4datadir = $(datadir)/aclocal m4data_DATA = netatalk.m4 EXTRA_DIST = $(m4data_DATA) netatalk-2.2.2/distrib/m4/Makefile.in0000644000175200017500000003053111703521725014275 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile for distrib/m4/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = distrib/m4 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(m4datadir)" m4dataDATA_INSTALL = $(INSTALL_DATA) DATA = $(m4data_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ m4datadir = $(datadir)/aclocal m4data_DATA = netatalk.m4 EXTRA_DIST = $(m4data_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign distrib/m4/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign distrib/m4/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-m4dataDATA: $(m4data_DATA) @$(NORMAL_INSTALL) test -z "$(m4datadir)" || $(MKDIR_P) "$(DESTDIR)$(m4datadir)" @list='$(m4data_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(m4dataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(m4datadir)/$$f'"; \ $(m4dataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(m4datadir)/$$f"; \ done uninstall-m4dataDATA: @$(NORMAL_UNINSTALL) @list='$(m4data_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(m4datadir)/$$f'"; \ rm -f "$(DESTDIR)$(m4datadir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(m4datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-m4dataDATA install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-m4dataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-m4dataDATA install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-m4dataDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/distrib/m4/netatalk.m40000644000175200017500000001111411655731126014275 00000000000000# Configure paths for netatalk # Based on libsigc++ script by Karl Nelson # Modified by jeff b (jeff@univrel.pr.uconn.edu) dnl Test for netatalk, and define NETATALK_CFLAGS and NETATALK_LIBS dnl to be used as follows: dnl AM_PATH_NETATALK(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl AC_DEFUN([AM_PATH_NETATALK], [dnl dnl Get the cflags and libraries from the netatalk-config script dnl dnl dnl Prefix options dnl AC_ARG_WITH(netatalk-prefix, [ --with-netatalk-prefix=PREFIX Prefix where netatalk is installed (optional)] , netatalk_config_prefix="$withval", netatalk_config_prefix="") AC_ARG_WITH(netatalk-exec-prefix, [ --with-netatalk-exec-prefix=PREFIX Exec prefix where netatalk is installed (optional)] , netatalk_config_exec_prefix="$withval", netatalk_config_exec_prefix="") AC_ARG_ENABLE(netatalktest, [ --disable-netatalktest Do not try to compile and run a test netatalk program], , enable_netatalktest=yes) dnl dnl Prefix handling dnl if test x$netatalk_config_exec_prefix != x ; then netatalk_config_args="$netatalk_config_args --exec-prefix=$netatalk_config_exec_prefix" if test x${NETATALK_CONFIG+set} != xset ; then NETATALK_CONFIG=$netatalk_config_exec_prefix/bin/netatalk-config fi fi if test x$netatalk_config_prefix != x ; then netatalk_config_args="$netatalk_config_args --prefix=$netatalk_config_prefix" if test x${NETATALK_CONFIG+set} != xset ; then NETATALK_CONFIG=$netatalk_config_prefix/bin/netatalk-config fi fi dnl dnl See if netatalk-config is alive dnl AC_PATH_PROG(NETATALK_CONFIG, netatalk-config, no) netatalk_version_min=$1 dnl dnl Version check dnl AC_MSG_CHECKING(for netatalk - version >= $netatalk_version_min) no_netatalk="" if test "$NETATALK_CONFIG" = "no" ; then no_netatalk=yes else netatalk_version=`$NETATALK_CONFIG --version` NETATALK_CFLAGS=`$NETATALK_CONFIG $netatalk_config_args --cflags` NETATALK_LIBS=`$NETATALK_CONFIG $netatalk_config_args --libs` netatalk_major_version=`echo $netatalk_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` netatalk_minor_version=`echo $netatalk_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` netatalk_micro_version=`echo $netatalk_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` netatalk_major_min=`echo $netatalk_major_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` netatalk_minor_min=`echo $netatalk_minor_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` netatalk_micro_min=`echo $netatalk_micro_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` netatalk_version_proper=`expr \ $netatalk_major_version \> $netatalk_major_min \| \ $netatalk_major_version \= $netatalk_major_min \& \ $netatalk_minor_version \> $netatalk_minor_min \| \ $netatalk_major_version \= $netatalk_major_min \& \ $netatalk_minor_version \= $netatalk_minor_min \& \ $netatalk_micro_version \>= $netatalk_micro_min ` if test "$netatalk_version_proper" = "1" ; then AC_MSG_RESULT([$netatalk_major_version.$netatalk_minor_version.$netatalk_micro_version]) else AC_MSG_RESULT(no) no_netatalk=yes fi if test "X$no_netatalk" = "Xyes" ; then enable_netatalktest=no fi AC_LANG_SAVE AC_LANG_CPLUSPLUS dnl dnl dnl if test "x$enable_netatalktest" = "xyes" ; then AC_MSG_CHECKING(if netatalk sane) ac_save_CXXFLAGS="$CXXFLAGS" ac_save_LIBS="$LIBS" CXXFLAGS="$CXXFLAGS $NETATALK_CFLAGS" LIBS="$LIBS $NETATALK_LIBS" rm -f conf.netatalktest AC_TRY_RUN([ #include #include int main(int argc,char **argv) { if (netatalk_major_version!=$netatalk_major_version || netatalk_minor_version!=$netatalk_minor_version || netatalk_micro_version!=$netatalk_micro_version) { printf("(%d.%d.%d) ", netatalk_major_version,netatalk_minor_version,netatalk_micro_version); return 1; } } ],[ AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no) no_netatalk=yes ] ,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CXXFLAGS="$ac_save_CXXFLAGS" LIBS="$ac_save_LIBS" fi fi dnl dnl if test "x$no_netatalk" = x ; then ifelse([$2], , :, [$2]) else NETATALK_CFLAGS="" NETATALK_LIBS="" ifelse([$3], , :, [$3]) fi AC_LANG_RESTORE AC_SUBST(NETATALK_CFLAGS) AC_SUBST(NETATALK_LIBS) ]) netatalk-2.2.2/distrib/initscripts/0000777000175200017500000000000011704770431014346 500000000000000netatalk-2.2.2/distrib/initscripts/Makefile.am0000644000175200017500000001147011665651044016325 00000000000000## Makefile for distrib/initscripts/ SUFFIXES = .tmpl . pkgconfdir = @PKGCONFDIR@ # # Template Generation # .tmpl: sed -e s@:BINDIR:@${bindir}@ \ -e s@:SBINDIR:@${sbindir}@ \ -e s@:ETCDIR:@${pkgconfdir}@ \ -e s@:PKGLIBEXECDIR:@${pkglibexecdir}@ \ -e s@:NETATALK_VERSION:@${NETATALK_VERSION}@ \ <$< >$@ GENERATED_FILES = \ rc.afpd.netbsd \ rc.atalk.redhat-sysv \ rc.atalk.systemd \ rc.atalk.tru64 \ rc.atalk.bsd \ rc.atalkd.netbsd \ rc.atalk.suse-sysv \ rc.cnid_metad.netbsd \ rc.papd.netbsd \ rc.timelord.netbsd \ rc.atalk.sysv \ rc.atalk.gentoo \ rc.atalk.debian \ service.atalk.systemd TEMPLATES = \ rc.afpd.netbsd.tmpl \ rc.atalk.redhat-sysv.tmpl \ rc.atalk.systemd.tmpl \ rc.atalk.tru64.tmpl \ rc.atalk.bsd.tmpl \ rc.atalkd.netbsd.tmpl \ rc.atalk.suse-sysv.tmpl \ rc.cnid_metad.netbsd.tmpl \ rc.papd.netbsd.tmpl \ rc.timelord.netbsd.tmpl \ rc.atalk.sysv.tmpl \ rc.atalk.gentoo.tmpl \ rc.atalk.debian.tmpl \ service.atalk.systemd.tmpl CLEANFILES = $(GENERATED_FILES) $(sysv_SCRIPTS) $(service_DATA) afpd atalkd cnid_metad papd timelord EXTRA_DIST = $(TEMPLATES) # overwrite automake uninstall # not beautiful, but this way we can call the OS specific init script # tools, like chkconfig, insserv or rc-update uninstall: uninstall-startup # # checking for "redhat" style sysv scripts: # if USE_REDHAT_SYSV sysvdir = /etc/rc.d/init.d sysv_SCRIPTS = netatalk $(sysv_SCRIPTS): rc.atalk.redhat-sysv cp -f rc.atalk.redhat-sysv $(sysv_SCRIPTS) chmod a+x $(sysv_SCRIPTS) install-data-hook: -chkconfig --add $(sysv_SCRIPTS) uninstall-startup: -chkconfig --del $(sysv_SCRIPTS) rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) endif # # checking for general systemd scripts: # if USE_SYSTEMD sysvdir = $(pkglibexecdir) sysv_SCRIPTS = netatalk.sh servicedir = /lib/systemd/system service_DATA = netatalk.service $(sysv_SCRIPTS): rc.atalk.systemd cp -f rc.atalk.systemd $(sysv_SCRIPTS) chmod a+x $(sysv_SCRIPTS) $(service_DATA): service.atalk.systemd cp -f service.atalk.systemd $(service_DATA) install-data-hook: -systemctl daemon-reload uninstall-startup: -systemctl disable $(service_DATA) rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) \ $(DESTDIR)$(servicedir)/$(service_DATA) -systemctl daemon-reload endif # # checking for "SuSE" style sysv scripts: # if USE_SUSE_SYSV sysvdir = /etc/init.d sysv_SCRIPTS = netatalk $(sysv_SCRIPTS): rc.atalk.suse-sysv cp -f rc.atalk.suse-sysv $(sysv_SCRIPTS) chmod a+x $(sysv_SCRIPTS) install-data-hook: -insserv $(sysv_SCRIPTS) uninstall-startup: -insserv -d $(sysv_SCRIPTS) rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) endif # # checking for "tru64" style sysv scripts: # if USE_TRU64 sysvdir = /etc/init.d sysv_SCRIPTS = netatalk $(sysv_SCRIPTS): rc.atalk.tru64 cp -f rc.atalk.tru64 $(sysv_SCRIPTS) chmod a+x $(sysv_SCRIPTS) install-data-hook: uninstall-hook: uninstall-startup: uninstall-am endif # # checking for NetBSD init scripts # if USE_NETBSD sysvdir = /etc/rc.d sysv_SCRIPTS = afpd atalkd cnid_metad papd timelord afpd: rc.afpd.netbsd cp -f $< $@ chmod a+x $@ atalkd: rc.atalkd.netbsd cp -f $< $@ chmod a+x $@ cnid_metad: rc.cnid_metad.netbsd cp -f $< $@ chmod a+x $@ papd: rc.papd.netbsd cp -f $< $@ chmod a+x $@ timelord: rc.timelord.netbsd cp -f $< $@ chmod a+x $@ install-data-hook: uninstall-hook: uninstall-startup: uninstall-am endif # # checking for Solaris init scripts # if USE_SOLARIS sysvdir = /etc/init.d sysv_SCRIPTS = netatalk $(sysv_SCRIPTS): rc.atalk.sysv cp -f rc.atalk.sysv $@ chmod a+x $@ install-data-hook: rm -f $(DESTDIR)/etc/rc2.d/S90$(sysv_SCRIPTS) -ln -s ../init.d/$(sysv_SCRIPTS) $(DESTDIR)/etc/rc2.d/S90$(sysv_SCRIPTS) rm -f $(DESTDIR)/etc/rc0.d/K04$(sysv_SCRIPTS) -ln -s ../init.d/$(sysv_SCRIPTS) $(DESTDIR)/etc/rc0.d/K04$(sysv_SCRIPTS) uninstall-startup: rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) \ $(DESTDIR)/etc/rc2.d/S90$(sysv_SCRIPTS) \ $(DESTDIR)/etc/rc0.d/K04$(sysv_SCRIPTS) endif # # checking for "Gentoo" style sysv scripts: # if USE_GENTOO sysvdir = /etc/init.d sysv_SCRIPTS = netatalk $(sysv_SCRIPTS): rc.atalk.gentoo cp -f rc.atalk.gentoo $(sysv_SCRIPTS) chmod a+x $(sysv_SCRIPTS) install-data-hook: # -rc-update add $(sysv_SCRIPTS) default uninstall-startup: # -rc-update del $(sysv_SCRIPTS) default # rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) endif # # checking for "Debian" style sysv scripts: # if USE_DEBIAN sysvdir = /etc/init.d sysv_SCRIPTS = netatalk $(sysv_SCRIPTS): rc.atalk.debian cp -f rc.atalk.debian $(sysv_SCRIPTS) chmod a+x $(sysv_SCRIPTS) install-data-hook: # update-rc.d $(sysv_SCRIPTS) defaults 90 10 uninstall-startup: # rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) # update-rc.d netatalk remove endif # # defaults, no init scripts installed # if USE_UNDEF install-data-hook: uninstall-hook: uninstall-startup: uninstall-am endif netatalk-2.2.2/distrib/initscripts/Makefile.in0000644000175200017500000004757011703521725016343 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = distrib/initscripts DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(sysvdir)" "$(DESTDIR)$(servicedir)" sysvSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(sysv_SCRIPTS) SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; serviceDATA_INSTALL = $(INSTALL_DATA) DATA = $(service_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUFFIXES = .tmpl . pkgconfdir = @PKGCONFDIR@ GENERATED_FILES = \ rc.afpd.netbsd \ rc.atalk.redhat-sysv \ rc.atalk.systemd \ rc.atalk.tru64 \ rc.atalk.bsd \ rc.atalkd.netbsd \ rc.atalk.suse-sysv \ rc.cnid_metad.netbsd \ rc.papd.netbsd \ rc.timelord.netbsd \ rc.atalk.sysv \ rc.atalk.gentoo \ rc.atalk.debian \ service.atalk.systemd TEMPLATES = \ rc.afpd.netbsd.tmpl \ rc.atalk.redhat-sysv.tmpl \ rc.atalk.systemd.tmpl \ rc.atalk.tru64.tmpl \ rc.atalk.bsd.tmpl \ rc.atalkd.netbsd.tmpl \ rc.atalk.suse-sysv.tmpl \ rc.cnid_metad.netbsd.tmpl \ rc.papd.netbsd.tmpl \ rc.timelord.netbsd.tmpl \ rc.atalk.sysv.tmpl \ rc.atalk.gentoo.tmpl \ rc.atalk.debian.tmpl \ service.atalk.systemd.tmpl CLEANFILES = $(GENERATED_FILES) $(sysv_SCRIPTS) $(service_DATA) afpd atalkd cnid_metad papd timelord EXTRA_DIST = $(TEMPLATES) # -rc-update del $(sysv_SCRIPTS) default # rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) # # checking for "Debian" style sysv scripts: # @USE_DEBIAN_TRUE@sysvdir = /etc/init.d # # checking for "Gentoo" style sysv scripts: # @USE_GENTOO_TRUE@sysvdir = /etc/init.d # # checking for NetBSD init scripts # @USE_NETBSD_TRUE@sysvdir = /etc/rc.d # # checking for "redhat" style sysv scripts: # @USE_REDHAT_SYSV_TRUE@sysvdir = /etc/rc.d/init.d # # checking for Solaris init scripts # @USE_SOLARIS_TRUE@sysvdir = /etc/init.d # # checking for "SuSE" style sysv scripts: # @USE_SUSE_SYSV_TRUE@sysvdir = /etc/init.d # # checking for general systemd scripts: # @USE_SYSTEMD_TRUE@sysvdir = $(pkglibexecdir) # # checking for "tru64" style sysv scripts: # @USE_TRU64_TRUE@sysvdir = /etc/init.d @USE_DEBIAN_TRUE@sysv_SCRIPTS = netatalk @USE_GENTOO_TRUE@sysv_SCRIPTS = netatalk @USE_NETBSD_TRUE@sysv_SCRIPTS = afpd atalkd cnid_metad papd timelord @USE_REDHAT_SYSV_TRUE@sysv_SCRIPTS = netatalk @USE_SOLARIS_TRUE@sysv_SCRIPTS = netatalk @USE_SUSE_SYSV_TRUE@sysv_SCRIPTS = netatalk @USE_SYSTEMD_TRUE@sysv_SCRIPTS = netatalk.sh @USE_TRU64_TRUE@sysv_SCRIPTS = netatalk @USE_SYSTEMD_TRUE@servicedir = /lib/systemd/system @USE_SYSTEMD_TRUE@service_DATA = netatalk.service all: all-am .SUFFIXES: .SUFFIXES: .tmpl . $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign distrib/initscripts/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign distrib/initscripts/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-sysvSCRIPTS: $(sysv_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(sysvdir)" || $(MKDIR_P) "$(DESTDIR)$(sysvdir)" @list='$(sysv_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(sysvSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(sysvdir)/$$f'"; \ $(sysvSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(sysvdir)/$$f"; \ else :; fi; \ done uninstall-sysvSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(sysv_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(sysvdir)/$$f'"; \ rm -f "$(DESTDIR)$(sysvdir)/$$f"; \ done mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-serviceDATA: $(service_DATA) @$(NORMAL_INSTALL) test -z "$(servicedir)" || $(MKDIR_P) "$(DESTDIR)$(servicedir)" @list='$(service_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(serviceDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(servicedir)/$$f'"; \ $(serviceDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(servicedir)/$$f"; \ done uninstall-serviceDATA: @$(NORMAL_UNINSTALL) @list='$(service_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(servicedir)/$$f'"; \ rm -f "$(DESTDIR)$(servicedir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(sysvdir)" "$(DESTDIR)$(servicedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @USE_DEBIAN_FALSE@@USE_GENTOO_FALSE@@USE_NETBSD_FALSE@@USE_REDHAT_SYSV_FALSE@@USE_SOLARIS_FALSE@@USE_SUSE_SYSV_FALSE@@USE_SYSTEMD_FALSE@@USE_TRU64_FALSE@@USE_UNDEF_FALSE@install-data-hook: @USE_NETBSD_FALSE@@USE_TRU64_FALSE@@USE_UNDEF_FALSE@uninstall-hook: clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-serviceDATA install-sysvSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-serviceDATA uninstall-sysvSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-data-am install-strip uninstall-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-hook install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-serviceDATA install-strip install-sysvSCRIPTS \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-hook uninstall-serviceDATA uninstall-sysvSCRIPTS # # Template Generation # .tmpl: sed -e s@:BINDIR:@${bindir}@ \ -e s@:SBINDIR:@${sbindir}@ \ -e s@:ETCDIR:@${pkgconfdir}@ \ -e s@:PKGLIBEXECDIR:@${pkglibexecdir}@ \ -e s@:NETATALK_VERSION:@${NETATALK_VERSION}@ \ <$< >$@ # overwrite automake uninstall # not beautiful, but this way we can call the OS specific init script # tools, like chkconfig, insserv or rc-update uninstall: uninstall-startup @USE_REDHAT_SYSV_TRUE@$(sysv_SCRIPTS): rc.atalk.redhat-sysv @USE_REDHAT_SYSV_TRUE@ cp -f rc.atalk.redhat-sysv $(sysv_SCRIPTS) @USE_REDHAT_SYSV_TRUE@ chmod a+x $(sysv_SCRIPTS) @USE_REDHAT_SYSV_TRUE@install-data-hook: @USE_REDHAT_SYSV_TRUE@ -chkconfig --add $(sysv_SCRIPTS) @USE_REDHAT_SYSV_TRUE@uninstall-startup: @USE_REDHAT_SYSV_TRUE@ -chkconfig --del $(sysv_SCRIPTS) @USE_REDHAT_SYSV_TRUE@ rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) @USE_SYSTEMD_TRUE@$(sysv_SCRIPTS): rc.atalk.systemd @USE_SYSTEMD_TRUE@ cp -f rc.atalk.systemd $(sysv_SCRIPTS) @USE_SYSTEMD_TRUE@ chmod a+x $(sysv_SCRIPTS) @USE_SYSTEMD_TRUE@$(service_DATA): service.atalk.systemd @USE_SYSTEMD_TRUE@ cp -f service.atalk.systemd $(service_DATA) @USE_SYSTEMD_TRUE@install-data-hook: @USE_SYSTEMD_TRUE@ -systemctl daemon-reload @USE_SYSTEMD_TRUE@uninstall-startup: @USE_SYSTEMD_TRUE@ -systemctl disable $(service_DATA) @USE_SYSTEMD_TRUE@ rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) \ @USE_SYSTEMD_TRUE@ $(DESTDIR)$(servicedir)/$(service_DATA) @USE_SYSTEMD_TRUE@ -systemctl daemon-reload @USE_SUSE_SYSV_TRUE@$(sysv_SCRIPTS): rc.atalk.suse-sysv @USE_SUSE_SYSV_TRUE@ cp -f rc.atalk.suse-sysv $(sysv_SCRIPTS) @USE_SUSE_SYSV_TRUE@ chmod a+x $(sysv_SCRIPTS) @USE_SUSE_SYSV_TRUE@install-data-hook: @USE_SUSE_SYSV_TRUE@ -insserv $(sysv_SCRIPTS) @USE_SUSE_SYSV_TRUE@uninstall-startup: @USE_SUSE_SYSV_TRUE@ -insserv -d $(sysv_SCRIPTS) @USE_SUSE_SYSV_TRUE@ rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) @USE_TRU64_TRUE@$(sysv_SCRIPTS): rc.atalk.tru64 @USE_TRU64_TRUE@ cp -f rc.atalk.tru64 $(sysv_SCRIPTS) @USE_TRU64_TRUE@ chmod a+x $(sysv_SCRIPTS) @USE_TRU64_TRUE@install-data-hook: @USE_TRU64_TRUE@uninstall-hook: @USE_TRU64_TRUE@uninstall-startup: uninstall-am @USE_NETBSD_TRUE@afpd: rc.afpd.netbsd @USE_NETBSD_TRUE@ cp -f $< $@ @USE_NETBSD_TRUE@ chmod a+x $@ @USE_NETBSD_TRUE@atalkd: rc.atalkd.netbsd @USE_NETBSD_TRUE@ cp -f $< $@ @USE_NETBSD_TRUE@ chmod a+x $@ @USE_NETBSD_TRUE@cnid_metad: rc.cnid_metad.netbsd @USE_NETBSD_TRUE@ cp -f $< $@ @USE_NETBSD_TRUE@ chmod a+x $@ @USE_NETBSD_TRUE@papd: rc.papd.netbsd @USE_NETBSD_TRUE@ cp -f $< $@ @USE_NETBSD_TRUE@ chmod a+x $@ @USE_NETBSD_TRUE@timelord: rc.timelord.netbsd @USE_NETBSD_TRUE@ cp -f $< $@ @USE_NETBSD_TRUE@ chmod a+x $@ @USE_NETBSD_TRUE@install-data-hook: @USE_NETBSD_TRUE@uninstall-hook: @USE_NETBSD_TRUE@uninstall-startup: uninstall-am @USE_SOLARIS_TRUE@$(sysv_SCRIPTS): rc.atalk.sysv @USE_SOLARIS_TRUE@ cp -f rc.atalk.sysv $@ @USE_SOLARIS_TRUE@ chmod a+x $@ @USE_SOLARIS_TRUE@install-data-hook: @USE_SOLARIS_TRUE@ rm -f $(DESTDIR)/etc/rc2.d/S90$(sysv_SCRIPTS) @USE_SOLARIS_TRUE@ -ln -s ../init.d/$(sysv_SCRIPTS) $(DESTDIR)/etc/rc2.d/S90$(sysv_SCRIPTS) @USE_SOLARIS_TRUE@ rm -f $(DESTDIR)/etc/rc0.d/K04$(sysv_SCRIPTS) @USE_SOLARIS_TRUE@ -ln -s ../init.d/$(sysv_SCRIPTS) $(DESTDIR)/etc/rc0.d/K04$(sysv_SCRIPTS) @USE_SOLARIS_TRUE@uninstall-startup: @USE_SOLARIS_TRUE@ rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) \ @USE_SOLARIS_TRUE@ $(DESTDIR)/etc/rc2.d/S90$(sysv_SCRIPTS) \ @USE_SOLARIS_TRUE@ $(DESTDIR)/etc/rc0.d/K04$(sysv_SCRIPTS) @USE_GENTOO_TRUE@$(sysv_SCRIPTS): rc.atalk.gentoo @USE_GENTOO_TRUE@ cp -f rc.atalk.gentoo $(sysv_SCRIPTS) @USE_GENTOO_TRUE@ chmod a+x $(sysv_SCRIPTS) @USE_GENTOO_TRUE@install-data-hook: # -rc-update add $(sysv_SCRIPTS) default @USE_GENTOO_TRUE@uninstall-startup: @USE_DEBIAN_TRUE@$(sysv_SCRIPTS): rc.atalk.debian @USE_DEBIAN_TRUE@ cp -f rc.atalk.debian $(sysv_SCRIPTS) @USE_DEBIAN_TRUE@ chmod a+x $(sysv_SCRIPTS) @USE_DEBIAN_TRUE@install-data-hook: # update-rc.d $(sysv_SCRIPTS) defaults 90 10 @USE_DEBIAN_TRUE@uninstall-startup: # rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) # update-rc.d netatalk remove # # defaults, no init scripts installed # @USE_UNDEF_TRUE@install-data-hook: @USE_UNDEF_TRUE@uninstall-hook: @USE_UNDEF_TRUE@uninstall-startup: uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/distrib/initscripts/rc.cnid_metad.netbsd.tmpl0000644000175200017500000000053711655731244021141 00000000000000#!/bin/sh # # PROVIDE: cnid_metad # # Start cnid_dbd daemons on request. (netatalk :NETATALK_VERSION:) # The cnid_dbd is an implementation for accessing to CNID databases # through a dedicated daemon process. # . /etc/rc.subr name="cnid_metad" rcvar=$name command=":SBINDIR:/cnid_metad" etcdir=":ETCDIR:" load_rc_config $name run_rc_command "$1" netatalk-2.2.2/distrib/initscripts/service.atalk.systemd.tmpl0000644000175200017500000000100111674111343021367 00000000000000# This file is part of netatalk :NETATALK_VERSION:. # The method of using shell-script "netatalk.sh" is not suitable. # The future service files are due to start daemons directly. # See netatalk-xxx/distrib/systemd/ directory in tarball. [Unit] Description=File and Printer sharing for Macintosh clients After=syslog.target network.target slpd.service avahi-daemon.service [Service] Type=oneshot ExecStart=/bin/sh -c "exec :PKGLIBEXECDIR:/netatalk.sh" RemainAfterExit=yes [Install] WantedBy=multi-user.target netatalk-2.2.2/distrib/initscripts/rc.atalk.systemd.tmpl0000644000175200017500000000411011665651044020346 00000000000000#!/bin/sh # Netatalk :NETATALK_VERSION: startup script for systemd. # The method of using this script is not suitable. # This script will be deleted in the future. ATALK_BIN=:BINDIR: ATALK_CONF_DIR=:ETCDIR: ATALK_SBIN=:SBINDIR: # default ATALK_NAME=`echo ${HOSTNAME}|cut -d. -f1` ATALK_UNIX_CHARSET='LOCALE' ATALK_MAC_CHARSET='MAC_ROMAN' CNID_METAD_RUN=yes AFPD_RUN=yes AFPD_MAX_CLIENTS=20 AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so" AFPD_GUEST=nobody CNID_CONFIG="-l log_note" ATALKD_RUN=no PAPD_RUN=no TIMELORD_RUN=no A2BOOT_RUN=no ATALK_ZONE= ATALK_BGROUND=no # read in netatalk configuration if [ -f ${ATALK_CONF_DIR}/netatalk.conf ]; then . ${ATALK_CONF_DIR}/netatalk.conf fi netatalk_startup() { if [ x"${ATALKD_RUN}" != x"no" -a -x ${ATALK_SBIN}/atalkd ]; then ${ATALK_SBIN}/atalkd if [ -x ${ATALK_BIN}/nbprgstr ]; then ${ATALK_BIN}/nbprgstr -p 4 ${ATALK_NAME}:Workstation${ATALK_ZONE} ${ATALK_BIN}/nbprgstr -p 4 ${ATALK_NAME}:netatalk${ATALK_ZONE} fi if [ x"${PAPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/papd ]; then ${ATALK_SBIN}/papd fi # check for timelord in bin directory if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_BIN}/timelord ]; then ${ATALK_BIN}/timelord fi # check for timelord in sbin directory if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/timelord ]; then ${ATALK_SBIN}/timelord fi # check for a2boot in bin directory if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_BIN}/a2boot ]; then ${ATALK_BIN}/a2boot fi # check for a2boot in sbin directory if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_SBIN}/a2boot ]; then ${ATALK_SBIN}/a2boot fi fi if [ x"${CNID_METAD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/cnid_metad ]; then ${ATALK_SBIN}/cnid_metad $CNID_CONFIG fi if [ x"${AFPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/afpd ]; then ${ATALK_SBIN}/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \ -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE} fi } if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then netatalk_startup >& /dev/null & else netatalk_startup fi netatalk-2.2.2/distrib/initscripts/rc.atalk.suse-sysv.tmpl0000755000175200017500000000772011700340470020640 00000000000000#! /bin/sh # Copyright (c) 1996-2001 SuSE GmbH Nuernberg, Germany. All rights reserved. # # Author: # Reinhold Sojer, # Olaf Hering, # ### BEGIN INIT INFO # Provides: netatalk # Required-Start: $local_fs # Required-Stop: $local_fs # Should-Start: $network $named $remote_fs $syslog slpd avahi-daemon # Should-Stop: $remote_fs $network $syslog # Default-Start: 3 5 # Default-Stop: # Description: AFP over TCP and legacy AppleTalk daemons ### END INIT INFO # Netatalk :NETATALK_VERSION: ATALK_NAME=`hostname|sed 's/\..*$//'` ATALK_UNIX_CHARSET='LOCALE' ATALK_MAC_CHARSET='MAC_ROMAN' CNID_METAD_RUN=yes AFPD_RUN=yes AFPD_MAX_CLIENTS=20 AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so" AFPD_GUEST=nobody CNID_CONFIG="-l log_note" ATALKD_RUN=no PAPD_RUN=no TIMELORD_RUN=no #A2BOOT_RUN=no ATALK_ZONE= ATALK_BGROUND=no . /etc/rc.status . :ETCDIR:/netatalk.conf # startup code for everything atalk_startup() { if [ x"${ATALKD_RUN}" != x"no" ]; then echo -n " Starting atalkd ... " :SBINDIR:/atalkd ; my_ec=$? if [ -x :BINDIR:/nbprgstr -a "$my_ec" = "0" ]; then echo -n ".. " :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:Workstation echo -n ". " :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:netatalk fi if [ "$my_ec" != "0" ] ; then false ; fi rc_status -v rc_reset if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ]; then echo -n " Starting papd" :SBINDIR:/papd rc_status -v fi rc_reset if [ x"${TIMELORD_RUN}" = x"yes" -a -x :SBINDIR:/timelord ]; then echo -n " Starting timelord" :SBINDIR:/timelord rc_status -v fi rc_reset fi if [ x"${CNID_METAD_RUN}" = x"yes" -a -x :SBINDIR:/cnid_metad ] ; then echo -n " Starting cnid_metad " startproc :SBINDIR:/cnid_metad ${CNID_CONFIG} rc_status -v fi if [ x"${AFPD_RUN}" = x"yes" -a -x :SBINDIR:/afpd ] ; then echo -n " Starting afpd (" echo -n ${AFPD_UAMLIST} -g ${AFPD_GUEST} \ -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE} echo -n ")" startproc :SBINDIR:/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \ ${AFPD_OPTIONS} \ -c ${AFPD_MAX_CLIENTS} -n "${ATALK_NAME}${ATALK_ZONE}" rc_status -v fi touch /var/lock/subsys/atalk } case "$1" in start) if test ! -z "$UID" -a "$UID" != 0 ; then echo "you have to be root to start netatalk daemons" rc_failed else if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then echo -n "Starting netatalk in the background ..." atalk_startup >& /dev/null & rc_status -v else echo "Starting netatalk (this may take a while) ..." atalk_startup fi fi ;; stop) echo -n "Shutting down netatalk" if test -x :SBINDIR:/papd ; then killproc -TERM :SBINDIR:/papd fi if test -x :SBINDIR:/timelord ; then killproc -TERM :SBINDIR:/timelord fi if test -x :SBINDIR:/atalkd ; then killproc -TERM :SBINDIR:/atalkd fi killproc -TERM :SBINDIR:/cnid_metad killproc -TERM :SBINDIR:/afpd rc_status -v ;; restart|reload|force-reload) $0 stop $0 start rc_status ;; status) echo "Checking for netatalk services" if [ x"${ATALKD_RUN}" = x"yes" -a -x :SBINDIR:/atalkd ] ; then checkproc :SBINDIR:/atalkd && echo -n "atalkd: OK " || echo -n "atalkd: No process " fi if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ] ; then checkproc :SBINDIR:/papd && echo -n "papd: OK " || echo -n "papd: No process " fi if [ x"${TIMELORD_RUN}" = x"yes" -a -x :SBINDIR:/timelord ] ; then checkproc :SBINDIR:/timelord && echo -n " timelord: OK " || echo -n " timelord: No process " fi if [ x"${CNID_METAD_RUN}" = x"yes" ] ; then checkproc :SBINDIR:/cnid_metad && echo -n " cnid_metad: OK " || echo -n " cnid_metad: No process " fi checkproc :SBINDIR:/afpd && echo "afpd: OK" || echo "afpd: No process" # assume that afpd is the "main" process ... checkproc :SBINDIR:/afpd rc_status -v ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac rc_exit netatalk-2.2.2/distrib/initscripts/rc.atalk.sysv.tmpl0000755000175200017500000000527511655731244017702 00000000000000#! /bin/sh # # Start/stop the Netatalk :NETATALK_VERSION: daemons. # # If you use AppleTalk, Make sure not to start atalkd in the background: # its data structures must have time to stablize before running the # other processes. # # # kill the named process(es) # killproc() { pid=`/usr/bin/ps -e | /usr/bin/grep $1 | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'` [ "$pid" != "" ] && kill $pid } # default ATALK_NAME=`hostname|cut -d. -f1` ATALK_UNIX_CHARSET='LOCALE' ATALK_MAC_CHARSET='MAC_ROMAN' CNID_METAD_RUN=yes AFPD_RUN=yes AFPD_MAX_CLIENTS=20 AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so" AFPD_GUEST=nobody CNID_CONFIG="-l log_note" ATALKD_RUN=no PAPD_RUN=no TIMELORD_RUN=no #A2BOOT_RUN=no ATALK_ZONE= ATALK_BGROUND=no # old netatalk.conf expected hostname in $HOSTNAME by default HOSTNAME=`hostname` . :ETCDIR:/netatalk.conf # # Start the netatalk server processes. # atalk_startup() { echo 'starting netatalk daemons: \c' if [ x"${ATALKD_RUN}" != x"no" ]; then if [ -x :SBINDIR:/atalkd ]; then :SBINDIR:/atalkd; echo ' atalkd\c' fi if [ -x :BINDIR:/nbprgstr ]; then :BINDIR:/nbprgstr -p 4 "${ATALK_NAME}:Workstation${ATALK_ZONE}"; :BINDIR:/nbprgstr -p 4 "${ATALK_NAME}:netatalk${ATALK_ZONE}"; echo ' nbprgstr\c' fi if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ]; then :SBINDIR:/papd; echo ' papd\c' fi if [ x"${TIMELORD_RUN}" = x"yes" -a -x :SBINDIR:/timelord ]; then :SBINDIR:/timelord; echo ' timelord\c' fi fi if [ x"${CNID_METAD_RUN}" = x"yes" -a -x :SBINDIR:/cnid_metad ]; then :SBINDIR:/cnid_metad $CNID_CONFIG echo ' cnid_metad\c' fi if [ x"${AFPD_RUN}" = x"yes" -a -x :SBINDIR:/afpd ]; then :SBINDIR:/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \ -c ${AFPD_MAX_CLIENTS} -n "${ATALK_NAME}${ATALK_ZONE}"; echo ' afpd\c' fi echo '.' } case "$1" in 'start') if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then echo "Starting netatalk in the background ... " atalk_startup > /dev/null & else atalk_startup fi ;; # # Stop the netatalk server processes. # 'stop') echo 'stopping netatalk daemons:\c' if [ -x :SBINDIR:/papd ]; then killproc papd; echo ' papd\c' fi if [ -x :SBINDIR:/afpd ]; then killproc afpd; echo ' afpd\c' fi if [ -x :SBINDIR:/cnid_metad ]; then killproc cnid_met; echo ' cnid_metad\c' fi if [ -x :SBINDIR:/timelord ]; then killproc timelord; echo ' timelord\c' fi # kill atalkd last, since without it the plumbing goes away. if [ -x :SBINDIR:/atalkd ]; then killproc atalkd; echo ' atalkd\c' fi echo '.' ;; # # Usage statement. # *) echo "usage: $0 {start|stop}" exit 1 ;; esac netatalk-2.2.2/distrib/initscripts/rc.atalk.tru64.tmpl0000755000175200017500000000427011655731244017654 00000000000000#! /bin/sh # # Start/stop the Netatalk :NETATALK_VERSION: daemons. # # If you use AppleTalk, Make sure not to start atalkd in the background: # its data structures must have time to stablize before running the # other processes. # ATALK_BIN=:BINDIR: ATALK_CONF_DIR=:ETCDIR: ATALK_SBIN=:SBINDIR: ATALK_START_ATALKD=0 ATALK_START_NBPRGSTR=0 ATALK_START_PAPD=0 ATALK_START_CNID_METAD=1 ATALK_START_AFPD=1 ATALK_START_TIMELORD=0 # # kill the named process(es) # killproc() { pid=`/usr/bin/ps -e | /usr/bin/grep $1 | /usr/bin/grep -v grep | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'` [ "$pid" != "" ] && kill $pid } case "$1" in # # Start the netatalk server processes. # 'start') echo 'starting netatalk daemons: \c' if [ ${ATALK_START_ATALKD} -eq 1 -a -x ${ATALK_SBIN}/atalkd ]; then ${ATALK_SBIN}/atalkd; echo ' atalkd\c' fi if [ ${ATALK_START_NBPRGSTR} -eq 1 -a -x ${ATALK_BIN}/nbprgstr ]; then ${ATALK_BIN}/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:Workstation ${ATALK_BIN}/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:netatalk echo ' nbprgstr\c' fi if [ ${ATALK_START_PAPD} -eq 1 -a -x ${ATALK_SBIN}/papd ]; then ${ATALK_SBIN}/papd; echo ' papd\c' fi if [ ${ATALK_START_CNID_METAD} -eq 1 -a -x ${ATALK_SBIN}/cnid_metad ]; then ${ATALK_SBIN}/cnid_metad; echo ' cnid_metad\c' fi if [ ${ATALK_START_AFPD} -eq 1 -a -x ${ATALK_SBIN}/afpd ]; then ${ATALK_SBIN}/afpd; echo ' afpd\c' fi if [ ${ATALK_START_TIMELORD} -eq 1 -a -x ${ATALK_SBIN}/timelord ]; then ${ATALK_SBIN}/timelord; echo ' timelord\c' fi echo '.' ;; # # Stop the netatalk server processes. # 'stop') echo 'stopping netatalk daemons:\c' if [ -x ${ATALK_SBIN}/papd ]; then killproc papd; echo ' papd\c' fi if [ -x ${ATALK_SBIN}/afpd ]; then killproc afpd; echo ' afpd\c' fi if [ -x ${ATALK_SBIN}/cnid_metad ]; then killproc cnid_metad; echo ' cnid_metad\c' fi if [ -x ${ATALK_SBIN}/timelord ]; then killproc timelord; echo ' timelord\c' fi # kill atalkd last, since without it the plumbing goes away. if [ -x ${ATALK_SBIN}/atalkd ]; then killproc atalkd; echo ' atalkd\c' fi echo '.' ;; # # Usage statement. # *) echo "usage: $0 {start|stop}" exit 1 ;; esac netatalk-2.2.2/distrib/initscripts/rc.timelord.netbsd.tmpl0000644000175200017500000000062211655731244020664 00000000000000#!/bin/sh # # PROVIDE: timelord # REQUIRE: atalkd # # AppleTalk time server daemon. (netatalk :NETATALK_VERSION:) # Make sure not to start atalkd in the background: # its data structures must have time to stablize before running the # other processes. # . /etc/rc.subr name="timelord" rcvar=$name command=":SBINDIR:/timelord" pidfile="/var/run/${name}.pid" load_rc_config $name run_rc_command "$1" netatalk-2.2.2/distrib/initscripts/rc.atalkd.netbsd.tmpl0000644000175200017500000000150111655731244020302 00000000000000#!/bin/sh # # PROVIDE: atalkd # REQUIRE: DAEMON # # AppleTalk daemon. (netatalk :NETATALK_VERSION:) # If you use AppleTalk, Make sure not to start atalkd in the background: # its data structures must have time to stablize before running the # other processes. # . /etc/rc.subr name="atalkd" rcvar=$name command=":SBINDIR:/atalkd" pidfile="/var/run/${name}.pid" register=":BINDIR:/nbprgstr" myhostname=`hostname|sed 's/\..*$//'` required_files=":ETCDIR:/atalkd.conf $register" start_cmd="atalkd_start" atalkd_start() { if [ -x $command ]; then echo 'Starting atalkd.' $command $command_args fi if [ -x $register ]; then echo 'Setting AppleTalk info with nbprgstr.' $register -p 4 $myhostname:Workstation $register -p 4 $myhostname:netatalk fi } load_rc_config $name run_rc_command "$1" netatalk-2.2.2/distrib/initscripts/rc.atalk.bsd.tmpl0000755000175200017500000000331211655731244017434 00000000000000#!/bin/sh # # Netatalk :NETATALK_VERSION: daemons. # If you use AppleTalk, Make sure not to start atalkd in the background: # its data structures must have time to stablize before running the # other processes. # # # SUNOS: UNCOMMENT THESE LINES TO LOAD THE KERNEL MODULE. Note that # modunload-ing netatalk may cause your machine to panic or hang. # ##echo -n 'loading netatalk: ' ##if [ -f :ETCDIR:/netatalk.o ]; then ## /usr/etc/modload -sym :ETCDIR:/netatalk.o; ##fi ATALK_NAME=`hostname|sed 's/\..*$//'` ATALK_UNIX_CHARSET='LOCALE' ATALK_MAC_CHARSET='MAC_ROMAN' CNID_METAD_RUN=yes AFPD_RUN=yes AFPD_MAX_CLIENTS=20 AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so" AFPD_GUEST=nobody CNID_CONFIG="-l log_note" ATALKD_RUN=no PAPD_RUN=no TIMELORD_RUN=no #A2BOOT_RUN=no ATALK_ZONE= #ATALK_BGROUND=no netatalk_conf=":ETCDIR:/netatalk.conf" [ -f ${netatalk_conf} ] && . ${netatalk_conf} echo -n 'starting netatalk daemons:' if [ X"${ATALKD_RUN}" != X"no" ]; then if [ -x :SBINDIR:/atalkd ]; then :SBINDIR:/atalkd; echo -n ' atalkd' fi if [ -x :BINDIR:/nbprgstr ]; then :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:Workstation :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:netatalk echo -n ' nbprgstr' fi fi if [ -x :SBINDIR:/papd -a X"${PAPD_RUN}" != X"no" ]; then :SBINDIR:/papd; echo -n ' papd' fi if [ -x :SBINDIR:/cnid_metad -a X"${CNID_METAD_RUN}" != X"no" ]; then :SBINDIR:/cnid_metad $CNID_CONFIG echo -n ' cnid_metad' fi if [ -x :SBINDIR:/afpd -a X"${AFPD_RUN}" != X"no" ]; then :SBINDIR:/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \ -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE} echo -n ' afpd' fi if [ -x :SBINDIR:/timelord -a X"${TIMELORD_RUN}" != X"no" ]; then :SBINDIR:/timelord; echo -n ' timelord' fi echo '.' netatalk-2.2.2/distrib/initscripts/rc.atalk.debian.tmpl0000644000175200017500000000671611665651044020116 00000000000000#!/bin/sh ### BEGIN INIT INFO # Provides: netatalk # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 1 ### END INIT INFO # # netatalk Netatalk :NETATALK_VERSION: initscript # Author: Thomas Kaiser set -e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="Netatalk" NAME=netatalk SCRIPTNAME=/etc/init.d/$NAME # Guard to prevent execution if netatalk was removed. test -x :SBINDIR:/afpd || exit 0 # Set defaults. Please change these options in /etc/default/netatalk ATALK_NAME=`/bin/hostname --short` ATALK_UNIX_CHARSET='LOCALE' ATALK_MAC_CHARSET='MAC_ROMAN' CNID_METAD_RUN=yes AFPD_RUN=yes AFPD_MAX_CLIENTS=50 AFPD_UAMLIST="-U uams_dhx2.so" AFPD_GUEST=nobody CNID_CONFIG="-l log_note" ATALKD_RUN=no PAPD_RUN=no TIMELORD_RUN=no #A2BOOT_RUN=no ATALK_ZONE= ATALK_BGROUND=no # old /etc/default/netatalk expected hostname in $HOSTNAME by default HOSTNAME=`/bin/hostname` # Read in netatalk configuration. if [ -f /etc/default/netatalk ]; then . /etc/default/netatalk fi # Start Netatalk servers. atalk_startup() { if [ x"$ATALKD_RUN" = x"yes" ]; then # Try to load the AppleTalk kernel module if it was intended. if grep -q '^appletalk$' /etc/modules; then /sbin/modprobe appletalk || echo "[could not load appletalk module]" fi # Start atalkd server. :SBINDIR:/atalkd # register workstation :BINDIR:/nbprgstr -p 4 "$ATALK_NAME:Workstation$ATALK_ZONE" :BINDIR:/nbprgstr -p 4 "$ATALK_NAME:netatalk$ATALK_ZONE" echo -n " atalkd" fi # prepare startup of file services if [ "x$CNID_METAD_RUN" = "xyes" -a -x :SBINDIR:/cnid_metad ] ; then echo -n " cnid_metad" :SBINDIR:/cnid_metad $CNID_CONFIG fi if [ x"$AFPD_RUN" = x"yes" ]; then :SBINDIR:/afpd $AFPD_UAMLIST -g $AFPD_GUEST -c $AFPD_MAX_CLIENTS \ -n "$ATALK_NAME$ATALK_ZONE" echo -n " afpd" fi if [ "x$ATALKD_RUN" = "xyes" ]; then if [ "x$PAPD_RUN" = "xyes" ]; then :SBINDIR:/papd echo -n " papd" fi if [ x"$TIMELORD_RUN" = x"yes" ]; then :SBINDIR:/timelord echo -n " timelord" fi fi } case "$1" in start) if [ "x$ATALK_BGROUND" = "xyes" -a "x$ATALKD_RUN" = "xyes" ]; then echo "Starting Netatalk services in the background." atalk_startup >/dev/null & else echo -n "Starting Netatalk services (this will take a while): " atalk_startup echo "." fi ;; stop) echo -n "Stopping Netatalk Daemons:" echo -n " afpd" start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/afpd echo -n " cnid_metad" start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/cnid_metad if test -x :SBINDIR:/papd; then echo -n " papd" start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/papd fi if test -x :SBINDIR:/timelord; then echo -n " timelord" start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/timelord fi if test -x :SBINDIR:/atalkd; then echo -n " atalkd" start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/atalkd fi echo "." ;; restart) $0 force-reload ;; force-reload) echo -n "Restarting Netatalk Daemons (this will take a while)" $0 stop echo -n "." sleep 2 echo -n "." if $0 start; then echo "done." fi ;; *) echo "Usage: $0 {start|stop|restart|force-reload}" >&2 exit 1 ;; esac netatalk-2.2.2/distrib/initscripts/rc.papd.netbsd.tmpl0000644000175200017500000000065411655731244017776 00000000000000#!/bin/sh # # PROVIDE: papd # REQUIRE: atalkd # # AppleTalk print server daemon. (netatalk :NETATALK_VERSION:) # Make sure not to start atalkd in the background: # its data structures must have time to stablize before running the # other processes. # . /etc/rc.subr name="papd" rcvar=$name command=":SBINDIR:/papd" pidfile="/var/run/${name}.pid" required_files=":ETCDIR:/papd.conf" load_rc_config $name run_rc_command "$1" netatalk-2.2.2/distrib/initscripts/rc.atalk.gentoo.tmpl0000644000175200017500000000547311655731244020166 00000000000000#!/sbin/runscript # Netatalk :NETATALK_VERSION: daemons. # If you use AppleTalk, Make sure not to start atalkd in the background: # its data structures must have time to stablize before running the # other processes. ATALK_NAME=`echo ${HOSTNAME}|cut -d. -f1` ATALK_UNIX_CHARSET='LOCALE' ATALK_MAC_CHARSET='MAC_ROMAN' CNID_METAD_RUN=yes AFPD_RUN=yes AFPD_MAX_CLIENTS=20 AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so" AFPD_GUEST=nobody CNID_CONFIG="-l log_note" ATALKD_RUN=no PAPD_RUN=no TIMELORD_RUN=no #A2BOOT_RUN=no ATALK_ZONE= ATALK_BGROUND=no depend() { need net use logger dns } atalk_startup () { # . :ETCDIR:/netatalk.conf if [ "${ATALKD_RUN}" != "no" ]; then ebegin "Starting atalkd" start-stop-daemon --start --quiet --exec :SBINDIR:/atalkd eend $? for reg in \ "${ATALK_NAME}:Workstation${ATALK_ZONE}" \ "${ATALK_NAME}:netatalk${ATALK_ZONE}" do ebegin " Registering $reg" :BINDIR:/nbprgstr "$reg" eend $? done if [ "${PAPD_RUN}" = "yes" ]; then ebegin " Starting papd" start-stop-daemon --start --quiet --exec :SBINDIR:/papd eend $? fi fi if [ "${CNID_METAD_RUN}" = "yes" ] ; then ebegin "Starting cnid_metad" start-stop-daemon --start --quiet --exec :SBINDIR:/cnid_metad -- \ ${CNID_CONFIG} eend $? fi if [ "${AFPD_RUN}" = "yes" ]; then ebegin "Starting afpd" start-stop-daemon --start --quiet --exec :SBINDIR:/afpd -- \ ${AFPD_UAMLIST} -g ${AFPD_GUEST} -c ${AFPD_MAX_CLIENTS} \ -n "${ATALK_NAME}${ATALK_ZONE}" eend $? fi if [ "${TIMELORD_RUN}" = "yes" ]; then ebegin "Starting timelord" start-stop-daemon --start --quiet --exec :SBINDIR:/timelord eend $? fi } start () { . :ETCDIR:/netatalk.conf if [ x"${ATALK_BGROUND}" = x"yes" -a "${ATALKD_RUN}" != "no" ]; then echo "Starting netatalk in the background ... " atalk_startup >& /dev/null & else atalk_startup fi } stop () { . :ETCDIR:/netatalk.conf if [ "${AFPD_RUN}" = "yes" ]; then ebegin "Stopping afpd" start-stop-daemon --stop --quiet --exec :SBINDIR:/afpd eend $? fi if [ "${TIMELORD_RUN}" = "yes" ]; then ebegin "Stopping timelord" start-stop-daemon --stop --quiet --exec :SBINDIR:/timelord eend $? fi if [ "${ATALKD_RUN}" != "no" ]; then if [ "${PAPD_RUN}" = "yes" ]; then ebegin "Stopping papd" start-stop-daemon --stop --quiet --exec :SBINDIR:/papd eend $? fi for reg in \ "${ATALK_NAME}:Workstation${ATALK_ZONE}" \ "${ATALK_NAME}:netatalk${ATALK_ZONE}" do ebegin "Unregistering $reg" :BINDIR:/nbpunrgstr "$reg" eend $? done ebegin "Stopping atalkd" start-stop-daemon --stop --quiet --exec :SBINDIR:/atalkd eend $? fi if [ "${CNID_METAD_RUN}" = "yes" ] ; then ebegin "Stopping cnid_metad" start-stop-daemon --stop --quiet --exec :SBINDIR:/cnid_metad eend $? fi } netatalk-2.2.2/distrib/initscripts/rc.afpd.netbsd.tmpl0000644000175200017500000000107711674111343017755 00000000000000#!/bin/sh # # PROVIDE: afpd # REQUIRE: cnid_metad # KEYWORD: shutdown # # Apple Filing Protocol daemon. (netatalk :NETATALK_VERSION:) # If you use AppleTalk, Make sure not to start atalkd in the background: # its data structures must have time to stablize before running the # other processes. # . /etc/rc.subr name="afpd" rcvar=$name command=":SBINDIR:/afpd" etcdir=":ETCDIR:" pidfile="/var/run/${name}.pid" command_args="-P ${pidfile}" required_files="$etcdir/afpd.conf $etcdir/AppleVolumes.default $etcdir/AppleVolumes.system" load_rc_config $name run_rc_command "$1" netatalk-2.2.2/distrib/initscripts/rc.atalk.redhat-sysv.tmpl0000644000175200017500000001431511655731244021137 00000000000000#! /bin/sh # chkconfig: - 91 35 # description: This package is an implementation of "AFP over TCP" # and provides printer, file sharing, and routing # services via legacy AppleTalk networking protocol. # # Netatalk :NETATALK_VERSION: daemons. # If you use AppleTalk, Make sure not to start atalkd in the background: # its data structures must have time to stablize before running the # other processes. ATALK_BIN=:BINDIR: ATALK_CONF_DIR=:ETCDIR: ATALK_SBIN=:SBINDIR: # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # default ATALK_NAME=`echo ${HOSTNAME}|cut -d. -f1` ATALK_UNIX_CHARSET='LOCALE' ATALK_MAC_CHARSET='MAC_ROMAN' CNID_METAD_RUN=yes AFPD_RUN=yes AFPD_MAX_CLIENTS=20 AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so" AFPD_GUEST=nobody CNID_CONFIG="-l log_note" ATALKD_RUN=no PAPD_RUN=no TIMELORD_RUN=no A2BOOT_RUN=no ATALK_ZONE= ATALK_BGROUND=no # read in netatalk configuration if [ -f ${ATALK_CONF_DIR}/netatalk.conf ]; then . ${ATALK_CONF_DIR}/netatalk.conf fi # initialize return values RETVAL=1 RETVAL_ATALKD=0 RETVAL_PAPD=0 RETVAL_CNID_METAD=0 RETVAL_AFPD=0 # startup code for everything atalk_startup() { # Check that networking is up. if [ ${NETWORKING} = "no" ]; then echo "[Network isn't started]"; exit 1; fi if [ ! -f ${ATALK_CONF_DIR}/netatalk.conf ]; then echo "[${ATALK_CONF_DIR}/netatalk.conf not found]"; exit 6; fi if [ x"${ATALKD_RUN}" != x"no" -a -x ${ATALK_SBIN}/atalkd ]; then # Quickly probe for appletalk and warn if we can't find it #/sbin/modprobe appletalk || echo "[could not load appletalk module]" # Check for IP Encapsulation support #/sbin/modprobe ipddp || echo "[could not load IP encapsulation]" echo -n " Starting atalkd:" daemon ${ATALK_SBIN}/atalkd RETVAL_ATALKD=$? echo if [ -x ${ATALK_BIN}/nbprgstr ]; then action " Registering ${ATALK_NAME}:Workstation${ATALK_ZONE}:" ${ATALK_BIN}/nbprgstr -p 4 \"${ATALK_NAME}:Workstation${ATALK_ZONE}\" action " Registering ${ATALK_NAME}:netatalk${ATALK_ZONE}:" ${ATALK_BIN}/nbprgstr -p 4 \"${ATALK_NAME}:netatalk${ATALK_ZONE}\" fi if [ x"${PAPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/papd ]; then echo -n " Starting papd:" daemon ${ATALK_SBIN}/papd RETVAL_PAPD=$? echo fi # check for timelord in bin directory if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_BIN}/timelord ]; then echo -n " Starting timelord" daemon ${ATALK_BIN}/timelord echo fi # check for timelord in sbin directory if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/timelord ]; then echo -n " Starting timelord" daemon ${ATALK_SBIN}/timelord echo fi # check for a2boot in bin directory if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_BIN}/a2boot ]; then echo -n " Starting a2boot" daemon ${ATALK_BIN}/a2boot echo fi # check for a2boot in sbin directory if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_SBIN}/a2boot ]; then echo -n " Starting a2boot" daemon ${ATALK_SBIN}/a2boot echo fi fi if [ x"${CNID_METAD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/cnid_metad ] ; then echo -n " Starting cnid_metad:" daemon ${ATALK_SBIN}/cnid_metad $CNID_CONFIG RETVAL_CNID_METAD=$? echo fi if [ x"${AFPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/afpd ] ; then echo -n " Starting afpd:" daemon ${ATALK_SBIN}/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \ -c ${AFPD_MAX_CLIENTS} -n \"${ATALK_NAME}${ATALK_ZONE}\" RETVAL_AFPD=$? echo fi if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_CNID_METAD -eq 0 -a $RETVAL_AFPD -eq 0 ]; then RETVAL=0 touch /var/lock/subsys/atalk || RETVAL=1 fi } case "$1" in 'start') echo -n 'Starting Netatalk services: ' if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then echo -n "(backgrounded)" atalk_startup >& /dev/null & else echo atalk_startup fi echo ;; 'stop') echo 'Shutting down Netatalk services: ' if [ x"${ATALKD_RUN}" != x"no" ]; then if [ x"${PAPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/papd ]; then echo -n " Stopping papd:" killproc papd RETVAL_PAPD=$? echo fi # checking for timelord in bin directory if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_BIN}/timelord ]; then echo -n " Stopping timelord:" killproc timelord echo fi # checking for timelord in sbin directory if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/timelord ]; then echo -n " Stopping timelord:" killproc timelord echo fi # checking for a2boot in bin directory if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_BIN}/a2boot ]; then echo -n " Stopping a2boot:" killproc a2boot echo fi # checking for a2boot in sbin directory if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_SBIN}/a2boot ]; then echo -n " Stopping a2boot:" killproc a2boot echo fi action " Unregistering ${ATALK_NAME}:Workstation${ATALK_ZONE}:" ${ATALK_BIN}/nbpunrgstr \"${ATALK_NAME}:Workstation${ATALK_ZONE}\" action " Unregistering ${ATALK_NAME}:netatalk${ATALK_ZONE}:" ${ATALK_BIN}/nbpunrgstr \"${ATALK_NAME}:netatalk${ATALK_ZONE}\" # kill atalkd last, since without it the plumbing goes away. if [ -x ${ATALK_SBIN}/atalkd ]; then echo -n " Stopping atalk:" killproc atalkd RETVAL_ATALKD=$? echo fi fi # kill this separately as we also do AFP/tcp if [ x"${AFPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/afpd ]; then echo -n " Stopping afpd:" killproc afpd RETVAL_AFPD=$? echo fi if [ x"${CNID_METAD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/cnid_metad ]; then echo -n " Stopping cnid_metad:" killproc cnid_metad RETVAL_CNID_METAD=$? echo fi if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_AFPD -eq 0 ] ; then RETVAL=0 rm -f /var/lock/subsys/atalk || RETVAL=1 fi echo "" ;; 'restart'|'reload') $0 stop $0 start RETVAL=$? ;; 'status') status atalkd status papd status timelord status a2boot status cnid_metad status afpd RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart|reload|status}" exit 2 esac exit $RETVAL netatalk-2.2.2/distrib/systemd/0000777000175200017500000000000011704770432013464 500000000000000netatalk-2.2.2/distrib/systemd/Makefile.am0000644000175200017500000000014711664405606015441 00000000000000# Makefile for distrib/systemd/ EXTRA_DIST = README netatalk-afpd.service netatalk-cnid_metad.service netatalk-2.2.2/distrib/systemd/Makefile.in0000644000175200017500000002637511703521725015460 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile for distrib/systemd/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = distrib/systemd DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = README netatalk-afpd.service netatalk-cnid_metad.service all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign distrib/systemd/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign distrib/systemd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/distrib/systemd/netatalk-afpd.service0000644000175200017500000000055611664405606017506 00000000000000# This is experimental service file. # See distrib/systemd/README [Unit] Description=Netatalk AFP fileserver for Macintosh clients After=syslog.target network.target slpd.service avahi-daemon.service netatalk-cnid_metad.service [Service] Type=forking GuessMainPID=no ExecStart=/usr/sbin/afpd -c 20 Restart=always RestartSec=1 [Install] WantedBy=multi-user.target netatalk-2.2.2/distrib/systemd/netatalk-cnid_metad.service0000644000175200017500000000046511664405606020662 00000000000000# This is experimental service file. # See distrib/systemd/README [Unit] Description=Netatalk CNID database daemon for afpd After=syslog.target network.target [Service] Type=forking GuessMainPID=no ExecStart=/usr/sbin/cnid_metad -l log_note Restart=always RestartSec=1 [Install] WantedBy=multi-user.target netatalk-2.2.2/distrib/systemd/README0000644000175200017500000000124411664405606014264 00000000000000The service file of the current Netatalk is not appropriate because it use a shell-script "netatalk.sh". Two experimental files are for future netatalk. These files start daemons directly and do not read "netatalk.conf". Therefore, you need to edit files for setting options. ATALK_NAME: set in afpd.conf instead AFPD_MAX_CLIENTS: set in netatalk-afpd.service by using -c AFPD_UAMLIST: set in afpd.conf instead AFPD_GUEST: set in afpd.conf instead CNID_CONFIG: set in netatalk-cnid_metad.service by using -l and -f options There are no service files for atalkd, papd, timelord and a2boot because AppleTalk feature is due to be abolished in the future. netatalk-2.2.2/compile0000755000175200017500000000717311661232404011630 00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2005-05-14.22 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: netatalk-2.2.2/CONTRIBUTORS0000644000175200017500000000770611655731126012144 00000000000000Lots of thanks to the following people who've made Netatalk what it is with their contributions. Cheers. Original Authors, pre-Sourceforge. Thanks a bunch folks, wherever you are. Wesley Craig Adrian Sun Steve Hirsch : ProDOS II support/initial Randnum support Robert Marinchick: initial rquota patch Frank Morton: megatron information patch Tim Carlson: Solaris testing iNOUE Koichi: RPM for RedHat systems Stefan Bethke: FreeBSD Leland Wallace Gerry Tomlinson : original afile/achfile/acleandir implementation Recent Contributors since Sourceforge Sourceforge Administration: Jeffrey Buchbinder Matthew Keller Developers: Version 1.4.99 - 2.0 Alain Richard David R Bosso Joe Clarke Jonathan Newman Lance Levsen Matthew Keller Andrew Morgan Daniel E. Lautenschleger Jeffrey Buchbinder Sam Noble Simon Bazley Sebastian Rittau Steve Freitas Uwe Hees Benjamin Heitmann Bob Rogers Burkhard Schmidt Glenn Trewitt Olaf Hering Robert Cohen Robert Stickel Sumit Bose Brandon Warren Dan Wilga Rafal Lewczuk Didier Gautheron Joerg Lenneis Bjoern Fernhomberg Webmin Module: Matthew Keller Package Maintainers and Contributors: Sebastian Rittau (Debian GNU/Linux) Jonas Smedegaard (Debian GNU systems) Joe Clarke (FreeBSD) David Rankin (NetBSD) Sourceforge Website Maintainers: Andrew Morgan Documentation: Version 1.4.99 - 2.0 Steve Freitas Karen A Swanberg Lance Levsen Andrew Morgan Jeffrey Buchbinder Gjermund G Thorsen Paul Krohn Ryan McBeth Simon Bazley Rob Lineweaver Alistair Riddell Edmund Lam Sebastian Rittau Chris Blake Thomas Kaiser Bug Reports: Version 1.4.99 - 2.0 Ryan Dooley Don Jessup Kevin M. Myer Lawrence Farr" Ralph Hackl Adrian Moir Akop Pogosian Alistair Riddell Axel Rose Benjamin Lee Brice D Ruth Carsten Rogas Daniel Resare Derrik Pates Edmund Lam Gjermund Gusland Thorsen <90167484@mobilpost.com> Ian Wehrman Magnus Stenman Mark Guertin Matthew Geier Miro Jurisic Roland Schulz Simon Roberts Steven Karel Thomas Schierle Roger And thanks to everyone on the netatalk-devel and netatalk-docs lists. If you feel you should be listed here and aren't, please let us know. Cheers! netatalk-2.2.2/AUTHORS0000644000175200017500000000660711655731126011333 00000000000000Lots of thanks to the following people who've made Netatalk what it is with their contributions. Cheers. Original Authors, pre-Sourceforge. Thanks a bunch folks, where ever you are. Wesley Craig Adrian Sun Steve Hirsch: ProDOS II support/initial Randnum support Robert Marinchick: initial rquota patch Frank Morton: megatron information patch Tim Carlson: Solaris testing iNOUE Koichi: RPM for RedHat systems Stefan Bethke: FreeBSD Leland Wallace Recent Contributors since Sourceforge Sourceforge Administration: Jeffrey Buchbinder Matthew Keller Developers: Version 1.4.99 - 1.5 Alain Richard David R Bosso Joe Clarke Jonathan Newman Lance Levsen Matthew Keller Andrew Morgan Daniel E. Lautenschleger Jeffrey Buchbinder Sam Noble Simon Bazley Sebastian Rittau Steve Freitas Uwe Hees Benjamin Heitmann Bob Rogers Burkhard Schmidt Glenn Trewitt Olaf Hering Robert Cohen Robert Stickel Sumit Webmin Module: Matthew Keller Package Maintainers: Sebastian Rittau (RPM, Debian) Joe Clarke (FreeBSD) Sourceforge Website Maintainers: Andrew Morgan Documentation: Version 1.4.99 - 1.5 Steve Freitas Karen A Swanberg Lance Levsen Andrew Morgan Jeffrey Buchbinder Gjermund G Thorsen Paul Krohn Ryan McBeth Simon Bazley Rob Lineweaver Alistair Riddell Edmund Lam Bug Reports: Version 1.4.99 - 1.5 Ryan Dooley Don Jessup Kevin M. Myer Lawrence Farr" Ralph Hackl Adrian Moir Akop Pogosian Alistair Riddell Axel Rose Benjamin Lee Brice D Ruth Carsten Rogas Daniel Resare Derrik Pates Edmund Lam Gjermund Gusland Thorsen <90167484@mobilpost.com> Ian Wehrman Magnus Stenman Mark Guertin Matthew Geier Miro Jurisic Roland Schulz Simon Roberts Steven Karel Thomas Schierle Roger And thanks to everyone on the netatalk-devel and netatalk-docs lists. If you feel you should be listed here and aren't, please let me know, Lance Levsen, l.levsen@printwest.com Cheers.netatalk-2.2.2/etc/0000777000175200017500000000000011704770430011105 500000000000000netatalk-2.2.2/etc/Makefile.am0000644000175200017500000000015011655731126013055 00000000000000# Makefile.am for etc/ SUBDIRS = afpd cnid_dbd uams if USE_APPLETALK SUBDIRS += atalkd papd psf endif netatalk-2.2.2/etc/Makefile.in0000644000175200017500000004140611703521725013073 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for etc/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @USE_APPLETALK_TRUE@am__append_1 = atalkd papd psf subdir = etc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = afpd cnid_dbd uams atalkd papd psf DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = afpd cnid_dbd uams $(am__append_1) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign etc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign etc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/etc/psf/0000777000175200017500000000000011704770430011675 500000000000000netatalk-2.2.2/etc/psf/Makefile.am0000644000175200017500000000202011655731126013643 00000000000000# Makefile.am for etc/psf/ libexec_PROGRAMS = psf psa libexec_SCRIPTS = etc2ps.sh pkgdata_DATA = pagecount.ps psf_SOURCES = psf.c psa_SOURCES = psa.c AM_CFLAGS = -DZEROWIDTH \ -D_PATH_PAP=\"$(bindir)/pap\" \ -D_PATH_PSORDER=\"$(bindir)/psorder\" \ -D_PATH_PSA=\"$(libexecdir)/psa\" \ -D_PATH_PSFILTER=\"$(libexecdir)/etc2ps.sh\" \ -D_PATH_PAGECOUNT=\"$(pkgdatadir)/pagecount.ps\" EXTRA_DIST = $(libexec_SCRIPTS) $(pkgdata_DATA) # declare links psf_LINKS = ofpap ifpap tfpap ifpaprev tfpaprev ofwpap ifwpap \ tfwpap ifwpaprev tfwpaprev ofmpap ifmpap tfmpap ifmpaprev \ tfmpaprev ofwmpap ifwmpap tfwmpap ifwmpaprev tfwmpaprev # # install sections for links # install-exec-hook: @list='$(psf_LINKS)'; for l in $$list; do \ rm $(DESTDIR)$(libexecdir)/$$l 2>/dev/null || true; \ (cd $(DESTDIR)$(libexecdir) && $(LN_S) psf $$l); \ done # # uninstall sections for links # uninstall-hook: @list='$(psf_LINKS)'; for l in $$list; do \ rm -f $(DESTDIR)$(libexecdir)/$$l; \ done # # cleanup # CLEANFILES = $(psf_LINKS) netatalk-2.2.2/etc/psf/Makefile.in0000644000175200017500000004773411703521726013676 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for etc/psf/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ libexec_PROGRAMS = psf$(EXEEXT) psa$(EXEEXT) subdir = etc/psf DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(libexecdir)" \ "$(DESTDIR)$(pkgdatadir)" libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(libexec_PROGRAMS) am_psa_OBJECTS = psa.$(OBJEXT) psa_OBJECTS = $(am_psa_OBJECTS) psa_LDADD = $(LDADD) am_psf_OBJECTS = psf.$(OBJEXT) psf_OBJECTS = $(am_psf_OBJECTS) psf_LDADD = $(LDADD) libexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(libexec_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(psa_SOURCES) $(psf_SOURCES) DIST_SOURCES = $(psa_SOURCES) $(psf_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; pkgdataDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgdata_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ libexec_SCRIPTS = etc2ps.sh pkgdata_DATA = pagecount.ps psf_SOURCES = psf.c psa_SOURCES = psa.c AM_CFLAGS = -DZEROWIDTH \ -D_PATH_PAP=\"$(bindir)/pap\" \ -D_PATH_PSORDER=\"$(bindir)/psorder\" \ -D_PATH_PSA=\"$(libexecdir)/psa\" \ -D_PATH_PSFILTER=\"$(libexecdir)/etc2ps.sh\" \ -D_PATH_PAGECOUNT=\"$(pkgdatadir)/pagecount.ps\" EXTRA_DIST = $(libexec_SCRIPTS) $(pkgdata_DATA) # declare links psf_LINKS = ofpap ifpap tfpap ifpaprev tfpaprev ofwpap ifwpap \ tfwpap ifwpaprev tfwpaprev ofmpap ifmpap tfmpap ifmpaprev \ tfmpaprev ofwmpap ifwmpap tfwmpap ifwmpaprev tfwmpaprev # # cleanup # CLEANFILES = $(psf_LINKS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign etc/psf/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign etc/psf/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libexecPROGRAMS: $(libexec_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)" @list='$(libexec_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \ else :; fi; \ done uninstall-libexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(libexec_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \ rm -f "$(DESTDIR)$(libexecdir)/$$f"; \ done clean-libexecPROGRAMS: @list='$(libexec_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done psa$(EXEEXT): $(psa_OBJECTS) $(psa_DEPENDENCIES) @rm -f psa$(EXEEXT) $(LINK) $(psa_OBJECTS) $(psa_LDADD) $(LIBS) psf$(EXEEXT): $(psf_OBJECTS) $(psf_DEPENDENCIES) @rm -f psf$(EXEEXT) $(LINK) $(psf_OBJECTS) $(psf_LDADD) $(LIBS) install-libexecSCRIPTS: $(libexec_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)" @list='$(libexec_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(libexecSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \ $(libexecSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(libexecdir)/$$f"; \ else :; fi; \ done uninstall-libexecSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(libexec_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \ rm -f "$(DESTDIR)$(libexecdir)/$$f"; \ done mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psf.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgdataDATA: $(pkgdata_DATA) @$(NORMAL_INSTALL) test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" @list='$(pkgdata_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \ $(pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \ done uninstall-pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(pkgdata_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(pkgdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-pkgdataDATA install-dvi: install-dvi-am install-exec-am: install-libexecPROGRAMS install-libexecSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libexecPROGRAMS uninstall-libexecSCRIPTS \ uninstall-pkgdataDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-exec-am install-strip uninstall-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libexecPROGRAMS clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-libexecPROGRAMS install-libexecSCRIPTS install-man \ install-pdf install-pdf-am install-pkgdataDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-hook uninstall-libexecPROGRAMS \ uninstall-libexecSCRIPTS uninstall-pkgdataDATA # # install sections for links # install-exec-hook: @list='$(psf_LINKS)'; for l in $$list; do \ rm $(DESTDIR)$(libexecdir)/$$l 2>/dev/null || true; \ (cd $(DESTDIR)$(libexecdir) && $(LN_S) psf $$l); \ done # # uninstall sections for links # uninstall-hook: @list='$(psf_LINKS)'; for l in $$list; do \ rm -f $(DESTDIR)$(libexecdir)/$$l; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/etc/psf/psf.c0000644000175200017500000004153111655731126012555 00000000000000/* * $Id: psf.c,v 1.13 2009-10-16 01:50:50 didg Exp $ * * Copyright (c) 1990,1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * * PostScript Filter, psf. * * Handles both PostScript files and text files. Files with the * '%!' PostScript header are sent directly to the printer, * unmodified. Text files are first converted to PostScript, * then sent. Printers may be directly attached or on an AppleTalk * network. Other media are possible. Currently, psf invokes * pap to send files to AppleTalk-ed printers. Replace the pap* * variables to use another program for communication. psf only * converts plain-text. If called as "tf" or "df", psf will invoke * a troff or dvi to PostScript converter. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #define FUCKED #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include /* POSIX.1 sys/wait.h check */ #include #ifdef HAVE_SYS_WAIT_H #include #endif /* HAVE_SYS_WAIT_H */ #ifndef WEXITSTATUS #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif /* ! WEXITSTATUS */ #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif /* ! WIFEXITED */ #include #include #include #include #include #include #include #include #include /* Forward Declarations */ int pexecv(char *path, char *argv[]); int copyio(); int textps(); static char psapath[] = _PATH_PSA; static char *psaargv[] = { "psa", NULL, NULL, NULL, NULL }; /* * If we're not doing accounting, we just call pap as below. * If we are doing accounting, we call pap twice. The first time, * we call it with "-E" in arg 2, pagecount.ps in arg 3, and "-" in * arg 4. The second time, we call it with "-c" in arg 2, pagecount.ps * in arg 3, and 0 in arg 4. */ static char pappath[] = _PATH_PAP; static char *papargv[] = { "pap", "-sstatus", NULL, NULL, NULL, NULL, NULL, NULL }; static char revpath[] = _PATH_PSORDER; static char *revargv[] = { "psorder", "-d", NULL }; static char *filtargv[] = { NULL, NULL, NULL }; static char inbuf[ 1024 * 8 ]; static int inlen; static int literal; static int width = 80, length = 66, indent = 0; static char *prog, *name, *host; static struct papersize { int width; int length; float win; float lin; } papersizes[] = { { 80, 66, 8.5, 11.0 }, /* US Letter */ { 80, 70, 8.27, 11.69 }, /* A4 */ }; int main( int ac, char **av) { int c, rc, children = 0; #ifdef FUCKED int psafileno = 0, multiconn = 0, waitidle = 0, waitidle2 = 0; #endif /* FUCKED */ int status; extern char *optarg; extern int optind, opterr; opterr = 0; if (( prog = rindex( av[ 0 ], '/' )) == NULL ) { prog = av[ 0 ]; } else { prog++; } #ifdef ultrix openlog( prog, LOG_PID ); #else /* ultrix */ openlog( prog, LOG_PID, LOG_LPR ); #endif /* ultrix */ while (( c = getopt( ac, av, "P:C:D:F:L:J:x:y:n:h:w:l:i:c" )) != EOF ) { switch ( c ) { case 'n' : name = optarg; break; case 'h' : host = optarg; break; case 'w' : width = atoi( optarg ); #ifdef ZEROWIDTH /* * Some version of lpd pass 0 for the page width. */ if ( width == 0 ) { width = 80; } #endif /* ZEROWIDTH */ break; case 'l' : length = atoi( optarg ); break; case 'i' : indent = atoi( optarg ); break; case 'c' : /* Print control chars */ literal++; break; case 'F' : case 'L' : case 'J' : case 'P' : case 'x' : case 'y' : break; #ifdef notdef default : syslog( LOG_ERR, "bad option: %c", c ); exit( 2 ); #endif /* notdef */ } } if ( ac - optind > 1 ) { syslog( LOG_ERR, "Too many arguments" ); exit( 2 ); } #ifdef FUCKED if ( index( prog, 'w' )) { waitidle++; } if ( index( prog, 'W' )) { waitidle2++; } if ( index( prog, 'm' )) { multiconn++; } #endif /* FUCKED */ syslog( LOG_INFO, "starting for %s", name ? name : "?" ); restart: if (( inlen = read( 0, inbuf, sizeof( inbuf ))) < 0 ) { syslog( LOG_ERR, "read: %s", strerror(errno) ); exit( 1 ); } if ( inlen == 0 ) { /* nothing to be done */ syslog( LOG_INFO, "done" ); exit( 0 ); } /* * If we've been given an accounting file, start the accounting * process. */ if ( optind < ac ) { /* build arguments */ psaargv[ 1 ] = av[ optind ]; psaargv[ 2 ] = name; psaargv[ 3 ] = host; if (( c = pexecv( psapath, psaargv )) < 0 ) { syslog( LOG_ERR, "%s: %s", psapath, strerror(errno) ); exit( 2 ); } children++; syslog( LOG_INFO, "accounting with psa[%d]", c ); } /* * Check prog's name to decide what programs to execute. */ if ( strstr( prog, "pap" ) != NULL ) { if ( optind < ac ) { /* accounting */ #ifdef FUCKED if ( multiconn ) { psafileno = getdtablesize(); psafileno--; dup2( 1, psafileno ); if ( waitidle2 ) { papargv[ 2 ] = "-W"; papargv[ 3 ] = "-c"; papargv[ 4 ] = "-E"; papargv[ 5 ] = _PATH_PAGECOUNT; papargv[ 6 ] = "-"; papargv[ 7 ] = NULL; } else if ( waitidle ) { papargv[ 2 ] = "-w"; papargv[ 3 ] = "-c"; papargv[ 4 ] = "-E"; papargv[ 5 ] = _PATH_PAGECOUNT; papargv[ 6 ] = "-"; papargv[ 7 ] = NULL; } else { papargv[ 2 ] = "-c"; papargv[ 3 ] = "-E"; papargv[ 4 ] = _PATH_PAGECOUNT; papargv[ 5 ] = "-"; papargv[ 6 ] = NULL; } } else { /* * This is how it should be done. */ papargv[ 2 ] = "-c"; papargv[ 3 ] = _PATH_PAGECOUNT; papargv[ 4 ] = "-"; papargv[ 5 ] = _PATH_PAGECOUNT; papargv[ 6 ] = NULL; } #endif /* FUCKED */ } else { papargv[ 2 ] = "-c"; papargv[ 3 ] = "-E"; papargv[ 4 ] = NULL; } if (( c = pexecv( pappath, papargv )) < 0 ) { syslog( LOG_ERR, "%s: %s", pappath, strerror(errno) ); exit( 2 ); } children++; syslog( LOG_INFO, "sending to pap[%d]", c ); } /* * Might be a good idea to have both a "forw" and a "rev", so that * reversed documents can be reordered for the printing device. */ if ( strstr( prog, "rev" ) != NULL ) { if (( c = pexecv( revpath, revargv )) < 0 ) { syslog( LOG_ERR, "%s: %s", revpath, strerror(errno) ); exit( 2 ); } syslog( LOG_INFO, "sending to rev[%d]", c ); children++; } /* * Invoke an external (script) filter to produce PostScript from * non-text input. */ if ( *prog != 'i' && *prog != 'o' && *( prog + 1 ) == 'f' ) { filtargv[ 0 ] = filtargv[ 1 ] = prog; if (( c = pexecv( _PATH_PSFILTER, filtargv )) < 0 ) { syslog( LOG_ERR, "%s: %s", _PATH_PSFILTER, strerror(errno) ); exit( 2 ); } syslog( LOG_INFO, "external filter[%d]", c ); children++; rc = copyio(); /* external filter */ } else { if ( inlen >= 2 && inbuf[ 0 ] == '%' && inbuf[ 1 ] == '!' ) { syslog( LOG_INFO, "PostScript" ); rc = copyio(); /* PostScript */ } else if ( inlen >= 2 && inbuf[ 0 ] == '\033' && inbuf[ 1 ] == '%' ) { syslog( LOG_INFO, "PostScript w/PJL" ); rc = copyio(); /* PostScript */ } else { syslog( LOG_INFO, "straight text" ); rc = textps(); /* straight text */ } } #ifdef FUCKED if ( strstr( prog, "pap" ) != NULL && optind < ac && multiconn ) { dup2( psafileno, 1 ); close( psafileno ); papargv[ 2 ] = "-c"; if ( waitidle2 ) { papargv[ 3 ] = "-W"; papargv[ 4 ] = _PATH_PAGECOUNT; papargv[ 5 ] = NULL; } else if ( waitidle ) { papargv[ 3 ] = "-w"; papargv[ 4 ] = _PATH_PAGECOUNT; papargv[ 5 ] = NULL; } else { papargv[ 3 ] = _PATH_PAGECOUNT; papargv[ 4 ] = NULL; } if (( c = pexecv( pappath, papargv )) < 0 ) { syslog( LOG_ERR, "%s: %s", pappath, strerror(errno) ); exit( 2 ); } children++; syslog( LOG_INFO, "pagecount with pap[%d]", c ); } #endif /* FUCKED */ if ( children ) { close( 1 ); } while ( children ) { if (( c = wait3( &status, 0, NULL )) < 0 ) { syslog( LOG_ERR, "wait3: %s", strerror(errno) ); exit( 1 ); } if ( WIFEXITED( status )) { #ifndef WEXITSTATUS #define WEXITSTATUS(x) ((x).w_status) #endif /* WEXITSTATUS */ if ( WEXITSTATUS( status ) != 0 ) { syslog( LOG_ERR, "%d died with %d", c, WEXITSTATUS( status )); exit( WEXITSTATUS( status )); } else { syslog( LOG_INFO, "%d done", c ); children--; } } else { syslog( LOG_ERR, "%d died badly", c ); exit( 1 ); } } if ( rc == 3 ) { syslog( LOG_INFO, "pausing" ); kill( getpid(), SIGSTOP ); syslog( LOG_INFO, "restarting" ); goto restart; } syslog( LOG_INFO, "done" ); exit( rc ); } int copyio(void) { /* implement the FSM needed to do the suspend. Note that * the last characters will be \031\001 so don't worry * Fun things: 1. \031\001 should not be written to output device * 2. The \031 can be last char of one read, \001 first of next * - we need to write \031 if not followed by \001 */ struct timeval tv; fd_set fdset; int ctl = 0; notdone: do { /* * First, \031 and \001 *must* be the last things in the buffer * (\001 can be the first thing in the next buffer). There's no * need to scan any of the intervening bytes. Second, if there's * more input, the escape sequence was bogus, and we should keep * reading. */ if ( inlen == 1 ) { if ( ctl == 1 ) { if ( inbuf[ 0 ] == '\001' ) { ctl = 2; break; } if ( write( 1, "\031", 1 ) != 1 ) { syslog( LOG_ERR, "write: %s", strerror(errno) ); return( 1 ); } ctl = 0; } if ( inbuf[ 0 ] == '\031' ) { ctl = 1; } } else { if ( ctl == 1 ) { if ( write( 1, "\031", 1 ) != 1 ) { syslog( LOG_ERR, "write: %s", strerror(errno) ); return( 1 ); } } ctl = 0; if ( inbuf[ inlen - 2 ] == '\031' && inbuf[ inlen - 1 ] == '\001' ) { ctl = 2; } else if ( inbuf[ inlen - 1 ] == '\031' ) { ctl = 1; } } inlen -= ctl; if (( inlen > 0 ) && ( write( 1, inbuf, inlen ) != inlen )) { syslog( LOG_ERR, "write: %s", strerror(errno) ); return( 1 ); } if ( ctl == 2 ) { break; } } while (( inlen = read( 0, inbuf, sizeof( inbuf ))) > 0 ); if ( ctl == 2 ) { tv.tv_sec = 2; tv.tv_usec = 0; FD_ZERO( &fdset ); FD_SET( 0, &fdset ); if ( select( 1, &fdset, NULL, NULL, &tv ) != 0 ) { if (( inlen = read( 0, inbuf, sizeof( inbuf ))) > 0 ) { goto notdone; } } } if ( inlen < 0 ) { syslog( LOG_ERR, "read: %s", strerror(errno) ); return( 1 ); } if ( ctl == 1 ) { if ( write( 1, "\031", 1 ) != 1 ) { syslog( LOG_ERR, "write: %s", strerror(errno) ); return( 1 ); } } else if ( ctl == 2 ) { return( 3 ); } return( 0 ); } static char *font = "Courier"; static int point = 11; static char pspro[] = "\ /GSV save def % global VM\n\ /SP {\n\ /SV save def % save vmstate\n\ dup /H exch def % save font height\n\ exch findfont exch scalefont setfont % select font\n\ ( ) stringwidth pop /W exch def % save font width\n\ 0.5 sub 72 mul /CY exch def % save start Y\n\ pop 0.5 add 72 mul /CX exch def % save start X\n\ CX CY moveto % make current point\n\ } bind def\n\ /S /show load def\n\ /NL { CX CY H sub dup /CY exch def moveto } bind def\n\ /CR { CX CY moveto } bind def\n\ /B { W neg 0 rmoveto}bind def\n\ /T { W mul 0 rmoveto}bind def\n\ /EP { SV restore showpage } bind def\n\ %%EndProlog\n"; int textps(void) { struct papersize papersize; int state = 0, line = 0, col = 0, npages = 0, rc; unsigned int i; char *p, *end; #define elements(x) (sizeof(x)/sizeof((x)[0])) for ( i = 0; i < elements( papersizes ); i++ ) { if ( width == papersizes[ 0 ].width && length == papersizes[ 0 ].length ) { papersize = papersizes[ i ]; break; } } if ( i >= elements( papersizes )) { papersize = papersizes[ 0 ]; /* default */ } #define ST_AVAIL (1<<0) #define ST_CONTROL (1<<1) #define ST_PAGE (1<<2) /* * convert text lines to postscript. * A grungy little state machine. If I was more creative, I could * probably think of a better way of doing this... */ do { p = inbuf; end = inbuf + inlen; while ( p < end ) { if (( state & ST_PAGE ) == 0 && *p != '\031' && *p != '\001' ) { if ( npages == 0 ) { printf( "%%!PS-Adobe-2.0\n%%%%Pages: (atend)\n" ); printf( "%%%%DocumentFonts: %s\n", font ); fflush( stdout ); /* output postscript prologue: */ if ( write( 1, pspro, sizeof( pspro ) - 1 ) != sizeof( pspro ) - 1 ) { syslog( LOG_ERR, "write prologue: %s", strerror(errno) ); return( 1 ); } if ( name && host ) { printf( "statusdict /jobname (%s@%s) put\n", name, host ); } } printf( "%%%%Page: ? %d\n", ++npages ); printf( "%d %f %f /%s %d SP\n", indent, papersize.win, papersize.lin, font, point ); state |= ST_PAGE; } if ( state & ST_CONTROL && *p != '\001' ) { /* It is a very bad thing to toss a job because it contains * unprintable characters. Instead, we will convert them to * question marks. This is adapted from a solution described * by Werner Eugster on his ApplePrint * webpage (http://www.giub.unibe.ch/~eugster/appleprint.html). * * Note that this is rather ugly code. The same change is * applied identically at two different locations in this file. * It would be better someday to combine the two. */ if ( !literal ) { fprintf( stderr, "unprintable character (0x%x) converted to ?!\n", (unsigned char)*p ); putchar( '?' ); /* Replace unprintable char with a question mark. */ } else { printf( "\\%o", (unsigned char)031 ); } state &= ~ST_CONTROL; col++; } switch ( *p ) { case '\n' : /* end of line */ if ( state & ST_AVAIL ) { printf( ")S\n" ); state &= ~ST_AVAIL; } printf( "NL\n" ); line++; col = 0; if ( line >= length ) { printf( "EP\n" ); state &= ~ST_PAGE; line = 0; } break; case '\r' : /* carriage return (for overtyping) */ if ( state & ST_AVAIL ) { printf( ")S CR\n" ); state &= ~ST_AVAIL; } col = 0; break; case '\f' : /* form feed */ if ( state & ST_AVAIL ) { printf( ")S\n" ); state &= ~ST_AVAIL; } printf( "EP\n" ); state &= ~ST_PAGE; line = 0; col = 0; break; case '\b' : /* backspace */ /* show line, back up one character */ if ( state & ST_AVAIL ) { printf( ")S\n" ); state &= ~ST_AVAIL; } printf( "B\n" ); col--; break; case '\t' : /* tab */ if ( state & ST_AVAIL ) { printf( ")S\n" ); state &= ~ST_AVAIL; } printf( "%d T\n", 8 - ( col % 8 )); col += 8 - ( col % 8 ); break; /* * beginning of lpr control sequence */ case '\031' : state |= ST_CONTROL; break; case '\001' : /* lpr control sequence */ if ( state & ST_CONTROL ) { rc = 3; goto out; } /* FALLTHROUGH */ case '\\' : case ')' : case '(' : if (( state & ST_AVAIL ) == 0 ) { printf( "(" ); state |= ST_AVAIL; } putchar( '\\' ); /* FALLTHROUGH */ default : if (( state & ST_AVAIL ) == 0 ) { printf( "(" ); state |= ST_AVAIL; } if ( !isascii( *p ) || !isprint( *p )) { if ( !literal ) { fprintf( stderr, "unprintable character (0x%x) converted to ?!\n", (unsigned char)*p ); putchar( '?' ); /* Replace unprintable char with a question mark. */ } else { printf( "\\%o", (unsigned char)*p ); } } else { putchar( *p ); } col++; break; } p++; } } while (( inlen = read( 0, inbuf, sizeof( inbuf ))) > 0 ); if ( inlen < 0 ) { syslog( LOG_ERR, "read: %s", strerror(errno) ); return( 1 ); } rc = 0; out: if ( state & ST_AVAIL ) { printf( ")S\n" ); state &= ~ST_AVAIL; } if ( state & ST_PAGE ) { printf( "EP\n" ); state &= ~ST_PAGE; } if ( npages > 0 ) { printf( "%%%%Trailer\nGSV restore\n%%%%Pages: %d\n%%%%EOF\n", npages ); fflush( stdout ); } return( rc ); } /* * Interface to pipe and exec, for starting children in pipelines. * * Manipulates file descriptors 0, 1, and 2, such that the new child * is reading from the parent's output. */ int pexecv( char *path, char *argv[]) { int fd[ 2 ], c; if ( pipe( fd ) < 0 ) { return( -1 ); } switch ( c = fork()) { case -1 : return( -1 ); /* NOTREACHED */ case 0 : if ( close( fd[ 1 ] ) < 0 ) { return( -1 ); } if ( dup2( fd[ 0 ], 0 ) < 0 ) { return( -1 ); } if ( close( fd[ 0 ] ) < 0 ) { return( -1 ); } execv( path, argv ); return( -1 ); /* NOTREACHED */ default : if ( close( fd[ 0 ] ) < 0 ) { return( -1 ); } if ( dup2( fd[ 1 ], 1 ) < 0 ) { return( -1 ); } if ( close( fd[ 1 ] ) < 0 ) { return( -1 ); } return( c ); } } netatalk-2.2.2/etc/psf/pagecount.ps0000644000175200017500000000017211655731126014146 00000000000000%!PS-Adobe-3.0 Query %%?BeginQuery: PageCount statusdict begin pagecount (*) print = flush end %%?EndQuery: Unknown %%EOF netatalk-2.2.2/etc/psf/etc2ps.sh0000644000175200017500000000221511655731126013351 00000000000000#!/bin/sh # # This filter is called by psf to convert "other" formats to PostScript. # psf handles text and PostScript native. "Other" formats, e.g. DVI, C/A/T, # need to be converted before the page reverser and the printer can use # them. # # $0 begins with the filter name, e.g. df, tf. Each format is a separate # tag in the case. # DVIPSPATH=/usr/local/tex/bin DVIPS=/usr/local/tex/bin/dvips DVIPSARGS="-f -q" TROFF2PS=/usr/local/psroff/troff2/troff2ps TROFF2PSARGS="-Z -O-.10" PATH=/usr/bin:$DVIPSPATH; export PATH case $1 in # # Use "dvips" by Radical Eye Software to convert TeX DVI files to PostScript. # Note that you *must* have METAFONT, etc, in your path. # df*) if [ -x "$DVIPS" ]; then TEMPFILE=`mktemp -t psfilter.XXXXXX` || exit 1 cat > $TEMPFILE $DVIPS $DVIPSARGS < $TEMPFILE rm -f $TEMPFILE else echo "$0: filter dvips uninstalled" 1>&2 exit 2 fi ;; # # troff2ps is from psroff by Chris Lewis. # tf*) if [ -x "$TROFF2PS" ]; then exec $TROFF2PS $TROFF2PSARGS else echo "$0: filter troff2ps uninstalled" 1>&2 exit 2 fi ;; *) echo "$0: filter $1 unavailable" 1>&2 exit 2 ;; esac exit 0 netatalk-2.2.2/etc/psf/psa.c0000644000175200017500000000567011655731126012554 00000000000000/* * $Id: psa.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * * PostScript Accounting, psa. * * psa is invoked by psf, as output for a communication program. The * communication program is expected to send a small program before and * after each job, which causes the page count to be emitted in a well * known format. psa reads its input, looking for page counts and other * interesting data. Any data that it doesn't understand, it emits to * stderr, the lpd log file. Data that it does understand may be written * to a status file or logged. Once all input has been received, psa * subtracts the beginning and end page counts, and log an accounting * record in the accounting file. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include int main( int ac, char **av) { FILE *af; char *acc, *user, *host; char buf[ 1024 ], *p, *end; int cc, n, ipc = -1, fpc = -1; if ( ac != 4 ) { fprintf( stderr, "Usage:\t%s accounting-file user host\n", av[ 0 ] ); exit( 2 ); } acc = av[ 1 ]; user = av[ 2 ]; host = av[ 3 ]; /* * Explain n = !n ... Is there no beauty in truth? */ while (( cc = read( 0, buf, sizeof( buf ))) > 0 ) { if ( ipc < 0 && *buf == '*' ) { /* find initial pagecount */ for ( p = buf, end = buf + cc; p < end; p++ ) { if ( *p == '\n' || *p == '\r' ) { break; } } if ( p == end ) { fprintf( stderr, "Can't find initial page count!\n" ); exit( 2 ); } p++; ipc = atoi( buf + 1 ); cc -= ( p - buf ); if ( cc != 0 ) { bcopy( p, buf, cc ); } } else { /* find final pagecount */ for ( p = buf + cc - 1; p >= buf; p-- ) { if ( *p != '\n' && *p != '\r' ) { break; } } if ( p < buf ) { fprintf( stderr, "Can't find final page count!\n" ); exit( 2 ); } for ( ; p >= buf; p-- ) { if ( *p == '\n' || *p == '\r' ) { break; } } if ( p < buf ) { p = buf; } else { cc -= p - buf; p++; } if ( *p == '*' ) { n = atoi( p + 1 ); #define max(x,y) ((x)>(y)?(x):(y)) fpc = max( n, fpc ); } } if ( cc != 0 && write( 2, buf, cc ) != cc ) { fprintf( stderr, "write 1: 2 %p %d\n", buf, cc ); perror( "write" ); exit( 2 ); } } if ( cc < 0 ) { perror( "read" ); exit( 2 ); } if ( ipc < 0 ) { fprintf( stderr, "Didn't find initial page count!\n" ); exit( 2 ); } if ( fpc < 0 ) { fprintf( stderr, "Didn't find final page count!\n" ); exit( 2 ); } /* * Write accounting record. */ if (( af = fopen( acc, "a" )) != NULL ) { fprintf( af, "%7.2f\t%s:%s\n", (float)( fpc - ipc ), host, user ); } else { perror( acc ); exit( 2 ); } exit( 0 ); } netatalk-2.2.2/etc/papd/0000777000175200017500000000000011704770430012031 500000000000000netatalk-2.2.2/etc/papd/auth.c0000644000175200017500000000611311655731126013057 00000000000000/* * $Id: auth.c,v 1.9 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "uam_auth.h" static struct uam_mod uam_modules = {NULL, NULL, &uam_modules, &uam_modules}; static struct uam_obj uam_login = {"", "", 0, {{NULL, NULL, NULL}}, &uam_login, &uam_login}; static struct uam_obj uam_changepw = {"", "", 0, {{NULL, NULL, NULL}}, &uam_changepw, &uam_changepw}; static struct uam_obj uam_printer = {"", "", 0, {{NULL, NULL, NULL}}, &uam_printer, &uam_printer}; /* * Return a list of names for loaded uams */ int getuamnames(const int type, char *uamnames) { struct uam_obj *prev, *start; if (!(start = UAM_LIST(type))) return(-1); prev = start; while((prev = prev->uam_prev) != start) { strcat(uamnames, prev->uam_name); strcat(uamnames, "\n"); } strcat(uamnames, "*\n"); return(0); } /* just do a linked list search. this could be sped up with a hashed * list, but i doubt anyone's going to have enough uams to matter. */ struct uam_obj *auth_uamfind(const int type, const char *name, const int len) { struct uam_obj *prev, *start; if (!name || !(start = UAM_LIST(type))) return NULL; prev = start; while ((prev = prev->uam_prev) != start) if (strndiacasecmp(prev->uam_name, name, len) == 0) return prev; return NULL; } int auth_register(const int type, struct uam_obj *uam) { struct uam_obj *start; if (!uam || !uam->uam_name || (*uam->uam_name == '\0')) return -1; if (!(start = UAM_LIST(type))) return 1; uam_attach(start, uam); return 0; } /* load all of the modules */ int auth_load(const char *path, const char *list) { char name[MAXPATHLEN + 1], buf[MAXPATHLEN + 1], *p; struct uam_mod *mod; struct stat st; size_t len; if (!path || !list || (len = strlen(path)) > sizeof(name) - 2) return -1; strlcpy(buf, list, sizeof(buf)); if ((p = strtok(buf, ",")) == NULL) return -1; strcpy(name, path); if (name[len - 1] != '/') { strcat(name, "/"); len++; } while (p) { strlcpy(name + len, p, sizeof(name) - len); if ((stat(name, &st) == 0) && (mod = uam_load(name, p))) { uam_attach(&uam_modules, mod); LOG(log_info, logtype_papd, "uam: %s loaded", p); } p = strtok(NULL, ","); } return 0; } /* get rid of all of the uams */ void auth_unload(void) { struct uam_mod *mod, *prev, *start = &uam_modules; prev = start->uam_prev; while ((mod = prev) != start) { prev = prev->uam_prev; uam_detach(mod); uam_unload(mod); } } netatalk-2.2.2/etc/papd/Makefile.am0000644000175200017500000000176711655731126014020 00000000000000# Makefile.am for etc/papd/ pkgconfdir = @PKGCONFDIR@ spooldir = @SPOOLDIR@ sbin_PROGRAMS = papd bin_PROGRAMS = showppd papd_SOURCES = main.c printcap.c session.c file.c comment.c lp.c ppd.c \ magics.c headers.c queries.c auth.c uam.c print_cups.c papd_LDADD = $(top_builddir)/libatalk/libatalk.la @CUPS_LIBS@ @LIBADD_DL@ papd_LDFLAGS = -export-dynamic @CUPS_LDFLAGS@ showppd_SOURCES = showppd.c ppd.c showppd_CFLAGS = -DSHOWPPD showppd_LDADD = $(top_builddir)/libatalk/libatalk.la noinst_HEADERS = \ comment.h \ file.h \ lp.h \ ppd.h \ printcap.h \ printer.h \ session.h \ print_cups.h \ uam_auth.h AM_CFLAGS = \ -I$(top_srcdir)/include -I$(top_srcdir)/sys \ @CUPS_CFLAGS@\ -D_PATH_PAPDCONF=\"$(pkgconfdir)/papd.conf\" \ -D_PATH_PAPDUAMPATH=\"$(UAMS_PATH)/\" \ -DSPOOLDIR=\"$(spooldir)/\" if USE_SPOOLDIR install-exec-hook: echo "Creating SPOOLDIR $(DESTDIR)$(spooldir)..." $(mkinstalldirs) $(DESTDIR)$(spooldir) chmod 0777 $(DESTDIR)$(spooldir) else install-exec-hook: endif netatalk-2.2.2/etc/papd/ppd.c0000644000175200017500000001406211655731126012703 00000000000000/* * $Id: ppd.c,v 1.17 2009-10-14 02:24:05 didg Exp $ * * Copyright (c) 1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include "printer.h" #include "ppd.h" struct ppd_font *ppd_fonts = NULL; struct ppd_feature ppd_features[] = { { "*LanguageLevel", NULL }, { "*PSVersion", NULL }, #ifdef HAVE_CUPS { "*FreeVM", "33554432" }, #else { "*FreeVM", NULL }, #endif { "*Product", NULL }, { "*PCFileName", NULL }, { "*ModelName", NULL }, { "*NickName", NULL }, { "*ColorDevice", NULL }, { "*FaxSupport", NULL }, { "*TTRasterizer", NULL }, { NULL, NULL }, }; struct ppdent { char *pe_main; char *pe_option; char *pe_translation; char *pe_value; }; #ifndef SHOWPPD static int ppd_inited; static void ppd_init(void) { if (ppd_inited) return; ppd_inited++; if (printer->p_ppdfile) read_ppd( printer->p_ppdfile, 0 ); } #endif /* SHOWPPD */ /* quick and ugly hack to be able to read ppd files with Mac line ending */ static char* my_fgets(char *buf, size_t bufsize, FILE *stream) { int p; /* uninitialized, OK 310105 */ size_t count = 0; while (count < (bufsize - 1) && EOF != (p=fgetc(stream))) { buf[count] = p; count++; if ( p == '\r' || p == '\n') break; } if (p == EOF && count == 0) return NULL; /* translate line endings */ if ( buf[count - 1] == '\r') buf[count - 1] = '\n'; buf[count] = 0; return buf; } static struct ppdent *getppdent( FILE *stream) { static char buf[ 1024 ]; static struct ppdent ppdent; char *p, *q; ppdent.pe_main = ppdent.pe_option = ppdent.pe_translation = ppdent.pe_value = NULL; while (( p = my_fgets( buf, sizeof( buf ), stream )) != NULL ) { if ( *p != '*' ) { /* main key word */ continue; } if ( p[ strlen( p ) - 1 ] != '\n') { LOG(log_error, logtype_papd, "getppdent: line too long" ); continue; } q = p; while ( (*p != ' ') && (*p != '\t') && (*p != ':') && (*p != '\n') ) { p++; } if ( (*( q + 1 ) == '%') || (*( q + 1 ) == '?') ) { /* comments & queries */ continue; } ppdent.pe_main = q; if ( *p == '\n' ) { *p = '\0'; ppdent.pe_option = ppdent.pe_translation = ppdent.pe_value = NULL; return( &ppdent ); } if ( *p != ':' ) { /* option key word */ *p++ = '\0'; while ( (*p == ' ') || (*p == '\t') ) { p++; } q = p; while ( (*p != ':') && (*p != '/') && (*p != '\n') ) { p++; } if ( *p == '\n' ) { continue; } ppdent.pe_option = q; if ( *p == '/' ) { /* translation string */ *p++ = '\0'; q = p; while ( *p != ':' && *p != '\n' ) { p++; } if ( *p != ':' ) { continue; } ppdent.pe_translation = q; } else { ppdent.pe_translation = NULL; } } *p++ = '\0'; while ( (*p == ' ') || (*p == '\t') ) { p++; } /* value */ q = p; while ( *p != '\n' ) { p++; } *p = '\0'; ppdent.pe_value = q; return( &ppdent ); } return( NULL ); } int read_ppd(char *file, int fcnt) { FILE *ppdfile; struct ppdent *pe; struct ppd_feature *pfe; struct ppd_font *pfo; if ( fcnt > 20 ) { LOG(log_error, logtype_papd, "read_ppd: %s: Too many files!", file ); return( -1 ); } if (( ppdfile = fopen( file, "r" )) == NULL ) { LOG(log_error, logtype_papd, "read_ppd %s: %s", file, strerror(errno) ); return( -1 ); } while (( pe = getppdent( ppdfile )) != NULL ) { /* *Include files */ if ( strcmp( pe->pe_main, "*Include" ) == 0 ) { read_ppd( pe->pe_value, fcnt + 1 ); continue; } /* *Font */ if ( strcmp( pe->pe_main, "*Font" ) == 0 && pe->pe_option ) { for ( pfo = ppd_fonts; pfo; pfo = pfo->pd_next ) { if ( strcmp( pfo->pd_font, pe->pe_option ) == 0 ) { break; } } if ( pfo ) { continue; } if (( pfo = (struct ppd_font *)malloc( sizeof( struct ppd_font ))) == NULL ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) ); exit( 1 ); } if (( pfo->pd_font = (char *)malloc( strlen( pe->pe_option ) + 1 )) == NULL ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) ); exit( 1 ); } strcpy( pfo->pd_font, pe->pe_option ); pfo->pd_next = ppd_fonts; ppd_fonts = pfo; continue; } /* Features */ for ( pfe = ppd_features; pfe->pd_name; pfe++ ) { if ( strcmp( pe->pe_main, pfe->pd_name ) == 0 ) { break; } } if ( pfe->pd_name && pe->pe_value ) { if (( pfe->pd_value = (char *)malloc( strlen( pe->pe_value ) + 1 )) == NULL ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) ); exit( 1 ); } strcpy( pfe->pd_value, pe->pe_value ); continue; } } fclose( ppdfile ); return( 0 ); } struct ppd_font *ppd_font( char *font) { struct ppd_font *pfo; #ifndef SHOWPPD if ( ! ppd_inited ) { ppd_init(); } #endif /* SHOWPPD */ for ( pfo = ppd_fonts; pfo; pfo = pfo->pd_next ) { if ( strcmp( pfo->pd_font, font ) == 0 ) { return( pfo ); } } return( NULL ); } struct ppd_feature *ppd_feature( const char *feature, int len) { struct ppd_feature *pfe; char ppd_feature_main[ 256 ]; const char *end, *p; char *q; #ifndef SHOWPPD if ( ! ppd_inited ) { ppd_init(); } #endif /* SHOWPPD */ if (len > sizeof(ppd_feature_main) -1) return( NULL ); for ( end = feature + len, p = feature, q = ppd_feature_main; (p <= end) && (*p != '\n') && (*p != '\r'); p++, q++ ) { *q = *p; } if ( p > end ) { return( NULL ); } *q = '\0'; for ( pfe = ppd_features; pfe->pd_name; pfe++ ) { if ( (strcmp( pfe->pd_name, ppd_feature_main ) == 0) && pfe->pd_value ) { return( pfe ); } } return( NULL ); } netatalk-2.2.2/etc/papd/Makefile.in0000644000175200017500000005756011703521725014027 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for etc/papd/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ sbin_PROGRAMS = papd$(EXEEXT) bin_PROGRAMS = showppd$(EXEEXT) subdir = etc/papd DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) am_papd_OBJECTS = main.$(OBJEXT) printcap.$(OBJEXT) session.$(OBJEXT) \ file.$(OBJEXT) comment.$(OBJEXT) lp.$(OBJEXT) ppd.$(OBJEXT) \ magics.$(OBJEXT) headers.$(OBJEXT) queries.$(OBJEXT) \ auth.$(OBJEXT) uam.$(OBJEXT) print_cups.$(OBJEXT) papd_OBJECTS = $(am_papd_OBJECTS) papd_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la papd_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(papd_LDFLAGS) \ $(LDFLAGS) -o $@ am_showppd_OBJECTS = showppd-showppd.$(OBJEXT) showppd-ppd.$(OBJEXT) showppd_OBJECTS = $(am_showppd_OBJECTS) showppd_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la showppd_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(showppd_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(papd_SOURCES) $(showppd_SOURCES) DIST_SOURCES = $(papd_SOURCES) $(showppd_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgconfdir = @PKGCONFDIR@ spooldir = @SPOOLDIR@ papd_SOURCES = main.c printcap.c session.c file.c comment.c lp.c ppd.c \ magics.c headers.c queries.c auth.c uam.c print_cups.c papd_LDADD = $(top_builddir)/libatalk/libatalk.la @CUPS_LIBS@ @LIBADD_DL@ papd_LDFLAGS = -export-dynamic @CUPS_LDFLAGS@ showppd_SOURCES = showppd.c ppd.c showppd_CFLAGS = -DSHOWPPD showppd_LDADD = $(top_builddir)/libatalk/libatalk.la noinst_HEADERS = \ comment.h \ file.h \ lp.h \ ppd.h \ printcap.h \ printer.h \ session.h \ print_cups.h \ uam_auth.h AM_CFLAGS = \ -I$(top_srcdir)/include -I$(top_srcdir)/sys \ @CUPS_CFLAGS@\ -D_PATH_PAPDCONF=\"$(pkgconfdir)/papd.conf\" \ -D_PATH_PAPDUAMPATH=\"$(UAMS_PATH)/\" \ -DSPOOLDIR=\"$(spooldir)/\" all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign etc/papd/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign etc/papd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done papd$(EXEEXT): $(papd_OBJECTS) $(papd_DEPENDENCIES) @rm -f papd$(EXEEXT) $(papd_LINK) $(papd_OBJECTS) $(papd_LDADD) $(LIBS) showppd$(EXEEXT): $(showppd_OBJECTS) $(showppd_DEPENDENCIES) @rm -f showppd$(EXEEXT) $(showppd_LINK) $(showppd_OBJECTS) $(showppd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comment.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/headers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/magics.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_cups.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printcap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queries.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/showppd-ppd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/showppd-showppd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uam.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< showppd-showppd.o: showppd.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(showppd_CFLAGS) $(CFLAGS) -MT showppd-showppd.o -MD -MP -MF $(DEPDIR)/showppd-showppd.Tpo -c -o showppd-showppd.o `test -f 'showppd.c' || echo '$(srcdir)/'`showppd.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/showppd-showppd.Tpo $(DEPDIR)/showppd-showppd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='showppd.c' object='showppd-showppd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(showppd_CFLAGS) $(CFLAGS) -c -o showppd-showppd.o `test -f 'showppd.c' || echo '$(srcdir)/'`showppd.c showppd-showppd.obj: showppd.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(showppd_CFLAGS) $(CFLAGS) -MT showppd-showppd.obj -MD -MP -MF $(DEPDIR)/showppd-showppd.Tpo -c -o showppd-showppd.obj `if test -f 'showppd.c'; then $(CYGPATH_W) 'showppd.c'; else $(CYGPATH_W) '$(srcdir)/showppd.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/showppd-showppd.Tpo $(DEPDIR)/showppd-showppd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='showppd.c' object='showppd-showppd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(showppd_CFLAGS) $(CFLAGS) -c -o showppd-showppd.obj `if test -f 'showppd.c'; then $(CYGPATH_W) 'showppd.c'; else $(CYGPATH_W) '$(srcdir)/showppd.c'; fi` showppd-ppd.o: ppd.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(showppd_CFLAGS) $(CFLAGS) -MT showppd-ppd.o -MD -MP -MF $(DEPDIR)/showppd-ppd.Tpo -c -o showppd-ppd.o `test -f 'ppd.c' || echo '$(srcdir)/'`ppd.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/showppd-ppd.Tpo $(DEPDIR)/showppd-ppd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ppd.c' object='showppd-ppd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(showppd_CFLAGS) $(CFLAGS) -c -o showppd-ppd.o `test -f 'ppd.c' || echo '$(srcdir)/'`ppd.c showppd-ppd.obj: ppd.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(showppd_CFLAGS) $(CFLAGS) -MT showppd-ppd.obj -MD -MP -MF $(DEPDIR)/showppd-ppd.Tpo -c -o showppd-ppd.obj `if test -f 'ppd.c'; then $(CYGPATH_W) 'ppd.c'; else $(CYGPATH_W) '$(srcdir)/ppd.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/showppd-ppd.Tpo $(DEPDIR)/showppd-ppd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ppd.c' object='showppd-ppd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(showppd_CFLAGS) $(CFLAGS) -c -o showppd-ppd.obj `if test -f 'ppd.c'; then $(CYGPATH_W) 'ppd.c'; else $(CYGPATH_W) '$(srcdir)/ppd.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-sbinPROGRAMS .MAKE: install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-sbinPROGRAMS @USE_SPOOLDIR_TRUE@install-exec-hook: @USE_SPOOLDIR_TRUE@ echo "Creating SPOOLDIR $(DESTDIR)$(spooldir)..." @USE_SPOOLDIR_TRUE@ $(mkinstalldirs) $(DESTDIR)$(spooldir) @USE_SPOOLDIR_TRUE@ chmod 0777 $(DESTDIR)$(spooldir) @USE_SPOOLDIR_FALSE@install-exec-hook: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/etc/papd/queries.c0000644000175200017500000004270411655731126013601 00000000000000/* * $Id: queries.c,v 1.22 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #ifdef KRB #ifdef SOLARIS #include #else /* SOLARIS */ #include #endif /* SOLARIS */ #endif /* KRB */ #include "file.h" #include "comment.h" #include "printer.h" #include "ppd.h" #include "lp.h" #include "uam_auth.h" int cq_default( struct papfile *, struct papfile * ); int cq_k4login( struct papfile *, struct papfile * ); int cq_uameth( struct papfile *, struct papfile * ); int gq_balance( struct papfile * ); int gq_pagecost( struct papfile * ); int gq_true( struct papfile * ); int gq_rbispoolerid( struct papfile * ); int gq_rbiuamlist( struct papfile * ); int cq_query( struct papfile *, struct papfile * ); void cq_font_answer( char *, char *, struct papfile * ); int cq_font( struct papfile *, struct papfile * ); int cq_feature( struct papfile *, struct papfile * ); int cq_printer( struct papfile *, struct papfile * ); int cq_rmjob( struct papfile *, struct papfile * ); #ifndef HAVE_CUPS int cq_listq( struct papfile *, struct papfile * ); int cq_rbilogin( struct papfile *, struct papfile * ); #endif /* HAVE_CUPS */ int cq_default( struct papfile *in, struct papfile *out) { char *start, *stop, *p; int linelength, crlflength; struct papd_comment *comment = compeek(); for (;;) { switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } stop = start+linelength; if ( comgetflags() == 0 ) { /* started */ if ( comment->c_end ) { comsetflags( 1 ); } else { compop(); CONSUME( in, linelength + crlflength ); return( CH_DONE ); } } else { /* return default */ if ( comcmp( start, start+linelength, comment->c_end, 0 ) == 0 ) { for ( p = start; p < stop; p++ ) { if ( *p == ':' ) { break; } } if (p < stop) { p++; while ( *p == ' ' ) { p++; } } append( out, p, stop - p + crlflength ); compop(); CONSUME( in, linelength + crlflength ); return( CH_DONE ); } } CONSUME( in, linelength + crlflength ); } } #ifdef KRB char *LoginOK = "LoginOK\n"; char *LoginFailed = "LoginFailed\n"; #define h2b(x) (isdigit((x))?(x)-'0':(isupper((x))?(x)-'A':(x)-'a')+10) int cq_k4login( struct papfile *in, struct papfile *out) { char *start, *p; int linelength, crlflength; unsigned char *t; struct papd_comment *comment = compeek(); KTEXT_ST tkt; AUTH_DAT ad; int rc, i; switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } p = start + strlen( comment->c_begin ); while ( *p == ' ' ) { p++; } bzero( &tkt, sizeof( tkt )); stop = start+linelength; /* FIXME */ for ( i = 0, t = tkt.dat; p < stop; p += 2, t++, i++ ) { *t = ( h2b( (unsigned char)*p ) << 4 ) + h2b( (unsigned char)*( p + 1 )); } tkt.length = i; if (( rc = krb_rd_req( &tkt, "LaserWriter", printer->p_name, 0, &ad, "" )) != RD_AP_OK ) { LOG(log_error, logtype_papd, "cq_k4login: %s", krb_err_txt[ rc ] ); append( out, LoginFailed, strlen( LoginFailed )); compop(); CONSUME( in, linelength + crlflength ); return( CH_DONE ); } LOG(log_info, logtype_papd, "cq_k4login: %s.%s@%s", ad.pname, ad.pinst, ad.prealm ); lp_person( ad.pname ); lp_host( ad.prealm ); append( out, LoginOK, strlen( LoginOK )); compop(); CONSUME( in, linelength + crlflength); return( CH_DONE ); } char *uameth = "UMICHKerberosIV\n*\n"; int cq_uameth( struct papfile *in, struct papfile *out) { char *start; int linelength, crlflength; struct papd_comment *c, *comment = compeek(); for (;;) { switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } if ( comgetflags() == 0 ) { /* start */ if (( printer->p_flags & P_KRB ) == 0 ) { /* no kerberos */ if ( comswitch( queries, cq_default ) < 0 ) { LOG(log_error, logtype_papd, "cq_uameth: can't find default!" ); exit( 1 ); } return( CH_DONE ); } comsetflags( 1 ); } else { if ( comcmp( start, stop, comment->c_end, 0 ) == 0 ) { /* end */ append( out, uameth, strlen( uameth )); compop(); return( CH_DONE ); } } CONSUME( in, linelength + crlflength ); } } #endif /* KRB */ int gq_true( struct papfile *out) { if ( printer->p_flags & P_SPOOLED ) { append( out, "true\n", 5 ); return( 0 ); } else { return( -1 ); } } int gq_pagecost( struct papfile *out) { char cost[ 60 ]; /* check for spooler? XXX */ if ( printer->p_pagecost_msg != NULL ) { append( out, printer->p_pagecost_msg, strlen( printer->p_pagecost_msg )); } else if ( printer->p_flags & P_ACCOUNT ) { #ifdef ABS_PRINT lp_pagecost(); #endif /* ABS_PRINT */ sprintf( cost, "%d", printer->p_pagecost ); append( out, cost, strlen( cost )); } else { return( -1 ); } append( out, "\n", 1 ); return( 0 ); } #ifdef ABS_PRINT int gq_balance( struct papfile *out) { char balance[ 60 ]; if ( lp_pagecost() != 0 ) { return( -1 ); } sprintf( balance, "$%1.2f\n", printer->p_balance ); append( out, balance, strlen( balance )); return( 0 ); } #endif /* ABS_PRINT */ /* * Handler for RBISpoolerID */ static const char *spoolerid = "(PAPD Spooler) 1.0 (" VERSION ")\n"; int gq_rbispoolerid( struct papfile *out) { append( out, spoolerid, strlen( spoolerid )); return(0); } /* * Handler for RBIUAMListQuery */ static const char *nouams = "*\n"; int gq_rbiuamlist( struct papfile *out) { char uamnames[128] = "\0"; if (printer->p_flags & P_AUTH_PSSP) { if (getuamnames(UAM_SERVER_PRINTAUTH, uamnames) < 0) { append(out, nouams, strlen(nouams)); return(0); } else { append(out, uamnames, strlen(uamnames)); return(0); } } else { append(out, nouams, strlen(nouams)); return(0); } } struct genquery { char *gq_name; int (*gq_handler)(); } genqueries[] = { { "UMICHCostPerPage", gq_pagecost }, #ifdef notdef { "UMICHUserBalance", gq_balance }, #endif /* notdef */ { "RBISpoolerID", gq_rbispoolerid }, { "RBIUAMListQuery", gq_rbiuamlist }, { "ADOIsBinaryOK?", gq_true }, { "UMICHListQueue", gq_true }, { "UMICHDeleteJob", gq_true }, { NULL, NULL }, }; int cq_query( struct papfile *in, struct papfile *out) { char *start, *stop, *p, *q; int linelength, crlflength; struct papd_comment *comment = compeek(); struct genquery *gq; for (;;) { switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } stop = start+linelength; if ( comgetflags() == 0 ) { /* started */ comsetflags( 1 ); for ( p = start; p < stop; p++ ) { if ( *p == ':' ) { break; } } if (p < stop) for ( p++; p < stop; p++ ) { if ( *p != ' ' && *p != '\t' ) { break; } } for ( q = p; q < stop; q++ ) { if ( *q == ' ' || *q == '\t' || *q == '\r' || *q == '\n' ) { break; } } for ( gq = genqueries; gq->gq_name; gq++ ) { if (( strlen( gq->gq_name ) == (size_t)(q - p) ) && ( strncmp( gq->gq_name, p, q - p ) == 0 )) { break; } } if ( gq->gq_name == NULL || gq->gq_handler == NULL || (gq->gq_handler)( out ) < 0 ) { if ( comswitch( queries, cq_default ) < 0 ) { LOG(log_error, logtype_papd, "cq_feature: can't find default!" ); exit( 1 ); } return( CH_DONE ); } } else { if ( comcmp( start, stop, comment->c_end, 0 ) == 0 ) { compop(); CONSUME( in, linelength + crlflength ); return( CH_DONE ); } } CONSUME( in, linelength + crlflength ); } } void cq_font_answer( char *start, char *stop, struct papfile *out) { char *p, *q, buf[ 256 ]; struct ppd_font *pfo; p = start; while ( p < stop ) { unsigned int count = 0; while (( *p == ' ' || *p == '\t' ) && p < stop ) { p++; } q = buf; while ( *p != ' ' && *p != '\t' && *p != '\n' && *p != '\r' && p < stop && count < sizeof(buf)) { *q++ = *p++; count++; } if ( q != buf ) { *q = '\0'; append( out, "/", 1 ); append( out, buf, strlen( buf )); append( out, ":", 1 ); if (( pfo = ppd_font( buf )) == NULL ) { append( out, "No\n", 3 ); } else { append( out, "Yes\n", 4 ); } } } return; } int cq_font(struct papfile *in, struct papfile *out) { char *start, *stop, *p; int linelength, crlflength; struct papd_comment *comment = compeek(); for (;;) { switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } stop = start + linelength; if ( comgetflags() == 0 ) { comsetflags( 1 ); for ( p = start; p < stop; p++ ) { if ( *p == ':' ) { break; } } if (p < stop) p++; cq_font_answer( p, stop, out ); } else { if ( comgetflags() == 1 && comcmp( start, stop, comcont, 0 ) == 0 ) { /* continuation */ for ( p = start; p < stop; p++ ) { if ( *p == ' ' ) { break; } } if (p < stop) p++; cq_font_answer( p, stop, out ); } else { comsetflags( 2 ); if ( comcmp( start, stop, comment->c_end, 0 ) == 0 ) { append( out, "*\n", 2 ); compop(); CONSUME( in, linelength + crlflength ); return( CH_DONE ); } } } CONSUME( in, linelength + crlflength ); } } int cq_feature( struct papfile *in, struct papfile *out) { char *start, *stop, *p; int linelength, crlflength; struct papd_comment *comment = compeek(); struct ppd_feature *pfe; for (;;) { switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } stop = start + linelength; if ( comgetflags() == 0 ) { comsetflags( 1 ); /* parse for feature */ for ( p = start; p < stop; p++ ) { if ( *p == ':' ) { break; } } if (p < stop) p++; while ( *p == ' ' ) { p++; } if (( pfe = ppd_feature( p, stop - p )) == NULL ) { if ( comswitch( queries, cq_default ) < 0 ) { LOG(log_error, logtype_papd, "cq_feature: can't find default!" ); exit( 1 ); } return( CH_DONE ); } append( out, pfe->pd_value, strlen( pfe->pd_value )); append( out, "\r", 1 ); } else { if ( comcmp( start, stop, comment->c_end, 0 ) == 0 ) { compop(); CONSUME( in, linelength + crlflength ); return( CH_DONE ); } } CONSUME( in, linelength + crlflength ); } } static const char *psver = "*PSVersion\n"; static const char *prod = "*Product\n"; int cq_printer(struct papfile *in, struct papfile *out) { char *start, *p; int linelength, crlflength; struct papd_comment *comment = compeek(); struct ppd_feature *pdpsver, *pdprod; for (;;) { switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } if ( comgetflags() == 0 ) { comsetflags( 1 ); if (( pdpsver = ppd_feature( psver, strlen( psver ))) == NULL ) { if ( comswitch( queries, cq_default ) < 0 ) { LOG(log_error, logtype_papd, "cq_printer: can't find default!" ); exit( 1 ); } return( CH_DONE ); } for ( p = pdpsver->pd_value; *p != '\0'; p++ ) { if ( *p == ' ' ) { break; } } if ( *p == '\0' ) { LOG(log_error, logtype_papd, "cq_printer: can't parse PSVersion!" ); if ( comswitch( queries, cq_default ) < 0 ) { LOG(log_error, logtype_papd, "cq_printer: can't find default!" ); exit( 1 ); } return( CH_DONE ); } if (( pdprod = ppd_feature( prod, strlen( prod ))) == NULL ) { if ( comswitch( queries, cq_default ) < 0 ) { LOG(log_error, logtype_papd, "cq_printer: can't find default!" ); exit( 1 ); } return( CH_DONE ); } /* revision */ append( out, p + 1, strlen( p + 1 )); append( out, "\r", 1 ); /* version */ append( out, pdpsver->pd_value, p - pdpsver->pd_value ); append( out, "\r", 1 ); /* product */ append( out, pdprod->pd_value, strlen( pdprod->pd_value )); append( out, "\r", 1 ); } else { if ( comcmp( start, start+linelength, comment->c_end, 0 ) == 0 ) { compop(); CONSUME( in, linelength + crlflength ); return( CH_DONE ); } } CONSUME( in, linelength + crlflength ); } } #ifndef HAVE_CUPS static const char *rmjobfailed = "Failed\n"; static const char *rmjobok = "Ok\n"; int cq_rmjob( struct papfile *in, struct papfile *out) { char *start, *stop, *p; int linelength, crlflength; int job; switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } stop = start + linelength; for ( p = start; p < stop; p++ ) { if ( *p == ' ' || *p == '\t' ) { break; } } for ( ; p < stop; p++ ) { if ( *p != ' ' && *p != '\t' ) { break; } } *stop = '\0'; if ( p < stop && ( job = atoi( p )) > 0 ) { lp_rmjob( job ); append( out, rmjobok, strlen( rmjobok )); } else { append( out, rmjobfailed, strlen( rmjobfailed )); } compop(); CONSUME( in, linelength + crlflength ); return( CH_DONE ); } int cq_listq( struct papfile *in, struct papfile *out) { char *start; int linelength, crlflength; switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } if ( lp_queue( out )) { LOG(log_error, logtype_papd, "cq_listq: lp_queue failed" ); } compop(); CONSUME( in, linelength + crlflength ); return( CH_DONE ); } #endif /* HAVE_CUPS */ /* * Handler for RBILogin */ static struct uam_obj *papd_uam = NULL; static const char *rbiloginok = "0\r"; static const char *rbiloginbad = "-1\r"; static const char *rbiloginerrstr = "%%[Error: SecurityError; \ SecurityViolation: Unknown user, incorrect password or log on is \ disabled ]%%\r%%[Flushing: rest of job (to end-of-file) will be \ ignored ]%%\r"; int cq_rbilogin( struct papfile *in, struct papfile *out) { char *start, *stop, *p, *begin; int linelength, crlflength; char username[UAM_USERNAMELEN + 1] = "\0"; struct papd_comment *comment = compeek(); char uamtype[20]; for (;;) { switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } stop = start + linelength; if ( comgetflags() == 0 ) { /* first line */ begin = start + strlen(comment->c_begin); p = begin; while (*p != ' ' && p < stop) { p++; } memset(uamtype, 0, sizeof(uamtype)); if ((size_t)(p -begin) <= sizeof(uamtype) -1) { strncpy(uamtype, begin, p - begin); } if ( !*uamtype || (papd_uam = auth_uamfind(UAM_SERVER_PRINTAUTH, uamtype, strlen(uamtype))) == NULL) { LOG(log_info, logtype_papd, "Could not find uam: %s", uamtype); append(out, rbiloginbad, strlen(rbiloginbad)); append(out, rbiloginerrstr, strlen(rbiloginerrstr)); } else { if ( (papd_uam->u.uam_printer(p,stop,username,out)) == 0 ) { lp_person( username ); append(out, rbiloginok, strlen( rbiloginok )); LOG(log_info, logtype_papd, "RBILogin: Logged in '%s'", username); } else { append(out, rbiloginbad, strlen( rbiloginbad)); append(out, rbiloginerrstr, strlen(rbiloginerrstr)); } } comsetflags( 1 ); } else { if ( comcmp( start, stop, comment->c_end, 0 ) == 0 ) { compop(); return( CH_DONE ); } } CONSUME( in, linelength + crlflength ); } } /* * All queries start with %%?Begin and end with %%?End. Note that the * "Begin"/"End" general queries have to be last. */ struct papd_comment queries[] = { #ifdef KRB { "%%Login: UMICHKerberosIV", NULL, cq_k4login, 0 }, { "%%?BeginUAMethodsQuery", "%%?EndUAMethodsQuery:", cq_uameth,C_FULL }, #endif /* KRB */ #ifndef HAVE_CUPS { "%UMICHListQueue", NULL, cq_listq, C_FULL }, { "%UMICHDeleteJob", NULL, cq_rmjob, 0 }, #endif /* HAVE_CUPS */ { "%%?BeginQuery: RBILogin ", "%%?EndQuery", cq_rbilogin, 0 }, { "%%?BeginQuery", "%%?EndQuery", cq_query, 0 }, { "%%?BeginFeatureQuery", "%%?EndFeatureQuery", cq_feature, 0 }, { "%%?BeginFontQuery", "%%?EndFontQuery", cq_font, 0 }, { "%%?BeginPrinterQuery", "%%?EndPrinterQuery", cq_printer,C_FULL }, { "%%?Begin", "%%?End", cq_default, 0 }, { NULL, NULL, NULL, 0 }, }; netatalk-2.2.2/etc/papd/file.h0000644000175200017500000000176211655731126013047 00000000000000/* * $Id: file.h,v 1.8 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifndef PAPD_FILE_H #define PAPD_FILE_H 1 #include struct papfile { int pf_state; struct state *pf_xstate; int pf_bufsize; int pf_datalen; char *pf_buf; char *pf_data; int origin; }; #define PF_BOT (1<<0) #define PF_EOF (1<<1) #define PF_QUERY (1<<2) #define PF_STW (1<<3) #define PF_TRANSLATE (1<<4) #define CONSUME( pf, len ) { (pf)->pf_data += (len); \ (pf)->pf_datalen -= (len); \ if ((pf)->pf_datalen <= 0) { \ (pf)->pf_data = (pf)->pf_buf; \ (pf)->pf_datalen = 0; \ } \ } #define PF_MORESPACE 1024 int markline ( struct papfile *, char **, int *, int * ); void morespace ( struct papfile *, const char *, int ); void append ( struct papfile *, const char *, int ); void spoolerror ( struct papfile *, char * ); #endif /* PAPD_FILE_H */ netatalk-2.2.2/etc/papd/showppd.c0000644000175200017500000000175611655731126013612 00000000000000/* * $Id: showppd.c,v 1.7 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include "ppd.h" extern struct ppd_font *ppd_fonts; extern struct ppd_feature ppd_features[]; int main(int ac, char **av) { struct ppd_feature *pfe; struct ppd_font *pfo; if ( ac != 2 ) { fprintf( stderr, "Usage:\t%s ppdfile\n", av[ 0 ] ); exit( 1 ); } read_ppd( av[ 1 ], 0 ); for ( pfo = ppd_fonts; pfo; pfo = pfo->pd_next ) { printf( "Font: %s\n", pfo->pd_font ); } for ( pfe = ppd_features; pfe->pd_name; pfe++ ) { printf( "Feature: %s %s\n", pfe->pd_name, (pfe->pd_value)?pfe->pd_value:"NULL" ); } exit ( 0 ); } netatalk-2.2.2/etc/papd/session.c0000644000175200017500000001760311655731126013607 00000000000000/* * $Id: session.c,v 1.20 2009-10-16 01:10:59 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef HAVE_SYS_ERRNO_H #include #endif /* HAVE_SYS_ERRNO_H */ #ifdef HAVE_ERRNO_H #include #endif /* HAVE_ERRNO_H */ #include #include #include #include #include #include #include #include #include #include #include "file.h" #include "lp.h" #include "session.h" int ps(struct papfile *infile, struct papfile *outfile, struct sockaddr_at *sat); extern unsigned char connid, quantum, oquantum; static char buf[ PAP_MAXQUANTUM ][ 4 + PAP_MAXDATA ]; static struct iovec niov[ PAP_MAXQUANTUM ] = { { buf[ 0 ], 0 }, { buf[ 1 ], 0 }, { buf[ 2 ], 0 }, { buf[ 3 ], 0 }, { buf[ 4 ], 0 }, { buf[ 5 ], 0 }, { buf[ 6 ], 0 }, { buf[ 7 ], 0 }, }; /* * Accept files until the client closes the connection. * Read lines of a file, until the client sends eof, after * which we'll send eof also. */ int session(ATP atp, struct sockaddr_at *sat) { struct timeval tv; struct atp_block atpb; struct sockaddr_at ssat; struct papfile infile, outfile; fd_set fds; char cbuf[ 578 ]; int i, cc, timeout = 0, readpending = 0; u_int16_t seq = 0, rseq = 1, netseq; u_char readport; /* uninitialized, OK 310105 */ infile.pf_state = PF_BOT; infile.pf_bufsize = 0; infile.pf_datalen = 0; infile.pf_buf = NULL; infile.pf_data = NULL; outfile.pf_state = PF_BOT; outfile.pf_bufsize = 0; outfile.pf_datalen = 0; outfile.pf_buf = NULL; outfile.pf_data = NULL; /* * Ask for data. */ cbuf[ 0 ] = connid; cbuf[ 1 ] = PAP_READ; if (++seq == 0) seq = 1; netseq = htons( seq ); memcpy( &cbuf[ 2 ], &netseq, sizeof( netseq )); atpb.atp_saddr = sat; atpb.atp_sreqdata = cbuf; atpb.atp_sreqdlen = 4; /* bytes in SendData request */ atpb.atp_sreqto = 5; /* retry timer */ atpb.atp_sreqtries = -1; /* infinite retries */ if ( atp_sreq( atp, &atpb, oquantum, ATP_XO )) { LOG(log_error, logtype_papd, "atp_sreq: %s", strerror(errno) ); return( -1 ); } for (;;) { /* * Time between tickles. */ tv.tv_sec = 60; tv.tv_usec = 0; /* * If we don't get anything for a while, time out. */ FD_ZERO( &fds ); FD_SET( atp_fileno( atp ), &fds ); do { /* do list until success or an unrecoverable error occurs */ if (( cc = select( FD_SETSIZE, &fds, NULL, NULL, &tv )) < 0 ) LOG(log_error, logtype_papd, "select: %s", strerror(errno) ); /* log all errors */ } while (( cc < 0 ) && (errno == 4)); if ( cc < 0 ) { LOG(log_error, logtype_papd, "select: Error is unrecoverable" ); return( -1 ); } if ( cc == 0 ) { if ( timeout++ > 2 ) { LOG(log_error, logtype_papd, "connection timed out" ); lp_cancel(); return( -1 ); } /* * Send a tickle. */ cbuf[ 0 ] = connid; cbuf[ 1 ] = PAP_TICKLE; cbuf[ 2 ] = cbuf[ 3 ] = 0; atpb.atp_saddr = sat; atpb.atp_sreqdata = cbuf; atpb.atp_sreqdlen = 4; /* bytes in Tickle request */ atpb.atp_sreqto = 0; /* best effort */ atpb.atp_sreqtries = 1; /* try once */ if ( atp_sreq( atp, &atpb, 0, 0 )) { LOG(log_error, logtype_papd, "atp_sreq: %s", strerror(errno) ); return( -1 ); } continue; } else { timeout = 0; } memset( &ssat, 0, sizeof( struct sockaddr_at )); switch( atp_rsel( atp, &ssat, ATP_TRESP | ATP_TREQ )) { case ATP_TREQ : atpb.atp_saddr = &ssat; atpb.atp_rreqdata = cbuf; atpb.atp_rreqdlen = sizeof( cbuf ); if ( atp_rreq( atp, &atpb ) < 0 ) { LOG(log_error, logtype_papd, "atp_rreq: %s", strerror(errno) ); return( -1 ); } /* sanity */ if ( (unsigned char)cbuf[ 0 ] != connid ) { LOG(log_error, logtype_papd, "Bad ATP request!" ); continue; } switch( cbuf[ 1 ] ) { case PAP_READ : /* * Other side is ready for some data. */ memcpy( &netseq, &cbuf[ 2 ], sizeof( netseq )); if ( netseq != 0 ) { if ( rseq != ntohs( netseq )) { break; } if ( rseq++ == 0xffff ) rseq = 1; } readpending = 1; readport = ssat.sat_port; break; case PAP_CLOSE : /* * Respond to the close request. * If we're in the middle of a file, clean up. */ if (( infile.pf_state & PF_BOT ) || ( infile.pf_datalen == 0 && ( infile.pf_state & PF_EOF ))) { lp_print(); } else { lp_cancel(); } niov[ 0 ].iov_len = 4; ((char *)niov[ 0 ].iov_base)[ 0 ] = connid; ((char *)niov[ 0 ].iov_base)[ 1 ] = PAP_CLOSEREPLY; ((char *)niov[ 0 ].iov_base)[ 2 ] = ((char *)niov[ 0 ].iov_base)[ 3 ] = 0; atpb.atp_sresiov = niov; atpb.atp_sresiovcnt = 1; if ( atp_sresp( atp, &atpb ) < 0 ) { LOG(log_error, logtype_papd, "atp_sresp: %s", strerror(errno) ); exit( 1 ); } return( 0 ); break; case PAP_TICKLE : break; default : LOG(log_error, logtype_papd, "Bad PAP request!" ); } break; case ATP_TRESP : atpb.atp_saddr = &ssat; for ( i = 0; i < oquantum; i++ ) { niov[ i ].iov_len = PAP_MAXDATA + 4; } atpb.atp_rresiov = niov; atpb.atp_rresiovcnt = oquantum; if ( atp_rresp( atp, &atpb ) < 0 ) { LOG(log_error, logtype_papd, "atp_rresp: %s", strerror(errno) ); return( -1 ); } /* sanity */ if ( ((unsigned char *)niov[ 0 ].iov_base)[ 0 ] != connid || ((char *)niov[ 0 ].iov_base)[ 1 ] != PAP_DATA ) { LOG(log_error, logtype_papd, "Bad data response!" ); continue; } for ( i = 0; i < atpb.atp_rresiovcnt; i++ ) { append( &infile, (char *)niov[ i ].iov_base + 4, niov[ i ].iov_len - 4 ); if (( infile.pf_state & PF_EOF ) == 0 && ((char *)niov[ 0 ].iov_base)[ 2 ] ) { infile.pf_state |= PF_EOF; } } /* move data */ if ( ps( &infile, &outfile, sat ) < 0 ) { LOG(log_error, logtype_papd, "parse: bad return" ); return( -1 ); /* really? close? */ } /* * Ask for more data. */ cbuf[ 0 ] = connid; cbuf[ 1 ] = PAP_READ; if ( ++seq == 0 ) seq = 1; netseq = htons( seq ); memcpy( &cbuf[ 2 ], &netseq, sizeof( netseq )); atpb.atp_saddr = sat; atpb.atp_sreqdata = cbuf; atpb.atp_sreqdlen = 4; /* bytes in SendData request */ atpb.atp_sreqto = 5; /* retry timer */ atpb.atp_sreqtries = -1; /* infinite retries */ if ( atp_sreq( atp, &atpb, oquantum, ATP_XO )) { LOG(log_error, logtype_papd, "atp_sreq: %s", strerror(errno) ); return( -1 ); } break; case 0: break; default : LOG(log_error, logtype_papd, "atp_rsel: %s", strerror(errno) ); return( -1 ); } /* send any data that we have */ if ( readpending && ( outfile.pf_datalen || ( outfile.pf_state & PF_EOF ))) { for ( i = 0; i < quantum; i++ ) { ((char *)niov[ i ].iov_base)[ 0 ] = connid; ((char *)niov[ i ].iov_base)[ 1 ] = PAP_DATA; ((char *)niov[ i ].iov_base)[ 2 ] = ((char *)niov[ i ].iov_base)[ 3 ] = 0; if ( outfile.pf_datalen > PAP_MAXDATA ) { cc = PAP_MAXDATA; } else { cc = outfile.pf_datalen; if ( outfile.pf_state & PF_EOF ) { ((char *)niov[ 0 ].iov_base)[ 2 ] = 1; /* eof */ outfile.pf_state = PF_BOT; infile.pf_state = PF_BOT; } } niov[ i ].iov_len = 4 + cc; memcpy( (char *)niov[ i ].iov_base + 4, outfile.pf_data, cc ); CONSUME( &outfile, cc ); if ( outfile.pf_datalen == 0 ) { i++; break; } } ssat.sat_port = readport; atpb.atp_saddr = &ssat; atpb.atp_sresiov = niov; atpb.atp_sresiovcnt = i; /* reported by stevebn@pc1.eos.co.uk */ if ( atp_sresp( atp, &atpb ) < 0 ) { LOG(log_error, logtype_papd, "atp_sresp: %s", strerror(errno) ); return( -1 ); } readpending = 0; } } } netatalk-2.2.2/etc/papd/print_cups.h0000644000175200017500000000113711655731126014312 00000000000000 #ifndef PAPD_CUPS_H #define PAPD_CUPS_H 1 #ifdef HAVE_CUPS #include struct cups_status { int pr_status; char * status_message; }; int cups_printername_ok (char * ); const char * cups_get_printer_ppd ( char * ); int cups_get_printer_status (struct printer *pr); int cups_print_job ( char *, char *, char *, char *, char *); struct printer * cups_autoadd_printers ( struct printer *, struct printer *); int cups_check_printer ( struct printer *, struct printer *, int); const char *cups_get_language ( void ); #endif /* HAVE_CUPS */ #endif /* PAPD_CUPS_H */ netatalk-2.2.2/etc/papd/printer.h0000644000175200017500000000317411655731126013612 00000000000000/* * $Id: printer.h,v 1.6 2005-04-28 20:49:49 bfernhomberg Exp $ * * Copyright (c) 1990,1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ struct printer { char *p_name; char *p_type; char *p_zone; char *p_u_name; #ifdef notdef char *p_fonts; char *p_psetdir; #endif /* notdef */ char *p_ppdfile; char p_status[255]; char *p_authprintdir; int p_flags; struct at_addr p_addr; union { struct { char *pr_printer; char *pr_operator; char *pr_spool; #ifdef ABS_PRINT char *pr_role; double pr_balance; int pr_srvid; #endif /* ABS_PRINT */ int pr_pagecost; char *pr_pagecost_msg; char *pr_lock; } pu_pr; char *pu_cmd; } p_un; ATP p_atp; #ifdef HAVE_CUPS char *p_cupsoptions; #endif struct printer *p_next; }; #define p_cmd p_un.pu_cmd #define p_printer p_un.pu_pr.pr_printer #define p_operator p_un.pu_pr.pr_operator #define p_spool p_un.pu_pr.pr_spool #ifdef ABS_PRINT #define p_role p_un.pu_pr.pr_role #define p_balance p_un.pu_pr.pr_balance #define p_srvid p_un.pu_pr.pr_srvid #endif /* ABS_PRINT */ #define p_pagecost p_un.pu_pr.pr_pagecost #define p_pagecost_msg p_un.pu_pr.pr_pagecost_msg #define p_lock p_un.pu_pr.pr_lock #define P_PIPED (1<<0) #define P_SPOOLED (1<<1) #define P_REGISTERED (1<<2) #define P_ACCOUNT (1<<3) #define P_KRB (1<<4) #define P_AUTH (1<<5) #define P_AUTH_PSSP (1<<6) #define P_AUTH_CAP (1<<7) #define P_CUPS (1<<8) #define P_CUPS_PPD (1<<9) #define P_CUPS_AUTOADDED (1<<10) #define P_FOOMATIC_HACK (1<<11) extern struct printer *printer; netatalk-2.2.2/etc/papd/magics.c0000644000175200017500000001173011655731126013362 00000000000000/* * $Id: magics.c,v 1.15 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include "file.h" #include "comment.h" #include "lp.h" static int state=0; static void parser_error(struct papfile *outfile) { spoolerror( outfile, "Comments error, Ignoring job." ); outfile->pf_state |= PF_EOF; lp_close(); } int ps( struct papfile *infile, struct papfile *outfile, struct sockaddr_at *sat) { char *start; int linelength, crlflength; struct papd_comment *comment; for (;;) { if ( infile->pf_state & PF_STW ) { infile->pf_state &= ~PF_STW; /* set up spool file */ if ( lp_open( outfile, sat ) < 0 && !state) { LOG(log_error, logtype_papd, "lp_open failed" ); spoolerror( outfile, "Ignoring job." ); } state = 1; } if ( (comment = compeek()) ) { switch( (*comment->c_handler)( infile, outfile, sat )) { case CH_DONE : continue; case CH_MORE : return( CH_MORE ); case CH_ERROR : parser_error(outfile); return( 0 ); default : return( CH_ERROR ); } } else { switch ( markline( infile, &start, &linelength, &crlflength )) { case 0 : /* eof on infile */ outfile->pf_state |= PF_EOF; lp_close(); return( 0 ); case -2: parser_error(outfile); return( 0 ); case -1 : return( 0 ); } if ( infile->pf_state & PF_BOT ) { if (( comment = commatch( start, start+linelength, magics )) != NULL ) { compush( comment ); continue; /* top of for (;;) */ } #if 0 infile->pf_state &= ~PF_BOT; /* set up spool file */ if ( lp_open( outfile, sat ) < 0 ) { LOG(log_error, logtype_papd, "lp_open failed" ); spoolerror( outfile, "Ignoring job." ); } #endif } /* write to file */ lp_write( infile, start, linelength + crlflength ); CONSUME( infile, linelength + crlflength ); } } } int cm_psquery( struct papfile *in, struct papfile *out, struct sockaddr_at *sat _U_) { struct papd_comment *comment; char *start; int linelength, crlflength; for (;;) { switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : /* eof on infile */ out->pf_state |= PF_EOF; compop(); return( CH_DONE ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } if ( in->pf_state & PF_BOT ) { in->pf_state &= ~PF_BOT; } else { if (( comment = commatch( start, start+linelength, queries )) != NULL ) { compush( comment ); return( CH_DONE ); } } CONSUME( in, linelength + crlflength ); } } int cm_psadobe( struct papfile *in, struct papfile *out, struct sockaddr_at *sat _U_) { char *start; int linelength, crlflength; struct papd_comment *comment = compeek(); for (;;) { switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : /* eof on infile */ out->pf_state |= PF_EOF; compop(); return( CH_DONE ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } if ( in->pf_state & PF_BOT ) { in->pf_state &= ~PF_BOT; #if 0 if ( lp_open( out, sat ) < 0 ) { LOG(log_error, logtype_papd, "lp_open failed" ); spoolerror( out, "Ignoring job." ); } #endif } else { if (( comment = commatch( start, start + linelength, headers )) != NULL ) { compush( comment ); return( CH_DONE ); } } lp_write( in, start, linelength + crlflength ); CONSUME( in, linelength + crlflength ); } } char *Query = "Query"; int cm_psswitch(struct papfile *in, struct papfile *out, struct sockaddr_at *sat _U_) { char *start, *stop, *p; int linelength, crlflength; switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : /* eof on infile */ out->pf_state |= PF_EOF; compop(); return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } stop = start + linelength; for ( p = start; p < stop; p++ ) { if ( *p == ' ' || *p == '\t' ) { break; } } for ( ; p < stop; p++ ) { if ( *p != ' ' && *p != '\t' ) { break; } } if ( (size_t)(stop - p) >= strlen( Query ) && strncmp( p, Query, strlen( Query )) == 0 ) { if ( comswitch( magics, cm_psquery ) < 0 ) { LOG(log_error, logtype_papd, "cm_psswitch: can't find psquery!" ); exit( 1 ); } } else { if ( comswitch( magics, cm_psadobe ) < 0 ) { LOG(log_error, logtype_papd, "cm_psswitch: can't find psadobe!" ); exit( 1 ); } } return( CH_DONE ); } struct papd_comment magics[] = { { "%!PS-Adobe-3.0 Query", NULL, cm_psquery, C_FULL }, { "%!PS-Adobe-3.0", NULL, cm_psadobe, C_FULL }, { "%!PS-Adobe-", NULL, cm_psswitch, 0 }, { NULL, NULL, NULL, 0 }, }; netatalk-2.2.2/etc/papd/ppd.h0000644000175200017500000000077311655731126012714 00000000000000/* * $Id: ppd.h,v 1.6 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifndef PAPD_PPD_H #define PAPD_PPD_H 1 #include struct ppd_font { char *pd_font; struct ppd_font *pd_next; }; struct ppd_feature { char *pd_name; char *pd_value; }; struct ppd_feature *ppd_feature (const char *, int); struct ppd_font *ppd_font (char *); int read_ppd (char *, int); #endif /* PAPD_PPD_H */ netatalk-2.2.2/etc/papd/printcap.h0000644000175200017500000000061411655731126013743 00000000000000/* * $Id: printcap.h,v 1.5 2009-10-13 22:55:37 didg Exp $ */ #ifndef PAPD_PRINTCAP_H #define PAPD_PRINTCAP_H 1 #include int getprent ( register char *, register char *, register int ); int pnchktc ( char * ); int pgetflag ( char * ); void endprent ( void ); int pgetent ( char *, char *, char * ); int pgetnum ( char * ); int pnamatch ( char * ); #endif /* PAPD_PRINTCAP_H */ netatalk-2.2.2/etc/papd/main.c0000644000175200017500000005560011655731126013047 00000000000000/* * $Id: main.c,v 1.31 2009-10-29 13:38:15 didg Exp $ * * Copyright (c) 1990,1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include /* POSIX.1 sys/wait.h check */ #include #ifdef HAVE_SYS_WAIT_H #include #endif /* HAVE_SYS_WAIT_H */ #ifndef WEXITSTATUS #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif /* ! WEXITSTATUS */ #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif /* ! WIFEXITED */ #include /* STDC check */ #if STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #include #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #include #include #include #include #include #include #include "printer.h" #include "printcap.h" #include "session.h" #include "uam_auth.h" #include "print_cups.h" #define PIPED_STATUS "status: print spooler processing job" struct printer defprinter; struct printer *printers = NULL; int debug = 0; static char *conffile = _PATH_PAPDCONF; char *printcap = _PATH_PAPDPRINTCAP; unsigned char connid, quantum, sock, oquantum = PAP_MAXQUANTUM; char *cannedstatus = PIPED_STATUS; struct printer *printer = NULL; char *version = VERSION; static char *pidfile = _PATH_PAPDLOCK; char *uamlist; char *uampath = _PATH_PAPDUAMPATH; /* Prototypes for locally used functions */ int getstatus( struct printer *pr, char *buf ); int rprintcap( struct printer *pr ); static void getprinters( char *cf ); /* this only needs to be used by the server process */ static void papd_exit(const int i) { server_unlock(pidfile); auth_unload(); exit(i); } static void die(int n) { struct printer *pr; struct at_addr addr; memset(&addr, 0, sizeof(addr)); for ( pr = printers; pr; pr = pr->p_next ) { if ( pr->p_flags & P_REGISTERED ) { if ( nbp_unrgstr( pr->p_name, pr->p_type, pr->p_zone, &addr ) < 0 ) { LOG(log_error, logtype_papd, "can't unregister %s:%s@%s", pr->p_name, pr->p_type, pr->p_zone ); papd_exit( n + 1 ); } LOG(log_info, logtype_papd, "unregister %s:%s@%s", pr->p_name, pr->p_type, pr->p_zone ); } #ifdef HAVE_CUPS if ( pr->p_flags & P_SPOOLED && pr->p_flags & P_CUPS_PPD ) { LOG(log_info, logtype_papd, "Deleting CUPS temp PPD file for %s (%s)", pr->p_name, pr->p_ppdfile); unlink (pr->p_ppdfile); } #endif /* HAVE_CUPS */ } papd_exit( n ); } static void reap(int sig _U_) { int status; int pid; while (( pid = wait3( &status, WNOHANG, NULL )) > 0 ) { if ( WIFEXITED( status )) { if ( WEXITSTATUS( status )) { LOG(log_error, logtype_papd, "child %d exited with %d", pid, WEXITSTATUS( status )); } else { LOG(log_info, logtype_papd, "child %d done", pid ); } } else { if ( WIFSIGNALED( status )) { LOG(log_error, logtype_papd, "child %d killed with %d", pid, WTERMSIG( status )); } else { LOG(log_error, logtype_papd, "child %d died", pid ); } } } return; } static char rbuf[ 255 + 1 + 8 ]; int main(int ac, char **av) { extern char *optarg; ATP atp; struct atp_block atpb; struct sockaddr_at sat; struct sigaction sv; struct iovec iov; fd_set fdset; struct printer *pr; char *p, hostname[ MAXHOSTNAMELEN ]; char cbuf[ 8 ]; int c; char *atname; if ( gethostname( hostname, sizeof( hostname )) < 0 ) { perror( "gethostname" ); exit( 1 ); } if (( p = strchr( hostname, '.' )) != NULL ) { *p = '\0'; } if (( defprinter.p_name = (char *)malloc( strlen( hostname ) + 1 )) == NULL ) { perror( "malloc" ); exit( 1 ); } strcpy( defprinter.p_name, hostname ); defprinter.p_type = "LaserWriter"; defprinter.p_zone = "*"; memset(&defprinter.p_addr, 0, sizeof(defprinter.p_addr)); #ifdef __svr4__ defprinter.p_flags = P_PIPED; defprinter.p_printer = "/usr/bin/lp -T PS"; #else /* __svr4__ */ defprinter.p_flags = P_SPOOLED; defprinter.p_printer = "lp"; #endif /* __svr4__ */ defprinter.p_operator = "operator"; defprinter.p_spool = _PATH_PAPDSPOOLDIR; #ifdef ABS_PRINT defprinter.p_role = NULL; defprinter.p_srvid = 0; #endif /* ABS_PRINT */ defprinter.p_pagecost = 200; /* default cost */ defprinter.p_pagecost_msg = NULL; defprinter.p_lock = "lock"; while (( c = getopt( ac, av, "adf:p:P:v" )) != EOF ) { switch ( c ) { case 'a' : /* for compatibility with old papd */ break; case 'd' : /* debug */ debug++; break; case 'f' : /* conffile */ conffile = optarg; break; case 'p' : /* printcap */ printcap = optarg; break; case 'P' : pidfile = optarg; break; case 'v' : /* version */ printf( "papd (version %s)\n", VERSION ); exit ( 1 ); break; default : fprintf( stderr, "Usage:\t%s [ -d ] [ -f conffile ] [ -p printcap ]\n", *av ); exit( 1 ); } } switch (server_lock("papd", pidfile, debug)) { case 0: /* open a couple things again in the child */ if (!debug && (c = open("/", O_RDONLY)) >= 0) { dup2(c, 1); dup2(c, 2); } break; case -1: exit(1); default: exit(0); } #ifdef DEBUG1 fault_setup(NULL); #endif /* * Start logging. */ if (( p = strrchr( av[ 0 ], '/' )) == NULL ) { p = av[ 0 ]; } else { p++; } #ifdef ultrix openlog( p, LOG_PID ); #else /* ultrix */ set_processname(p); syslog_setup(log_debug, logtype_default, logoption_ndelay | logoption_pid | debug ? logoption_perror : 0, logfacility_lpr ); #endif /* ultrix */ LOG(log_info, logtype_papd, "restart (%s)", version ); #ifdef HAVE_CUPS LOG(log_info, logtype_papd, "CUPS support enabled (%s)", CUPS_API_VERSION ); #endif getprinters( conffile ); for ( pr = printers; pr; pr = pr->p_next ) { if (( pr->p_flags & P_SPOOLED ) && rprintcap( pr ) < 0 ) { LOG(log_error, logtype_papd, "printcap problem: %s", pr->p_printer ); } if (!(pr->p_flags & P_CUPS)) { if ((size_t)-1 != convert_string_allocate(CH_UNIX, CH_MAC, pr->p_name, -1, &atname)) { pr->p_u_name = pr->p_name; pr->p_name = atname; } } if (( pr->p_atp = atp_open( ATADDR_ANYPORT, &pr->p_addr )) == NULL ) { LOG(log_error, logtype_papd, "atp_open: %s", strerror(errno) ); papd_exit( 1 ); } if ( nbp_rgstr( atp_sockaddr( pr->p_atp ), pr->p_name, pr->p_type, pr->p_zone ) < 0 ) { LOG(log_error, logtype_papd, "can't register %s:%s@%s", pr->p_u_name, pr->p_type, pr->p_zone ); die( 1 ); } if ( pr->p_flags & P_AUTH ) { LOG(log_info, logtype_papd, "Authentication enabled: %s", pr->p_u_name ); } else { LOG(log_info, logtype_papd, "Authentication disabled: %s", pr->p_u_name ); } LOG(log_info, logtype_papd, "register %s:%s@%s", pr->p_u_name, pr->p_type, pr->p_zone ); pr->p_flags |= P_REGISTERED; } memset(&sv, 0, sizeof(sv)); sv.sa_handler = die; sigemptyset( &sv.sa_mask ); sv.sa_flags = SA_RESTART; if ( sigaction( SIGTERM, &sv, NULL ) < 0 ) { LOG(log_error, logtype_papd, "sigaction: %s", strerror(errno) ); papd_exit( 1 ); } sv.sa_handler = reap; sigemptyset( &sv.sa_mask ); sv.sa_flags = SA_RESTART; if ( sigaction( SIGCHLD, &sv, NULL ) < 0 ) { LOG(log_error, logtype_papd, "sigaction: %s", strerror(errno) ); papd_exit( 1 ); } /* * Load UAMS */ auth_load(uampath, uamlist); /* * Begin accepting connections. */ FD_ZERO( &fdset ); for (;;) { for ( pr = printers; pr; pr = pr->p_next ) { FD_SET( atp_fileno( pr->p_atp ), &fdset ); } if (( c = select( FD_SETSIZE, &fdset, NULL, NULL, NULL )) < 0 ) { if ( errno == EINTR ) { continue; } LOG(log_error, logtype_papd, "select: %s", strerror(errno) ); papd_exit( 1 ); } for ( pr = printers; pr; pr = pr->p_next ) { if ( FD_ISSET( atp_fileno( pr->p_atp ), &fdset )) { int err = 0; memset( &sat, 0, sizeof( struct sockaddr_at )); #ifdef BSD4_4 sat.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ sat.sat_family = AF_APPLETALK; sat.sat_addr.s_net = ATADDR_ANYNET; sat.sat_addr.s_node = ATADDR_ANYNODE; sat.sat_port = ATADDR_ANYPORT; /* do an atp_rsel(), to prevent hangs */ if (( c = atp_rsel( pr->p_atp, &sat, ATP_TREQ )) != ATP_TREQ ) { continue; } atpb.atp_saddr = &sat; atpb.atp_rreqdata = cbuf; atpb.atp_rreqdlen = sizeof( cbuf ); if ( atp_rreq( pr->p_atp, &atpb ) < 0 ) { LOG(log_error, logtype_papd, "atp_rreq: %s", strerror(errno) ); continue; } /* should check length of req buf */ switch( cbuf[ 1 ] ) { case PAP_OPEN : connid = (unsigned char)cbuf[ 0 ]; sock = (unsigned char)cbuf[ 4 ]; quantum = (unsigned char)cbuf[ 5 ]; rbuf[ 0 ] = cbuf[ 0 ]; rbuf[ 1 ] = PAP_OPENREPLY; rbuf[ 2 ] = rbuf[ 3 ] = 0; if (( pr->p_flags & P_SPOOLED ) && rprintcap( pr ) != 0 ) { LOG(log_error, logtype_papd, "printcap problem: %s", pr->p_printer ); rbuf[ 2 ] = rbuf[ 3 ] = 0xff; err = 1; } #ifdef HAVE_CUPS /* * If cups is not accepting jobs, we return * 0xffff to indicate we're busy */ #ifdef DEBUG LOG(log_debug9, logtype_papd, "CUPS: PAP_OPEN"); #endif if ( (pr->p_flags & P_SPOOLED) && (cups_get_printer_status ( pr ) == 0)) { LOG(log_error, logtype_papd, "CUPS_PAP_OPEN: %s is not accepting jobs", pr->p_printer ); rbuf[ 2 ] = rbuf[ 3 ] = 0xff; err = 1; } #endif /* HAVE_CUPS */ /* * If this fails, we've run out of sockets. Rather than * just die(), let's try to continue. Maybe some sockets * will close, and we can continue; */ if (( atp = atp_open( ATADDR_ANYPORT, &pr->p_addr)) == NULL ) { LOG(log_error, logtype_papd, "atp_open: %s", strerror(errno) ); rbuf[ 2 ] = rbuf[ 3 ] = 0xff; /* printer busy */ rbuf[ 4 ] = 0; /* FIXME is it right? */ err = 1; } else { rbuf[ 4 ] = atp_sockaddr( atp )->sat_port; } rbuf[ 5 ] = oquantum; rbuf[ 6 ] = rbuf[ 7 ] = 0; iov.iov_base = rbuf; iov.iov_len = 8 + getstatus( pr, &rbuf[ 8 ] ); atpb.atp_sresiov = &iov; atpb.atp_sresiovcnt = 1; /* * This may error out if we lose a route, so we won't die(). */ if ( atp_sresp( pr->p_atp, &atpb ) < 0 ) { LOG(log_error, logtype_papd, "atp_sresp: %s", strerror(errno) ); err = 1; } if ( err ) { if (atp) { atp_close(atp); } continue; } switch ( c = fork()) { case -1 : LOG(log_error, logtype_papd, "fork: %s", strerror(errno) ); atp_close(atp); continue; case 0 : /* child */ printer = pr; #ifndef HAVE_CUPS if (( printer->p_flags & P_SPOOLED ) && chdir( printer->p_spool ) < 0 ) { LOG(log_error, logtype_papd, "chdir %s: %s", printer->p_spool, strerror(errno) ); exit( 1 ); } #else if (( printer->p_flags & P_SPOOLED ) && chdir( SPOOLDIR ) < 0 ) { LOG(log_error, logtype_papd, "chdir %s: %s", SPOOLDIR, strerror(errno) ); exit( 1 ); } #endif sv.sa_handler = SIG_DFL; sigemptyset( &sv.sa_mask ); sv.sa_flags = SA_RESTART; if ( sigaction( SIGTERM, &sv, NULL ) < 0 ) { LOG(log_error, logtype_papd, "sigaction: %s", strerror(errno) ); exit( 1 ); } if ( sigaction( SIGCHLD, &sv, NULL ) < 0 ) { LOG(log_error, logtype_papd, "sigaction: %s", strerror(errno) ); exit( 1 ); } for ( pr = printers; pr; pr = pr->p_next ) { atp_close( pr->p_atp ); } sat.sat_port = sock; if ( session( atp, &sat ) < 0 ) { LOG(log_error, logtype_papd, "bad session" ); exit( 1 ); } exit( 0 ); break; default : /* parent */ LOG(log_info, logtype_papd, "child %d for \"%s\" from %u.%u", c, pr->p_name, ntohs( sat.sat_addr.s_net ), sat.sat_addr.s_node); atp_close( atp ); } break; case PAP_SENDSTATUS : rbuf[ 0 ] = 0; rbuf[ 1 ] = PAP_STATUS; rbuf[ 2 ] = rbuf[ 3 ] = 0; rbuf[ 4 ] = rbuf[ 5 ] = 0; rbuf[ 6 ] = rbuf[ 7 ] = 0; iov.iov_base = rbuf; iov.iov_len = 8 + getstatus( pr, &rbuf[ 8 ] ); atpb.atp_sresiov = &iov; atpb.atp_sresiovcnt = 1; /* * This may error out if we lose a route, so we won't die(). */ if ( atp_sresp( pr->p_atp, &atpb ) < 0 ) { LOG(log_error, logtype_papd, "atp_sresp: %s", strerror(errno) ); } break; default : LOG(log_error, logtype_papd, "Bad request from %u.%u!", ntohs( sat.sat_addr.s_net ), sat.sat_addr.s_node ); continue; break; } #ifdef notdef /* * Sometimes the child process will send its first READ * before the parent has sent the OPEN REPLY. Moving this * code into the OPEN/STATUS switch fixes this problem. */ iov.iov_base = rbuf; iov.iov_len = 8 + getstatus( pr, &rbuf[ 8 ] ); atpb.atp_sresiov = &iov; atpb.atp_sresiovcnt = 1; /* * This may error out if we lose a route, so we won't die(). */ if ( atp_sresp( pr->p_atp, &atpb ) < 0 ) { LOG(log_error, logtype_papd, "atp_sresp: %s", strerror(errno) ); } #endif /* notdef */ } } } return 0; } /* * We assume buf is big enough for 255 bytes of data and a length byte. */ int getstatus(struct printer *pr, char *buf) { #ifdef HAVE_CUPS if ( pr->p_flags & P_PIPED ) { *buf = strlen( cannedstatus ); strncpy( &buf[ 1 ], cannedstatus, *buf ); return( *buf + 1 ); } else { cups_get_printer_status( pr ); *buf = strlen ( pr->p_status ); strncpy ( &buf[1], pr->p_status, *buf); return ( *buf + 1); } #else char path[ MAXPATHLEN ]; int fd = -1, rc; if ( pr->p_flags & P_SPOOLED && ( pr->p_spool != NULL )) { strcpy( path, pr->p_spool ); strcat( path, "/status" ); fd = open( path, O_RDONLY); } if (( pr->p_flags & P_PIPED ) || ( fd < 0 )) { *buf = strlen( cannedstatus ); strncpy( &buf[ 1 ], cannedstatus, *buf ); return( *buf + 1 ); } else { if (( rc = read( fd, &buf[ 1 ], 255 )) < 0 ) { rc = 0; } close( fd ); if ( rc && buf[ rc ] == '\n' ) { /* remove trailing newline */ rc--; } *buf = rc; return( rc + 1 ); } #endif /* HAVE_CUPS */ } char *pgetstr(char *id, char **area); char *getpname(char **area, int bufsize); #define PF_CONFBUFFER 1024 static void getprinters( char *cf) { char buf[ PF_CONFBUFFER ], area[ PF_CONFBUFFER ], *a, *p, *name, *type, *zone; struct printer *pr; int c; while (( c = getprent( cf, buf, PF_CONFBUFFER )) > 0 ) { a = area; /* * Get the printer's nbp name. */ if (( p = getpname( &a, PF_CONFBUFFER )) == NULL ) { fprintf( stderr, "No printer name\n" ); exit( 1 ); } if (( pr = (struct printer *)malloc( sizeof( struct printer ))) == NULL ) { perror( "malloc" ); exit( 1 ); } memset( pr, 0, sizeof( struct printer )); name = defprinter.p_name; type = defprinter.p_type; zone = defprinter.p_zone; if ( nbp_name( p, &name, &type, &zone )) { fprintf( stderr, "Can't parse \"%s\"\n", name ); exit( 1 ); } if ( name != defprinter.p_name ) { if (( pr->p_name = (char *)malloc( strlen( name ) + 1 )) == NULL ) { perror( "malloc" ); exit( 1 ); } strcpy( pr->p_name, name ); } else { pr->p_name = name; } if ( type != defprinter.p_type ) { if (( pr->p_type = (char *)malloc( strlen( type ) + 1 )) == NULL ) { perror( "malloc" ); exit( 1 ); } strcpy( pr->p_type, type ); } else { pr->p_type = type; } if ( zone != defprinter.p_zone ) { if (( pr->p_zone = (char *)malloc( strlen( zone ) + 1 )) == NULL ) { perror( "malloc" ); exit( 1 ); } strcpy( pr->p_zone, zone ); } else { pr->p_zone = zone; } if ( pnchktc( cf ) != 1 ) { fprintf( stderr, "Bad papcap entry\n" ); exit( 1 ); } /* * Get PPD file. */ if (( p = pgetstr( "pd", &a ) )) { if (( pr->p_ppdfile = (char *)malloc( strlen( p ) + 1 )) == NULL ) { perror( "malloc" ); exit( 1 ); } strcpy( pr->p_ppdfile, p ); } /* * Get lpd printer name. */ if (( p = pgetstr( "pr", &a )) == NULL ) { pr->p_printer = defprinter.p_printer; pr->p_flags = defprinter.p_flags; } else { if ( *p == '|' ) { p++; pr->p_flags = P_PIPED; } else { pr->p_flags = P_SPOOLED; } if (( pr->p_printer = (char *)malloc( strlen( p ) + 1 )) == NULL ) { perror( "malloc" ); exit( 1 ); } strcpy( pr->p_printer, p ); } /* * Do we want authenticated printing? */ if ((p = pgetstr( "ca", &a )) != NULL ) { if ((pr->p_authprintdir = (char *)malloc(strlen(p)+1)) == NULL) { perror( "malloc" ); exit(1); } strcpy( pr->p_authprintdir, p ); pr->p_flags |= P_AUTH; pr->p_flags |= P_AUTH_CAP; } else { pr->p_authprintdir = NULL; } if ( pgetflag( "sp" ) == 1 ) { pr->p_flags |= P_AUTH; pr->p_flags |= P_AUTH_PSSP; } if ((p = pgetstr("am", &a)) != NULL ) { if ((uamlist = (char *)malloc(strlen(p)+1)) == NULL ) { perror("malloc"); exit(1); } strcpy(uamlist, p); } if ( pr->p_flags & P_SPOOLED ) { /* * Get operator name. */ if (( p = pgetstr( "op", &a )) == NULL ) { pr->p_operator = defprinter.p_operator; } else { if (( pr->p_operator = (char *)malloc( strlen( p ) + 1 )) == NULL ) { perror( "malloc" ); exit( 1 ); } strcpy( pr->p_operator, p ); } } /* get printer's appletalk address. */ if (( p = pgetstr( "pa", &a )) == NULL ) memcpy(&pr->p_addr, &defprinter.p_addr, sizeof(pr->p_addr)); else atalk_aton(p, &pr->p_addr); #ifdef HAVE_CUPS if ((p = pgetstr("co", &a)) != NULL ) { pr->p_cupsoptions = strdup(p); LOG (log_error, logtype_papd, "enabling cups-options for %s: %s", pr->p_name, pr->p_cupsoptions); } #endif /* convert line endings for setup sections. real ugly work around for foomatic deficiencies, need to get rid of this */ if ( pgetflag("fo") == 1 ) { pr->p_flags |= P_FOOMATIC_HACK; LOG (log_error, logtype_papd, "enabling foomatic hack for %s", pr->p_name); } if (strncasecmp (pr->p_name, "cupsautoadd", 11) == 0) { #ifdef HAVE_CUPS pr = cups_autoadd_printers (pr, printers); printers = pr; #else LOG (log_error, logtype_papd, "cupsautoadd: Cups support not compiled in"); #endif /* HAVE_CUPS */ } else { #ifdef HAVE_CUPS if ( cups_check_printer ( pr, printers, 1) == 0) { pr->p_next = printers; printers = pr; } #else pr->p_next = printers; printers = pr; #endif /* HAVE_CUPS */ } } if ( c == 0 ) { endprent(); } else { /* No capability file, do default */ printers = &defprinter; } } int rprintcap( struct printer *pr) { #ifdef HAVE_CUPS char *p; if ( pr->p_flags & P_SPOOLED && !(pr->p_flags & P_CUPS_AUTOADDED) ) { /* Skip check if autoadded */ if ( cups_printername_ok ( pr->p_printer ) != 1) { LOG(log_error, logtype_papd, "No such CUPS printer: '%s'", pr->p_printer ); return( -1 ); } } /* * Check for ppd file, moved here because of cups_autoadd we cannot check at the usual location */ if ( pr->p_ppdfile == NULL ) { if ( (p = (char *) cups_get_printer_ppd ( pr->p_printer )) != NULL ) { if (( pr->p_ppdfile = (char *)malloc( strlen( p ) + 1 )) == NULL ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) ); exit( 1 ); } strcpy( pr->p_ppdfile, p ); pr->p_flags |= P_CUPS_PPD; LOG(log_info, logtype_papd, "PPD File for %s set to %s", pr->p_printer, pr->p_ppdfile ); } } #else char buf[ 1024 ], area[ 1024 ], *a, *p; int c; /* * Spool directory from printcap file. */ if ( pr->p_flags & P_SPOOLED ) { if ( pgetent( printcap, buf, pr->p_printer ) != 1 ) { LOG(log_error, logtype_papd, "No such printer: %s", pr->p_printer ); return( -1 ); } /* * Spool directory. */ if ( pr->p_spool != NULL && pr->p_spool != defprinter.p_spool ) { free( pr->p_spool ); } a = area; if (( p = pgetstr( "sd", &a )) == NULL ) { pr->p_spool = defprinter.p_spool; } else { if (( pr->p_spool = (char *)malloc( strlen( p ) + 1 )) == NULL ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) ); exit( 1 ); } strcpy( pr->p_spool, p ); } /* * Is accounting on? */ a = area; if ( pgetstr( "af", &a ) == NULL ) { pr->p_flags &= ~P_ACCOUNT; } else { pr->p_flags |= P_ACCOUNT; #ifdef ABS_PRINT if ( pr->p_role != NULL && pr->p_role != defprinter.p_role ) { free( pr->p_role ); } a = area; if (( p = pgetstr( "ro", &a )) == NULL ) { pr->p_role = defprinter.p_role; } else { if (( pr->p_role = (char *)malloc( strlen( p ) + 1 )) == NULL ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) ); exit( 1 ); } strcpy( pr->p_role, p ); } if (( c = pgetnum( "si" )) < 0 ) { pr->p_srvid = defprinter.p_srvid; } else { pr->p_srvid = c; } #endif /* ABS_PRINT */ } /* * Cost of printer. */ if ( pr->p_pagecost_msg != NULL && pr->p_pagecost_msg != defprinter.p_pagecost_msg ) { free( pr->p_pagecost_msg ); } a = area; if (( p = pgetstr( "pc", &a )) != NULL ) { if (( pr->p_pagecost_msg = (char *)malloc( strlen( p ) + 1 )) == NULL ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) ); exit( 1 ); } strcpy( pr->p_pagecost_msg, p ); pr->p_pagecost = 0; } else if ( pr->p_flags & P_ACCOUNT ) { if (( c = pgetnum( "pc" )) < 0 ) { pr->p_pagecost = defprinter.p_pagecost; } else { pr->p_pagecost = c; } pr->p_pagecost_msg = NULL; } /* * Get lpd lock file. */ if ( pr->p_lock != NULL && pr->p_lock != defprinter.p_lock ) { free( pr->p_lock ); } a = area; if (( p = pgetstr( "lo", &a )) == NULL ) { pr->p_lock = defprinter.p_lock; } else { if (( pr->p_lock = (char *)malloc( strlen( p ) + 1 )) == NULL ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) ); exit( 1 ); } strcpy( pr->p_lock, p ); } #ifdef KRB /* * Must Kerberos authenticate? */ if ( pgetflag( "ka" ) == 1 ) { pr->p_flags |= P_KRB; } else { pr->p_flags &= ~P_KRB; } #endif /* KRB */ endprent(); } #endif /* HAVE_CUPS */ return( 0 ); } netatalk-2.2.2/etc/papd/comment.c0000644000175200017500000000443211655731126013562 00000000000000/* * $Id: comment.c,v 1.10 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include "comment.h" struct comstate *comstate; char *comcont = "%%+"; void compop( void ) { struct comstate *cs; cs = comstate; comstate = cs->cs_prev; free( cs ); } void compush(struct papd_comment *comment) { struct comstate *cs; if (( cs = (struct comstate *)malloc( sizeof( struct comstate ))) == NULL ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) ); exit( 1 ); } cs->cs_comment = comment; cs->cs_prev = comstate; cs->cs_flags = 0; comstate = cs; } int comswitch(struct papd_comment *comments, int (*handler)()) { struct papd_comment *c, *comment = NULL; for ( c = comments; c->c_begin; c++ ) { if ( c->c_handler == handler ) { comment = c; } } if ( comment == NULL || comment->c_handler != handler ) { LOG(log_error, logtype_papd, "comswitch: can't find handler!" ); return( -1 ); } compop(); compush( comment ); return( 0 ); } int comcmp( char *start, char *stop, char *str,int how) { int cc, len; len = stop - start; cc = strlen( str ); if ( how & C_FULL ) { if ( (cc == len) && (strncmp( str, start, cc ) == 0) ) { return( 0 ); } } else { if ( (cc <= len) && (strncmp( str, start, cc ) == 0) ) { return( 0 ); } } return( 1 ); } struct papd_comment *commatch( char *start, char *stop, struct papd_comment comments[]) { struct papd_comment *comment; for ( comment = comments; comment->c_begin; comment++ ) { if ( comcmp( start, stop, comment->c_begin, comment->c_flags ) == 0 ) { break; } } if ( comment->c_begin ) { return( comment ); } else { return( NULL ); } } char *comtoken( char *start, char *stop, char *pos, char *delim) { if ( pos < start || pos > stop ) { abort(); } for ( ; pos < stop; pos++ ) { if ( index( delim, *pos )) { break; } } if ( ++pos < stop ) { return( pos ); } else { return( NULL ); } } netatalk-2.2.2/etc/papd/file.c0000644000175200017500000000533111655731126013036 00000000000000/* * $Id: file.c,v 1.12 2009-10-14 02:24:05 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include "file.h" /* */ int markline( struct papfile *pf, char **start, int *linelength, int *crlflength ) { char *p; if ( pf->pf_datalen == 0 && ( pf->pf_state & PF_EOF )) { return( 0 ); } *start = pf->pf_data; /* get a line */ for ( *linelength=0; *linelength < pf->pf_datalen; (*linelength)++) { if (pf->pf_data[*linelength] == '\n' || pf->pf_data[*linelength] == '\r') { break; } } if ( *linelength >= pf->pf_datalen ) { if ( pf->pf_state & PF_EOF ) { append( pf, "\n", 1 ); } else if (*linelength < 1024) { return( -1 ); } } p = pf->pf_data + *linelength; *crlflength=0; while(*crlflength < pf->pf_datalen-*linelength && (p[*crlflength]=='\r' || p[*crlflength]=='\n')) { (*crlflength)++; } if (!*crlflength) { /* line is way too long, something fishy is going on, give up */ LOG(log_error, logtype_papd, "markline: no crlf in comment, give up" ); return( -2 ); } /* success, return 1 */ return( 1 ); } void morespace(struct papfile *pf, const char *data, int len) { char *nbuf; int nsize; if ( pf->pf_data != pf->pf_buf ) { /* pull up */ bcopy( pf->pf_data, pf->pf_buf, pf->pf_datalen); pf->pf_data = pf->pf_buf; } if ( pf->pf_datalen + len > pf->pf_bufsize ) { /* make more space */ nsize = (( pf->pf_bufsize + len ) / PF_MORESPACE + (( pf->pf_bufsize + len ) % PF_MORESPACE != 0 )) * PF_MORESPACE; if ( pf->pf_buf ) { if (( nbuf = (char *)realloc( pf->pf_buf, nsize )) == NULL ) { exit( 1 ); } } else { if (( nbuf = (char *)malloc( nsize )) == NULL ) { exit( 1 ); } } pf->pf_bufsize = nsize; pf->pf_data = nbuf + ( pf->pf_data - pf->pf_buf ); pf->pf_buf = nbuf; } bcopy( data, pf->pf_data + pf->pf_datalen, len ); pf->pf_datalen += len; } void append(struct papfile *pf, const char *data, int len) { if ((pf->pf_data + pf->pf_datalen + len) > (pf->pf_buf + pf->pf_bufsize)) { morespace(pf, data, len); } else { memcpy(pf->pf_data + pf->pf_datalen, data, len); pf->pf_datalen += len; } } void spoolerror(struct papfile *out, char *str) { char *pserr1 = "%%[ Error: "; char *pserr2 = " ]%%\n"; if ( str == NULL ) { str = "Spooler error."; } append( out, pserr1, strlen( pserr1 )); append( out, str, strlen( str )); append( out, pserr2, strlen( pserr2 )); } netatalk-2.2.2/etc/papd/comment.h0000644000175200017500000000267611655731126013577 00000000000000/* * $Id: comment.h,v 1.6 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifndef PAPD_COMMENT_H #define PAPD_COMMENT_H 1 #include struct papd_comment { char *c_begin; char *c_end; int (*c_handler)(); int c_flags; }; #define CH_DONE 0 #define CH_MORE 1 #define CH_ERROR -1 struct comstate { struct papd_comment *cs_comment; struct comstate *cs_prev; int cs_flags; }; extern struct papd_comment *commatch(); extern struct comstate *comstate; extern struct papd_comment magics[]; extern struct papd_comment queries[]; extern struct papd_comment headers[]; extern char *comcont; #define compeek() (comstate==NULL?NULL:(comstate->cs_comment)) #define comgetflags() (comstate->cs_flags) #define comsetflags(f) (comstate->cs_flags=(f)) /* * Comment flags. 0-15 reserved for "global" flags, 16-31 for specific * subtypes. */ #define C_FULL (1<<0) /* or prefix */ #define C_CONTINUE (1<<1) /* * Query subtypes. */ /* * Magic "number" subtypes. */ #define CM_NOPRINT (1<<16) /* or print */ void compop ( void ); void compush ( struct papd_comment * ); int comswitch ( struct papd_comment *, int (*)() ); int comcmp ( char *, char *, char *, int ); struct papd_comment *commatch ( char *, char *, struct papd_comment * ); char *comtoken ( char *, char *, char *, char * ); #endif /* PAPD_COMMENT_H */ netatalk-2.2.2/etc/papd/lp.h0000644000175200017500000000133211655731126012534 00000000000000/* * $Id: lp.h,v 1.6 2009-10-13 22:55:37 didg Exp $ */ #ifndef PAPD_LP_H #define PAPD_LP_H 1 #include #include #include "file.h" void lp_person ( char * ); int lp_pagecost ( void ); void lp_host ( char * ); void lp_job ( char * ); void lp_for ( char * ); void lp_origin ( int ); int lp_rmjob ( int ); int lp_queue ( struct papfile * ); /* cancel current job */ int lp_cancel ( void ); /* print current job */ int lp_print ( void ); /* open a file for spooling */ int lp_open ( struct papfile *, struct sockaddr_at * ); /* open a buffer to the current open file */ int lp_write ( struct papfile *,char *, size_t ); /* close current spooling file */ int lp_close ( void ); #endif /* PAPD_LP_H */ netatalk-2.2.2/etc/papd/printcap.c0000644000175200017500000002634311655731126013745 00000000000000/* * $Id: printcap.c,v 1.12 2009-10-14 02:24:05 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * * Copyright (c) 1983 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #include "printcap.h" #ifndef BUFSIZ #define BUFSIZ 1024 #endif /* ! BUFSIZ */ #define MAXHOP 32 /* max number of tc= indirections */ /* * termcap - routines for dealing with the terminal capability data base * * BUG: Should use a "last" pointer in tbuf, so that searching * for capabilities alphabetically would not be a n**2/2 * process when large numbers of capabilities are given. * Note: If we add a last pointer now we will screw up the * tc capability. We really should compile termcap. * * Essentially all the work here is scanning and decoding escapes * in string capabilities. We don't use stdio because the editor * doesn't, and because living w/o it is not hard. */ #define PRINTCAP #ifdef PRINTCAP #define tgetent pgetent #define tskip pskip #define tgetstr pgetstr #define tdecode pdecode #define tgetnum pgetnum #define tgetflag pgetflag #define tdecode pdecode #define tnchktc pnchktc #define tnamatch pnamatch #define V6 #endif /* PRINTCAP */ static FILE *pfp = NULL; /* printcap data base file pointer */ static char *tbuf; static int hopcount; /* detect infinite loops in termcap, init 0 */ /* * Similar to tgetent except it returns the next entry instead of * doing a lookup. * * Added a "cap" parameter, so we can use these calls for printcap * and papd.conf. */ int getprent( char *cap, char *bp, int bufsize) { register int c, skip = 0, i; if (pfp == NULL && (pfp = fopen( cap, "r")) == NULL) return(-1); tbuf = bp; i = 0; for (;;) { switch (c = getc(pfp)) { case EOF: if (bp != tbuf) { *bp = '\0'; return(1); } fclose(pfp); pfp = NULL; return(0); case '\n': if (bp == tbuf) { skip = 0; continue; } if (bp[-1] == '\\') { bp--; continue; } *bp = '\0'; return(1); case '#': if (bp == tbuf) skip++; default: if (skip) continue; if (bp >= tbuf+BUFSIZ) { write(2, "Termcap entry too long\n", 23); *bp = '\0'; return(1); } *bp++ = c; if (++i >= bufsize) { write(2, "config file too large\n", 22); fclose(pfp); pfp = NULL; *bp = '\0'; return(1); } } } } void endprent(void) { if (pfp != NULL) fclose(pfp); } /* * Get an entry for terminal name in buffer bp, * from the termcap file. Parse is very rudimentary; * we just notice escaped newlines. * * Added a "cap" parameter, so we can use these calls for printcap * and papd.conf. */ int tgetent(char *cap, char *bp, char *name) { register char *cp; register int c; register int i = 0, cnt = 0; char ibuf[BUFSIZ]; int tf; int skip; hopcount = 0; tbuf = bp; tf = 0; #ifndef V6 cp = getenv("TERMCAP"); /* * TERMCAP can have one of two things in it. It can be the * name of a file to use instead of /etc/termcap. In this * case it better start with a "/". Or it can be an entry to * use so we don't have to read the file. In this case it * has to already have the newlines crunched out. */ if (cp && *cp) { if (*cp!='/') { cp2 = getenv("TERM"); if (cp2==(char *) 0 || strcmp(name,cp2)==0) { strcpy(bp,cp); return(tnchktc(cap)); } else { tf = open(cap, 0); } } else tf = open(cp, 0); } if (tf==0) tf = open(cap, 0); #else /* V6 */ tf = open(cap, 0); #endif /* V6 */ if (tf < 0) return (-1); for (;;) { cp = bp; skip = 0; for (;;) { if (i == cnt) { cnt = read(tf, ibuf, BUFSIZ); if (cnt <= 0) { close(tf); return (0); } i = 0; } c = ibuf[i++]; if (c == '\n') { if (!skip && cp > bp && cp[-1] == '\\') { cp--; continue; } skip = 0; if (cp == bp) continue; else break; } if (c == '#' && cp == bp) skip++; if (skip) continue; if (cp >= bp+BUFSIZ) { write(2,"Termcap entry too long\n", 23); break; } else *cp++ = c; } *cp = 0; /* * The real work for the match. */ if (tnamatch(name)) { close(tf); return(tnchktc(cap)); } } } /* * tnchktc: check the last entry, see if it's tc=xxx. If so, * recursively find xxx and append that entry (minus the names) * to take the place of the tc=xxx entry. This allows termcap * entries to say "like an HP2621 but doesn't turn on the labels". * Note that this works because of the left to right scan. * * Added a "cap" parameter, so we can use these calls for printcap * and papd.conf. */ int tnchktc( char *cap) { register char *p, *q; char tcname[16]; /* name of similar terminal */ char tcbuf[BUFSIZ]; char *holdtbuf = tbuf; int l; p = tbuf + strlen(tbuf) - 2; /* before the last colon */ while (*--p != ':') if (p MAXHOP) { write(2, "Infinite tc= loop\n", 18); return (0); } if (tgetent( cap, tcbuf, tcname) != 1) return(0); for (q=tcbuf; *q != ':'; q++) ; l = p - holdtbuf + strlen(q); if (l > BUFSIZ) { write(2, "Termcap entry too long\n", 23); q[BUFSIZ - (p-tbuf)] = 0; } strcpy(p, q+1); tbuf = holdtbuf; return(1); } /* * Tnamatch deals with name matching. The first field of the termcap * entry is a sequence of names separated by |'s, so we compare * against each such name. The normal : terminator after the last * name (before the first field) stops us. */ int tnamatch(char *np) { register char *Np, *Bp; Bp = tbuf; if (*Bp == '#') return(0); for (;;) { for (Np = np; *Np && *Bp == *Np; Bp++, Np++) continue; if (*Np == 0 && (*Bp == '|' || *Bp == ':' || *Bp == 0)) return (1); while (*Bp && *Bp != ':' && *Bp != '|') Bp++; if (*Bp == 0 || *Bp == ':') return (0); Bp++; } } /* * Skip to the next field. Notice that this is very dumb, not * knowing about \: escapes or any such. If necessary, :'s can be put * into the termcap file in octal. */ static char *tskip(char *bp) { while (*bp && *bp != ':') bp++; while (*bp && *bp == ':') bp++; return (bp); } /* * Return the (numeric) option id. * Numeric options look like * li#80 * i.e. the option string is separated from the numeric value by * a # character. If the option is not found we return -1. * Note that we handle octal numbers beginning with 0. */ int tgetnum(char *id) { register int i, base; register char *bp = tbuf; for (;;) { bp = tskip(bp); if (*bp == 0) return (-1); if (*bp++ != id[0] || *bp == 0 || *bp++ != id[1]) continue; if (*bp == '@') return(-1); if (*bp != '#') continue; bp++; base = 10; if (*bp == '0') base = 8; i = 0; while (isdigit(*bp)) i *= base, i += *bp++ - '0'; return (i); } } /* * Handle a flag option. * Flag options are given "naked", i.e. followed by a : or the end * of the buffer. Return 1 if we find the option, or 0 if it is * not given. */ int tgetflag(char *id) { register char *bp = tbuf; for (;;) { bp = tskip(bp); if (!*bp) return (0); if (*bp++ == id[0] && *bp != 0 && *bp++ == id[1]) { if (!*bp || *bp == ':') return (1); else if (*bp == '@') return(0); } } } /* * Tdecode does the grung work to decode the * string capability escapes. */ static char * tdecode(char *str, char **area) { register char *cp; register int c; register char *dp; int i; cp = *area; while ((c = *str++) && c != ':') { switch (c) { case '^': c = *str++ & 037; break; case '\\': dp = "E\033^^\\\\::n\nr\rt\tb\bf\f"; c = *str++; nextc: if (*dp++ == c) { c = *dp++; break; } dp++; if (*dp) goto nextc; if (isdigit(c)) { c -= '0', i = 2; do c <<= 3, c |= *str++ - '0'; while (--i && isdigit(*str)); } break; } *cp++ = c; } *cp++ = 0; str = *area; *area = cp; return (str); } /* * Get a string valued option. * These are given as * cl=^Z * Much decoding is done on the strings, and the strings are * placed in area, which is a ref parameter which is updated. * No checking on area overflow. */ char * tgetstr(char *id, char **area) { register char *bp = tbuf; for (;;) { bp = tskip(bp); if (!*bp) return (NULL); if (*bp++ != id[0] || *bp == 0 || *bp++ != id[1]) continue; if (*bp == '@') return(NULL); if (*bp != '=') continue; bp++; return (tdecode(bp, area)); } } static char * decodename(char *str, char **area, int bufsize) { register char *cp; register int c; register char *dp; int i; cp = *area; while ((c = *str++) && --bufsize && c != ':' && c != '|' ) { switch (c) { case '^': c = *str++ & 037; break; case '\\': dp = "E\033^^\\\\::n\nr\rt\tb\bf\f"; c = *str++; nextc: if (*dp++ == c) { c = *dp++; break; } dp++; if (*dp) goto nextc; if (isdigit(c)) { c -= '0', i = 2; do c <<= 3, c |= *str++ - '0'; while (--i && isdigit(*str)); } break; } *cp++ = c; } *cp++ = 0; str = *area; *area = cp; return (str); } char * getpname(char **area, int bufsize) { return( decodename( tbuf, area, bufsize)); } netatalk-2.2.2/etc/papd/headers.c0000644000175200017500000001601611655731126013534 00000000000000/* * $Id: headers.c,v 1.14 2009-10-29 13:38:15 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include "file.h" #include "comment.h" #include "lp.h" int ch_title( struct papfile *, struct papfile * ); int ch_for( struct papfile *, struct papfile * ); static char *get_text(char *start, int linelength) { char *p, *q; char *t, *ret; char *stop; /* 1023 is arbitrary 255 max for comment but some may be escape \xxx and space and keyword */ if (linelength > 1023) return NULL; t = ret = calloc(1, linelength +1); if (!ret) return NULL; stop = start + linelength; for ( p = start; p < stop; p++ ) { if ( *p == ':' ) { p++; break; } } for ( ; p < stop; p++ ) { if (*p != ' ' && *p != '\t') { break; } } if ( p < stop && *p == '(' ) { int count; /* start with ( then it's a */ p++; for ( q = p, count = 1; q < stop; q++, t++ ) { if (*q == '(') { count++; } else if ( *q == ')' ) { count--; if (!count) { break; } } *t = *q; } } else { /* it's a textline */ for ( q = p; q < stop; q++, t++ ) { *t = *q; } } return ret; } int ch_for( struct papfile *in, struct papfile *out _U_) { char *start, *cmt; int linelength, crlflength; switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } cmt = get_text(start, linelength); if ( cmt ) { lp_for ( cmt ); free(cmt); } in->pf_state |= PF_TRANSLATE; lp_write( in, start, linelength + crlflength ); in->pf_state &= ~PF_TRANSLATE; compop(); CONSUME( in, linelength + crlflength ); return( CH_DONE ); } int ch_title( struct papfile *in, struct papfile *out _U_) { char *start, *cmt; int linelength, crlflength; switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } #ifdef DEBUG LOG(log_debug9, logtype_papd, "Parsing %%Title"); #endif cmt = get_text(start, linelength); if ( cmt ) { lp_job( cmt ); free(cmt); } in->pf_state |= PF_TRANSLATE; lp_write( in, start, linelength + crlflength ); in->pf_state &= ~PF_TRANSLATE; compop(); CONSUME( in, linelength + crlflength ); return( CH_DONE ); } static int guess_creator ( char *creator ) { if (strstr(creator, "LaserWriter")) return 1; if (strstr(creator, "cgpdftops")) return 2; return 0; } int ch_creator( struct papfile *in, struct papfile *out _U_) { char *start, *cmt; int linelength, crlflength; switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } cmt = get_text(start, linelength); if ( cmt ) { in->origin = guess_creator ( cmt ); free(cmt); lp_origin(in->origin); } in->pf_state |= PF_TRANSLATE; lp_write( in, start, linelength + crlflength ); in->pf_state &= ~PF_TRANSLATE; compop(); CONSUME( in, linelength + crlflength ); return( CH_DONE ); } int ch_endcomm( struct papfile *in, struct papfile *out _U_) { char *start; int linelength, crlflength; #ifdef DEBUG LOG(log_debug9, logtype_papd, "End Comment"); #endif in->pf_state |= PF_STW; switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } in->pf_state |= PF_TRANSLATE; lp_write( in, start, linelength + crlflength ); in->pf_state &= ~PF_TRANSLATE; compop(); CONSUME( in, linelength + crlflength ); return ( CH_DONE); } int ch_starttranslate( struct papfile *in, struct papfile *out _U_) { char *start; int linelength, crlflength; #ifdef DEBUG LOG(log_debug9, logtype_papd, "Start translate"); #endif switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } in->pf_state |= PF_TRANSLATE; lp_write( in, start, linelength + crlflength ); compop(); CONSUME( in, linelength + crlflength ); return ( CH_DONE); } int ch_endtranslate(struct papfile *in, struct papfile *out _U_) { char *start; int linelength, crlflength; #ifdef DEBUG LOG(log_debug9, logtype_papd, "EndTranslate"); #endif switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } lp_write( in, start, linelength + crlflength ); in->pf_state &= ~PF_TRANSLATE; compop(); CONSUME( in, linelength + crlflength ); return ( CH_DONE); } int ch_translateone( struct papfile *in, struct papfile *out _U_) { char *start; int linelength, crlflength; #ifdef DEBUG LOG(log_debug9, logtype_papd, "TranslateOne"); #endif switch ( markline( in, &start, &linelength, &crlflength )) { case 0 : return( 0 ); case -1 : return( CH_MORE ); case -2 : return( CH_ERROR ); } in->pf_state |= PF_TRANSLATE; lp_write( in, start, linelength + crlflength ); in->pf_state &= ~PF_TRANSLATE; compop(); CONSUME( in, linelength + crlflength ); return ( CH_DONE); } /* * "Header" comments. */ struct papd_comment headers[] = { { "%%Title:", NULL, ch_title, 0 }, { "%%For:", NULL, ch_for, 0 }, { "%%Creator:", NULL, ch_creator, 0 }, { "%%EndComments", NULL, ch_endcomm, 0 }, { "%%BeginFeature", NULL, ch_starttranslate, 0 }, { "%%EndFeature", NULL, ch_endtranslate, 0 }, { "%%BeginPageSetup", NULL, ch_starttranslate, 0 }, { "%%EndPageSetup", NULL, ch_endtranslate, 0 }, #if 0 { "%%BeginSetup", NULL, ch_translateone, 0 }, { "%%EndSetup", NULL, ch_translateone, 0 }, { "%%BeginProlog", NULL, ch_translateone, 0 }, { "%%EndProlog", NULL, ch_translateone, 0 }, { "%%Page:", NULL, ch_translateone, 0 }, { "%%PageTrailer", NULL, ch_translateone, 0 }, { "%%Trailer", NULL, ch_translateone, 0 }, { "%%EOF", NULL, ch_translateone, 0 }, #endif { "%%", NULL, ch_translateone, 0 }, { NULL, NULL, NULL, 0 }, }; netatalk-2.2.2/etc/papd/uam_auth.h0000644000175200017500000000366411655731126013736 00000000000000/* * $Id: uam_auth.h,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. * * interface between uam.c and auth.c */ #ifndef PAPD_UAM_AUTH_H #define PAPD_UAM_AUTH_H 1 #include #include #include #include "file.h" struct uam_mod { void *uam_module; struct uam_export *uam_fcn; struct uam_mod *uam_prev, *uam_next; }; struct uam_obj { const char *uam_name; /* authentication method */ char *uam_path; /* where it's located */ int uam_count; union { struct { int (*login) (void *, struct passwd **, char *, int, char *, int *); int (*logincont) (void *, struct passwd **, char *, int, char *, int *); void (*logout) (void); } uam_login; int (*uam_changepw) (void *, char *, struct passwd *, char *, int, char *, int *); int (*uam_printer) (char *, char *, char *, struct papfile *); } u; struct uam_obj *uam_prev, *uam_next; }; #define uam_attach(a, b) do { \ (a)->uam_prev->uam_next = (b); \ (b)->uam_prev = (a)->uam_prev; \ (b)->uam_next = (a); \ (a)->uam_prev = (b); \ } while (0) #define uam_detach(a) do { \ (a)->uam_prev->uam_next = (a)->uam_next; \ (a)->uam_next->uam_prev = (a)->uam_prev; \ } while (0) #define UAM_LIST(type) (((type) == UAM_SERVER_LOGIN) ? &uam_login : \ (((type) == UAM_SERVER_CHANGEPW) ? &uam_changepw : \ (((type) == UAM_SERVER_PRINTAUTH) ? &uam_printer : NULL))) extern struct uam_mod *uam_load (const char *, const char *); extern void uam_unload (struct uam_mod *); /* auth.c */ int auth_load (const char *, const char *); int auth_register (const int, struct uam_obj *); #define auth_unregister(a) uam_detach(a) struct uam_obj *auth_uamfind (const int, const char *, const int); void auth_unload (void); int getuamnames (const int, char *); #endif /* uam_auth.h */ netatalk-2.2.2/etc/papd/print_cups.c0000644000175200017500000004375111655731126014315 00000000000000/* * $Id: print_cups.c,v 1.6 2010-01-26 20:43:11 didg Exp $ * * Copyright 2004 Bjoern Fernhomberg. * * Some code copied or adapted from print_cups.c for samba * Copyright 1999-2003 by Michael R Sweet. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #ifdef HAVE_CUPS #include #include #include #include #include #include #include #include "printer.h" #include "print_cups.h" #define MAXCHOOSERLEN 31 #define HTTP_MAX_URI 1024 static const char* cups_status_msg[] = { "status: busy; info: \"%s\" is rejecting jobs; ", "status: idle; info: \"%s\" is stopped, accepting jobs ;", "status: idle; info: \"%s\" is ready ; ", }; /* Local functions */ static int convert_to_mac_name ( const char *encoding, char * inptr, char * outptr, size_t outlen); static size_t to_ascii ( char *inbuf, char **outbuf); static int cups_mangle_printer_name ( struct printer *pr, struct printer *printers); static void cups_free_printer ( struct printer *pr); const char * cups_get_language (void) { cups_lang_t *language; language = cupsLangDefault(); /* needed for conversion */ return cupsLangEncoding(language); } /* * 'cups_passwd_cb()' - The CUPS password callback... */ static const char * /* O - Password or NULL */ cups_passwd_cb(const char *prompt _U_) /* I - Prompt */ { /* * Always return NULL to indicate that no password is available... */ return (NULL); } /* * 'cups_printername_ok()' - Verify supplied printer name is a valid cups printer */ int /* O - 1 if printer name OK */ cups_printername_ok(char *name) /* I - Name of printer */ { http_t *http; /* HTTP connection to server */ ipp_t *request, /* IPP Request */ *response; /* IPP Response */ cups_lang_t *language; /* Default language */ char uri[HTTP_MAX_URI]; /* printer-uri attribute */ /* * Make sure we don't ask for passwords... */ cupsSetPasswordCB(cups_passwd_cb); /* * Try to connect to the server... */ if ((http = httpConnect(cupsServer(), ippPort())) == NULL) { LOG(log_error, logtype_papd, "Unable to connect to CUPS server %s - %s", cupsServer(), strerror(errno)); return (0); } /* * Build an IPP_GET_PRINTER_ATTRS request, which requires the following * attributes: * * attributes-charset * attributes-natural-language * requested-attributes * printer-uri */ request = ippNew(); request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; request->request.op.request_id = 1; language = cupsLangDefault(); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, cupsLangEncoding(language)); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, language->language); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requested-attributes", NULL, "printer-uri"); sprintf(uri, "ipp://localhost/printers/%s", name); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); /* * Do the request and get back a response... */ if ((response = cupsDoRequest(http, request, "/")) == NULL) { LOG(log_error, logtype_papd, "Unable to get printer status for %s - %s", name, ippErrorString(cupsLastError())); httpClose(http); return (0); } httpClose(http); if (response->request.status.status_code >= IPP_OK_CONFLICT) { LOG(log_error, logtype_papd, "Unable to get printer status for %s - %s", name, ippErrorString(response->request.status.status_code)); ippDelete(response); return (0); } else { ippDelete(response); return (1); } return (0); } const char * cups_get_printer_ppd ( char * name) { cupsSetPasswordCB(cups_passwd_cb); return cupsGetPPD( name ); } int cups_get_printer_status (struct printer *pr) { http_t *http; /* HTTP connection to server */ ipp_t *request, /* IPP Request */ *response; /* IPP Response */ ipp_attribute_t *attr; /* Current attribute */ cups_lang_t *language; /* Default language */ char uri[HTTP_MAX_URI]; /* printer-uri attribute */ int status = -1; static const char *pattrs[] = /* Requested printer attributes */ { "printer-state", "printer-state-message", "printer-is-accepting-jobs" }; /* * Make sure we don't ask for passwords... */ cupsSetPasswordCB(cups_passwd_cb); /* * Try to connect to the server... */ if ((http = httpConnect(cupsServer(), ippPort())) == NULL) { LOG(log_error, logtype_papd, "Unable to connect to CUPS server %s - %s", cupsServer(), strerror(errno)); return (0); } /* * Generate the printer URI... */ sprintf(uri, "ipp://localhost/printers/%s", pr->p_printer); /* * Build an IPP_GET_PRINTER_ATTRIBUTES request, which requires the * following attributes: * * attributes-charset * attributes-natural-language * requested-attributes * printer-uri */ request = ippNew(); request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; request->request.op.request_id = 1; language = cupsLangDefault(); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, cupsLangEncoding(language)); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, language->language); ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requested-attributes", (sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); /* * Do the request and get back a response... */ if ((response = cupsDoRequest(http, request, "/")) == NULL) { LOG(log_error, logtype_papd, "Unable to get printer status for %s - %s", pr->p_printer, ippErrorString(cupsLastError())); httpClose(http); return (0); } if (response->request.status.status_code >= IPP_OK_CONFLICT) { LOG(log_error, logtype_papd, "Unable to get printer status for %s - %s", pr->p_printer, ippErrorString(response->request.status.status_code)); ippDelete(response); httpClose(http); return (0); } /* * Get the current printer status and convert it to the status values. */ memset ( pr->p_status, 0 ,sizeof(pr->p_status)); if ((attr = ippFindAttribute(response, "printer-state", IPP_TAG_ENUM)) != NULL) { if (attr->values[0].integer == IPP_PRINTER_STOPPED) status = 1; else if (attr->values[0].integer == IPP_NOT_ACCEPTING) status = 0; else status = 2; } if ((attr = ippFindAttribute(response, "printer-is-accepting-jobs", IPP_TAG_BOOLEAN)) != NULL) { if ( attr->values[0].integer == 0 ) status = 0; } snprintf ( pr->p_status, 255, cups_status_msg[status], pr->p_printer ); if ((attr = ippFindAttribute(response, "printer-state-message", IPP_TAG_TEXT)) != NULL) strncat ( pr->p_status, attr->values[0].string.text, 255-strlen(pr->p_status)); ippDelete(response); /* * Return the print status ... */ httpClose(http); return (status); } /*------------------------------------------------------------------------*/ /* pass the job to cups */ int cups_print_job ( char * name, char *filename, char *job, char *username, char * cupsoptions ) { int jobid; char filepath[MAXPATHLEN]; int num_options; cups_option_t *options; /* Initialize the options array */ num_options = 0; options = (cups_option_t *)0; cupsSetPasswordCB(cups_passwd_cb); if ( username != NULL ) { /* Add options using cupsAddOption() */ num_options = cupsAddOption("job-originating-user-name", username, num_options, &options); num_options = cupsAddOption("originating-user-name", username, num_options, &options); cupsSetUser ( username ); } if (cupsoptions != NULL) { num_options = cupsParseOptions(cupsoptions, num_options, &options); } strlcpy ( filepath, SPOOLDIR, sizeof(filepath)); strlcat ( filepath , "/", sizeof(filepath)); strlcat ( filepath , filename, sizeof(filepath)); if ((jobid = cupsPrintFile( name, filepath, job, 0, options)) == 0) LOG(log_error, logtype_papd, "Unable to print job '%s' (%s) to printer '%s' for user '%s' - CUPS error : '%s'", job, filepath, name, username, ippErrorString(cupsLastError())); else LOG(log_info, logtype_papd, "Job '%s' queued to printer '%s' with id '%d'", job, name, jobid); cupsFreeOptions(num_options, options); return (jobid); } /*------------------------------------------------------------------------*/ struct printer * cups_autoadd_printers ( struct printer *defprinter, struct printer *printers) { struct printer *pr; int num_dests,i; int ret; cups_dest_t *dests; cups_lang_t *language; char name[MAXCHOOSERLEN+1], *p; language = cupsLangDefault(); /* needed for conversion */ num_dests = cupsGetDests(&dests); /* get the available destination from CUPS */ for (i=0; i< num_dests; i++) { if (( pr = (struct printer *)malloc( sizeof( struct printer ))) == NULL ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) ); exit( 1 ); } memcpy( pr, defprinter, sizeof( struct printer ) ); /* convert from CUPS to local encoding */ convert_string_allocate( add_charset(cupsLangEncoding(language)), CH_UNIX, dests[i].name, -1, &pr->p_u_name); /* convert CUPS name to Mac charset */ if ( convert_to_mac_name ( cupsLangEncoding(language), dests[i].name, name, sizeof(name)) <= 0) { LOG (log_error, logtype_papd, "Conversion from CUPS to MAC name failed for %s", dests[i].name); free (pr); continue; } if (( pr->p_name = (char *)malloc( strlen( name ) + 1 )) == NULL ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) ); exit( 1 ); } strcpy( pr->p_name, name ); /* set printer flags */ pr->p_flags &= ~P_PIPED; pr->p_flags |= P_SPOOLED; pr->p_flags |= P_CUPS; pr->p_flags |= P_CUPS_AUTOADDED; if (( pr->p_printer = (char *)malloc( strlen( dests[i].name ) + 1 )) == NULL ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) ); exit( 1 ); } strcpy( pr->p_printer, dests[i].name ); if ( (p = (char *) cups_get_printer_ppd ( pr->p_printer )) != NULL ) { if (( pr->p_ppdfile = (char *)malloc( strlen( p ) + 1 )) == NULL ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) ); exit( 1 ); } strcpy( pr->p_ppdfile, p ); pr->p_flags |= P_CUPS_PPD; } if ( (ret = cups_check_printer ( pr, printers, 0)) == -1) ret = cups_mangle_printer_name ( pr, printers ); if (ret) { cups_free_printer (pr); LOG(log_info, logtype_papd, "Printer %s not added: reason %d", name, ret); } else { pr->p_next = printers; printers = pr; } } cupsFreeDests(num_dests, dests); cupsLangFree(language); return printers; } /*------------------------------------------------------------------------*/ /* cups_mangle_printer_name * Mangles the printer name if two CUPS printer provide the same Chooser Name * Append '#nn' to the chooser name, if it is longer than 28 char we overwrite the last three chars * Returns: 0 on Success, 2 on Error */ static int cups_mangle_printer_name ( struct printer *pr, struct printer *printers) { size_t count, name_len; char name[MAXCHOOSERLEN]; count = 1; name_len = strlen (pr->p_name); strncpy ( name, pr->p_name, MAXCHOOSERLEN-3); /* Reallocate necessary space */ (name_len >= MAXCHOOSERLEN-3) ? (name_len = MAXCHOOSERLEN+1) : (name_len = name_len + 4); pr->p_name = (char *) realloc (pr->p_name, name_len ); while ( ( cups_check_printer ( pr, printers, 0 )) && count < 100) { memset ( pr->p_name, 0, name_len); strncpy ( pr->p_name, name, MAXCHOOSERLEN-3); sprintf ( pr->p_name, "%s#%2.2u", pr->p_name, count++); } if ( count > 99) return (2); return (0); } /*------------------------------------------------------------------------*/ /* fallback ASCII conversion */ static size_t to_ascii ( char *inptr, char **outptr) { char *out, *osav; if ( NULL == (out = (char*) malloc ( strlen ( inptr) + 1 )) ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) ); exit (1); } osav = out; while ( *inptr != '\0' ) { if ( *inptr & 0x80 ) { *out = '_'; out++; inptr++; } else *out++ = *inptr++; } *out = '\0'; *outptr = osav; return ( strlen (osav) ); } /*------------------------------------------------------------------------*/ /* convert_to_mac_name * 1) Convert from encoding to MacRoman * 2) Shorten to MAXCHOOSERLEN (31) * 3) Replace @ and _ as they are illegal * Returns: -1 on failure, length of name on success; outpr contains name in MacRoman */ static int convert_to_mac_name ( const char * encoding, char * inptr, char * outptr, size_t outlen) { char *outbuf; char *soptr; size_t name_len = 0; size_t i; charset_t chCups; /* Change the encoding */ if ((charset_t)-1 != (chCups = add_charset(encoding))) { name_len = convert_string_allocate( chCups, CH_MAC, inptr, -1, &outbuf); } if (name_len == 0 || name_len == (size_t)-1) { /* charset conversion failed, use ascii fallback */ name_len = to_ascii ( inptr, &outbuf ); } soptr = outptr; for ( i=0; i< name_len && i < outlen-1 ; i++) { if ( outbuf[i] == '_' ) *soptr = ' '; /* Replace '_' with a space (just for the looks) */ else if ( outbuf[i] == '@' || outbuf[i] == ':' ) *soptr = '_'; /* Replace @ and : with '_' as they are illegal chars */ else *soptr = outbuf[i]; soptr++; } *soptr = '\0'; free (outbuf); return (i); } /*------------------------------------------------------------------------*/ /* * cups_check_printer: * check if a printer with this name already exists. * if yes, and replace = 1 the existing printer is replaced with * the new one. This allows to overwrite printer settings * created by cupsautoadd. It also used by cups_mangle_printer. */ int cups_check_printer ( struct printer *pr, struct printer *printers, int replace) { struct printer *listptr, *listprev; listptr = printers; listprev = NULL; while ( listptr != NULL) { if ( strcasecmp (pr->p_name, listptr->p_name) == 0) { if ( pr->p_flags & P_CUPS_AUTOADDED ) { /* Check if printer has been autoadded */ if ( listptr->p_flags & P_CUPS_AUTOADDED ) return (-1); /* Conflicting Cups Auto Printer (mangling issue?) */ else return (1); /* Never replace a hand edited printer with auto one */ } if ( replace ) { /* Replace printer */ if ( listprev != NULL) { pr->p_next = listptr->p_next; listprev->p_next = pr; cups_free_printer (listptr); } else { printers = pr; printers->p_next = listptr->p_next; cups_free_printer (listptr); } } return (1); /* Conflicting Printers */ } listprev = listptr; listptr = listptr->p_next; } return (0); /* No conflict */ } /*------------------------------------------------------------------------*/ void cups_free_printer ( struct printer *pr) { if ( pr->p_name != NULL) free (pr->p_name); if ( pr->p_printer != NULL) free (pr->p_printer); if ( pr->p_ppdfile != NULL) free (pr->p_ppdfile); /* CUPS autoadded printers share the other informations * so if the printer is autoadded we won't free them. * We might leak some bytes here though. */ if ( pr->p_flags & P_CUPS_AUTOADDED ) { free (pr); return; } if ( pr->p_operator != NULL ) free (pr->p_operator); if ( pr->p_zone != NULL ) free (pr->p_zone); if ( pr->p_type != NULL ) free (pr->p_type); if ( pr->p_authprintdir != NULL ) free (pr->p_authprintdir); free ( pr ); return; } #endif /* HAVE_CUPS*/ netatalk-2.2.2/etc/papd/uam.c0000644000175200017500000001313211655731126012677 00000000000000/* * $Id: uam.c,v 1.11 2009-10-15 11:39:48 didg Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include /* STDC check */ #if STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #include #include #include #include #include #include #include #include "uam_auth.h" /* --- server uam functions -- */ /* uam_load. uams must have a uam_setup function. */ struct uam_mod *uam_load(const char *path, const char *name) { char buf[MAXPATHLEN + 1], *p; struct uam_mod *mod; void *module; if ((module = mod_open(path)) == NULL) { LOG(log_error, logtype_papd, "uam_load(%s): failed to load: %s", name, mod_error()); return NULL; } if ((mod = (struct uam_mod *) malloc(sizeof(struct uam_mod))) == NULL) { LOG(log_error, logtype_papd, "uam_load(%s): malloc failed", name); goto uam_load_fail; } strlcpy(buf, name, sizeof(buf)); if ((p = strchr(buf, '.'))) *p = '\0'; if ((mod->uam_fcn = mod_symbol(module, buf)) == NULL) { goto uam_load_err; } if (mod->uam_fcn->uam_type != UAM_MODULE_SERVER) { LOG(log_error, logtype_papd, "uam_load(%s): attempted to load a non-server module", name); goto uam_load_err; } /* version check would go here */ if (!mod->uam_fcn->uam_setup || ((*mod->uam_fcn->uam_setup)(name) < 0)) { LOG(log_error, logtype_papd, "uam_load(%s): uam_setup failed", name); goto uam_load_err; } mod->uam_module = module; return mod; uam_load_err: free(mod); uam_load_fail: mod_close(module); return NULL; } /* unload the module. we check for a cleanup function, but we don't * die if one doesn't exist. however, things are likely to leak without one. */ void uam_unload(struct uam_mod *mod) { if (mod->uam_fcn->uam_cleanup) (*mod->uam_fcn->uam_cleanup)(); mod_close(mod->uam_module); free(mod); } /* -- client-side uam functions -- */ /* set up stuff for this uam. */ int uam_register(const int type, const char *path, const char *name, ...) { va_list ap; struct uam_obj *uam; int ret; if (!name) return -1; /* see if it already exists. */ if ((uam = auth_uamfind(type, name, strlen(name)))) { if (strcmp(uam->uam_path, path)) { /* it exists, but it's not the same module. */ LOG(log_error, logtype_papd, "uam_register: \"%s\" already loaded by %s", name, path); return -1; } uam->uam_count++; return 0; } /* allocate space for uam */ if ((uam = calloc(1, sizeof(struct uam_obj))) == NULL) return -1; uam->uam_name = name; uam->uam_path = strdup(path); uam->uam_count++; va_start(ap, name); switch (type) { case UAM_SERVER_LOGIN: /* expect three arguments */ uam->u.uam_login.login = va_arg(ap, void *); uam->u.uam_login.logincont = va_arg(ap, void *); uam->u.uam_login.logout = va_arg(ap, void *); break; case UAM_SERVER_CHANGEPW: /* one argument */ uam->u.uam_changepw = va_arg(ap, void *); break; case UAM_SERVER_PRINTAUTH: /* x arguments */ uam->u.uam_printer = va_arg(ap, void *); break; default: break; } va_end(ap); /* attach to other uams */ ret = auth_register(type, uam); if (ret) { free(uam->uam_path); free(uam); } return ret; } void uam_unregister(const int type, const char *name) { struct uam_obj *uam; if (!name) return; uam = auth_uamfind(type, name, strlen(name)); if (!uam || --uam->uam_count > 0) return; auth_unregister(uam); free(uam->uam_path); free(uam); } /* Crap to support uams which call this afpd function */ int uam_afpserver_option(void *private _U_, const int what _U_, void *option _U_, size_t *len _U_) { return(0); } /* --- helper functions for plugin uams --- */ struct passwd *uam_getname(void *dummy _U_, char *name, const int len) { struct passwd *pwent; char *user; int i; if ((pwent = getpwnam(name))) return pwent; #ifndef NO_REAL_USER_NAME for (i = 0; i < len; i++) name[i] = tolower(name[i]); setpwent(); while ((pwent = getpwent())) { if ((user = strchr(pwent->pw_gecos, ','))) *user = '\0'; user = pwent->pw_gecos; /* check against both the gecos and the name fields. the user * might have just used a different capitalization. */ if ((strncasecmp(user, name, len) == 0) || (strncasecmp(pwent->pw_name, name, len) == 0)) { strncpy(name, pwent->pw_name, len); break; } } endpwent(); #endif /* NO_REAL_USER_NAME */ /* os x server doesn't keep anything useful if we do getpwent */ return pwent ? getpwnam(name) : NULL; } int uam_checkuser(const struct passwd *pwd) { char *p; if (!pwd || !pwd->pw_shell || (*pwd->pw_shell == '\0')) return -1; while ((p = getusershell())) { if ( strcmp( p, pwd->pw_shell ) == 0 ) break; } endusershell(); #ifndef DISABLE_SHELLCHECK if (!p) { LOG(log_info, logtype_papd, "illegal shell %s for %s",pwd->pw_shell,pwd->pw_name); return -1; } #endif /* DISABLE_SHELLCHECK */ return 0; } netatalk-2.2.2/etc/papd/lp.c0000644000175200017500000007170011655731126012535 00000000000000/* * $Id: lp.c,v 1.33 2009-10-29 13:38:15 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * * Portions: * Copyright (c) 1983 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. */ /* * Interface to lpr system. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #undef s_net #ifdef ABS_PRINT #include #endif /* ABS_PRINT */ #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #include #include #include #include #include #include "printer.h" #include "file.h" #include "lp.h" #ifdef HAVE_CUPS #include "print_cups.h" #endif /* These functions aren't used outside of lp.c */ int lp_conn_inet(); int lp_disconn_inet( int ); int lp_conn_unix(); int lp_disconn_unix( int ); static char hostname[ MAXHOSTNAMELEN ]; extern struct sockaddr_at *sat; static struct lp { int lp_flags; FILE *lp_stream; int lp_seq; int lp_origin; char lp_letter; char *lp_person; char *lp_created_for; /* Holds the content of the Postscript %%For Comment if available */ char *lp_host; char *lp_job; char *lp_spoolfile; } lp; #define LP_INIT (1<<0) #define LP_OPEN (1<<1) #define LP_PIPE (1<<2) #define LP_CONNECT (1<<3) #define LP_QUEUE (1<<4) #define LP_JOBPENDING (1<<5) void lp_origin (int origin) { lp.lp_origin = origin; } /* the converted string should always be shorter, but ... FIXME! */ static void convert_octal (char *string, charset_t dest) { unsigned char *p, *q; char temp[4]; long int ch; q=p=(unsigned char *)string; while ( *p != '\0' ) { ch = 0; if ( *p == '\\' ) { p++; if (dest && isdigit(*p) && isdigit(*(p+1)) && isdigit(*(p+2)) ) { temp[0] = *p; temp[1] = *(p+1); temp[2] = *(p+2); temp[3] = 0; ch = strtol( temp, NULL, 8); if ( ch && ch < 0xff) *q = ch; else *q = '.'; p += 2; } else *q = '.'; } else { *q = *p; } p++; q++; } *q = 0; } static void translate(charset_t from, charset_t dest, char **option) { char *translated; if (*option != NULL) { convert_octal(*option, from); if (from) { if ((size_t) -1 != (convert_string_allocate(from, dest, *option, -1, &translated)) ) { free (*option); *option = translated; } } } } static void lp_setup_comments (charset_t dest) { charset_t from=0; switch (lp.lp_origin) { case 1: from=CH_MAC; break; case 2: from=CH_UTF8_MAC; break; } if (lp.lp_job) { #ifdef DEBUG1 LOG(log_debug9, logtype_papd, "job: %s", lp.lp_job ); #endif translate(from, dest, &lp.lp_job); } if (lp.lp_created_for) { #ifdef DEBUG1 LOG(log_debug9, logtype_papd, "for: %s", lp.lp_created_for ); #endif translate(from, dest, &lp.lp_created_for); } if (lp.lp_person) { #ifdef DEBUG1 LOG(log_debug9, logtype_papd, "person: %s", lp.lp_person ); #endif translate(from, dest, &lp.lp_person); } } #define is_var(a, b) (strncmp((a), (b), 2) == 0) #if 0 /* removed, it's not used and a pain to get it right from a security POV */ static size_t quote(char *dest, char *src, const size_t bsize, size_t len) { size_t used = 0; while (len && used < bsize ) { switch (*src) { case '$': case '\\': case '"': case '`': if (used + 2 > bsize ) return used; *dest = '\\'; dest++; used++; break; } *dest = *src; src++; dest++; len--; used++; } return used; } static char* pipexlate(char *src) { char *p, *q, *dest; static char destbuf[MAXPATHLEN +1]; size_t destlen = MAXPATHLEN; int len = 0; dest = destbuf; if (!src) return NULL; memset(dest, 0, MAXPATHLEN +1); if ((p = strchr(src, '%')) == NULL) { /* nothing to do */ strncpy(dest, src, MAXPATHLEN); return destbuf; } /* first part of the path. copy and forward to the next variable. */ len = MIN((size_t)(p - src), destlen); if (len > 0) { strncpy(dest, src, len); destlen -= len; dest += len; } while (p && destlen > 0) { /* now figure out what the variable is */ q = NULL; if (is_var(p, "%U")) { q = lp.lp_person; } else if (is_var(p, "%C") || is_var(p, "%J") ) { q = lp.lp_job; } else if (is_var(p, "%F")) { q = lp.lp_created_for; } else if (is_var(p, "%%")) { q = "%"; } /* copy the stuff over. if we don't understand something that we * should, just skip it over. */ if (q) { len = MIN(strlen(q), destlen); len = quote(dest, q, destlen, len); } else { len = MIN(2, destlen); strncpy(dest, q, len); } dest += len; destlen -= len; /* stuff up to next % */ src = p + 2; p = strchr(src, '%'); len = p ? MIN((size_t)(p - src), destlen) : destlen; if (len > 0) { strncpy(dest, src, len); dest += len; destlen -= len; } } if (!destlen) { /* reach end of buffer, maybe prematurely, give up */ return NULL; } return destbuf; } #endif void lp_person(char *person) { if ( lp.lp_person != NULL ) { free( lp.lp_person ); } if (( lp.lp_person = (char *)malloc( strlen( person ) + 1 )) == NULL ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) ); exit( 1 ); } strcpy( lp.lp_person, person ); } #ifdef ABS_PRINT int lp_pagecost(void) { char cost[ 22 ]; char balance[ 22 ]; int err; if ( lp.lp_person == NULL ) { return( -1 ); } err = ABS_canprint( lp.lp_person, printer->p_role, printer->p_srvid, cost, balance ); printer->p_pagecost = floor( atof( cost ) * 10000.0 ); printer->p_balance = atof( balance ) + atof( cost ); return( err < 0 ? -1 : 0 ); } #endif /* ABS_PRINT */ void lp_host( char *host) { if ( lp.lp_host != NULL ) { free( lp.lp_host ); } if (( lp.lp_host = (char *)malloc( strlen( host ) + 1 )) == NULL ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) ); exit( 1 ); } strcpy( lp.lp_host, host ); LOG(log_debug, logtype_papd, "host: %s", lp.lp_host ); } /* Currently lp_job and lp_for will not handle the * conversion of macroman chars > 0x7f correctly * This should be added. */ void lp_job(char *job) { if ( lp.lp_job != NULL ) { free( lp.lp_job ); } lp.lp_job = strdup(job); #ifdef DEBUG LOG(log_debug9, logtype_papd, "job: %s", lp.lp_job ); #endif } void lp_for (char *lpfor) { if ( lp.lp_created_for != NULL ) { free( lp.lp_created_for ); } lp.lp_created_for = strdup(lpfor); } static int lp_init(struct papfile *out, struct sockaddr_at *sat) { int authenticated = 0; #ifndef HAVE_CUPS int fd, n, len; char *cp, buf[ BUFSIZ ]; struct stat st; #endif /* HAVE_CUPS */ #ifdef ABS_PRINT char cost[ 22 ]; char balance[ 22 ]; #endif /* ABS_PRINT */ if ( printer->p_flags & P_AUTH ) { authenticated = 0; /* cap style "log on to afp server before printing" authentication */ if ( printer->p_authprintdir && (printer->p_flags & P_AUTH_CAP) ) { int addr_net = ntohs( sat->sat_addr.s_net ); int addr_node = sat->sat_addr.s_node; char addr_filename[256]; char auth_string[256]; char *username, *afpdpid; struct stat cap_st; FILE *cap_file; memset( auth_string, 0, 256 ); sprintf(addr_filename, "%s/net%d.%dnode%d", printer->p_authprintdir, addr_net/256, addr_net%256, addr_node); if (stat(addr_filename, &cap_st) == 0) { if ((cap_file = fopen(addr_filename, "r")) != NULL) { if (fgets(auth_string, 256, cap_file) != NULL) { username = auth_string; if ((afpdpid = strrchr( auth_string, ':' )) != NULL) { *afpdpid = '\0'; afpdpid++; } if (getpwnam(username) != NULL ) { LOG(log_info, logtype_papd, "CAP authenticated %s", username); lp_person(username); authenticated = 1; } else { LOG(log_info, logtype_papd, "CAP error: invalid username: '%s'", username); } } else { LOG(log_info, logtype_papd, "CAP error: could not read username"); } } else { LOG(log_info, logtype_papd, "CAP error: %s", strerror(errno)); } } else { LOG(log_info, logtype_papd, "CAP error: %s", strerror(errno)); } } if ( printer->p_flags & P_AUTH_PSSP ) { if ( lp.lp_person != NULL ) { authenticated = 1; } } if ( authenticated == 0 ) { LOG(log_error, logtype_papd, "lp_init: must authenticate" ); spoolerror( out, "Authentication required." ); return( -1 ); } #ifdef ABS_PRINT if (( printer->p_flags & P_ACCOUNT ) && printer->p_pagecost > 0 && ! ABS_canprint( lp.lp_person, printer->p_role, printer->p_srvid, cost, balance )) { LOG(log_error, logtype_papd, "lp_init: no ABS funds" ); spoolerror( out, "No ABS funds available." ); return( -1 ); } #endif /* ABS_PRINT */ } if ( gethostname( hostname, sizeof( hostname )) < 0 ) { LOG(log_error, logtype_papd, "gethostname: %s", strerror(errno) ); exit( 1 ); } if ( lp.lp_flags & LP_INIT ) { LOG(log_error, logtype_papd, "lp_init: already inited, die!" ); abort(); } lp.lp_flags = 0; lp.lp_stream = NULL; lp.lp_letter = 'A'; if ( printer->p_flags & P_SPOOLED ) { #ifndef HAVE_CUPS /* check if queuing is enabled: mode & 010 on lock file */ if ( stat( printer->p_lock, &st ) < 0 ) { LOG(log_error, logtype_papd, "lp_init: %s: %s", printer->p_lock, strerror(errno) ); spoolerror( out, NULL ); return( -1 ); } if ( st.st_mode & 010 ) { LOG(log_info, logtype_papd, "lp_init: queuing is disabled" ); spoolerror( out, "Queuing is disabled." ); return( -1 ); } if (( fd = open( ".seq", O_RDWR|O_CREAT, 0661 )) < 0 ) { LOG(log_error, logtype_papd, "lp_init: can't create .seq" ); spoolerror( out, NULL ); return( -1 ); } #ifndef SOLARIS /* flock is unsupported, I doubt this stuff works anyway with newer solaris so ignore for now */ if ( flock( fd, LOCK_EX ) < 0 ) { LOG(log_error, logtype_papd, "lp_init: can't lock .seq" ); spoolerror( out, NULL ); return( -1 ); } #endif n = 0; if (( len = read( fd, buf, sizeof( buf ))) < 0 ) { LOG(log_error, logtype_papd, "lp_init read: %s", strerror(errno) ); spoolerror( out, NULL ); return( -1 ); } if ( len > 0 ) { for ( cp = buf; len; len--, cp++ ) { if ( *cp < '0' || *cp > '9' ) { break; } n = n * 10 + ( *cp - '0' ); } } lp.lp_seq = n; n = ( n + 1 ) % 1000; sprintf( buf, "%03d\n", n ); lseek( fd, 0L, 0 ); write( fd, buf, strlen( buf )); close( fd ); #else if (cups_get_printer_status ( printer ) == 0) { spoolerror( out, "Queuing is disabled." ); return( -1 ); } lp.lp_seq = getpid(); #endif /* HAVE CUPS */ } else { lp.lp_flags |= LP_PIPE; lp.lp_seq = getpid(); } lp.lp_flags |= LP_INIT; return( 0 ); } int lp_open(struct papfile *out, struct sockaddr_at *sat) { char name[ MAXPATHLEN ]; int fd; struct passwd *pwent; #ifdef DEBUG LOG (log_debug9, logtype_papd, "lp_open"); #endif if ( lp.lp_flags & LP_JOBPENDING ) { lp_print(); } if (( lp.lp_flags & LP_INIT ) == 0 && lp_init( out, sat ) != 0 ) { return( -1 ); } if ( lp.lp_flags & LP_OPEN ) { /* LOG(log_error, logtype_papd, "lp_open already open" ); */ /* abort(); */ return (-1); } if ( lp.lp_flags & LP_PIPE ) { char *pipe_cmd; /* go right to program */ if (lp.lp_person != NULL) { if((pwent = getpwnam(lp.lp_person)) != NULL) { if(setreuid(pwent->pw_uid, pwent->pw_uid) != 0) { LOG(log_error, logtype_papd, "setreuid error: %s", strerror(errno)); exit(1); } } else { LOG(log_error, logtype_papd, "Error getting username (%s)", lp.lp_person); exit(1); } } lp_setup_comments(CH_UNIX); pipe_cmd = printer->p_printer; if (!pipe_cmd) { LOG(log_error, logtype_papd, "lp_open: no pipe cmd" ); spoolerror( out, NULL ); return( -1 ); } if (( lp.lp_stream = popen(pipe_cmd, "w" )) == NULL ) { LOG(log_error, logtype_papd, "lp_open popen %s: %s", printer->p_printer, strerror(errno) ); spoolerror( out, NULL ); return( -1 ); } LOG(log_debug, logtype_papd, "lp_open: opened %s", pipe_cmd ); } else { sprintf( name, "df%c%03d%s", lp.lp_letter++, lp.lp_seq, hostname ); if (( fd = open( name, O_WRONLY|O_CREAT|O_EXCL, 0660 )) < 0 ) { LOG(log_error, logtype_papd, "lp_open %s: %s", name, strerror(errno) ); spoolerror( out, NULL ); return( -1 ); } if ( NULL == (lp.lp_spoolfile = (char *) malloc (strlen (name) +1)) ) { LOG(log_error, logtype_papd, "malloc: %s", strerror(errno)); exit(1); } strcpy ( lp.lp_spoolfile, name); if (lp.lp_person != NULL) { if ((pwent = getpwnam(lp.lp_person)) == NULL) { LOG(log_error, logtype_papd, "getpwnam %s: no such user", lp.lp_person); spoolerror( out, NULL ); return( -1 ); } } else { if ((pwent = getpwnam(printer->p_operator)) == NULL) { LOG(log_error, logtype_papd, "getpwnam %s: no such user", printer->p_operator); spoolerror( out, NULL ); return( -1 ); } } if (fchown(fd, pwent->pw_uid, -1) < 0) { LOG(log_error, logtype_papd, "chown %s %s: %s", pwent->pw_name, name, strerror(errno)); spoolerror( out, NULL ); return( -1 ); } if (( lp.lp_stream = fdopen( fd, "w" )) == NULL ) { LOG(log_error, logtype_papd, "lp_open fdopen: %s", strerror(errno) ); spoolerror( out, NULL ); return( -1 ); } #ifdef DEBUG LOG(log_debug9, logtype_papd, "lp_open: opened %s", name ); #endif } lp.lp_flags |= LP_OPEN; return( 0 ); } int lp_close(void) { if (( lp.lp_flags & LP_INIT ) == 0 || ( lp.lp_flags & LP_OPEN ) == 0 ) { return 0; } fclose( lp.lp_stream ); lp.lp_stream = NULL; lp.lp_flags &= ~LP_OPEN; lp.lp_flags |= LP_JOBPENDING; return 0; } int lp_write(struct papfile *in, char *buf, size_t len) { #define BUFSIZE 32768 static char tempbuf[BUFSIZE]; static char tempbuf2[BUFSIZE]; static size_t bufpos = 0; static int last_line_translated = 1; /* if 0, append a \n a the start */ char *tbuf = buf; /* Before we write out anything check for a pending job, e.g. cover page */ if (lp.lp_flags & LP_JOBPENDING) lp_print(); /* foomatic doesn't handle mac line endings, so we convert them for * the Postscript headers * REALLY ugly hack, remove ASAP again */ if ((printer->p_flags & P_FOOMATIC_HACK) && (in->pf_state & PF_TRANSLATE) && (buf[len-1] != '\n') ) { if (len <= BUFSIZE) { if (!last_line_translated) { tempbuf2[0] = '\n'; memcpy(tempbuf2+1, buf, len++); } else memcpy(tempbuf2, buf, len); if (tempbuf2[len-1] == '\r') tempbuf2[len-1] = '\n'; tempbuf2[len] = 0; tbuf = tempbuf2; last_line_translated = 1; #ifdef DEBUG LOG(log_debug9, logtype_papd, "lp_write: %s", tbuf ); #endif } else { LOG(log_error, logtype_papd, "lp_write: conversion buffer too small" ); abort(); } } else { if (printer->p_flags & P_FOOMATIC_HACK && buf[len-1] == '\n') { last_line_translated = 1; } else last_line_translated = 0; } /* To be able to do commandline substitutions on piped printers * we store the start of the print job in a buffer. * %%EndComment triggers writing to file */ if (( lp.lp_flags & LP_OPEN ) == 0 ) { #ifdef DEBUG LOG(log_debug9, logtype_papd, "lp_write: writing to temporary buffer" ); #endif if ((bufpos+len) > BUFSIZE) { LOG(log_error, logtype_papd, "lp_write: temporary buffer too small" ); /* FIXME: call lp_open here? abort isn't nice... */ abort(); } else { memcpy(tempbuf + bufpos, tbuf, len); bufpos += len; if (bufpos > BUFSIZE/2) in->pf_state |= PF_STW; /* we used half of the buffer, start writing */ return(0); } } else if ( bufpos) { if ( fwrite( tempbuf, 1, bufpos, lp.lp_stream ) != bufpos ) { LOG(log_error, logtype_papd, "lp_write: %s", strerror(errno) ); abort(); } bufpos=0; } if ( fwrite( tbuf, 1, len, lp.lp_stream ) != len ) { LOG(log_error, logtype_papd, "lp_write: %s", strerror(errno) ); abort(); } return( 0 ); } int lp_cancel(void) { char name[ MAXPATHLEN ]; char letter; if (( lp.lp_flags & LP_INIT ) == 0 || lp.lp_letter == 'A' ) { return 0; } if ( lp.lp_flags & LP_OPEN ) { lp_close(); } for ( letter = 'A'; letter < lp.lp_letter; letter++ ) { sprintf( name, "df%c%03d%s", letter, lp.lp_seq, hostname ); if ( unlink( name ) < 0 ) { LOG(log_error, logtype_papd, "lp_cancel unlink %s: %s", name, strerror(errno) ); } } return 0; } /* * Create printcap control file, signal printer. Errors here should * remove queue files. * * XXX piped? */ int lp_print(void) { #ifndef HAVE_CUPS char buf[ MAXPATHLEN ]; char tfname[ MAXPATHLEN ]; char cfname[ MAXPATHLEN ]; char letter; int fd, n, s; FILE *cfile; #endif /* HAVE_CUPS */ if (( lp.lp_flags & LP_INIT ) == 0 || lp.lp_letter == 'A' ) { return 0; } lp_close(); lp.lp_flags &= ~LP_JOBPENDING; if ( printer->p_flags & P_SPOOLED ) { #ifndef HAVE_CUPS sprintf( tfname, "tfA%03d%s", lp.lp_seq, hostname ); if (( fd = open( tfname, O_WRONLY|O_EXCL|O_CREAT, 0660 )) < 0 ) { LOG(log_error, logtype_papd, "lp_print %s: %s", tfname, strerror(errno) ); return 0; } if (( cfile = fdopen( fd, "w" )) == NULL ) { LOG(log_error, logtype_papd, "lp_print %s: %s", tfname, strerror(errno) ); return 0; } fprintf( cfile, "H%s\n", hostname ); /* XXX lp_host? */ if ( lp.lp_person ) { fprintf( cfile, "P%s\n", lp.lp_person ); } else { fprintf( cfile, "P%s\n", printer->p_operator ); } if ( lp.lp_job && *lp.lp_job ) { fprintf( cfile, "J%s\n", lp.lp_job ); fprintf( cfile, "T%s\n", lp.lp_job ); } else { fprintf( cfile, "JMac Job\n" ); fprintf( cfile, "TMac Job\n" ); } fprintf( cfile, "C%s\n", hostname ); /* XXX lp_host? */ if ( lp.lp_person ) { fprintf( cfile, "L%s\n", lp.lp_person ); } else { fprintf( cfile, "L%s\n", printer->p_operator ); } for ( letter = 'A'; letter < lp.lp_letter; letter++ ) { fprintf( cfile, "fdf%c%03d%s\n", letter, lp.lp_seq, hostname ); fprintf( cfile, "Udf%c%03d%s\n", letter, lp.lp_seq, hostname ); } if ( lp.lp_job && *lp.lp_job ) { fprintf( cfile, "N%s\n", lp.lp_job ); } else { fprintf( cfile, "NMac Job\n" ); } fclose( cfile ); sprintf( cfname, "cfA%03d%s", lp.lp_seq, hostname ); if ( link( tfname, cfname ) < 0 ) { LOG(log_error, logtype_papd, "lp_print can't link %s to %s: %s", cfname, tfname, strerror(errno) ); return 0; } unlink( tfname ); if (( s = lp_conn_unix()) < 0 ) { LOG(log_error, logtype_papd, "lp_print: lp_conn_unix: %s", strerror(errno) ); return 0; } sprintf( buf, "\1%s\n", printer->p_printer ); n = strlen( buf ); if ( write( s, buf, n ) != n ) { LOG(log_error, logtype_papd, "lp_print write: %s" , strerror(errno)); return 0; } if ( read( s, buf, 1 ) != 1 ) { LOG(log_error, logtype_papd, "lp_print read: %s" , strerror(errno)); return 0; } lp_disconn_unix( s ); if ( buf[ 0 ] != '\0' ) { LOG(log_error, logtype_papd, "lp_print lpd said %c: %s", buf[ 0 ], strerror(errno) ); return 0; } #else if ( ! (lp.lp_job && *lp.lp_job) ) { lp.lp_job = strdup("Mac Job"); } lp_setup_comments(add_charset(cups_get_language ())); if (lp.lp_person != NULL) { cups_print_job ( printer->p_printer, lp.lp_spoolfile, lp.lp_job, lp.lp_person, printer->p_cupsoptions); } else if (lp.lp_created_for != NULL) { cups_print_job ( printer->p_printer, lp.lp_spoolfile, lp.lp_job, lp.lp_created_for, printer->p_cupsoptions); } else { cups_print_job ( printer->p_printer, lp.lp_spoolfile, lp.lp_job, printer->p_operator, printer->p_cupsoptions); } /*LOG(log_info, logtype_papd, "lp_print unlink %s", lp.lp_spoolfile );*/ unlink ( lp.lp_spoolfile ); return 0; #endif /* HAVE_CUPS*/ } LOG(log_info, logtype_papd, "lp_print queued" ); return 0; } #ifndef HAVE_CUPS int lp_disconn_unix( int fd ) { return( close( fd )); } int lp_conn_unix(void) { int s; struct sockaddr_un saun; if (( s = socket( AF_UNIX, SOCK_STREAM, 0 )) < 0 ) { LOG(log_error, logtype_papd, "lp_conn_unix socket: %s", strerror(errno) ); return( -1 ); } memset( &saun, 0, sizeof( struct sockaddr_un )); saun.sun_family = AF_UNIX; strcpy( saun.sun_path, _PATH_DEVPRINTER ); if ( connect( s, (struct sockaddr *)&saun, strlen( saun.sun_path ) + 2 ) < 0 ) { LOG(log_error, logtype_papd, "lp_conn_unix connect %s: %s", saun.sun_path, strerror(errno) ); close( s ); return( -1 ); } return( s ); } int lp_disconn_inet( int fd ) { return( close( fd )); } int lp_conn_inet(void) { int privfd, port = IPPORT_RESERVED - 1; struct sockaddr_in sin; struct servent *sp; struct hostent *hp; if (( sp = getservbyname( "printer", "tcp" )) == NULL ) { LOG(log_error, logtype_papd, "printer/tcp: unknown service" ); return( -1 ); } if ( gethostname( hostname, sizeof( hostname )) < 0 ) { LOG(log_error, logtype_papd, "gethostname: %s", strerror(errno) ); exit( 1 ); } if (( hp = gethostbyname( hostname )) == NULL ) { LOG(log_error, logtype_papd, "%s: unknown host", hostname ); return( -1 ); } if (( privfd = rresvport( &port )) < 0 ) { LOG(log_error, logtype_papd, "lp_connect: socket: %s", strerror(errno) ); close( privfd ); return( -1 ); } memset( &sin, 0, sizeof( struct sockaddr_in )); sin.sin_family = AF_INET; /* sin.sin_addr.s_addr = htonl( INADDR_LOOPBACK ); */ memcpy( &sin.sin_addr, hp->h_addr, hp->h_length ); sin.sin_port = sp->s_port; if ( connect( privfd, (struct sockaddr *)&sin, sizeof( struct sockaddr_in )) < 0 ) { LOG(log_error, logtype_papd, "lp_connect: %s", strerror(errno) ); close( privfd ); return( -1 ); } return( privfd ); } int lp_rmjob( int job) { char buf[ 1024 ]; int n, s; if (( s = lp_conn_inet()) < 0 ) { LOG(log_error, logtype_papd, "lp_rmjob: %s", strerror(errno) ); return( -1 ); } if ( lp.lp_person == NULL ) { return( -1 ); } sprintf( buf, "\5%s %s %d\n", printer->p_printer, lp.lp_person, job ); n = strlen( buf ); if ( write( s, buf, n ) != n ) { LOG(log_error, logtype_papd, "lp_rmjob write: %s", strerror(errno) ); lp_disconn_inet( s ); return( -1 ); } while (( n = read( s, buf, sizeof( buf ))) > 0 ) { LOG(log_debug, logtype_papd, "read %.*s", n, buf ); } lp_disconn_inet( s ); return( 0 ); } char *kw_rank = "Rank"; char *kw_active = "active"; char *tag_rank = "rank: "; char *tag_owner = "owner: "; char *tag_job = "job: "; char *tag_files = "files: "; char *tag_size = "size: "; char *tag_status = "status: "; int lp_queue( struct papfile *out) { char buf[ 1024 ], *start, *stop, *p, *q; int linelength, crlflength; static struct papfile pf; int s; size_t len; ssize_t n; if (( s = lp_conn_unix()) < 0 ) { LOG(log_error, logtype_papd, "lp_queue: %s", strerror(errno) ); return( -1 ); } sprintf( buf, "\3%s\n", printer->p_printer ); n = strlen( buf ); if ( write( s, buf, n ) != n ) { LOG(log_error, logtype_papd, "lp_queue write: %s", strerror(errno) ); lp_disconn_unix( s ); return( -1 ); } pf.pf_state = PF_BOT; while (( n = read( s, buf, sizeof( buf ))) > 0 ) { append( &pf, buf, n ); } for (;;) { if ( markline( &pf, &start, &linelength, &crlflength ) > 0 ) { /* parse */ stop = start + linelength; for ( p = start; p < stop; p++ ) { if ( *p == ' ' || *p == '\t' ) { break; } } if ( p >= stop ) { CONSUME( &pf , linelength + crlflength); continue; } /* * Keys: "Rank", a number, "active" * Anything else is status. */ len = p - start; if ( len == strlen( kw_rank ) && strncmp( kw_rank, start, len ) == 0 ) { CONSUME( &pf, linelength + crlflength ); continue; } if (( len == strlen( kw_active ) && strncmp( kw_active, start, len ) == 0 ) || isdigit( *start )) { /* a job line */ append( out, tag_rank, strlen( tag_rank )); append( out, start, p - start ); append( out, "\n", 1 ); for ( ; p < stop; p++ ) { if ( *p != ' ' && *p != '\t' ) { break; } } for ( q = p; p < stop; p++ ) { if ( *p == ' ' || *p == '\t' ) { break; } } if ( p >= stop ) { append( out, ".\n", 2 ); CONSUME( &pf, linelength + crlflength ); continue; } append( out, tag_owner, strlen( tag_owner )); append( out, q, p - q ); append( out, "\n", 1 ); for ( ; p < stop; p++ ) { if ( *p != ' ' && *p != '\t' ) { break; } } for ( q = p; p < stop; p++ ) { if ( *p == ' ' || *p == '\t' ) { break; } } if ( p >= stop ) { append( out, ".\n", 2 ); CONSUME( &pf , linelength + crlflength ); continue; } append( out, tag_job, strlen( tag_job )); append( out, q, p - q ); append( out, "\n", 1 ); for ( ; p < stop; p++ ) { if ( *p != ' ' && *p != '\t' ) { break; } } for ( q = p, p = stop; p > q; p-- ) { if ( *p == ' ' || *p == '\t' ) { break; } } for ( ; p > q; p-- ) { if ( *p != ' ' && *p != '\t' ) { break; } } for ( ; p > q; p-- ) { if ( *p == ' ' || *p == '\t' ) { break; } } if ( p <= q ) { append( out, ".\n", 2 ); CONSUME( &pf, linelength + crlflength ); continue; } append( out, tag_files, strlen( tag_files )); append( out, q, p - q ); append( out, "\n", 1 ); for ( ; p < stop; p++ ) { if ( *p != ' ' && *p != '\t' ) { break; } } append( out, tag_size, strlen( tag_size )); append( out, p, stop - p ); append( out, "\n.\n", 3 ); CONSUME( &pf, linelength + crlflength ); continue; } /* status */ append( out, tag_status, strlen( tag_status )); append( out, start, linelength ); append( out, "\n.\n", 3 ); CONSUME( &pf, linelength + crlflength ); } else { append( out, "*\n", 2 ); lp_disconn_unix( s ); return( 0 ); } } } #endif /* HAVE_CUPS */ netatalk-2.2.2/etc/papd/session.h0000644000175200017500000000033711655731126013610 00000000000000/* * $Id: session.h,v 1.2 2001-06-25 20:13:45 rufustfirefly Exp $ */ #ifndef PAPD_SESSION_H #define PAPD_SESSION_H 1 #include int session( ATP atp, struct sockaddr_at *sat ); #endif /* PAPD_SESSION_H */ netatalk-2.2.2/etc/uams/0000777000175200017500000000000011704770427012060 500000000000000netatalk-2.2.2/etc/uams/uams_dhx_passwd.c0000644000175200017500000002352211655731244015334 00000000000000/* * $Id: uams_dhx_passwd.c,v 1.29 2010-03-30 12:44:35 franklahm Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #ifdef HAVE_CRYPT_H #include #endif /* ! HAVE_CRYPT_H */ #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_TIME_H #include #endif #include #ifdef SHADOWPW #include #endif /* SHADOWPW */ #if defined(GNUTLS_DHX) #include #elif defined(OPENSSL_DHX) #include #include #include #else /* OPENSSL_DHX */ #include #include #include #endif /* OPENSSL_DHX */ #include #include #include #define KEYSIZE 16 #define PASSWDLEN 64 #define CRYPTBUFLEN (KEYSIZE*2) #define CRYPT2BUFLEN (KEYSIZE + PASSWDLEN) /* hash a number to a 16-bit quantity */ #define dhxhash(a) ((((unsigned long) (a) >> 8) ^ \ (unsigned long) (a)) & 0xffff) /* the secret key */ static CAST_KEY castkey; static struct passwd *dhxpwd; static u_int8_t randbuf[16]; #ifdef TRU64 #include #include static const char *clientname; #endif /* TRU64 */ /* dhx passwd */ static int pwd_login(void *obj, char *username, int ulen, struct passwd **uam_pwd _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { unsigned char iv[] = "CJalbert"; u_int8_t p[] = {0xBA, 0x28, 0x73, 0xDF, 0xB0, 0x60, 0x57, 0xD4, 0x3F, 0x20, 0x24, 0x74, 0x4C, 0xEE, 0xE7, 0x5B }; u_int8_t g = 0x07; #ifdef SHADOWPW struct spwd *sp; #endif /* SHADOWPW */ BIGNUM *bn, *gbn, *pbn; u_int16_t sessid; size_t i; DH *dh; #ifdef TRU64 int rnd_seed[256]; for (i = 0; i < 256; i++) rnd_seed[i] = random(); RAND_seed(rnd_seed, sizeof(rnd_seed)); #endif /* TRU64 */ *rbuflen = 0; #ifdef TRU64 if( uam_afpserver_option( obj, UAM_OPTION_CLIENTNAME, (void *) &clientname, NULL ) < 0 ) return AFPERR_PARAM; #endif /* TRU64 */ if (( dhxpwd = uam_getname(obj, username, ulen)) == NULL ) { return AFPERR_NOTAUTH; } LOG(log_info, logtype_uams, "dhx login: %s", username); if (uam_checkuser(dhxpwd) < 0) return AFPERR_NOTAUTH; #ifdef SHADOWPW if (( sp = getspnam( dhxpwd->pw_name )) == NULL ) { LOG(log_info, logtype_uams, "no shadow passwd entry for %s", username); return AFPERR_NOTAUTH; } dhxpwd->pw_passwd = sp->sp_pwdp; #endif /* SHADOWPW */ if (!dhxpwd->pw_passwd) return AFPERR_NOTAUTH; /* get the client's public key */ if (!(bn = BN_bin2bn((unsigned char *)ibuf, KEYSIZE, NULL))) { return AFPERR_PARAM; } /* get our primes */ if (!(gbn = BN_bin2bn(&g, sizeof(g), NULL))) { BN_free(bn); return AFPERR_PARAM; } if (!(pbn = BN_bin2bn(p, sizeof(p), NULL))) { BN_free(gbn); BN_free(bn); return AFPERR_PARAM; } /* okay, we're ready */ if (!(dh = DH_new())) { BN_free(pbn); BN_free(gbn); BN_free(bn); return AFPERR_PARAM; } /* generate key and make sure we have enough space */ dh->p = pbn; dh->g = gbn; if (!DH_generate_key(dh) || (BN_num_bytes(dh->pub_key) > KEYSIZE)) { goto passwd_fail; } /* figure out the key. use rbuf as a temporary buffer. */ i = DH_compute_key((unsigned char *)rbuf, bn, dh); /* set the key */ CAST_set_key(&castkey, i, (unsigned char *)rbuf); /* session id. it's just a hashed version of the object pointer. */ sessid = dhxhash(obj); memcpy(rbuf, &sessid, sizeof(sessid)); rbuf += sizeof(sessid); *rbuflen += sizeof(sessid); /* send our public key */ BN_bn2bin(dh->pub_key, (unsigned char *)rbuf); rbuf += KEYSIZE; *rbuflen += KEYSIZE; /* buffer to be encrypted */ i = sizeof(randbuf); if (uam_afpserver_option(obj, UAM_OPTION_RANDNUM, (void *) randbuf, &i) < 0) { *rbuflen = 0; goto passwd_fail; } memcpy(rbuf, &randbuf, sizeof(randbuf)); #if 0 /* get the signature. it's always 16 bytes. */ if (uam_afpserver_option(obj, UAM_OPTION_SIGNATURE, (void *) &name, NULL) < 0) { *rbuflen = 0; goto passwd_fail; } memcpy(rbuf + KEYSIZE, name, KEYSIZE); #else /* 0 */ memset(rbuf + KEYSIZE, 0, KEYSIZE); #endif /* 0 */ /* encrypt using cast */ CAST_cbc_encrypt((unsigned char *)rbuf, (unsigned char *)rbuf, CRYPTBUFLEN, &castkey, iv, CAST_ENCRYPT); *rbuflen += CRYPTBUFLEN; BN_free(bn); DH_free(dh); return AFPERR_AUTHCONT; passwd_fail: BN_free(bn); DH_free(dh); return AFPERR_PARAM; } /* cleartxt login */ static int passwd_login(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { char *username; size_t len, ulen; *rbuflen = 0; if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) return AFPERR_MISC; if (ibuflen < 2) { return( AFPERR_PARAM ); } len = (unsigned char) *ibuf++; ibuflen--; if (!len || len > ibuflen || len > ulen ) { return( AFPERR_PARAM ); } memcpy(username, ibuf, len ); ibuf += len; ibuflen -=len; username[ len ] = '\0'; if ((unsigned long) ibuf & 1) { /* pad character */ ++ibuf; ibuflen--; } return (pwd_login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen)); } /* cleartxt login ext * uname format : byte 3 2 bytes len (network order) len bytes utf8 name */ static int passwd_login_ext(void *obj, char *uname, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { char *username; size_t len, ulen; u_int16_t temp16; *rbuflen = 0; if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) return AFPERR_MISC; if (*uname != 3) return AFPERR_PARAM; uname++; memcpy(&temp16, uname, sizeof(temp16)); len = ntohs(temp16); if (!len || len > ulen ) { return( AFPERR_PARAM ); } memcpy(username, uname +2, len ); username[ len ] = '\0'; return (pwd_login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen)); } static int passwd_logincont(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { #ifdef SHADOWPW struct spwd *sp; #endif /* SHADOWPW */ unsigned char iv[] = "LWallace"; BIGNUM *bn1, *bn2, *bn3; u_int16_t sessid; char *p; int err = AFPERR_NOTAUTH; *rbuflen = 0; /* check for session id */ memcpy(&sessid, ibuf, sizeof(sessid)); if (sessid != dhxhash(obj)) return AFPERR_PARAM; ibuf += sizeof(sessid); /* use rbuf as scratch space */ CAST_cbc_encrypt((unsigned char *)ibuf, (unsigned char *)rbuf, CRYPT2BUFLEN, &castkey, iv, CAST_DECRYPT); /* check to make sure that the random number is the same. we * get sent back an incremented random number. */ if (!(bn1 = BN_bin2bn((unsigned char *)rbuf, KEYSIZE, NULL))) return AFPERR_PARAM; if (!(bn2 = BN_bin2bn(randbuf, sizeof(randbuf), NULL))) { BN_free(bn1); return AFPERR_PARAM; } /* zero out the random number */ memset(rbuf, 0, sizeof(randbuf)); memset(randbuf, 0, sizeof(randbuf)); rbuf += KEYSIZE; if (!(bn3 = BN_new())) { BN_free(bn2); BN_free(bn1); return AFPERR_PARAM; } BN_sub(bn3, bn1, bn2); BN_free(bn2); BN_free(bn1); /* okay. is it one more? */ if (!BN_is_one(bn3)) { BN_free(bn3); return AFPERR_PARAM; } BN_free(bn3); rbuf[PASSWDLEN] = '\0'; #ifdef TRU64 { int ac; char **av; char hostname[256]; uam_afp_getcmdline( &ac, &av ); sprintf( hostname, "%s@%s", dhxpwd->pw_name, clientname ); if( uam_sia_validate_user( NULL, ac, av, hostname, dhxpwd->pw_name, NULL, FALSE, NULL, rbuf ) != SIASUCCESS ) return AFPERR_NOTAUTH; memset( rbuf, 0, PASSWDLEN ); *uam_pwd = dhxpwd; return AFP_OK; } #else /* TRU64 */ p = crypt( rbuf, dhxpwd->pw_passwd ); memset(rbuf, 0, PASSWDLEN); if ( strcmp( p, dhxpwd->pw_passwd ) == 0 ) { *uam_pwd = dhxpwd; err = AFP_OK; } #ifdef SHADOWPW if (( sp = getspnam( dhxpwd->pw_name )) == NULL ) { LOG(log_info, logtype_uams, "no shadow passwd entry for %s", dhxpwd->pw_name); return (AFPERR_NOTAUTH); } /* check for expired password */ if (sp && sp->sp_max != -1 && sp->sp_lstchg) { time_t now = time(NULL) / (60*60*24); int32_t expire_days = sp->sp_lstchg - now + sp->sp_max; if ( expire_days < 0 ) { LOG(log_info, logtype_uams, "password for user %s expired", dhxpwd->pw_name); err = AFPERR_PWDEXPR; } } #endif /* SHADOWPW */ return err; #endif /* TRU64 */ return AFPERR_NOTAUTH; } static int uam_setup(const char *path) { if (uam_register(UAM_SERVER_LOGIN_EXT, path, "DHCAST128", passwd_login, passwd_logincont, NULL, passwd_login_ext) < 0) return -1; /*uam_register(UAM_SERVER_PRINTAUTH, path, "DHCAST128", passwd_printer);*/ return 0; } static void uam_cleanup(void) { uam_unregister(UAM_SERVER_LOGIN, "DHCAST128"); /*uam_unregister(UAM_SERVER_PRINTAUTH, "DHCAST128"); */ } UAM_MODULE_EXPORT struct uam_export uams_dhx = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; UAM_MODULE_EXPORT struct uam_export uams_dhx_passwd = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; netatalk-2.2.2/etc/uams/Makefile.am0000644000175200017500000000635511670074215014033 00000000000000# Makefile.am for etc/uams/ SUBDIRS = uams_krb4 # # conditionally build some modules # UAMS_GENERIC = uams_guest.la uams_passwd.la uams_LINKS = uams_clrtxt.so dhx_exec_hook = echo dhx2_exec_hook = echo # these are complex: check if DHX and DHX2 module should be build if USE_DHX if HAVE_OPENSSL uams_LINKS += uams_dhx.so UAMS_DHX = uams_dhx_passwd.la if BUILD_PAM UAMS_DHX_PAM = uams_dhx_pam.la endif if USE_PAM_SO dhx_exec_hook += && $(LN_S) uams_dhx_pam.so uams_dhx.so else dhx_exec_hook += && $(LN_S) uams_dhx_passwd.so uams_dhx.so endif endif endif if USE_DHX2 if HAVE_LIBGCRYPT uams_LINKS += uams_dhx2.so UAMS_DHX2 = uams_dhx2_passwd.la if BUILD_PAM UAMS_DHX2_PAM = uams_dhx2_pam.la endif if USE_PAM_SO dhx2_exec_hook += && $(LN_S) uams_dhx2_pam.so uams_dhx2.so else dhx2_exec_hook += && $(LN_S) uams_dhx2_passwd.so uams_dhx2.so endif endif endif # these are simple, though some the last three depend on OpenSSL if BUILD_PAM UAMS_PAM = uams_pam.la endif if USE_RANDNUM UAMS_RANDNUM = uams_randnum.la endif if USE_PGP UAMS_PGP = uams_pgp.la endif if USE_GSSAPI UAMS_GSSAPI = uams_gss.la endif # links if USE_PAM_SO UAMS_CLRTXT_LINK = uams_pam.so else UAMS_CLRTXT_LINK = uams_passwd.so endif # # source files # uams_guest_la_SOURCES = uams_guest.c uams_randnum_la_SOURCES = uams_randnum.c uams_passwd_la_SOURCES = uams_passwd.c uams_pam_la_SOURCES = uams_pam.c uams_pgp_la_SOURCES = uams_pgp.c uams_dhx_passwd_la_SOURCES = uams_dhx_passwd.c uams_dhx_pam_la_SOURCES = uams_dhx_pam.c uams_dhx2_passwd_la_SOURCES = uams_dhx2_passwd.c uams_dhx2_pam_la_SOURCES = uams_dhx2_pam.c uams_gss_la_SOURCES = uams_gss.c # # flags # # these should be sorted out, applying both to AM_CFLAGS is senseless AM_CFLAGS = @SSL_CFLAGS@ @LIBGCRYPT_CFLAGS@ uams_pam_la_CFLAGS = @PAM_CFLAGS@ uams_dhx_pam_la_CFLAGS = @SSL_CFLAGS@ @PAM_CFLAGS@ uams_dhx2_pam_la_CFLAGS = @LIBGCRYPT_CFLAGS@ @PAM_CFLAGS@ uams_gss_la_CFLAGS = @GSSAPI_CFLAGS@ uams_guest_la_LDFLAGS = -module -avoid-version uams_randnum_la_LDFLAGS = -module -avoid-version @SSL_LIBS@ uams_passwd_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ uams_pam_la_LDFLAGS = -module -avoid-version @PAM_LIBS@ uams_pgp_la_LDFLAGS = -module -avoid-version @SSL_LIBS@ uams_dhx_passwd_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ @SSL_LIBS@ uams_dhx_pam_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ @SSL_LIBS@ @PAM_LIBS@ uams_dhx2_passwd_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ @LIBGCRYPT_LIBS@ uams_dhx2_pam_la_LDFLAGS = -module -avoid-version @LIBGCRYPT_LIBS@ @PAM_LIBS@ uams_gss_la_LDFLAGS = -module -avoid-version @GSSAPI_LIBS@ # # module compilation # uamsdir = @UAMS_PATH@ uams_LTLIBRARIES = \ $(UAMS_GENERIC) \ $(UAMS_PGP) \ $(UAMS_PAM) \ $(UAMS_RANDNUM) \ $(UAMS_DHX) \ $(UAMS_DHX_PAM) \ $(UAMS_DHX2) \ $(UAMS_DHX2_PAM) \ $(UAMS_GSSAPI) # # link creation # install-exec-hook: (if [ -d $(DESTDIR)$(uamsdir) ] ; then \ cd $(DESTDIR)$(uamsdir) && \ rm -f $(uams_LINKS) && \ $(LN_S) $(UAMS_CLRTXT_LINK) uams_clrtxt.so && \ $(dhx_exec_hook) && \ $(dhx2_exec_hook) ; \ fi) uninstall-hook: (if [ -d $(DESTDIR)$(uamsdir) ] ; then \ cd $(DESTDIR)$(uamsdir) && \ rm -f $(uams_LINKS) ; \ fi) netatalk-2.2.2/etc/uams/Makefile.in0000644000175200017500000010572611703521726014047 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for etc/uams/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ # these are complex: check if DHX and DHX2 module should be build @HAVE_OPENSSL_TRUE@@USE_DHX_TRUE@am__append_1 = uams_dhx.so @HAVE_OPENSSL_TRUE@@USE_DHX_TRUE@@USE_PAM_SO_TRUE@am__append_2 = && $(LN_S) uams_dhx_pam.so uams_dhx.so @HAVE_OPENSSL_TRUE@@USE_DHX_TRUE@@USE_PAM_SO_FALSE@am__append_3 = && $(LN_S) uams_dhx_passwd.so uams_dhx.so @HAVE_LIBGCRYPT_TRUE@@USE_DHX2_TRUE@am__append_4 = uams_dhx2.so @HAVE_LIBGCRYPT_TRUE@@USE_DHX2_TRUE@@USE_PAM_SO_TRUE@am__append_5 = && $(LN_S) uams_dhx2_pam.so uams_dhx2.so @HAVE_LIBGCRYPT_TRUE@@USE_DHX2_TRUE@@USE_PAM_SO_FALSE@am__append_6 = && $(LN_S) uams_dhx2_passwd.so uams_dhx2.so subdir = etc/uams DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(uamsdir)" uamsLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(uams_LTLIBRARIES) uams_dhx2_pam_la_LIBADD = am_uams_dhx2_pam_la_OBJECTS = uams_dhx2_pam_la-uams_dhx2_pam.lo uams_dhx2_pam_la_OBJECTS = $(am_uams_dhx2_pam_la_OBJECTS) uams_dhx2_pam_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(uams_dhx2_pam_la_CFLAGS) \ $(CFLAGS) $(uams_dhx2_pam_la_LDFLAGS) $(LDFLAGS) -o $@ @BUILD_PAM_TRUE@@HAVE_LIBGCRYPT_TRUE@@USE_DHX2_TRUE@am_uams_dhx2_pam_la_rpath = \ @BUILD_PAM_TRUE@@HAVE_LIBGCRYPT_TRUE@@USE_DHX2_TRUE@ -rpath \ @BUILD_PAM_TRUE@@HAVE_LIBGCRYPT_TRUE@@USE_DHX2_TRUE@ $(uamsdir) uams_dhx2_passwd_la_LIBADD = am_uams_dhx2_passwd_la_OBJECTS = uams_dhx2_passwd.lo uams_dhx2_passwd_la_OBJECTS = $(am_uams_dhx2_passwd_la_OBJECTS) uams_dhx2_passwd_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(uams_dhx2_passwd_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_LIBGCRYPT_TRUE@@USE_DHX2_TRUE@am_uams_dhx2_passwd_la_rpath = \ @HAVE_LIBGCRYPT_TRUE@@USE_DHX2_TRUE@ -rpath $(uamsdir) uams_dhx_pam_la_LIBADD = am_uams_dhx_pam_la_OBJECTS = uams_dhx_pam_la-uams_dhx_pam.lo uams_dhx_pam_la_OBJECTS = $(am_uams_dhx_pam_la_OBJECTS) uams_dhx_pam_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(uams_dhx_pam_la_CFLAGS) \ $(CFLAGS) $(uams_dhx_pam_la_LDFLAGS) $(LDFLAGS) -o $@ @BUILD_PAM_TRUE@@HAVE_OPENSSL_TRUE@@USE_DHX_TRUE@am_uams_dhx_pam_la_rpath = \ @BUILD_PAM_TRUE@@HAVE_OPENSSL_TRUE@@USE_DHX_TRUE@ -rpath \ @BUILD_PAM_TRUE@@HAVE_OPENSSL_TRUE@@USE_DHX_TRUE@ $(uamsdir) uams_dhx_passwd_la_LIBADD = am_uams_dhx_passwd_la_OBJECTS = uams_dhx_passwd.lo uams_dhx_passwd_la_OBJECTS = $(am_uams_dhx_passwd_la_OBJECTS) uams_dhx_passwd_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(uams_dhx_passwd_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_OPENSSL_TRUE@@USE_DHX_TRUE@am_uams_dhx_passwd_la_rpath = -rpath \ @HAVE_OPENSSL_TRUE@@USE_DHX_TRUE@ $(uamsdir) uams_gss_la_LIBADD = am_uams_gss_la_OBJECTS = uams_gss_la-uams_gss.lo uams_gss_la_OBJECTS = $(am_uams_gss_la_OBJECTS) uams_gss_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(uams_gss_la_CFLAGS) \ $(CFLAGS) $(uams_gss_la_LDFLAGS) $(LDFLAGS) -o $@ @USE_GSSAPI_TRUE@am_uams_gss_la_rpath = -rpath $(uamsdir) uams_guest_la_LIBADD = am_uams_guest_la_OBJECTS = uams_guest.lo uams_guest_la_OBJECTS = $(am_uams_guest_la_OBJECTS) uams_guest_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(uams_guest_la_LDFLAGS) $(LDFLAGS) -o $@ uams_pam_la_LIBADD = am_uams_pam_la_OBJECTS = uams_pam_la-uams_pam.lo uams_pam_la_OBJECTS = $(am_uams_pam_la_OBJECTS) uams_pam_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(uams_pam_la_CFLAGS) \ $(CFLAGS) $(uams_pam_la_LDFLAGS) $(LDFLAGS) -o $@ @BUILD_PAM_TRUE@am_uams_pam_la_rpath = -rpath $(uamsdir) uams_passwd_la_LIBADD = am_uams_passwd_la_OBJECTS = uams_passwd.lo uams_passwd_la_OBJECTS = $(am_uams_passwd_la_OBJECTS) uams_passwd_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(uams_passwd_la_LDFLAGS) $(LDFLAGS) -o $@ uams_pgp_la_LIBADD = am_uams_pgp_la_OBJECTS = uams_pgp.lo uams_pgp_la_OBJECTS = $(am_uams_pgp_la_OBJECTS) uams_pgp_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(uams_pgp_la_LDFLAGS) $(LDFLAGS) -o $@ @USE_PGP_TRUE@am_uams_pgp_la_rpath = -rpath $(uamsdir) uams_randnum_la_LIBADD = am_uams_randnum_la_OBJECTS = uams_randnum.lo uams_randnum_la_OBJECTS = $(am_uams_randnum_la_OBJECTS) uams_randnum_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(uams_randnum_la_LDFLAGS) $(LDFLAGS) -o $@ @USE_RANDNUM_TRUE@am_uams_randnum_la_rpath = -rpath $(uamsdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(uams_dhx2_pam_la_SOURCES) $(uams_dhx2_passwd_la_SOURCES) \ $(uams_dhx_pam_la_SOURCES) $(uams_dhx_passwd_la_SOURCES) \ $(uams_gss_la_SOURCES) $(uams_guest_la_SOURCES) \ $(uams_pam_la_SOURCES) $(uams_passwd_la_SOURCES) \ $(uams_pgp_la_SOURCES) $(uams_randnum_la_SOURCES) DIST_SOURCES = $(uams_dhx2_pam_la_SOURCES) \ $(uams_dhx2_passwd_la_SOURCES) $(uams_dhx_pam_la_SOURCES) \ $(uams_dhx_passwd_la_SOURCES) $(uams_gss_la_SOURCES) \ $(uams_guest_la_SOURCES) $(uams_pam_la_SOURCES) \ $(uams_passwd_la_SOURCES) $(uams_pgp_la_SOURCES) \ $(uams_randnum_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = uams_krb4 # # conditionally build some modules # UAMS_GENERIC = uams_guest.la uams_passwd.la uams_LINKS = uams_clrtxt.so $(am__append_1) $(am__append_4) dhx_exec_hook = echo $(am__append_2) $(am__append_3) dhx2_exec_hook = echo $(am__append_5) $(am__append_6) @HAVE_OPENSSL_TRUE@@USE_DHX_TRUE@UAMS_DHX = uams_dhx_passwd.la @BUILD_PAM_TRUE@@HAVE_OPENSSL_TRUE@@USE_DHX_TRUE@UAMS_DHX_PAM = uams_dhx_pam.la @HAVE_LIBGCRYPT_TRUE@@USE_DHX2_TRUE@UAMS_DHX2 = uams_dhx2_passwd.la @BUILD_PAM_TRUE@@HAVE_LIBGCRYPT_TRUE@@USE_DHX2_TRUE@UAMS_DHX2_PAM = uams_dhx2_pam.la # these are simple, though some the last three depend on OpenSSL @BUILD_PAM_TRUE@UAMS_PAM = uams_pam.la @USE_RANDNUM_TRUE@UAMS_RANDNUM = uams_randnum.la @USE_PGP_TRUE@UAMS_PGP = uams_pgp.la @USE_GSSAPI_TRUE@UAMS_GSSAPI = uams_gss.la @USE_PAM_SO_FALSE@UAMS_CLRTXT_LINK = uams_passwd.so # links @USE_PAM_SO_TRUE@UAMS_CLRTXT_LINK = uams_pam.so # # source files # uams_guest_la_SOURCES = uams_guest.c uams_randnum_la_SOURCES = uams_randnum.c uams_passwd_la_SOURCES = uams_passwd.c uams_pam_la_SOURCES = uams_pam.c uams_pgp_la_SOURCES = uams_pgp.c uams_dhx_passwd_la_SOURCES = uams_dhx_passwd.c uams_dhx_pam_la_SOURCES = uams_dhx_pam.c uams_dhx2_passwd_la_SOURCES = uams_dhx2_passwd.c uams_dhx2_pam_la_SOURCES = uams_dhx2_pam.c uams_gss_la_SOURCES = uams_gss.c # # flags # # these should be sorted out, applying both to AM_CFLAGS is senseless AM_CFLAGS = @SSL_CFLAGS@ @LIBGCRYPT_CFLAGS@ uams_pam_la_CFLAGS = @PAM_CFLAGS@ uams_dhx_pam_la_CFLAGS = @SSL_CFLAGS@ @PAM_CFLAGS@ uams_dhx2_pam_la_CFLAGS = @LIBGCRYPT_CFLAGS@ @PAM_CFLAGS@ uams_gss_la_CFLAGS = @GSSAPI_CFLAGS@ uams_guest_la_LDFLAGS = -module -avoid-version uams_randnum_la_LDFLAGS = -module -avoid-version @SSL_LIBS@ uams_passwd_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ uams_pam_la_LDFLAGS = -module -avoid-version @PAM_LIBS@ uams_pgp_la_LDFLAGS = -module -avoid-version @SSL_LIBS@ uams_dhx_passwd_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ @SSL_LIBS@ uams_dhx_pam_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ @SSL_LIBS@ @PAM_LIBS@ uams_dhx2_passwd_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ @LIBGCRYPT_LIBS@ uams_dhx2_pam_la_LDFLAGS = -module -avoid-version @LIBGCRYPT_LIBS@ @PAM_LIBS@ uams_gss_la_LDFLAGS = -module -avoid-version @GSSAPI_LIBS@ # # module compilation # uamsdir = @UAMS_PATH@ uams_LTLIBRARIES = \ $(UAMS_GENERIC) \ $(UAMS_PGP) \ $(UAMS_PAM) \ $(UAMS_RANDNUM) \ $(UAMS_DHX) \ $(UAMS_DHX_PAM) \ $(UAMS_DHX2) \ $(UAMS_DHX2_PAM) \ $(UAMS_GSSAPI) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign etc/uams/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign etc/uams/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-uamsLTLIBRARIES: $(uams_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(uamsdir)" || $(MKDIR_P) "$(DESTDIR)$(uamsdir)" @list='$(uams_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(uamsLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(uamsdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(uamsLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(uamsdir)/$$f"; \ else :; fi; \ done uninstall-uamsLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(uams_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(uamsdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(uamsdir)/$$p"; \ done clean-uamsLTLIBRARIES: -test -z "$(uams_LTLIBRARIES)" || rm -f $(uams_LTLIBRARIES) @list='$(uams_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done uams_dhx2_pam.la: $(uams_dhx2_pam_la_OBJECTS) $(uams_dhx2_pam_la_DEPENDENCIES) $(uams_dhx2_pam_la_LINK) $(am_uams_dhx2_pam_la_rpath) $(uams_dhx2_pam_la_OBJECTS) $(uams_dhx2_pam_la_LIBADD) $(LIBS) uams_dhx2_passwd.la: $(uams_dhx2_passwd_la_OBJECTS) $(uams_dhx2_passwd_la_DEPENDENCIES) $(uams_dhx2_passwd_la_LINK) $(am_uams_dhx2_passwd_la_rpath) $(uams_dhx2_passwd_la_OBJECTS) $(uams_dhx2_passwd_la_LIBADD) $(LIBS) uams_dhx_pam.la: $(uams_dhx_pam_la_OBJECTS) $(uams_dhx_pam_la_DEPENDENCIES) $(uams_dhx_pam_la_LINK) $(am_uams_dhx_pam_la_rpath) $(uams_dhx_pam_la_OBJECTS) $(uams_dhx_pam_la_LIBADD) $(LIBS) uams_dhx_passwd.la: $(uams_dhx_passwd_la_OBJECTS) $(uams_dhx_passwd_la_DEPENDENCIES) $(uams_dhx_passwd_la_LINK) $(am_uams_dhx_passwd_la_rpath) $(uams_dhx_passwd_la_OBJECTS) $(uams_dhx_passwd_la_LIBADD) $(LIBS) uams_gss.la: $(uams_gss_la_OBJECTS) $(uams_gss_la_DEPENDENCIES) $(uams_gss_la_LINK) $(am_uams_gss_la_rpath) $(uams_gss_la_OBJECTS) $(uams_gss_la_LIBADD) $(LIBS) uams_guest.la: $(uams_guest_la_OBJECTS) $(uams_guest_la_DEPENDENCIES) $(uams_guest_la_LINK) -rpath $(uamsdir) $(uams_guest_la_OBJECTS) $(uams_guest_la_LIBADD) $(LIBS) uams_pam.la: $(uams_pam_la_OBJECTS) $(uams_pam_la_DEPENDENCIES) $(uams_pam_la_LINK) $(am_uams_pam_la_rpath) $(uams_pam_la_OBJECTS) $(uams_pam_la_LIBADD) $(LIBS) uams_passwd.la: $(uams_passwd_la_OBJECTS) $(uams_passwd_la_DEPENDENCIES) $(uams_passwd_la_LINK) -rpath $(uamsdir) $(uams_passwd_la_OBJECTS) $(uams_passwd_la_LIBADD) $(LIBS) uams_pgp.la: $(uams_pgp_la_OBJECTS) $(uams_pgp_la_DEPENDENCIES) $(uams_pgp_la_LINK) $(am_uams_pgp_la_rpath) $(uams_pgp_la_OBJECTS) $(uams_pgp_la_LIBADD) $(LIBS) uams_randnum.la: $(uams_randnum_la_OBJECTS) $(uams_randnum_la_DEPENDENCIES) $(uams_randnum_la_LINK) $(am_uams_randnum_la_rpath) $(uams_randnum_la_OBJECTS) $(uams_randnum_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uams_dhx2_pam_la-uams_dhx2_pam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uams_dhx2_passwd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uams_dhx_pam_la-uams_dhx_pam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uams_dhx_passwd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uams_gss_la-uams_gss.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uams_guest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uams_pam_la-uams_pam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uams_passwd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uams_pgp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uams_randnum.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< uams_dhx2_pam_la-uams_dhx2_pam.lo: uams_dhx2_pam.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uams_dhx2_pam_la_CFLAGS) $(CFLAGS) -MT uams_dhx2_pam_la-uams_dhx2_pam.lo -MD -MP -MF $(DEPDIR)/uams_dhx2_pam_la-uams_dhx2_pam.Tpo -c -o uams_dhx2_pam_la-uams_dhx2_pam.lo `test -f 'uams_dhx2_pam.c' || echo '$(srcdir)/'`uams_dhx2_pam.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/uams_dhx2_pam_la-uams_dhx2_pam.Tpo $(DEPDIR)/uams_dhx2_pam_la-uams_dhx2_pam.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uams_dhx2_pam.c' object='uams_dhx2_pam_la-uams_dhx2_pam.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uams_dhx2_pam_la_CFLAGS) $(CFLAGS) -c -o uams_dhx2_pam_la-uams_dhx2_pam.lo `test -f 'uams_dhx2_pam.c' || echo '$(srcdir)/'`uams_dhx2_pam.c uams_dhx_pam_la-uams_dhx_pam.lo: uams_dhx_pam.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uams_dhx_pam_la_CFLAGS) $(CFLAGS) -MT uams_dhx_pam_la-uams_dhx_pam.lo -MD -MP -MF $(DEPDIR)/uams_dhx_pam_la-uams_dhx_pam.Tpo -c -o uams_dhx_pam_la-uams_dhx_pam.lo `test -f 'uams_dhx_pam.c' || echo '$(srcdir)/'`uams_dhx_pam.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/uams_dhx_pam_la-uams_dhx_pam.Tpo $(DEPDIR)/uams_dhx_pam_la-uams_dhx_pam.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uams_dhx_pam.c' object='uams_dhx_pam_la-uams_dhx_pam.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uams_dhx_pam_la_CFLAGS) $(CFLAGS) -c -o uams_dhx_pam_la-uams_dhx_pam.lo `test -f 'uams_dhx_pam.c' || echo '$(srcdir)/'`uams_dhx_pam.c uams_gss_la-uams_gss.lo: uams_gss.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uams_gss_la_CFLAGS) $(CFLAGS) -MT uams_gss_la-uams_gss.lo -MD -MP -MF $(DEPDIR)/uams_gss_la-uams_gss.Tpo -c -o uams_gss_la-uams_gss.lo `test -f 'uams_gss.c' || echo '$(srcdir)/'`uams_gss.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/uams_gss_la-uams_gss.Tpo $(DEPDIR)/uams_gss_la-uams_gss.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uams_gss.c' object='uams_gss_la-uams_gss.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uams_gss_la_CFLAGS) $(CFLAGS) -c -o uams_gss_la-uams_gss.lo `test -f 'uams_gss.c' || echo '$(srcdir)/'`uams_gss.c uams_pam_la-uams_pam.lo: uams_pam.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uams_pam_la_CFLAGS) $(CFLAGS) -MT uams_pam_la-uams_pam.lo -MD -MP -MF $(DEPDIR)/uams_pam_la-uams_pam.Tpo -c -o uams_pam_la-uams_pam.lo `test -f 'uams_pam.c' || echo '$(srcdir)/'`uams_pam.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/uams_pam_la-uams_pam.Tpo $(DEPDIR)/uams_pam_la-uams_pam.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uams_pam.c' object='uams_pam_la-uams_pam.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uams_pam_la_CFLAGS) $(CFLAGS) -c -o uams_pam_la-uams_pam.lo `test -f 'uams_pam.c' || echo '$(srcdir)/'`uams_pam.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(uamsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-uamsLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-uamsLTLIBRARIES install-dvi: install-dvi-recursive install-exec-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-uamsLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-exec-am install-strip uninstall-am .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ clean-uamsLTLIBRARIES ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip install-uamsLTLIBRARIES \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-hook uninstall-uamsLTLIBRARIES # # link creation # install-exec-hook: (if [ -d $(DESTDIR)$(uamsdir) ] ; then \ cd $(DESTDIR)$(uamsdir) && \ rm -f $(uams_LINKS) && \ $(LN_S) $(UAMS_CLRTXT_LINK) uams_clrtxt.so && \ $(dhx_exec_hook) && \ $(dhx2_exec_hook) ; \ fi) uninstall-hook: (if [ -d $(DESTDIR)$(uamsdir) ] ; then \ cd $(DESTDIR)$(uamsdir) && \ rm -f $(uams_LINKS) ; \ fi) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/etc/uams/uams_guest.c0000644000175200017500000000754411655731126014324 00000000000000/* * $Id: uams_guest.c,v 1.18 2009-11-08 01:07:17 didg Exp $ * * (c) 2001 (see COPYING) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include /* STDC check */ #if STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #include #include #include #include #include #ifndef MIN #define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif /* MIN */ /*XXX in etc/papd/file.h */ struct papfile; extern UAM_MODULE_EXPORT void append(struct papfile *, const char *, int); /* login and login_ext are almost the same */ static int noauth_login(void *obj, struct passwd **uam_pwd, char *ibuf _U_, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct passwd *pwent; char *guest, *username; *rbuflen = 0; LOG(log_info, logtype_uams, "login noauth" ); if (uam_afpserver_option(obj, UAM_OPTION_GUEST, (void *) &guest, NULL) < 0) return AFPERR_MISC; if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, NULL) < 0) return AFPERR_MISC; strcpy(username, guest); if ((pwent = getpwnam(guest)) == NULL) { LOG(log_error, logtype_uams, "noauth_login: getpwnam( %s ): %s", guest, strerror(errno) ); return( AFPERR_BADUAM ); } #ifdef AFS if ( setpag() < 0 ) { LOG(log_error, logtype_uams, "noauth_login: setpag: %s", strerror(errno) ); return( AFPERR_BADUAM ); } #endif /* AFS */ *uam_pwd = pwent; return( AFP_OK ); } static int noauth_login_ext(void *obj, char *uname _U_, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { return ( noauth_login (obj, uam_pwd, ibuf, ibuflen, rbuf, rbuflen)); } /* Printer NoAuthUAM Login */ static int noauth_printer(char *start, char *stop, char *username, struct papfile *out) { char *data, *p, *q; static const char *loginok = "0\r"; data = (char *)malloc(stop - start + 1); if (!data) { LOG(log_info, logtype_uams,"Bad Login NoAuthUAM: malloc"); return(-1); } strlcpy(data, start, stop - start + 1); /* We are looking for the following format in data: * (username) * * Hopefully username doesn't contain a ")" */ if ((p = strchr(data, '(' )) == NULL) { LOG(log_info, logtype_uams,"Bad Login NoAuthUAM: username not found in string"); free(data); return(-1); } p++; if ((q = strchr(p, ')' )) == NULL) { LOG(log_info, logtype_uams,"Bad Login NoAuthUAM: username not found in string"); free(data); return(-1); } memcpy(username, p, MIN( UAM_USERNAMELEN, q - p )); /* Done copying username, clean up */ free(data); if (getpwnam(username) == NULL) { LOG(log_info, logtype_uams, "Bad Login NoAuthUAM: %s: %s", username, strerror(errno) ); return(-1); } /* Login successful */ append(out, loginok, strlen(loginok)); LOG(log_info, logtype_uams, "Login NoAuthUAM: %s", username); return(0); } static int uam_setup(const char *path) { if (uam_register(UAM_SERVER_LOGIN_EXT, path, "No User Authent", noauth_login, NULL, NULL, noauth_login_ext) < 0) return -1; if (uam_register(UAM_SERVER_PRINTAUTH, path, "NoAuthUAM", noauth_printer) < 0) return -1; return 0; } static void uam_cleanup(void) { uam_unregister(UAM_SERVER_LOGIN, "No User Authent"); uam_unregister(UAM_SERVER_PRINTAUTH, "NoAuthUAM"); } UAM_MODULE_EXPORT struct uam_export uams_guest = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; netatalk-2.2.2/etc/uams/uams_dhx2_passwd.c0000644000175200017500000004340311655731244015416 00000000000000/* * $Id: uams_dhx2_passwd.c,v 1.8 2010-03-30 10:25:49 franklahm Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef UAM_DHX2 #include #include #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_CRYPT_H #include #endif #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_TIME_H #include #endif #ifdef SHADOWPW #include #endif #ifdef HAVE_LIBGCRYPT #include #endif #include #include #include /* Number of bits for p which we generate. Everybode out there uses 512, so we beet them */ #define PRIMEBITS 1024 /* hash a number to a 16-bit quantity */ #define dhxhash(a) ((((unsigned long) (a) >> 8) ^ \ (unsigned long) (a)) & 0xffff) /* Some parameters need be maintained across calls */ static gcry_mpi_t p, Ra; static gcry_mpi_t serverNonce; static char *K_MD5hash = NULL; static int K_hash_len; static u_int16_t ID; /* The initialization vectors for CAST128 are fixed by Apple. */ static unsigned char dhx_c2siv[] = { 'L', 'W', 'a', 'l', 'l', 'a', 'c', 'e' }; static unsigned char dhx_s2civ[] = { 'C', 'J', 'a', 'l', 'b', 'e', 'r', 't' }; /* Static variables used to communicate between the conversation function * and the server_login function */ static struct passwd *dhxpwd; /********************************************************* * Crypto helper func to generate p and g for use in DH. * libgcrypt doesn't provide one directly. * Algorithm taken from GNUTLS:gnutls_dh_primes.c *********************************************************/ /** * This function will generate a new pair of prime and generator for use in * the Diffie-Hellman key exchange. * The bits value should be one of 768, 1024, 2048, 3072 or 4096. **/ static int dh_params_generate (gcry_mpi_t *ret_p, gcry_mpi_t *ret_g, unsigned int bits) { int result, times = 0, qbits; gcry_mpi_t g = NULL, prime = NULL; gcry_mpi_t *factors = NULL; gcry_error_t err; /* Version check should be the very first call because it makes sure that important subsystems are intialized. */ if (!gcry_check_version (GCRYPT_VERSION)) { LOG(log_info, logtype_uams, "PAM DHX2: libgcrypt versions mismatch. Need: %s", GCRYPT_VERSION); result = AFPERR_MISC; goto error; } if (bits < 256) qbits = bits / 2; else qbits = (bits / 40) + 105; if (qbits & 1) /* better have an even number */ qbits++; /* find a prime number of size bits. */ do { if (times) { gcry_mpi_release (prime); gcry_prime_release_factors (factors); } err = gcry_prime_generate (&prime, bits, qbits, &factors, NULL, NULL, GCRY_STRONG_RANDOM, GCRY_PRIME_FLAG_SPECIAL_FACTOR); if (err != 0) { result = AFPERR_MISC; goto error; } err = gcry_prime_check (prime, 0); times++; } while (err != 0 && times < 10); if (err != 0) { result = AFPERR_MISC; goto error; } /* generate the group generator. */ err = gcry_prime_group_generator (&g, prime, factors, NULL); if (err != 0) { result = AFPERR_MISC; goto error; } gcry_prime_release_factors (factors); factors = NULL; if (ret_g) *ret_g = g; else gcry_mpi_release (g); if (ret_p) *ret_p = prime; else gcry_mpi_release (prime); return 0; error: gcry_prime_release_factors (factors); gcry_mpi_release (g); gcry_mpi_release (prime); return result; } static int dhx2_setup(void *obj, char *ibuf _U_, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { int ret; size_t nwritten; gcry_mpi_t g, Ma; char *Ra_binary = NULL; #ifdef SHADOWPW struct spwd *sp; #endif /* SHADOWPW */ *rbuflen = 0; /* Initialize passwd/shadow */ #ifdef SHADOWPW if (( sp = getspnam( dhxpwd->pw_name )) == NULL ) { LOG(log_info, logtype_uams, "DHX2: no shadow passwd entry for this user"); return AFPERR_NOTAUTH; } dhxpwd->pw_passwd = sp->sp_pwdp; #endif /* SHADOWPW */ if (!dhxpwd->pw_passwd) return AFPERR_NOTAUTH; /* Initialize DH params */ p = gcry_mpi_new(0); g = gcry_mpi_new(0); Ra = gcry_mpi_new(0); Ma = gcry_mpi_new(0); /* Generate p and g for DH */ ret = dh_params_generate( &p, &g, PRIMEBITS); if (ret != 0) { LOG(log_info, logtype_uams, "DHX2: Couldn't generate p and g"); ret = AFPERR_MISC; goto error; } /* Generate our random number Ra. */ Ra_binary = calloc(1, PRIMEBITS/8); if (Ra_binary == NULL) { ret = AFPERR_MISC; goto error; } gcry_randomize(Ra_binary, PRIMEBITS/8, GCRY_STRONG_RANDOM); gcry_mpi_scan(&Ra, GCRYMPI_FMT_USG, Ra_binary, PRIMEBITS/8, NULL); free(Ra_binary); Ra_binary = NULL; /* Ma = g^Ra mod p. This is our "public" key */ gcry_mpi_powm(Ma, g, Ra, p); /* ------- DH Init done ------ */ /* Start building reply packet */ /* Session ID first */ ID = dhxhash(obj); *(u_int16_t *)rbuf = htons(ID); rbuf += 2; *rbuflen += 2; /* g is next */ gcry_mpi_print( GCRYMPI_FMT_USG, (unsigned char *)rbuf, 4, &nwritten, g); if (nwritten < 4) { memmove( rbuf+4-nwritten, rbuf, nwritten); memset( rbuf, 0, 4-nwritten); } rbuf += 4; *rbuflen += 4; /* len = length of p = PRIMEBITS/8 */ *(u_int16_t *)rbuf = htons((u_int16_t) PRIMEBITS/8); rbuf += 2; *rbuflen += 2; /* p */ gcry_mpi_print( GCRYMPI_FMT_USG, (unsigned char *)rbuf, PRIMEBITS/8, NULL, p); rbuf += PRIMEBITS/8; *rbuflen += PRIMEBITS/8; /* Ma */ gcry_mpi_print( GCRYMPI_FMT_USG, (unsigned char *)rbuf, PRIMEBITS/8, &nwritten, Ma); if (nwritten < PRIMEBITS/8) { memmove(rbuf + (PRIMEBITS/8) - nwritten, rbuf, nwritten); memset(rbuf, 0, (PRIMEBITS/8) - nwritten); } rbuf += PRIMEBITS/8; *rbuflen += PRIMEBITS/8; ret = AFPERR_AUTHCONT; error: /* We exit here anyway */ /* We will only need p and Ra later, but mustn't forget to release it ! */ gcry_mpi_release(g); gcry_mpi_release(Ma); return ret; } /* -------------------------------- */ static int login(void *obj, char *username, int ulen, struct passwd **uam_pwd _U_, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { if (( dhxpwd = uam_getname(obj, username, ulen)) == NULL ) { LOG(log_info, logtype_uams, "DHX2: unknown username"); return AFPERR_NOTAUTH; } LOG(log_info, logtype_uams, "DHX2 login: %s", username); return dhx2_setup(obj, ibuf, ibuflen, rbuf, rbuflen); } /* -------------------------------- */ /* dhx login: things are done in a slightly bizarre order to avoid * having to clean things up if there's an error. */ static int passwd_login(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { char *username; size_t len, ulen; *rbuflen = 0; /* grab some of the options */ if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) { LOG(log_info, logtype_uams, "DHX2: uam_afpserver_option didn't meet uam_option_username -- %s", strerror(errno)); return AFPERR_PARAM; } len = (unsigned char) *ibuf++; if ( len > ulen ) { LOG(log_info, logtype_uams, "DHX2: Signature Retieval Failure -- %s", strerror(errno)); return AFPERR_PARAM; } memcpy(username, ibuf, len ); ibuf += len; username[ len ] = '\0'; if ((unsigned long) ibuf & 1) /* pad to even boundary */ ++ibuf; return (login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen)); } /* ----------------------------- */ static int passwd_login_ext(void *obj, char *uname, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { char *username; size_t len, ulen; u_int16_t temp16; *rbuflen = 0; /* grab some of the options */ if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) { LOG(log_info, logtype_uams, "DHX2: uam_afpserver_option didn't meet uam_option_username -- %s", strerror(errno)); return AFPERR_PARAM; } if (*uname != 3) return AFPERR_PARAM; uname++; memcpy(&temp16, uname, sizeof(temp16)); len = ntohs(temp16); if ( !len || len > ulen ) { LOG(log_info, logtype_uams, "DHX2: Signature Retrieval Failure -- %s", strerror(errno)); return AFPERR_PARAM; } memcpy(username, uname +2, len ); username[ len ] = '\0'; return (login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen)); } /* -------------------------------- */ static int logincont1(void *obj _U_, struct passwd **uam_pwd _U_, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { size_t nwritten; int ret; gcry_mpi_t Mb, K, clientNonce; unsigned char *K_bin = NULL; char serverNonce_bin[16]; gcry_cipher_hd_t ctx; gcry_error_t ctxerror; *rbuflen = 0; Mb = gcry_mpi_new(0); K = gcry_mpi_new(0); clientNonce = gcry_mpi_new(0); serverNonce = gcry_mpi_new(0); /* Packet size should be: Session ID + Ma + Encrypted client nonce */ if (ibuflen != 2 + PRIMEBITS/8 + 16) { LOG(log_error, logtype_uams, "DHX2: Paket length not correct"); ret = AFPERR_PARAM; goto error_noctx; } /* Skip session id */ ibuf += 2; /* Extract Mb, client's "public" key */ gcry_mpi_scan(&Mb, GCRYMPI_FMT_USG, ibuf, PRIMEBITS/8, NULL); ibuf += PRIMEBITS/8; /* Now finally generate the Key: K = Mb^Ra mod p */ gcry_mpi_powm(K, Mb, Ra, p); /* We need K in binary form in order to ... */ K_bin = calloc(1, PRIMEBITS/8); if (K_bin == NULL) { ret = AFPERR_MISC; goto error_noctx; } gcry_mpi_print(GCRYMPI_FMT_USG, K_bin, PRIMEBITS/8, &nwritten, K); if (nwritten < PRIMEBITS/8) { memmove(K_bin + PRIMEBITS/8 - nwritten, K_bin, nwritten); memset(K_bin, 0, PRIMEBITS/8 - nwritten); } /* ... generate the MD5 hash of K. K_MD5hash is what we actually use ! */ K_MD5hash = calloc(1, K_hash_len = gcry_md_get_algo_dlen(GCRY_MD_MD5)); if (K_MD5hash == NULL) { ret = AFPERR_MISC; free(K_bin); K_bin = NULL; goto error_noctx; } gcry_md_hash_buffer(GCRY_MD_MD5, K_MD5hash, K_bin, PRIMEBITS/8); free(K_bin); K_bin = NULL; /* FIXME: To support the Reconnect UAM, we need to store this key somewhere */ /* Set up our encryption context. */ ctxerror = gcry_cipher_open( &ctx, GCRY_CIPHER_CAST5, GCRY_CIPHER_MODE_CBC, 0); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Set key */ ctxerror = gcry_cipher_setkey(ctx, K_MD5hash, K_hash_len); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Set the initialization vector for client->server transfer. */ ctxerror = gcry_cipher_setiv(ctx, dhx_c2siv, sizeof(dhx_c2siv)); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Finally: decrypt client's md5_K(client nonce, C2SIV) inplace */ ctxerror = gcry_cipher_decrypt(ctx, ibuf, 16, NULL, 0); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Pull out clients nonce */ gcry_mpi_scan(&clientNonce, GCRYMPI_FMT_USG, ibuf, 16, NULL); /* Increment nonce */ gcry_mpi_add_ui(clientNonce, clientNonce, 1); /* Generate our nonce and remember it for Logincont2 */ gcry_create_nonce(serverNonce_bin, 16); /* We'll use this here */ gcry_mpi_scan(&serverNonce, GCRYMPI_FMT_USG, serverNonce_bin, 16, NULL); /* For use in Logincont2 */ /* ---- Start building reply packet ---- */ /* Session ID + 1 first */ *(u_int16_t *)rbuf = htons(ID+1); rbuf += 2; *rbuflen += 2; /* Client nonce + 1 */ gcry_mpi_print(GCRYMPI_FMT_USG, (unsigned char *)rbuf, PRIMEBITS/8, NULL, clientNonce); /* Server nonce */ memcpy(rbuf+16, serverNonce_bin, 16); /* Set the initialization vector for server->client transfer. */ ctxerror = gcry_cipher_setiv(ctx, dhx_s2civ, sizeof(dhx_s2civ)); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Encrypt md5_K(clientNonce+1, serverNonce) inplace */ ctxerror = gcry_cipher_encrypt(ctx, rbuf, 32, NULL, 0); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } rbuf += 32; *rbuflen += 32; ret = AFPERR_AUTHCONT; goto exit; error_ctx: gcry_cipher_close(ctx); error_noctx: gcry_mpi_release(serverNonce); free(K_MD5hash); K_MD5hash=NULL; exit: gcry_mpi_release(K); gcry_mpi_release(Mb); gcry_mpi_release(Ra); gcry_mpi_release(p); gcry_mpi_release(clientNonce); return ret; } static int logincont2(void *obj _U_, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf _U_, size_t *rbuflen) { #ifdef SHADOWPW struct spwd *sp; #endif /* SHADOWPW */ int ret; char *p; gcry_mpi_t retServerNonce; gcry_cipher_hd_t ctx; gcry_error_t ctxerror; *rbuflen = 0; retServerNonce = gcry_mpi_new(0); /* Packet size should be: Session ID + ServerNonce + Passwd buffer (evantually +10 extra bytes, see Apples Docs)*/ if ((ibuflen != 2 + 16 + 256) && (ibuflen != 2 + 16 + 256 + 10)) { LOG(log_error, logtype_uams, "DHX2: Paket length not correct: %d. Should be 274 or 284.", ibuflen); ret = AFPERR_PARAM; goto error_noctx; } /* Set up our encryption context. */ ctxerror = gcry_cipher_open( &ctx, GCRY_CIPHER_CAST5, GCRY_CIPHER_MODE_CBC, 0); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Set key */ ctxerror = gcry_cipher_setkey(ctx, K_MD5hash, K_hash_len); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Set the initialization vector for client->server transfer. */ ctxerror = gcry_cipher_setiv(ctx, dhx_c2siv, sizeof(dhx_c2siv)); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Skip Session ID */ ibuf += 2; /* Finally: decrypt client's md5_K(serverNonce+1, passwor, C2SIV) inplace */ ctxerror = gcry_cipher_decrypt(ctx, ibuf, 16+256, NULL, 0); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Pull out nonce. Should be serverNonce+1 */ gcry_mpi_scan(&retServerNonce, GCRYMPI_FMT_USG, ibuf, 16, NULL); gcry_mpi_sub_ui(retServerNonce, retServerNonce, 1); if ( gcry_mpi_cmp( serverNonce, retServerNonce) != 0) { /* We're hacked! */ ret = AFPERR_NOTAUTH; goto error_ctx; } ibuf += 16; /* ibuf now point to passwd in cleartext */ /* ---- Start authentication --- */ ret = AFPERR_NOTAUTH; p = crypt( ibuf, dhxpwd->pw_passwd ); memset(ibuf, 0, 255); if ( strcmp( p, dhxpwd->pw_passwd ) == 0 ) { *uam_pwd = dhxpwd; ret = AFP_OK; } #ifdef SHADOWPW if (( sp = getspnam( dhxpwd->pw_name )) == NULL ) { LOG(log_info, logtype_uams, "no shadow passwd entry for %s", dhxpwd->pw_name); ret = AFPERR_NOTAUTH; goto exit; } /* check for expired password */ if (sp && sp->sp_max != -1 && sp->sp_lstchg) { time_t now = time(NULL) / (60*60*24); int32_t expire_days = sp->sp_lstchg - now + sp->sp_max; if ( expire_days < 0 ) { LOG(log_info, logtype_uams, "password for user %s expired", dhxpwd->pw_name); ret = AFPERR_PWDEXPR; goto exit; } } #endif /* SHADOWPW */ error_ctx: gcry_cipher_close(ctx); error_noctx: exit: free(K_MD5hash); K_MD5hash=NULL; gcry_mpi_release(serverNonce); gcry_mpi_release(retServerNonce); return ret; } static int passwd_logincont(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { u_int16_t retID; int ret; /* check for session id */ retID = ntohs(*(u_int16_t *)ibuf); if (retID == ID) ret = logincont1(obj, uam_pwd, ibuf, ibuflen, rbuf, rbuflen); else if (retID == ID+1) ret = logincont2(obj, uam_pwd, ibuf,ibuflen, rbuf, rbuflen); else { LOG(log_info, logtype_uams, "DHX2: Session ID Mismatch"); ret = AFPERR_PARAM; } return ret; } static int uam_setup(const char *path) { if (uam_register(UAM_SERVER_LOGIN_EXT, path, "DHX2", passwd_login, passwd_logincont, NULL, passwd_login_ext) < 0) return -1; return 0; } static void uam_cleanup(void) { uam_unregister(UAM_SERVER_LOGIN, "DHX2"); } UAM_MODULE_EXPORT struct uam_export uams_dhx2 = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; UAM_MODULE_EXPORT struct uam_export uams_dhx2_passwd = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; #endif /* UAM_DHX2 */ netatalk-2.2.2/etc/uams/uams_dhx2_pam.c0000644000175200017500000006762511656513763014713 00000000000000/* * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #if defined (USE_PAM) && defined (UAM_DHX2) #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #ifdef HAVE_SECURITY_PAM_APPL_H #include #endif #ifdef HAVE_PAM_PAM_APPL_H #include #endif #ifdef HAVE_LIBGCRYPT #include #endif /* HAVE_LIBGCRYPT */ #include #include #include /* Number of bits for p which we generate. Everybode out there uses 512, so we beet them */ #define PRIMEBITS 1024 /* hash a number to a 16-bit quantity */ #define dhxhash(a) ((((unsigned long) (a) >> 8) ^ \ (unsigned long) (a)) & 0xffff) /* Some parameters need be maintained across calls */ static gcry_mpi_t p, g, Ra; static gcry_mpi_t serverNonce; static char *K_MD5hash = NULL; static int K_hash_len; static u_int16_t ID; /* The initialization vectors for CAST128 are fixed by Apple. */ static unsigned char dhx_c2siv[] = { 'L', 'W', 'a', 'l', 'l', 'a', 'c', 'e' }; static unsigned char dhx_s2civ[] = { 'C', 'J', 'a', 'l', 'b', 'e', 'r', 't' }; /* Static variables used to communicate between the conversation function * and the server_login function */ static pam_handle_t *pamh = NULL; static char *PAM_username; static char *PAM_password; static struct passwd *dhxpwd; /********************************************************* * Crypto helper func to generate p and g for use in DH. * libgcrypt doesn't provide one directly. * Algorithm taken from GNUTLS:gnutls_dh_primes.c *********************************************************/ /** * This function will generate a new pair of prime and generator for use in * the Diffie-Hellman key exchange. * The bits value should be one of 768, 1024, 2048, 3072 or 4096. **/ static int dh_params_generate (unsigned int bits) { int result, times = 0, qbits; gcry_mpi_t *factors = NULL; gcry_error_t err; /* Version check should be the very first call because it makes sure that important subsystems are intialized. */ if (!gcry_check_version (GCRYPT_VERSION)) { LOG(log_error, logtype_uams, "PAM DHX2: libgcrypt versions mismatch. Need: %s", GCRYPT_VERSION); result = AFPERR_MISC; goto error; } if (bits < 256) qbits = bits / 2; else qbits = (bits / 40) + 105; if (qbits & 1) /* better have an even number */ qbits++; /* find a prime number of size bits. */ do { if (times) { gcry_mpi_release(p); gcry_prime_release_factors (factors); } err = gcry_prime_generate(&p, bits, qbits, &factors, NULL, NULL, GCRY_STRONG_RANDOM, GCRY_PRIME_FLAG_SPECIAL_FACTOR); if (err != 0) { result = AFPERR_MISC; goto error; } err = gcry_prime_check(p, 0); times++; } while (err != 0 && times < 10); if (err != 0) { result = AFPERR_MISC; goto error; } /* generate the group generator. */ err = gcry_prime_group_generator(&g, p, factors, NULL); if (err != 0) { result = AFPERR_MISC; goto error; } gcry_prime_release_factors(factors); return 0; error: gcry_prime_release_factors(factors); return result; } /* PAM conversation function * Here we assume (for now, at least) that echo on means login name, and * echo off means password. */ static int PAM_conv (int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr _U_) { int count = 0; struct pam_response *reply; #define COPY_STRING(s) (s) ? strdup(s) : NULL errno = 0; if (num_msg < 1) { /* Log Entry */ LOG(log_info, logtype_uams, "PAM DHX2 Conversation Err -- %s", strerror(errno)); /* Log Entry */ return PAM_CONV_ERR; } reply = (struct pam_response *) calloc(num_msg, sizeof(struct pam_response)); if (!reply) { /* Log Entry */ LOG(log_info, logtype_uams, "PAM DHX2: Conversation Err -- %s", strerror(errno)); /* Log Entry */ return PAM_CONV_ERR; } for (count = 0; count < num_msg; count++) { char *string = NULL; switch (msg[count]->msg_style) { case PAM_PROMPT_ECHO_ON: if (!(string = COPY_STRING(PAM_username))) { /* Log Entry */ LOG(log_info, logtype_uams, "PAM DHX2: username failure -- %s", strerror(errno)); /* Log Entry */ goto pam_fail_conv; } break; case PAM_PROMPT_ECHO_OFF: if (!(string = COPY_STRING(PAM_password))) { /* Log Entry */ LOG(log_info, logtype_uams, "PAM DHX2: passwd failure: --: %s", strerror(errno)); /* Log Entry */ goto pam_fail_conv; } break; case PAM_TEXT_INFO: #ifdef PAM_BINARY_PROMPT case PAM_BINARY_PROMPT: #endif /* PAM_BINARY_PROMPT */ /* ignore it... */ break; case PAM_ERROR_MSG: default: LOG(log_info, logtype_uams, "PAM DHX2: Binary_Prompt -- %s", strerror(errno)); goto pam_fail_conv; } if (string) { reply[count].resp_retcode = 0; reply[count].resp = string; string = NULL; } } *resp = reply; LOG(log_info, logtype_uams, "PAM DHX2: PAM Success"); return PAM_SUCCESS; pam_fail_conv: for (count = 0; count < num_msg; count++) { if (!reply[count].resp) continue; switch (msg[count]->msg_style) { case PAM_PROMPT_ECHO_OFF: case PAM_PROMPT_ECHO_ON: free(reply[count].resp); break; } } free(reply); /* Log Entry */ LOG(log_info, logtype_uams, "PAM DHX2: Conversation Err -- %s", strerror(errno)); /* Log Entry */ return PAM_CONV_ERR; } static struct pam_conv PAM_conversation = { &PAM_conv, NULL }; static int dhx2_setup(void *obj, char *ibuf _U_, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { int ret; size_t nwritten; gcry_mpi_t Ma; char *Ra_binary = NULL; *rbuflen = 0; Ra = gcry_mpi_new(0); Ma = gcry_mpi_new(0); /* Generate our random number Ra. */ Ra_binary = calloc(1, PRIMEBITS/8); if (Ra_binary == NULL) { ret = AFPERR_MISC; goto error; } gcry_randomize(Ra_binary, PRIMEBITS/8, GCRY_STRONG_RANDOM); gcry_mpi_scan(&Ra, GCRYMPI_FMT_USG, Ra_binary, PRIMEBITS/8, NULL); free(Ra_binary); Ra_binary = NULL; /* Ma = g^Ra mod p. This is our "public" key */ gcry_mpi_powm(Ma, g, Ra, p); /* ------- DH Init done ------ */ /* Start building reply packet */ /* Session ID first */ ID = dhxhash(obj); *(u_int16_t *)rbuf = htons(ID); rbuf += 2; *rbuflen += 2; /* g is next */ gcry_mpi_print( GCRYMPI_FMT_USG, (unsigned char *)rbuf, 4, &nwritten, g); if (nwritten < 4) { memmove( rbuf+4-nwritten, rbuf, nwritten); memset( rbuf, 0, 4-nwritten); } rbuf += 4; *rbuflen += 4; /* len = length of p = PRIMEBITS/8 */ *(u_int16_t *)rbuf = htons((u_int16_t) PRIMEBITS/8); rbuf += 2; *rbuflen += 2; /* p */ gcry_mpi_print( GCRYMPI_FMT_USG, (unsigned char *)rbuf, PRIMEBITS/8, NULL, p); rbuf += PRIMEBITS/8; *rbuflen += PRIMEBITS/8; /* Ma */ gcry_mpi_print( GCRYMPI_FMT_USG, (unsigned char *)rbuf, PRIMEBITS/8, &nwritten, Ma); if (nwritten < PRIMEBITS/8) { memmove(rbuf + (PRIMEBITS/8) - nwritten, rbuf, nwritten); memset(rbuf, 0, (PRIMEBITS/8) - nwritten); } rbuf += PRIMEBITS/8; *rbuflen += PRIMEBITS/8; ret = AFPERR_AUTHCONT; error: /* We exit here anyway */ /* We will need Ra later, but mustn't forget to release it ! */ gcry_mpi_release(Ma); return ret; } /* -------------------------------- */ static int login(void *obj, char *username, int ulen, struct passwd **uam_pwd _U_, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { if (( dhxpwd = uam_getname(obj, username, ulen)) == NULL ) { LOG(log_info, logtype_uams, "DHX2: unknown username"); return AFPERR_NOTAUTH; } PAM_username = username; LOG(log_info, logtype_uams, "DHX2 login: %s", username); return dhx2_setup(obj, ibuf, ibuflen, rbuf, rbuflen); } /* -------------------------------- */ /* dhx login: things are done in a slightly bizarre order to avoid * having to clean things up if there's an error. */ static int pam_login(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { char *username; size_t len, ulen; *rbuflen = 0; /* grab some of the options */ if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) { LOG(log_info, logtype_uams, "DHX2: uam_afpserver_option didn't meet uam_option_username -- %s", strerror(errno)); return AFPERR_PARAM; } len = (unsigned char) *ibuf++; if ( len > ulen ) { LOG(log_info, logtype_uams, "DHX2: Signature Retieval Failure -- %s", strerror(errno)); return AFPERR_PARAM; } memcpy(username, ibuf, len ); ibuf += len; username[ len ] = '\0'; if ((unsigned long) ibuf & 1) /* pad to even boundary */ ++ibuf; return (login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen)); } /* ----------------------------- */ static int pam_login_ext(void *obj, char *uname, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { char *username; size_t len, ulen; u_int16_t temp16; *rbuflen = 0; /* grab some of the options */ if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) { LOG(log_info, logtype_uams, "DHX2: uam_afpserver_option didn't meet uam_option_username -- %s", strerror(errno)); return AFPERR_PARAM; } if (*uname != 3) return AFPERR_PARAM; uname++; memcpy(&temp16, uname, sizeof(temp16)); len = ntohs(temp16); if ( !len || len > ulen ) { LOG(log_info, logtype_uams, "DHX2: Signature Retrieval Failure -- %s", strerror(errno)); return AFPERR_PARAM; } memcpy(username, uname +2, len ); username[ len ] = '\0'; return (login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen)); } /* -------------------------------- */ static int logincont1(void *obj _U_, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { int ret; size_t nwritten; gcry_mpi_t Mb, K, clientNonce; unsigned char *K_bin = NULL; char serverNonce_bin[16]; gcry_cipher_hd_t ctx; gcry_error_t ctxerror; *rbuflen = 0; Mb = gcry_mpi_new(0); K = gcry_mpi_new(0); clientNonce = gcry_mpi_new(0); serverNonce = gcry_mpi_new(0); /* Packet size should be: Session ID + Ma + Encrypted client nonce */ if (ibuflen != 2 + PRIMEBITS/8 + 16) { LOG(log_error, logtype_uams, "DHX2: Paket length not correct"); ret = AFPERR_PARAM; goto error_noctx; } /* Skip session id */ ibuf += 2; /* Extract Mb, client's "public" key */ gcry_mpi_scan(&Mb, GCRYMPI_FMT_USG, ibuf, PRIMEBITS/8, NULL); ibuf += PRIMEBITS/8; /* Now finally generate the Key: K = Mb^Ra mod p */ gcry_mpi_powm(K, Mb, Ra, p); /* We need K in binary form in order to ... */ K_bin = calloc(1, PRIMEBITS/8); if (K_bin == NULL) { ret = AFPERR_MISC; goto error_noctx; } gcry_mpi_print(GCRYMPI_FMT_USG, K_bin, PRIMEBITS/8, &nwritten, K); if (nwritten < PRIMEBITS/8) { memmove(K_bin + PRIMEBITS/8 - nwritten, K_bin, nwritten); memset(K_bin, 0, PRIMEBITS/8 - nwritten); } /* ... generate the MD5 hash of K. K_MD5hash is what we actually use ! */ K_MD5hash = calloc(1, K_hash_len = gcry_md_get_algo_dlen(GCRY_MD_MD5)); if (K_MD5hash == NULL) { ret = AFPERR_MISC; goto error_noctx; } gcry_md_hash_buffer(GCRY_MD_MD5, K_MD5hash, K_bin, PRIMEBITS/8); free(K_bin); K_bin = NULL; /* FIXME: To support the Reconnect UAM, we need to store this key somewhere */ /* Set up our encryption context. */ ctxerror = gcry_cipher_open( &ctx, GCRY_CIPHER_CAST5, GCRY_CIPHER_MODE_CBC, 0); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Set key */ ctxerror = gcry_cipher_setkey(ctx, K_MD5hash, K_hash_len); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Set the initialization vector for client->server transfer. */ ctxerror = gcry_cipher_setiv(ctx, dhx_c2siv, sizeof(dhx_c2siv)); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Finally: decrypt client's md5_K(client nonce, C2SIV) inplace */ ctxerror = gcry_cipher_decrypt(ctx, ibuf, 16, NULL, 0); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Pull out clients nonce */ gcry_mpi_scan(&clientNonce, GCRYMPI_FMT_USG, ibuf, 16, NULL); /* Increment nonce */ gcry_mpi_add_ui(clientNonce, clientNonce, 1); /* Generate our nonce and remember it for Logincont2 */ gcry_create_nonce(serverNonce_bin, 16); /* We'll use this here */ gcry_mpi_scan(&serverNonce, GCRYMPI_FMT_USG, serverNonce_bin, 16, NULL); /* For use in Logincont2 */ /* ---- Start building reply packet ---- */ /* Session ID + 1 first */ *(u_int16_t *)rbuf = htons(ID+1); rbuf += 2; *rbuflen += 2; /* Client nonce + 1 */ gcry_mpi_print(GCRYMPI_FMT_USG, (unsigned char *)rbuf, PRIMEBITS/8, NULL, clientNonce); /* Server nonce */ memcpy(rbuf+16, serverNonce_bin, 16); /* Set the initialization vector for server->client transfer. */ ctxerror = gcry_cipher_setiv(ctx, dhx_s2civ, sizeof(dhx_s2civ)); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Encrypt md5_K(clientNonce+1, serverNonce) inplace */ ctxerror = gcry_cipher_encrypt(ctx, rbuf, 32, NULL, 0); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } rbuf += 32; *rbuflen += 32; ret = AFPERR_AUTHCONT; goto exit; error_ctx: gcry_cipher_close(ctx); error_noctx: gcry_mpi_release(serverNonce); free(K_MD5hash); K_MD5hash=NULL; exit: gcry_mpi_release(K); gcry_mpi_release(Mb); gcry_mpi_release(Ra); gcry_mpi_release(clientNonce); return ret; } /** * Try to authenticate via PAM as "adminauthuser" **/ static int loginasroot(const char *adminauthuser, const char **hostname, int status) { int PAM_error; if ((PAM_error = pam_end(pamh, status)) != PAM_SUCCESS) goto exit; pamh = NULL; if ((PAM_error = pam_start("netatalk", adminauthuser, &PAM_conversation, &pamh)) != PAM_SUCCESS) { LOG(log_info, logtype_uams, "DHX2: PAM_Error: %s", pam_strerror(pamh,PAM_error)); goto exit; } /* solaris craps out if PAM_TTY and PAM_RHOST aren't set. */ pam_set_item(pamh, PAM_TTY, "afpd"); pam_set_item(pamh, PAM_RHOST, *hostname); if ((PAM_error = pam_authenticate(pamh, 0)) != PAM_SUCCESS) goto exit; LOG(log_warning, logtype_uams, "DHX2: Authenticated as \"%s\"", adminauthuser); exit: return PAM_error; } static int logincont2(void *obj_in, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf _U_, size_t *rbuflen) { AFPObj *obj = obj_in; int ret = AFPERR_MISC; int PAM_error; const char *hostname = NULL; gcry_mpi_t retServerNonce; gcry_cipher_hd_t ctx; gcry_error_t ctxerror; char *utfpass = NULL; *rbuflen = 0; /* Packet size should be: Session ID + ServerNonce + Passwd buffer (evantually +10 extra bytes, see Apples Docs) */ if ((ibuflen != 2 + 16 + 256) && (ibuflen != 2 + 16 + 256 + 10)) { LOG(log_error, logtype_uams, "DHX2: Paket length not correct: %u. Should be 274 or 284.", ibuflen); ret = AFPERR_PARAM; goto error_noctx; } retServerNonce = gcry_mpi_new(0); /* For PAM */ uam_afpserver_option(obj, UAM_OPTION_CLIENTNAME, (void *) &hostname, NULL); /* Set up our encryption context. */ ctxerror = gcry_cipher_open( &ctx, GCRY_CIPHER_CAST5, GCRY_CIPHER_MODE_CBC, 0); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Set key */ ctxerror = gcry_cipher_setkey(ctx, K_MD5hash, K_hash_len); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Set the initialization vector for client->server transfer. */ ctxerror = gcry_cipher_setiv(ctx, dhx_c2siv, sizeof(dhx_c2siv)); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Skip Session ID */ ibuf += 2; /* Finally: decrypt client's md5_K(serverNonce+1, passwor, C2SIV) inplace */ ctxerror = gcry_cipher_decrypt(ctx, ibuf, 16+256, NULL, 0); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Pull out nonce. Should be serverNonce+1 */ gcry_mpi_scan(&retServerNonce, GCRYMPI_FMT_USG, ibuf, 16, NULL); gcry_mpi_sub_ui(retServerNonce, retServerNonce, 1); if ( gcry_mpi_cmp( serverNonce, retServerNonce) != 0) { /* We're hacked! */ ret = AFPERR_NOTAUTH; goto error_ctx; } ibuf += 16; /* ---- Start authentication with PAM --- */ /* The password is in legacy Mac encoding, convert it to host encoding */ if (convert_string_allocate(CH_MAC, CH_UNIX, ibuf, -1, &utfpass) == (size_t)-1) { LOG(log_error, logtype_uams, "DHX2: conversion error"); goto error_ctx; } PAM_password = utfpass; #ifdef DEBUG LOG(log_maxdebug, logtype_default, "DHX2: password: %s", PAM_password); #endif /* Set these things up for the conv function */ ret = AFPERR_NOTAUTH; PAM_error = pam_start("netatalk", PAM_username, &PAM_conversation, &pamh); if (PAM_error != PAM_SUCCESS) { LOG(log_info, logtype_uams, "DHX2: PAM_Error: %s", pam_strerror(pamh,PAM_error)); goto error_ctx; } /* solaris craps out if PAM_TTY and PAM_RHOST aren't set. */ pam_set_item(pamh, PAM_TTY, "afpd"); pam_set_item(pamh, PAM_RHOST, hostname); PAM_error = pam_authenticate(pamh, 0); if (PAM_error != PAM_SUCCESS) { if (PAM_error == PAM_MAXTRIES) ret = AFPERR_PWDEXPR; LOG(log_info, logtype_uams, "DHX2: PAM_Error: %s", pam_strerror(pamh, PAM_error)); if (!obj->options.adminauthuser) goto error_ctx; if (loginasroot(obj->options.adminauthuser, &hostname, PAM_error) != PAM_SUCCESS) { goto error_ctx; } } PAM_error = pam_acct_mgmt(pamh, 0); if (PAM_error != PAM_SUCCESS ) { LOG(log_info, logtype_uams, "DHX2: PAM_Error: %s", pam_strerror(pamh, PAM_error)); if (PAM_error == PAM_NEW_AUTHTOK_REQD) /* password expired */ ret = AFPERR_PWDEXPR; #ifdef PAM_AUTHTOKEN_REQD else if (PAM_error == PAM_AUTHTOKEN_REQD) ret = AFPERR_PWDCHNG; #endif goto error_ctx; } #ifndef PAM_CRED_ESTABLISH #define PAM_CRED_ESTABLISH PAM_ESTABLISH_CRED #endif PAM_error = pam_setcred(pamh, PAM_CRED_ESTABLISH); if (PAM_error != PAM_SUCCESS) { LOG(log_info, logtype_uams, "DHX2: PAM_Error: %s", pam_strerror(pamh, PAM_error)); goto error_ctx; } PAM_error = pam_open_session(pamh, 0); if (PAM_error != PAM_SUCCESS) { LOG(log_info, logtype_uams, "DHX2: PAM_Error: %s", pam_strerror(pamh, PAM_error)); goto error_ctx; } memset(ibuf, 0, 256); /* zero out the password */ if (utfpass) memset(utfpass, 0, strlen(utfpass)); *uam_pwd = dhxpwd; LOG(log_info, logtype_uams, "DHX2: PAM Auth OK!"); ret = AFP_OK; error_ctx: gcry_cipher_close(ctx); error_noctx: if (utfpass) free(utfpass); free(K_MD5hash); K_MD5hash=NULL; gcry_mpi_release(serverNonce); gcry_mpi_release(retServerNonce); return ret; } static int pam_logincont(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { u_int16_t retID; int ret; /* check for session id */ retID = ntohs(*(u_int16_t *)ibuf); if (retID == ID) ret = logincont1(obj, ibuf, ibuflen, rbuf, rbuflen); else if (retID == ID+1) ret = logincont2(obj, uam_pwd, ibuf,ibuflen, rbuf, rbuflen); else { LOG(log_info, logtype_uams, "DHX2: Session ID Mismatch"); ret = AFPERR_PARAM; } return ret; } /* logout */ static void pam_logout(void) { pam_close_session(pamh, 0); pam_end(pamh, 0); pamh = NULL; } /**************************** * --- Change pwd stuff --- */ static int changepw_1(void *obj, char *uname, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { *rbuflen = 0; /* Remember it now, use it in changepw_3 */ PAM_username = uname; return( dhx2_setup(obj, ibuf, ibuflen, rbuf, rbuflen) ); } static int changepw_2(void *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { return( logincont1(obj, ibuf, ibuflen, rbuf, rbuflen) ); } static int changepw_3(void *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen _U_) { int ret; int PAM_error; uid_t uid; pam_handle_t *lpamh; const char *hostname = NULL; gcry_mpi_t retServerNonce; gcry_cipher_hd_t ctx; gcry_error_t ctxerror; *rbuflen = 0; LOG(log_error, logtype_uams, "DHX2 ChangePW: packet 3 processing"); /* Packet size should be: Session ID + ServerNonce + 2*Passwd buffer */ if (ibuflen != 2 + 16 + 2*256) { LOG(log_error, logtype_uams, "DHX2: Paket length not correct"); ret = AFPERR_PARAM; goto error_noctx; } retServerNonce = gcry_mpi_new(0); /* For PAM */ uam_afpserver_option(obj, UAM_OPTION_CLIENTNAME, (void *) &hostname, NULL); /* Set up our encryption context. */ ctxerror = gcry_cipher_open( &ctx, GCRY_CIPHER_CAST5, GCRY_CIPHER_MODE_CBC, 0); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Set key */ ctxerror = gcry_cipher_setkey(ctx, K_MD5hash, K_hash_len); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Set the initialization vector for client->server transfer. */ ctxerror = gcry_cipher_setiv(ctx, dhx_c2siv, sizeof(dhx_c2siv)); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Skip Session ID */ ibuf += 2; /* Finally: decrypt client's md5_K(serverNonce+1, 2*password, C2SIV) inplace */ ctxerror = gcry_cipher_decrypt(ctx, ibuf, 16+2*256, NULL, 0); if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) { ret = AFPERR_MISC; goto error_ctx; } /* Pull out nonce. Should be serverNonce+1 */ gcry_mpi_scan(&retServerNonce, GCRYMPI_FMT_USG, ibuf, 16, NULL); gcry_mpi_sub_ui(retServerNonce, retServerNonce, 1); if ( gcry_mpi_cmp( serverNonce, retServerNonce) != 0) { /* We're hacked! */ ret = AFPERR_NOTAUTH; goto error_ctx; } ibuf += 16; /* ---- Start pwd changing with PAM --- */ ibuf[255] = '\0'; /* For safety */ ibuf[511] = '\0'; /* check if new and old password are equal */ if (memcmp(ibuf, ibuf + 256, 255) == 0) { LOG(log_info, logtype_uams, "DHX2 Chgpwd: new and old password are equal"); ret = AFPERR_PWDSAME; goto error_ctx; } /* Set these things up for the conv function. PAM_username was set in changepw_1 */ PAM_password = ibuf + 256; PAM_error = pam_start("netatalk", PAM_username, &PAM_conversation, &lpamh); if (PAM_error != PAM_SUCCESS) { LOG(log_info, logtype_uams, "DHX2 Chgpwd: PAM error in pam_start"); ret = AFPERR_PARAM; goto error_ctx; } pam_set_item(lpamh, PAM_TTY, "afpd"); uam_afpserver_option(obj, UAM_OPTION_CLIENTNAME, (void *) &hostname, NULL); pam_set_item(lpamh, PAM_RHOST, hostname); uid = geteuid(); seteuid(0); PAM_error = pam_authenticate(lpamh,0); if (PAM_error != PAM_SUCCESS) { LOG(log_info, logtype_uams, "DHX2 Chgpwd: error authenticating with PAM"); seteuid(uid); pam_end(lpamh, PAM_error); ret = AFPERR_NOTAUTH; goto error_ctx; } PAM_password = ibuf; PAM_error = pam_chauthtok(lpamh, 0); seteuid(uid); /* un-root ourselves. */ memset(ibuf, 0, 512); if (PAM_error != PAM_SUCCESS) { LOG(log_info, logtype_uams, "DHX2 Chgpwd: error changing pw with PAM"); pam_end(lpamh, PAM_error); ret = AFPERR_ACCESS; goto error_ctx; } pam_end(lpamh, 0); ret = AFP_OK; error_ctx: gcry_cipher_close(ctx); error_noctx: free(K_MD5hash); K_MD5hash=NULL; gcry_mpi_release(serverNonce); gcry_mpi_release(retServerNonce); return ret; } static int dhx2_changepw(void *obj _U_, char *uname, struct passwd *pwd _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen _U_) { /* We use this to serialize the three incoming FPChangePassword calls */ static int dhx2_changepw_status = 1; int ret = AFPERR_NOTAUTH; /* gcc can't figure out it's always initialized */ switch (dhx2_changepw_status) { case 1: ret = changepw_1( obj, uname, ibuf, ibuflen, rbuf, rbuflen); if ( ret == AFPERR_AUTHCONT) dhx2_changepw_status = 2; break; case 2: ret = changepw_2( obj, ibuf, ibuflen, rbuf, rbuflen); if ( ret == AFPERR_AUTHCONT) dhx2_changepw_status = 3; else dhx2_changepw_status = 1; break; case 3: ret = changepw_3( obj, ibuf, ibuflen, rbuf, rbuflen); dhx2_changepw_status = 1; /* Whether is was succesfull or not: we restart anyway !*/ break; } return ret; } static int uam_setup(const char *path) { if (uam_register(UAM_SERVER_LOGIN_EXT, path, "DHX2", pam_login, pam_logincont, pam_logout, pam_login_ext) < 0) return -1; if (uam_register(UAM_SERVER_CHANGEPW, path, "DHX2", dhx2_changepw) < 0) return -1; p = gcry_mpi_new(0); g = gcry_mpi_new(0); LOG(log_debug, logtype_uams, "DHX2: generating mersenne primes"); /* Generate p and g for DH */ if (dh_params_generate(PRIMEBITS) != 0) { LOG(log_error, logtype_uams, "DHX2: Couldn't generate p and g"); return -1; } return 0; } static void uam_cleanup(void) { uam_unregister(UAM_SERVER_LOGIN, "DHX2"); uam_unregister(UAM_SERVER_CHANGEPW, "DHX2"); gcry_mpi_release(p); gcry_mpi_release(g); } UAM_MODULE_EXPORT struct uam_export uams_dhx2 = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; UAM_MODULE_EXPORT struct uam_export uams_dhx2_pam = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; #endif /* USE_PAM && UAM_DHX2 */ netatalk-2.2.2/etc/uams/uams_krb4/0000777000175200017500000000000011704770427013747 500000000000000netatalk-2.2.2/etc/uams/uams_krb4/send_to_kdc.c0000644000175200017500000002305011655731126016301 00000000000000/* * $Id: send_to_kdc.c,v 1.4 2001-06-25 20:13:45 rufustfirefly Exp $ * $Author: rufustfirefly $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * * $Source: /home/ralph/netatalk/rsync/netatalk/etc/uams/uams_krb4/send_to_kdc.c,v $ * * Copyright 1987, 1988 by the Massachusetts Institute of Technology. * * For copying and distribution information, please see the file * . */ #ifndef lint static char rcsid_send_to_kdc_c[] = "$Id: send_to_kdc.c,v 1.4 2001-06-25 20:13:45 rufustfirefly Exp $"; #endif /* lint */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef UAM_AFSKRB #include #include #include #include #include #include #include #include #ifdef lint #include /* struct iovec to make lint happy */ #endif /* lint */ #include #include #include #include #define S_AD_SZ sizeof(struct sockaddr_in) extern int krb_debug; extern char *malloc(), *calloc(), *realloc(); int krb_udp_port = 0; /* CLIENT_KRB_TIMEOUT indicates the time to wait before * retrying a server. It's defined in "krb.h". */ static struct timeval timeout = { CLIENT_KRB_TIMEOUT, 0}; static char *prog = "send_to_kdc"; static send_recv(); /* * This file contains two routines, send_to_kdc() and send_recv(). * send_recv() is a static routine used by send_to_kdc(). */ /* * send_to_kdc() sends a message to the Kerberos authentication * server(s) in the given realm and returns the reply message. * The "pkt" argument points to the message to be sent to Kerberos; * the "rpkt" argument will be filled in with Kerberos' reply. * The "realm" argument indicates the realm of the Kerberos server(s) * to transact with. If the realm is null, the local realm is used. * * If more than one Kerberos server is known for a given realm, * different servers will be queried until one of them replies. * Several attempts (retries) are made for each server before * giving up entirely. * * If an answer was received from a Kerberos host, KSUCCESS is * returned. The following errors can be returned: * * SKDC_CANT - can't get local realm * - can't find "kerberos" in /etc/services database * - can't open socket * - can't bind socket * - all ports in use * - couldn't find any Kerberos host * * SKDC_RETRY - couldn't get an answer from any Kerberos server, * after several retries */ send_to_kdc(pkt,rpkt,realm) KTEXT pkt; KTEXT rpkt; char *realm; { int i, f; int no_host; /* was a kerberos host found? */ int retry; int n_hosts; int retval; struct sockaddr_in to; struct hostent *host, *hostlist; char *cp; char krbhst[MAX_HSTNM]; char lrealm[REALM_SZ]; /* * If "realm" is non-null, use that, otherwise get the * local realm. */ if (realm) (void) strcpy(lrealm, realm); else if (krb_get_lrealm(lrealm,1)) { if (krb_debug) fprintf(stderr, "%s: can't get local realm\n", prog); return(SKDC_CANT); } if (krb_debug) printf("lrealm is %s\n", lrealm); if (krb_udp_port == 0) { register struct servent *sp; if ((sp = getservbyname("kerberos","udp")) == 0) { if (krb_debug) fprintf(stderr, "%s: Can't get kerberos/udp service\n", prog); return(SKDC_CANT); } krb_udp_port = sp->s_port; if (krb_debug) printf("krb_udp_port is %d\n", krb_udp_port); } memset(&to, 0, S_AD_SZ); hostlist = (struct hostent *) malloc(sizeof(struct hostent)); if (!hostlist) return (/*errno */SKDC_CANT); if ((f = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { if (krb_debug) fprintf(stderr,"%s: Can't open socket\n", prog); return(SKDC_CANT); } /* from now on, exit through rtn label for cleanup */ no_host = 1; /* get an initial allocation */ n_hosts = 0; for (i = 1; krb_get_krbhst(krbhst, lrealm, i) == KSUCCESS; ++i) { if (krb_debug) { printf("Getting host entry for %s...",krbhst); (void) fflush(stdout); } host = gethostbyname(krbhst); if (krb_debug) { printf("%s.\n", host ? "Got it" : "Didn't get it"); (void) fflush(stdout); } if (!host) continue; no_host = 0; /* found at least one */ n_hosts++; /* preserve host network address to check later * (would be better to preserve *all* addresses, * take care of that later) */ hostlist = (struct hostent *) realloc((char *)hostlist, (unsigned) sizeof(struct hostent)*(n_hosts+1)); if (!hostlist) return /*errno */SKDC_CANT; memcpy(&hostlist[n_hosts-1], host, sizeof(struct hostent)); host = &hostlist[n_hosts-1]; cp = malloc((unsigned)host->h_length); if (!cp) { retval = /*errno */SKDC_CANT; goto rtn; } memcpy(cp, host->h_addr, host->h_length); /* At least Sun OS version 3.2 (or worse) and Ultrix version 2.2 (or worse) only return one name ... */ #if !(defined(ULTRIX022) || (defined(SunOS) && SunOS < 40)) host->h_addr_list = (char **)malloc(sizeof(char *)); if (!host->h_addr_list) { retval = /*errno */SKDC_CANT; goto rtn; } #endif /* ULTRIX022 || SunOS */ host->h_addr = cp; memset(&hostlist[n_hosts], 0, sizeof(struct hostent)); to.sin_family = host->h_addrtype; memcpy(&to.sin_addr, host->h_addr, host->h_length); to.sin_port = krb_udp_port; if (send_recv(pkt, rpkt, f, &to, hostlist)) { retval = KSUCCESS; goto rtn; } if (krb_debug) { printf("Timeout, error, or wrong descriptor\n"); (void) fflush(stdout); } } if (no_host) { if (krb_debug) fprintf(stderr, "%s: can't find any Kerberos host.\n", prog); retval = SKDC_CANT; goto rtn; } /* retry each host in sequence */ for (retry = 0; retry < CLIENT_KRB_RETRY; ++retry) { for (host = hostlist; host->h_name != (char *)NULL; host++) { to.sin_family = host->h_addrtype; memcpy(&to.sin_addr, host->h_addr, host->h_length); if (send_recv(pkt, rpkt, f, &to, hostlist)) { retval = KSUCCESS; goto rtn; } } } retval = SKDC_RETRY; rtn: (void) close(f); if (hostlist) { register struct hostent *hp; for (hp = hostlist; hp->h_name; hp++) #if !(defined(ULTRIX022) || (defined(SunOS) && SunOS < 40)) if (hp->h_addr_list) { #endif /* ULTRIX022 || SunOS */ if (hp->h_addr) free(hp->h_addr); #if !(defined(ULTRIX022) || (defined(SunOS) && SunOS < 40)) free((char *)hp->h_addr_list); } #endif /* ULTRIX022 || SunOS */ free((char *)hostlist); } return(retval); } /* * try to send out and receive message. * return 1 on success, 0 on failure */ static send_recv(pkt,rpkt,f,_to,addrs) KTEXT pkt; KTEXT rpkt; int f; struct sockaddr_in *_to; struct hostent *addrs; { fd_set readfds; register struct hostent *hp; struct sockaddr_in from; int sin_size, rc; int numsent; if (krb_debug) { if (_to->sin_family == AF_INET) printf("Sending message to %s...", inet_ntoa(_to->sin_addr)); else printf("Sending message..."); (void) fflush(stdout); } if ((numsent = sendto(f,(char *)(pkt->dat), pkt->length, 0, (struct sockaddr *)_to, S_AD_SZ)) != pkt->length) { if (krb_debug) printf("sent only %d/%d\n",numsent, pkt->length); return 0; } if (krb_debug) { printf("Sent\nWaiting for reply..."); (void) fflush(stdout); } FD_ZERO(&readfds); FD_SET(f, &readfds); errno = 0; /* select - either recv is ready, or timeout */ /* see if timeout or error or wrong descriptor */ if (select(f + 1, &readfds, (fd_set *)0, (fd_set *)0, &timeout) < 1 || !FD_ISSET(f, &readfds)) { if (krb_debug) { fprintf(stderr, "select failed: readfds=%x", readfds); perror(""); } return 0; } sin_size = sizeof(from); if (( rc = recvfrom(f, (char *)(rpkt->dat), sizeof(rpkt->dat), 0, (struct sockaddr *)&from, &sin_size)) < 0) { if (krb_debug) perror("recvfrom"); return 0; } rpkt->length = rc; if (krb_debug) { printf("received packet from %s\n", inet_ntoa(from.sin_addr)); fflush(stdout); } for (hp = addrs; hp->h_name != (char *)NULL; hp++) { if (!memcmp(hp->h_addr, (char *)&from.sin_addr.s_addr, hp->h_length)) { if (krb_debug) { printf("Received it\n"); (void) fflush(stdout); } return 1; } if (krb_debug) fprintf(stderr, "packet not from %x\n", hp->h_addr); } if (krb_debug) fprintf(stderr, "%s: received packet from wrong host! (%x)\n", "send_to_kdc(send_rcv)", from.sin_addr.s_addr); return 0; } #endif /* UAM_AFSKRB */ netatalk-2.2.2/etc/uams/uams_krb4/Makefile.am0000644000175200017500000000044211655731126015715 00000000000000# Makefile.am for etc/uams/uams_krb4/ if USE_KERBEROS KERBEROS_MODULE = uams_krb4.la else KERBEROS_MODULE = endif uams_krb4_la_SOURCES = kuam.c lifetime.c send_to_kdc.c uams_krb4.c uams_krb4_la_LDFLAGS = -module -avoid-version uamsdir = @UAMS_PATH@ uams_LTLIBRARIES = $(KERBEROS_MODULE) netatalk-2.2.2/etc/uams/uams_krb4/Makefile.in0000644000175200017500000004314611703521726015733 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for etc/uams/uams_krb4/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = etc/uams/uams_krb4 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(uamsdir)" uamsLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(uams_LTLIBRARIES) uams_krb4_la_LIBADD = am_uams_krb4_la_OBJECTS = kuam.lo lifetime.lo send_to_kdc.lo \ uams_krb4.lo uams_krb4_la_OBJECTS = $(am_uams_krb4_la_OBJECTS) uams_krb4_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(uams_krb4_la_LDFLAGS) $(LDFLAGS) -o $@ @USE_KERBEROS_TRUE@am_uams_krb4_la_rpath = -rpath $(uamsdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(uams_krb4_la_SOURCES) DIST_SOURCES = $(uams_krb4_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @USE_KERBEROS_FALSE@KERBEROS_MODULE = @USE_KERBEROS_TRUE@KERBEROS_MODULE = uams_krb4.la uams_krb4_la_SOURCES = kuam.c lifetime.c send_to_kdc.c uams_krb4.c uams_krb4_la_LDFLAGS = -module -avoid-version uamsdir = @UAMS_PATH@ uams_LTLIBRARIES = $(KERBEROS_MODULE) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign etc/uams/uams_krb4/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign etc/uams/uams_krb4/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-uamsLTLIBRARIES: $(uams_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(uamsdir)" || $(MKDIR_P) "$(DESTDIR)$(uamsdir)" @list='$(uams_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(uamsLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(uamsdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(uamsLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(uamsdir)/$$f"; \ else :; fi; \ done uninstall-uamsLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(uams_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(uamsdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(uamsdir)/$$p"; \ done clean-uamsLTLIBRARIES: -test -z "$(uams_LTLIBRARIES)" || rm -f $(uams_LTLIBRARIES) @list='$(uams_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done uams_krb4.la: $(uams_krb4_la_OBJECTS) $(uams_krb4_la_DEPENDENCIES) $(uams_krb4_la_LINK) $(am_uams_krb4_la_rpath) $(uams_krb4_la_OBJECTS) $(uams_krb4_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kuam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lifetime.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/send_to_kdc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uams_krb4.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(uamsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-uamsLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-uamsLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-uamsLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-uamsLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip install-uamsLTLIBRARIES installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-uamsLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/etc/uams/uams_krb4/uams_krb4.c0000644000175200017500000004477611655731126015736 00000000000000/* * $Id: uams_krb4.c,v 1.10 2009-10-15 11:39:48 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #if defined( KRB ) || defined( UAM_AFSKRB ) #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #include #include #include #include /* STDC check */ #if STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #include #include #include #include #include #include #if 0 #include #endif /* 0 */ #include #include #include #include #include static C_Block seskey; static Key_schedule seskeysched; static char realm[ REALM_SZ ]; #ifdef UAM_AFSKRB static int validseskey = 0; static int logged = 0; static char *tktfile; static char instance[ INST_SZ ], name[ ANAME_SZ ]; #endif /* UAM_AFSKRB */ #ifdef AFS #include #include #include #include #include char *ka_LocalCell(); struct ClearToken { int32_t AuthHandle; char HandShakeKey[8]; int32_t ViceId; int32_t BeginTimestamp; int32_t EndTimestamp; }; #endif /* AFS */ #ifdef KRB static void lcase( p ) char *p; { for (; *p; p++ ) { if ( isupper( *p )) { *p = tolower( *p ); } } return; } static void ucase( p ) char *p; { for (; *p; p++ ) { if ( islower( *p )) { *p = toupper( *p ); } } return; } #define KRB4CMD_HELO 1 #define KRB4RPL_REALM 2 #define KRB4WRT_SESS 3 #define KRB4RPL_DONE 4 #define KRB4RPL_PRINC 5 #define KRB4WRT_TOKEN 6 #define KRB4WRT_SKIP 7 #define KRB4RPL_DONEMUT 8 #define KRB4CMD_SESS 9 #define KRB4CMD_TOKEN 10 #define KRB4CMD_SKIP 11 static int krb4_login(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen ) { char *p; char *username; struct passwd *pwd; u_int16_t len; KTEXT_ST tkt; static AUTH_DAT ad; int rc, proto; size_t ulen; char inst[ 40 ], princ[ 40 ]; if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, &username, &ulen) < 0) return AFPERR_MISC; if (uam_afpserver_option(obj, UAM_OPTION_PROTOCOL, &proto, NULL) < 0) return AFPERR_MISC; switch( *ibuf ) { case KRB4CMD_SESS: LOG(log_info, logtype_default, "krb4_login: KRB4CMD_SESS" ); ++ibuf; p = ibuf; memcpy( &len, p, sizeof( u_int16_t )); tkt.length = ntohs( len ); p += sizeof( u_int16_t ); if ( tkt.length <= 0 || tkt.length > MAX_KTXT_LEN ) { *rbuflen = 0; LOG(log_info, logtype_default, "krb4_login: tkt.length = %d", tkt.length ); return( AFPERR_BADUAM ); } memcpy( tkt.dat, p, tkt.length ); p += tkt.length; strcpy( inst, "*" ); switch( proto ) { case AFPPROTO_ASP: strcpy( princ, "afpserver" ); break; case AFPPROTO_DSI: strcpy( princ, "rcmd" ); break; } if( (rc = krb_rd_req( &tkt, princ, inst, 0, &ad, "" )) != RD_AP_OK ) { LOG(log_error, logtype_default, "krb4_login: krb_rd_req(): %s", krb_err_txt[ rc ] ); *rbuflen = 0; return( AFPERR_BADUAM ); } LOG(log_info, logtype_default, "krb4_login: %s.%s@%s", ad.pname, ad.pinst, ad.prealm ); strcpy( realm, ad.prealm ); memcpy( seskey, ad.session, sizeof( C_Block ) ); key_sched( (C_Block *)seskey, seskeysched ); strncpy( username, ad.pname, ulen ); p = rbuf; #ifdef AFS *p = KRB4RPL_DONE; /* XXX */ *rbuflen = 1; if (( pwd = uam_getname( obj, ad.pname, strlen(ad.pname) )) == NULL ) { return AFPERR_PARAM; } /* if (uam_checkuser( pwd ) < 0) { return AFPERR_NOTAUTH; } */ *uam_pwd = pwd; return( AFP_OK ); /* Should this be AFPERR_AUTHCONT? */ #else /* AFS */ /* get principals */ *p++ = KRB4RPL_PRINC; len = strlen( realm ); *p++ = len + 1; *p++ = '@'; strcpy( p, realm ); p += len + 1; break; #endif /* AFS */ case KRB4CMD_HELO: p = rbuf; if (krb_get_lrealm( realm, 1 ) != KSUCCESS ) { LOG(log_error, logtype_default, "krb4_login: can't get local realm!" ); return( AFPERR_NOTAUTH ); } *p++ = KRB4RPL_REALM; *p++ = 1; len = strlen( realm ); *p++ = len; strcpy( p, realm ); p += len + 1; break; default: *rbuflen = 0; LOG(log_info, logtype_default, "krb4_login: bad command %d", *ibuf ); return( AFPERR_NOTAUTH ); } #ifdef AFS if ( setpag() < 0 ) { *rbuflen = 0; LOG(log_error, logtype_default, "krb_login: setpag: %s", strerror(errno) ); return( AFPERR_BADUAM ); } #endif /*AFS*/ *rbuflen = p - rbuf; return( AFPERR_AUTHCONT ); } static int krb4_action( void *v1, void *v2, const int i ) { return i; } /* I have a hunch that problems might arise on platforms with non-16bit short's and non-32bit int's */ static int krb4_logincont(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { static struct passwd *pwd; KTEXT_ST tkt; static AUTH_DAT ad; int rc; u_int16_t len; char *p, *username, *servername; CREDENTIALS cr; #ifdef AFS struct ViceIoctl vi; struct ClearToken ct; #endif /* AFS */ char buf[ 1024 ]; int aint, ulen, snlen; if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, &username, &ulen) < 0) return AFPERR_MISC; if (uam_afpserver_option(obj, UAM_OPTION_HOSTNAME, &servername, &snlen) < 0) return AFPERR_MISC; ibuf++; switch ( rc = *ibuf++ ) { case KRB4CMD_TOKEN : #ifdef AFS p = buf; memcpy( &len, ibuf, sizeof( u_int16_t ) ); ibuf += sizeof( len ); len = ntohs( len ); aint = len; memcpy( p, &aint, sizeof( int ) ); p += sizeof( int ); memcpy( p, ibuf, len ); pcbc_encrypt( (C_Block *)p, (C_Block *)p, len, seskeysched, seskey, DECRYPT ); p += len; ibuf += len; memcpy( &len, ibuf, sizeof( u_int16_t ) ); ibuf += sizeof( u_int16_t ) ); len = ntohs( len ); if ( len != sizeof( struct ClearToken ) ) { LOG(log_error, logtype_default, "krb4_logincont: token too short" ); *rbuflen = 0; return( AFPERR_BADUAM ); } memcpy( &ct, ibuf, len ); pcbc_encrypt( (C_Block *)&ct, (C_Block *)&ct, len, seskeysched, seskey, DECRYPT ); aint = sizeof( struct ClearToken ); memcpy( p, &aint, sizeof( int ) ); p += sizeof( int ); memcpy( p, &ct, sizeof( struct ClearToken ) ); p += sizeof( struct ClearToken ); aint = 0; memcpy( p, &aint, sizeof( int ) ); p += sizeof( int ); lcase( realm ); strcpy( p, realm ); p += strlen( realm ) + 1; vi.in = buf; vi.in_size = p - buf; vi.out = buf; vi.out_size = sizeof( buf ); if ( pioctl( 0, VIOCSETTOK, &vi, 0 ) < 0 ) { LOG(log_error, logtype_default, "krb4_logincont: pioctl: %s", strerror(errno) ); *rbuflen = 0; return( AFPERR_BADUAM ); } /* FALL THROUGH */ case KRB4CMD_SKIP: p = rbuf; *p = KRB4RPL_DONE; /* XXX */ *rbuflen = 1; if (( pwd = uam_getname( obj, username, strlen(username) ) ) == NULL ) { return( AFPERR_NOTAUTH ); } /* if (uam_checkuser(pwd) < 0) { return AFPERR_NOTAUTH; } */ *uam_pwd = pwd; return( AFP_OK ); #endif /* AFS */ default: /* read in the rest */ if (uam_afp_read(obj, rbuf, rbuflen, krb4_action) < 0) return AFPERR_PARAM; p = rbuf; switch ( rc = *p++ ) { case KRB4WRT_SESS : memcpy( &len, p, sizeof( len )); tkt.length = ntohs( len ); p += sizeof( short ); if ( tkt.length <= 0 || tkt.length > MAX_KTXT_LEN ) { return( AFPERR_BADUAM ); } memcpy( tkt.dat, p, tkt.length ); p += tkt.length; if (( rc = krb_rd_req( &tkt, "afpserver", servername, 0, &ad, "" )) != RD_AP_OK ) { LOG(log_error, logtype_default, "krb4_logincont: krb_rd_req(): %s", krb_err_txt[ rc ] ); return( AFPERR_BADUAM ); } LOG(log_info, logtype_default, "krb4_login: %s.%s@%s", ad.pname, ad.pinst, ad.prealm ); memcpy(realm, ad.prealm, sizeof(realm)); memcpy(seskey, ad.session, sizeof( C_Block )); key_sched((C_Block *) seskey, seskeysched ); strncpy(username, ad.pname, ulen); p = rbuf; #ifndef AFS *p = KRB4RPL_DONE; /* XXX */ *rbuflen = 1; if (( pwd = uam_getname( obj, ad.pname, strlen(ad.pname) )) == NULL ) { return( AFPERR_PARAM ); } *uam_pwd = pwd; return AFP_OK; #else /* ! AFS */ /* get principals */ *p++ = KRB4RPL_PRINC; len = strlen( realm ); *p++ = len + 1; *p++ = '@'; strcpy( p, realm ); p += len + 1; *rbuflen = p - rbuf; return( AFPERR_AUTHCONT ); case KRB4WRT_TOKEN : memcpy( &len, p, sizeof( len )); len = ntohs( len ); p += sizeof( len ); memcpy( &cr, p, len ); pcbc_encrypt((C_Block *)&cr, (C_Block *)&cr, len, seskeysched, seskey, DES_DECRYPT ); p = buf; cr.ticket_st.length = ntohl( cr.ticket_st.length ); memcpy( p, &cr.ticket_st.length, sizeof( int )); p += sizeof( int ); memcpy( p, cr.ticket_st.dat, cr.ticket_st.length ); p += cr.ticket_st.length; ct.AuthHandle = ntohl( cr.kvno ); memcpy( ct.HandShakeKey, cr.session, sizeof( cr.session )); ct.ViceId = 0; ct.BeginTimestamp = ntohl( cr.issue_date ); ct.EndTimestamp = krb_life_to_time( ntohl( cr.issue_date ), ntohl( cr.lifetime )); aint = sizeof( struct ClearToken ); memcpy( p, &aint, sizeof( int )); p += sizeof( int ); memcpy( p, &ct, sizeof( struct ClearToken )); p += sizeof( struct ClearToken ); aint = 0; memcpy( p, &aint, sizeof( int )); p += sizeof( int ); lcase( realm ); strcpy( p, realm ); p += strlen( realm ) + 1; vi.in = buf; vi.in_size = p - buf; vi.out = buf; vi.out_size = sizeof( buf ); if ( pioctl( 0, VIOCSETTOK, &vi, 0 ) < 0 ) { LOG(log_error, logtype_default, "krb4_logincont: pioctl: %s", strerror(errno) ); return( AFPERR_BADUAM ); } /* FALL THROUGH */ case KRB4WRT_SKIP : p = rbuf; *p = KRB4RPL_DONE; /* XXX */ *rbuflen = 1; if (( pwd = uam_getname( obj, ad.pname, strlen(ad.pname) )) == NULL ) { return( AFPERR_PARAM ); } *uam_pwd = pwd; return AFP_OK; #endif /*AFS*/ default: LOG(log_info, logtype_default, "krb4_logincont: bad command %d", rc ); *rbuflen = 0; return( AFPERR_NOTAUTH ); break; } break; } } #endif /* KRB */ #ifdef AFS #include #include char *ka_LocalCell(); static void addrealm(realm,cells) char *realm; char ***cells; { char **ptr; int temp; ptr= *cells; for(;*ptr != 0 ;ptr++) if(!strcmp(realm,*ptr)) return; temp=ptr- *cells; *cells=(char**)realloc(*cells,((2+temp)*sizeof(char*))); ptr= *cells+temp; *ptr=(char*)malloc(strlen(realm)+1); strcpy(*ptr++,realm); *ptr=0; return; } static int kcheckuser(pwd,passwd) struct passwd *pwd; char *passwd; { int32_t code; char *instance=""; char realm[MAXKTCREALMLEN]; char lorealm[MAXKTCREALMLEN]; char *cell; Date lifetime=MAXKTCTICKETLIFETIME; int rval; char **cells=(char **)malloc(sizeof(char*)); char *temp; int rc,cellNum; struct ktc_principal serviceName; *cells=0; code = ka_Init(0); { char *temp,*temp1; temp=(char*)malloc(strlen(pwd->pw_dir)+1); strcpy(temp,pwd->pw_dir); temp1=temp; temp=strtok(temp,"/"); temp=strtok('\0',"/"); ka_CellToRealm(temp,realm,0); addrealm(realm,&cells); free(temp1); } setpag(); authenticate(cells,pwd->pw_name,passwd); cellNum=0; rc=ktc_ListTokens(cellNum,&cellNum,&serviceName); if(rc) rval=1; else{ rval=0; } return(rval); } static void authenticate(cells,name,passwd) char **cells; char *name; char *passwd; { char **ptr=cells; char *errorstring; while(*ptr){ ka_UserAuthenticate(name,/*instance*/"",/*cell*/*ptr++, passwd,/*setpag*/0,&errorstring); } } #endif /* AFS */ #if defined( UAM_AFSKRB ) && defined( AFS ) static int afskrb_login(void *obj, struct passwd *uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen ) { KTEXT_ST authent, rpkt; CREDENTIALS cr; char *p, *q, *username, servername; int len, rc, whoserealm, ulen, snlen; short slen; *rbuflen = 0; if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, &username, &ulen) < 0) return AFPERR_MISC; if (uam_afpserver_option(obj, UAM_OPTION_HOSTNAME, &servername, &snlen ) < 0) return AFPERR_MISC; len = (unsigned char) *ibuf++; ibuf[ len ] = '\0'; if (( p = strchr( ibuf, '@' )) != NULL ) { *p++ = '\0'; strcpy( realm, p ); ucase( realm ); whoserealm = 0; } else { if ( krb_get_lrealm( realm, 1 ) != KSUCCESS ) { return AFPERR_BADUAM; } whoserealm = 1; } if (( p = strchr( ibuf, '.' )) != NULL ) { *p++ = '\0'; strcpy( instance, p ); } else { *instance = '\0'; } strcpy( name, ibuf ); /* * We don't have the session key, yet. Get one. */ p = rbuf; if ( validseskey == 0 ) { if ( setpag() < 0 ) { LOG(log_error, logtype_default, "krb_login: setpag: %s", strerror(errno) ); return AFPERR_BADUAM; } krb_set_tkt_string(( tktfile = mktemp( _PATH_AFPTKT ))); if (( rc = krb_get_svc_in_tkt( "afpserver", servername, realm, TICKET_GRANTING_TICKET, realm, 255, KEYFILE )) != INTK_OK ) { LOG(log_error, logtype_default, "krb_login: can't get ticket-granting-ticket" ); return (( whoserealm ) ? AFPERR_BADUAM : AFPERR_PARAM ); } if ( krb_mk_req( &authent, name, instance, realm, 0 ) != KSUCCESS ) { return ( AFPERR_PARAM ); } if ( krb_get_cred( name, instance, realm, &cr ) != KSUCCESS ) { return ( AFPERR_BADUAM ); } if ( unlink( tktfile ) < 0 ) { LOG(log_error, logtype_default, "krb_login: unlink %s: %s", tktfile, strerror(errno) ); return ( AFPERR_BADUAM ); } memcpy( seskey, cr.session, sizeof( C_Block )); key_sched((C_Block *) seskey, seskeysched ); validseskey = 1; strncpy(username, name, ulen); memcpy( p, authent.dat, authent.length ); p += authent.length; } if ( kuam_get_in_tkt( name, instance, realm, TICKET_GRANTING_TICKET, realm, 255, &rpkt ) != INTK_OK ) { return ( AFPERR_PARAM ); } q = (char *)rpkt.dat; *p++ = *q++; *p++ = *q++; while ( *q++ ) ; while ( *q++ ) ; while ( *q++ ) ; q += 10; len = strlen( realm ); strcpy( p, realm ); p += len + 1; memcpy( &slen, q, sizeof( short )); memcpy( p, &slen, sizeof( short )); p += sizeof( short ); q += sizeof( short ); memcpy( p, q, slen ); p += slen; *rbuflen = p - rbuf; return( AFPERR_AUTHCONT ); } static int afskrb_logincont(void *obj, struct passwd *uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen ) { CREDENTIALS cr; struct ViceIoctl vi; struct ClearToken ct; struct passwd *pwd; char buf[ 1024 ], *p; int aint; short clen; *rbuflen = 0; if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, &username, NULL) < 0) return AFPERR_MISC; ibuf += 2; memcpy( &clen, ibuf, sizeof( short )); clen = ntohs( clen ); ibuf += sizeof( short ); pcbc_encrypt((C_Block *)ibuf, (C_Block *)ibuf, clen, seskeysched, seskey, DES_DECRYPT ); if ( kuam_set_in_tkt( name, instance, realm, TICKET_GRANTING_TICKET, realm, ibuf ) != INTK_OK ) { return ( AFPERR_PARAM ); } if ( get_ad_tkt( "afs", "", realm, 255 ) != KSUCCESS ) { return ( AFPERR_PARAM ); } if ( krb_get_cred( "afs", "", realm, &cr ) != KSUCCESS ) { return ( AFPERR_PARAM ); } p = buf; memcpy( p, &cr.ticket_st.length, sizeof( int )); p += sizeof( int ); memcpy( p, cr.ticket_st.dat, cr.ticket_st.length ); p += cr.ticket_st.length; ct.AuthHandle = cr.kvno; memcpy( ct.HandShakeKey, cr.session, sizeof( cr.session )); ct.ViceId = 0; ct.BeginTimestamp = cr.issue_date; /* ct.EndTimestamp = cr.issue_date + ( cr.lifetime * 5 * 60 ); */ ct.EndTimestamp = krb_life_to_time( cr.issue_date, cr.lifetime ); aint = sizeof( struct ClearToken ); memcpy( p, &aint, sizeof( int )); p += sizeof( int ); memcpy( p, &ct, sizeof( struct ClearToken )); p += sizeof( struct ClearToken ); aint = 0; memcpy( p, &aint, sizeof( int )); p += sizeof( int ); lcase( realm ); strcpy( p, realm ); p += strlen( realm ) + 1; vi.in = buf; vi.in_size = p - buf; vi.out = buf; vi.out_size = sizeof( buf ); if ( pioctl( 0, VIOCSETTOK, &vi, 0 ) < 0 ) { LOG(log_error, logtype_default, "krb_logincont: pioctl: %s", strerror(errno) ); return ( AFPERR_BADUAM ); } if ( unlink( tktfile ) < 0 ) { LOG(log_error, logtype_default, "krb_logincont: %s: %s", tktfile, strerror(errno) ); return ( AFPERR_BADUAM ); } if (( pwd = uam_getname( obj, username, strlen(username) )) == NULL ) { return ( AFPERR_PARAM ); } if ( logged == 0 ) { logged = 1; LOG(log_info, logtype_default, "authenticated %s.%s@%s", name, instance, realm ); *uam_pwd = pwd; return AFP_OK; } LOG(log_info, logtype_default, "re-authenticated %s.%s@%s", name, instance, realm ); return( AFP_OK ); } #endif /* UAM_AFSKRB AFS */ static int uam_setup(const char *path) { #ifdef KRB uam_register(UAM_SERVER_LOGIN, path, "Kerberos IV", krb4_login, krb4_logincont, NULL); /* uam_afpserver_action(); */ #endif /* KRB */ #ifdef UAM_AFSKRB uam_register(UAM_SERVER_LOGIN, path, "AFS Kerberos", afskrb_login, afskrb_logincont, NULL); /* uam_afpserver_action(); */ #endif /* UAM_AFSKRB */ return 0; } static void uam_cleanup(void) { #ifdef KRB /* uam_afpserver_action(); */ uam_unregister(UAM_SERVER_LOGIN, "Kerberos IV"); #endif #ifdef UAM_AFSKRB /* uam_afpserver_action(); */ uam_unregister(UAM_SERVER_LOGIN, "AFS Kerberos"); #endif } UAM_MODULE_EXPORT struct uam_export uams_krb4 = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; #endif /* KRB or UAM_AFSKRB */ netatalk-2.2.2/etc/uams/uams_krb4/lifetime.c0000644000175200017500000001407611655731126015633 00000000000000/* * $Id: lifetime.c,v 1.3 2001-06-25 20:13:45 rufustfirefly Exp $ * * Ticket lifetime. This defines the table used to lookup lifetime * for the fixed part of rande of the one byte lifetime field. Values * less than 0x80 are intrpreted as the number of 5 minute intervals. * Values from 0x80 to 0xBF should be looked up in this table. The * value of 0x80 is the same using both methods: 10 and two-thirds * hours . The lifetime of 0xBF is 30 days. The intervening values * of have a fixed ratio of roughly 1.06914. The value 0xFF is * defined to mean a ticket has no expiration time. This should be * used advisedly since individual servers may impose defacto * upperbounds on ticket lifetimes. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #define TKTLIFENUMFIXED 64 #define TKTLIFEMINFIXED 0x80 #define TKTLIFEMAXFIXED 0xBF #define TKTLIFENOEXPIRE 0xFF #define MAXTKTLIFETIME (30*24*3600) /* 30 days */ #ifndef NEVERDATE #define NEVERDATE ((u_int32_t)-1L) #endif /* NEVERDATE */ static int tkt_lifetimes[TKTLIFENUMFIXED] = { 38400, /* 10.67 hours, 0.44 days */ 41055, /* 11.40 hours, 0.48 days */ 43894, /* 12.19 hours, 0.51 days */ 46929, /* 13.04 hours, 0.54 days */ 50174, /* 13.94 hours, 0.58 days */ 53643, /* 14.90 hours, 0.62 days */ 57352, /* 15.93 hours, 0.66 days */ 61318, /* 17.03 hours, 0.71 days */ 65558, /* 18.21 hours, 0.76 days */ 70091, /* 19.47 hours, 0.81 days */ 74937, /* 20.82 hours, 0.87 days */ 80119, /* 22.26 hours, 0.93 days */ 85658, /* 23.79 hours, 0.99 days */ 91581, /* 25.44 hours, 1.06 days */ 97914, /* 27.20 hours, 1.13 days */ 104684, /* 29.08 hours, 1.21 days */ 111922, /* 31.09 hours, 1.30 days */ 119661, /* 33.24 hours, 1.38 days */ 127935, /* 35.54 hours, 1.48 days */ 136781, /* 37.99 hours, 1.58 days */ 146239, /* 40.62 hours, 1.69 days */ 156350, /* 43.43 hours, 1.81 days */ 167161, /* 46.43 hours, 1.93 days */ 178720, /* 49.64 hours, 2.07 days */ 191077, /* 53.08 hours, 2.21 days */ 204289, /* 56.75 hours, 2.36 days */ 218415, /* 60.67 hours, 2.53 days */ 233517, /* 64.87 hours, 2.70 days */ 249664, /* 69.35 hours, 2.89 days */ 266926, /* 74.15 hours, 3.09 days */ 285383, /* 79.27 hours, 3.30 days */ 305116, /* 84.75 hours, 3.53 days */ 326213, /* 90.61 hours, 3.78 days */ 348769, /* 96.88 hours, 4.04 days */ 372885, /* 103.58 hours, 4.32 days */ 398668, /* 110.74 hours, 4.61 days */ 426234, /* 118.40 hours, 4.93 days */ 455705, /* 126.58 hours, 5.27 days */ 487215, /* 135.34 hours, 5.64 days */ 520904, /* 144.70 hours, 6.03 days */ 556921, /* 154.70 hours, 6.45 days */ 595430, /* 165.40 hours, 6.89 days */ 636601, /* 176.83 hours, 7.37 days */ 680618, /* 189.06 hours, 7.88 days */ 727680, /* 202.13 hours, 8.42 days */ 777995, /* 216.11 hours, 9.00 days */ 831789, /* 231.05 hours, 9.63 days */ 889303, /* 247.03 hours, 10.29 days */ 950794, /* 264.11 hours, 11.00 days */ 1016537, /* 282.37 hours, 11.77 days */ 1086825, /* 301.90 hours, 12.58 days */ 1161973, /* 322.77 hours, 13.45 days */ 1242318, /* 345.09 hours, 14.38 days */ 1328218, /* 368.95 hours, 15.37 days */ 1420057, /* 394.46 hours, 16.44 days */ 1518247, /* 421.74 hours, 17.57 days */ 1623226, /* 450.90 hours, 18.79 days */ 1735464, /* 482.07 hours, 20.09 days */ 1855462, /* 515.41 hours, 21.48 days */ 1983758, /* 551.04 hours, 22.96 days */ 2120925, /* 589.15 hours, 24.55 days */ 2267576, /* 629.88 hours, 26.25 days */ 2424367, /* 673.44 hours, 28.06 days */ 2592000}; /* 720.00 hours, 30.00 days */ /* * krb_life_to_time - takes a start time and a Kerberos standard * lifetime char and returns the corresponding end time. There are * four simple cases to be handled. The first is a life of 0xff, * meaning no expiration, and results in an end time of 0xffffffff. * The second is when life is less than the values covered by the * table. In this case, the end time is the start time plus the * number of 5 minute intervals specified by life. The third case * returns start plus the MAXTKTLIFETIME if life is greater than * TKTLIFEMAXFIXED. The last case, uses the life value (minus * TKTLIFEMINFIXED) as an index into the table to extract the lifetime * in seconds, which is added to start to produce the end time. */ u_int32_t krb_life_to_time(start, life) u_int32_t start; int life; { life = (unsigned char) life; if (life == TKTLIFENOEXPIRE) return NEVERDATE; if (life < TKTLIFEMINFIXED) return start + life*5*60; if (life > TKTLIFEMAXFIXED) return start + MAXTKTLIFETIME; return start + tkt_lifetimes[life - TKTLIFEMINFIXED]; } /* * krb_time_to_life - takes start and end times for the ticket and * returns a Kerberos standard lifetime char, possibily using the * tkt_lifetimes table for lifetimes above 127*5 minutes. First, the * special case of (end == NEVERDATE) is handled to mean no * expiration. Then negative lifetimes and those greater than the * maximum ticket lifetime are rejected. Then lifetimes less than the * first table entry are handled by rounding the requested lifetime * *up* to the next 5 minute interval. The final step is to search * the table for the smallest entry *greater than or equal* to the * requested entry. */ int krb_time_to_life(start, end) u_int32_t start; u_int32_t end; { int32_t lifetime; int i; if (end == NEVERDATE) return TKTLIFENOEXPIRE; lifetime = end - start; if (lifetime > MAXTKTLIFETIME || lifetime <= 0) return 0; if (lifetime < tkt_lifetimes[0]) return (lifetime + 5*60 - 1)/(5*60); for (i=0; i #include #include #include #include #include #include /* use the bsd time.h struct defs for PC too! */ #include #include int swap_bytes; /* * krb_get_in_tkt() gets a ticket for a given principal to use a given * service and stores the returned ticket and session key for future * use. * * The "user", "instance", and "realm" arguments give the identity of * the client who will use the ticket. The "service" and "sinstance" * arguments give the identity of the server that the client wishes * to use. (The realm of the server is the same as the Kerberos server * to whom the request is sent.) The "life" argument indicates the * desired lifetime of the ticket; the "key_proc" argument is a pointer * to the routine used for getting the client's private key to decrypt * the reply from Kerberos. The "decrypt_proc" argument is a pointer * to the routine used to decrypt the reply from Kerberos; and "arg" * is an argument to be passed on to the "key_proc" routine. * * If all goes well, krb_get_in_tkt() returns INTK_OK, otherwise it * returns an error code: If an AUTH_MSG_ERR_REPLY packet is returned * by Kerberos, then the error code it contains is returned. Other * error codes returned by this routine include INTK_PROT to indicate * wrong protocol version, INTK_BADPW to indicate bad password (if * decrypted ticket didn't make sense), INTK_ERR if the ticket was for * the wrong server or the ticket store couldn't be initialized. * * The format of the message sent to Kerberos is as follows: * * Size Variable Field * ---- -------- ----- * * 1 byte KRB_PROT_VERSION protocol version number * 1 byte AUTH_MSG_KDC_REQUEST | message type * HOST_BYTE_ORDER local byte order in lsb * string user client's name * string instance client's instance * string realm client's realm * 4 bytes tlocal.tv_sec timestamp in seconds * 1 byte life desired lifetime * string service service's name * string sinstance service's instance */ kuam_get_in_tkt(user, instance, realm, service, sinstance, life, rpkt ) char *user; char *instance; char *realm; char *service; char *sinstance; int life; KTEXT rpkt; { KTEXT_ST pkt_st; KTEXT pkt = &pkt_st; /* Packet to KDC */ KTEXT_ST cip_st; KTEXT cip = &cip_st; /* Returned Ciphertext */ KTEXT_ST tkt_st; KTEXT tkt = &tkt_st; /* Current ticket */ unsigned char *v = pkt->dat; /* Prot vers no */ unsigned char *t = (pkt->dat+1); /* Prot msg type */ int msg_byte_order; int kerror; struct timeval t_local; u_int32_t rep_err_code; /* BUILD REQUEST PACKET */ /* Set up the fixed part of the packet */ *v = (unsigned char) KRB_PROT_VERSION; *t = (unsigned char) AUTH_MSG_KDC_REQUEST; *t |= HOST_BYTE_ORDER; /* Now for the variable info */ (void) strcpy((char *)(pkt->dat+2),user); /* aname */ pkt->length = 3 + strlen(user); (void) strcpy((char *)(pkt->dat+pkt->length), instance); /* instance */ pkt->length += 1 + strlen(instance); (void) strcpy((char *)(pkt->dat+pkt->length),realm); /* realm */ pkt->length += 1 + strlen(realm); (void) gettimeofday(&t_local,(struct timezone *) 0); /* timestamp */ memcpy((pkt->dat+pkt->length), &(t_local.tv_sec), 4); pkt->length += 4; *(pkt->dat+(pkt->length)++) = (char) life; (void) strcpy((char *)(pkt->dat+pkt->length),service); pkt->length += 1 + strlen(service); (void) strcpy((char *)(pkt->dat+pkt->length),sinstance); pkt->length += 1 + strlen(sinstance); rpkt->length = 0; /* SEND THE REQUEST AND RECEIVE THE RETURN PACKET */ if (kerror = send_to_kdc(pkt, rpkt, realm)) return(kerror); /* check packet version of the returned packet */ if (pkt_version(rpkt) != KRB_PROT_VERSION) return(INTK_PROT); /* Check byte order */ msg_byte_order = pkt_msg_type(rpkt) & 1; swap_bytes = 0; if (msg_byte_order != HOST_BYTE_ORDER) { swap_bytes++; } switch (pkt_msg_type(rpkt) & ~1) { case AUTH_MSG_KDC_REPLY: break; case AUTH_MSG_ERR_REPLY: memcpy(&rep_err_code,pkt_err_code(rpkt),4); if (swap_bytes) swap_u_long(rep_err_code); return((int)rep_err_code); default: return(INTK_PROT); } return( INTK_OK ); } kuam_set_in_tkt( user, instance, realm, service, sinstance, ptr) char *user, *instance, *realm, *service, *sinstance, *ptr; { KTEXT_ST tkt_st; KTEXT tkt = &tkt_st; struct timeval t_local; int lifetime, kvno, kerror; int32_t kdc_time; C_Block ses; char s_name[ SNAME_SZ ], s_instance[ INST_SZ ]; char rlm[ REALM_SZ ]; /* extract session key */ memcpy(ses, ptr, 8); ptr += 8; /* extract server's name */ (void) strcpy(s_name,ptr); ptr += strlen(s_name) + 1; /* extract server's instance */ (void) strcpy(s_instance,ptr); ptr += strlen(s_instance) + 1; /* extract server's realm */ (void) strcpy(rlm,ptr); ptr += strlen(rlm) + 1; /* extract ticket lifetime, server key version, ticket length */ /* be sure to avoid sign extension on lifetime! */ lifetime = (unsigned char) ptr[0]; kvno = (unsigned char) ptr[1]; tkt->length = (unsigned char) ptr[2]; ptr += 3; /* extract ticket itself */ memcpy( tkt->dat, ptr, tkt->length); ptr += tkt->length; if (strcmp(s_name, service) || strcmp(s_instance, sinstance) || strcmp(rlm, realm)) /* not what we asked for */ return(INTK_ERR); /* we need a better code here XXX */ /* check KDC time stamp */ memcpy(&kdc_time, ptr, 4); /* Time (coarse) */ if (swap_bytes) swap_u_long(kdc_time); ptr += 4; (void) gettimeofday(&t_local,(struct timezone *) 0); if (abs((int)(t_local.tv_sec - kdc_time)) > CLOCK_SKEW) { return(RD_AP_TIME); /* XXX should probably be better code */ } /* initialize ticket cache */ if (in_tkt(user,instance) != KSUCCESS) return(INTK_ERR); /* stash ticket, session key, etc. for future use */ if (kerror = save_credentials(s_name, s_instance, rlm, ses, lifetime, kvno, tkt, t_local.tv_sec)) return(kerror); return(INTK_OK); } #endif /* UAM_AFSKRB */ netatalk-2.2.2/etc/uams/uams_pgp.c0000644000175200017500000001045211655731244013754 00000000000000/* * $Id: uams_pgp.c,v 1.12 2009-10-15 11:39:48 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef UAM_PGP #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #ifdef HAVE_CRYPT_H #include #endif /* HAVE_CRYPT_H */ #include #include #if defined(GNUTLS_DHX) #include #elif defined(OPENSSL_DHX) #include #include #include #else /* OPENSSL_DHX */ #include #include #include #endif /* OPENSSL_DHX */ #include #include #define KEYSIZE 16 #define PASSWDLEN 64 #define CRYPTBUFLEN (KEYSIZE*2) #define CRYPT2BUFLEN (KEYSIZE + PASSWDLEN) /* hash a number to a 16-bit quantity */ #define pgphash(a) ((((unsigned long) (a) >> 8) ^ \ (unsigned long) (a)) & 0xffff) /* the secret key */ static struct passwd *pgppwd; static CAST_KEY castkey; static u_int8_t randbuf[16]; /* pgp passwd */ static int pgp_login(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { size_t len, i; char *name; *rbuflen = 0; if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &name, &i) < 0) return AFPERR_PARAM; len = (unsigned char) *ibuf++; if ( len > i ) { return( AFPERR_PARAM ); } memcpy(name, ibuf, len ); ibuf += len; name[ len ] = '\0'; if ((unsigned long) ibuf & 1) /* padding */ ++ibuf; if (( pgppwd = uam_getname(obj, name, i)) == NULL ) { return AFPERR_PARAM; } LOG(log_info, logtype_uams, "pgp login: %s", name); if (uam_checkuser(pgppwd) < 0) return AFPERR_NOTAUTH; /* get the challenge */ len = (unsigned char) *ibuf++; /* challenge */ /* get the signature. it's always 16 bytes. */ if (uam_afpserver_option(obj, UAM_OPTION_SIGNATURE, (void *) &name, NULL) < 0) { *rbuflen = 0; goto pgp_fail; } memcpy(rbuf + KEYSIZE, name, KEYSIZE); pgp_fail: return AFPERR_PARAM; } static int pgp_logincont(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { unsigned char iv[] = "RJscorat"; BIGNUM *bn1, *bn2, *bn3; u_int16_t sessid; char *p; *rbuflen = 0; /* check for session id */ memcpy(&sessid, ibuf, sizeof(sessid)); if (sessid != pgphash(obj)) return AFPERR_PARAM; ibuf += sizeof(sessid); /* use rbuf as scratch space */ CAST_cbc_encrypt(ibuf, rbuf, CRYPT2BUFLEN, &castkey, iv, CAST_DECRYPT); /* check to make sure that the random number is the same. we * get sent back an incremented random number. */ if (!(bn1 = BN_bin2bn(rbuf, KEYSIZE, NULL))) return AFPERR_PARAM; if (!(bn2 = BN_bin2bn(randbuf, sizeof(randbuf), NULL))) { BN_free(bn1); return AFPERR_PARAM; } /* zero out the random number */ memset(rbuf, 0, sizeof(randbuf)); memset(randbuf, 0, sizeof(randbuf)); rbuf += KEYSIZE; if (!(bn3 = BN_new())) { BN_free(bn2); BN_free(bn1); return AFPERR_PARAM; } BN_sub(bn3, bn1, bn2); BN_free(bn2); BN_free(bn1); /* okay. is it one more? */ if (!BN_is_one(bn3)) { BN_free(bn3); return AFPERR_PARAM; } BN_free(bn3); #ifdef AFS if ( kcheckuser(*uam_pwd, rbuf) == 0) { *uam_pwd = pgppwd; return AFP_OK; } #endif /* AFS */ rbuf[PASSWDLEN] = '\0'; p = crypt( rbuf, pgppwd->pw_passwd ); memset(rbuf, 0, PASSWDLEN); if ( strcmp( p, pgppwd->pw_passwd ) == 0 ) { *uam_pwd = pgppwd; return AFP_OK; } return AFPERR_NOTAUTH; } static int uam_setup(const char *path) { if (uam_register(UAM_SERVER_LOGIN, path, "PGPuam 1.0", pgp_login, pgp_logincont, NULL) < 0) return -1; return 0; } static void uam_cleanup(void) { uam_unregister(UAM_SERVER_LOGIN, "PGPuam 1.0"); } UAM_MODULE_EXPORT struct uam_export uams_pgp = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; #endif /* UAM_PGP */ netatalk-2.2.2/etc/uams/uams_passwd.c0000644000175200017500000002406111665651044014470 00000000000000/* * $Id: uams_passwd.c,v 1.31 2010-03-30 12:44:35 franklahm Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include #endif /* HAVE_CONFIG_H */ #include #include #include #include /* STDC check */ #if STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #ifdef HAVE_CRYPT_H #include #endif /* ! HAVE_CRYPT_H */ #include #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_TIME_H #include #endif #ifdef SHADOWPW #include #endif /* SHADOWPW */ #include #include #include #include #define PASSWDLEN 8 #ifndef MIN #define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif /* MIN */ #ifdef TRU64 #include #include static const char *clientname; #endif /* TRU64 */ /*XXX in etc/papd/file.h */ struct papfile; extern UAM_MODULE_EXPORT void append(struct papfile *, const char *, int); static int pwd_login(void *obj, char *username, int ulen, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf _U_, size_t *rbuflen _U_) { char *p; struct passwd *pwd; int err = AFP_OK; #ifdef SHADOWPW struct spwd *sp; #endif /* SHADOWPW */ #ifdef TRU64 if( uam_afpserver_option( obj, UAM_OPTION_CLIENTNAME, (void *) &clientname, NULL ) < 0 ) return AFPERR_MISC; #endif /* TRU64 */ if (ibuflen < PASSWDLEN) { return( AFPERR_PARAM ); } ibuf[ PASSWDLEN ] = '\0'; if (( pwd = uam_getname(obj, username, ulen)) == NULL ) { return AFPERR_NOTAUTH; } LOG(log_info, logtype_uams, "cleartext login: %s", username); if (uam_checkuser(pwd) < 0) { LOG(log_info, logtype_uams, "not a valid user"); return AFPERR_NOTAUTH; } #ifdef SHADOWPW if (( sp = getspnam( pwd->pw_name )) == NULL ) { LOG(log_info, logtype_uams, "no shadow passwd entry for %s", username); return AFPERR_NOTAUTH; } pwd->pw_passwd = sp->sp_pwdp; if (sp->sp_max != -1 && sp->sp_lstchg) { time_t now = time(NULL) / (60*60*24); int32_t expire_days = sp->sp_lstchg - now + sp->sp_max; if ( expire_days < 0 ) { LOG(log_info, logtype_uams, "Password for user %s expired", username); err = AFPERR_PWDEXPR; } } #endif /* SHADOWPW */ if (!pwd->pw_passwd) { return AFPERR_NOTAUTH; } *uam_pwd = pwd; #ifdef TRU64 { int ac; char **av; char hostname[256]; uam_afp_getcmdline( &ac, &av ); sprintf( hostname, "%s@%s", username, clientname ); if( uam_sia_validate_user( NULL, ac, av, hostname, username, NULL, FALSE, NULL, ibuf ) != SIASUCCESS ) return AFPERR_NOTAUTH; return err; } #else /* TRU64 */ p = crypt( ibuf, pwd->pw_passwd ); if ( strcmp( p, pwd->pw_passwd ) == 0 ) return err; #endif /* TRU64 */ return AFPERR_NOTAUTH; } /* cleartxt login */ static int passwd_login(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { char *username; size_t len, ulen; *rbuflen = 0; if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) return AFPERR_MISC; if (ibuflen < 2) { return( AFPERR_PARAM ); } len = (unsigned char) *ibuf++; ibuflen--; if (!len || len > ibuflen || len > ulen ) { return( AFPERR_PARAM ); } memcpy(username, ibuf, len ); ibuf += len; ibuflen -=len; username[ len ] = '\0'; if ((unsigned long) ibuf & 1) { /* pad character */ ++ibuf; ibuflen--; } return (pwd_login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen)); } /* cleartxt login ext * uname format : byte 3 2 bytes len (network order) len bytes unicode name */ static int passwd_login_ext(void *obj, char *uname, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { char *username; size_t len, ulen; u_int16_t temp16; *rbuflen = 0; if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) return AFPERR_MISC; if (*uname != 3) return AFPERR_PARAM; uname++; memcpy(&temp16, uname, sizeof(temp16)); len = ntohs(temp16); if (!len || len > ulen ) { return( AFPERR_PARAM ); } memcpy(username, uname +2, len ); username[ len ] = '\0'; return (pwd_login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen)); } #if 0 /* change passwd */ static int passwd_changepw(void *obj, char *username, struct passwd *pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { #ifdef SHADOWPW struct spwd *sp; #endif /* SHADOWPW */ char pw[PASSWDLEN + 1], *p; uid_t uid = geteuid(); if (uam_checkuser(pwd) < 0) return AFPERR_ACCESS; /* old password */ memcpy(pw, ibuf, PASSWDLEN); memset(ibuf, 0, PASSWDLEN); pw[PASSWDLEN] = '\0'; #ifdef SHADOWPW if (( sp = getspnam( pwd->pw_name )) == NULL ) { LOG(log_info, logtype_uams, "no shadow passwd entry for %s", username); return AFPERR_PARAM; } pwd->pw_passwd = sp->sp_pwdp; #endif /* SHADOWPW */ p = crypt(pw, pwd->pw_passwd ); if (strcmp( p, pwd->pw_passwd )) { memset(pw, 0, sizeof(pw)); return AFPERR_NOTAUTH; } /* new password */ ibuf += PASSWDLEN; ibuf[PASSWDLEN] = '\0'; #ifdef SHADOWPW #else /* SHADOWPW */ #endif /* SHADOWPW */ return AFP_OK; } #endif /* 0 */ /* Printer ClearTxtUAM login */ static int passwd_printer(char *start, char *stop, char *username, struct papfile *out) { struct passwd *pwd; #ifdef SHADOWPW struct spwd *sp; #endif /* SHADOWPW */ char *data, *p, *q; char password[PASSWDLEN + 1] = "\0"; static const char *loginok = "0\r"; int ulen; data = (char *)malloc(stop - start + 1); if (!data) { LOG(log_info, logtype_uams,"Bad Login ClearTxtUAM: malloc"); return(-1); } strlcpy(data, start, stop - start + 1); /* We are looking for the following format in data: * (username) (password) * * Let's hope username doesn't contain ") ("! */ /* Parse input for username in () */ if ((p = strchr(data, '(' )) == NULL) { LOG(log_info, logtype_uams,"Bad Login ClearTxtUAM: username not found in string"); free(data); return(-1); } p++; if ((q = strstr(p, ") (" )) == NULL) { LOG(log_info, logtype_uams,"Bad Login ClearTxtUAM: username not found in string"); free(data); return(-1); } memcpy(username, p, MIN( UAM_USERNAMELEN, q - p )); /* Parse input for password in next () */ p = q + 3; if ((q = strrchr(p , ')' )) == NULL) { LOG(log_info, logtype_uams,"Bad Login ClearTxtUAM: password not found in string"); free(data); return(-1); } memcpy(password, p, MIN(PASSWDLEN, q - p) ); /* Done copying username and password, clean up */ free(data); ulen = strlen(username); if (( pwd = uam_getname(NULL, username, ulen)) == NULL ) { LOG(log_info, logtype_uams, "Bad Login ClearTxtUAM: ( %s ) not found ", username); return(-1); } if (uam_checkuser(pwd) < 0) { /* syslog of error happens in uam_checkuser */ return(-1); } #ifdef SHADOWPW if (( sp = getspnam( pwd->pw_name )) == NULL ) { LOG(log_info, logtype_uams, "Bad Login ClearTxtUAM: no shadow passwd entry for %s", username); return(-1); } pwd->pw_passwd = sp->sp_pwdp; if (sp->sp_max != -1 && sp->sp_lstchg) { time_t now = time(NULL) / (60*60*24); int32_t expire_days = sp->sp_lstchg - now + sp->sp_max; if ( expire_days < 0 ) { LOG(log_info, logtype_uams, "Password for user %s expired", username); return (-1); } } #endif /* SHADOWPW */ if (!pwd->pw_passwd) { LOG(log_info, logtype_uams, "Bad Login ClearTxtUAM: no password for %s", username); return(-1); } #ifdef AFS if ( kcheckuser( pwd, password) == 0) return(0); #endif /* AFS */ p = crypt(password, pwd->pw_passwd); if (strcmp(p, pwd->pw_passwd) != 0) { LOG(log_info, logtype_uams, "Bad Login ClearTxtUAM: %s: bad password", username); return(-1); } /* Login successful */ append(out, loginok, strlen(loginok)); LOG(log_info, logtype_uams, "Login ClearTxtUAM: %s", username); return(0); } static int uam_setup(const char *path) { if (uam_register(UAM_SERVER_LOGIN_EXT, path, "Cleartxt Passwrd", passwd_login, NULL, NULL, passwd_login_ext) < 0) return -1; if (uam_register(UAM_SERVER_PRINTAUTH, path, "ClearTxtUAM", passwd_printer) < 0) return -1; return 0; } static void uam_cleanup(void) { uam_unregister(UAM_SERVER_LOGIN, "Cleartxt Passwrd"); uam_unregister(UAM_SERVER_PRINTAUTH, "ClearTxtUAM"); } UAM_MODULE_EXPORT struct uam_export uams_clrtxt = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; UAM_MODULE_EXPORT struct uam_export uams_passwd = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; netatalk-2.2.2/etc/uams/uams_dhx_pam.c0000644000175200017500000005000711655731126014605 00000000000000/* * $Id: uams_dhx_pam.c,v 1.33 2010-03-30 10:25:49 franklahm Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #if defined(USE_PAM) && defined(UAM_DHX) #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #ifdef HAVE_SECURITY_PAM_APPL_H #include #endif #ifdef HAVE_PAM_PAM_APPL_H #include #endif #if defined(GNUTLS_DHX) #include #elif defined(OPENSSL_DHX) #include #include #include #include #else /* OPENSSL_DHX */ #include #include #include #include #endif /* OPENSSL_DHX */ #include #include #define KEYSIZE 16 #define PASSWDLEN 64 #define CRYPTBUFLEN (KEYSIZE*2) #define CRYPT2BUFLEN (KEYSIZE + PASSWDLEN) #define CHANGEPWBUFLEN (KEYSIZE + 2*PASSWDLEN) /* hash a number to a 16-bit quantity */ #define dhxhash(a) ((((unsigned long) (a) >> 8) ^ \ (unsigned long) (a)) & 0xffff) /* the secret key */ static CAST_KEY castkey; static struct passwd *dhxpwd; static u_int8_t randbuf[KEYSIZE]; /* diffie-hellman bits */ static unsigned char msg2_iv[] = "CJalbert"; static unsigned char msg3_iv[] = "LWallace"; static const u_int8_t p[] = {0xBA, 0x28, 0x73, 0xDF, 0xB0, 0x60, 0x57, 0xD4, 0x3F, 0x20, 0x24, 0x74, 0x4C, 0xEE, 0xE7, 0x5B}; static const u_int8_t g = 0x07; /* Static variables used to communicate between the conversation function * and the server_login function */ static pam_handle_t *pamh = NULL; static char *PAM_username; static char *PAM_password; /* PAM conversation function * Here we assume (for now, at least) that echo on means login name, and * echo off means password. */ static int PAM_conv (int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr _U_) { int count = 0; struct pam_response *reply; #define COPY_STRING(s) (s) ? strdup(s) : NULL errno = 0; if (num_msg < 1) { /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM DHX Conversation Err -- %s", strerror(errno)); /* Log Entry */ return PAM_CONV_ERR; } reply = (struct pam_response *) calloc(num_msg, sizeof(struct pam_response)); if (!reply) { /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM DHX Conversation Err -- %s", strerror(errno)); /* Log Entry */ return PAM_CONV_ERR; } for (count = 0; count < num_msg; count++) { char *string = NULL; switch (msg[count]->msg_style) { case PAM_PROMPT_ECHO_ON: if (!(string = COPY_STRING(PAM_username))) { /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: username failure -- %s", strerror(errno)); /* Log Entry */ goto pam_fail_conv; } break; case PAM_PROMPT_ECHO_OFF: if (!(string = COPY_STRING(PAM_password))) { /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: passwd failure: --: %s", strerror(errno)); /* Log Entry */ goto pam_fail_conv; } break; case PAM_TEXT_INFO: #ifdef PAM_BINARY_PROMPT case PAM_BINARY_PROMPT: #endif /* PAM_BINARY_PROMPT */ /* ignore it... */ break; case PAM_ERROR_MSG: default: /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Binary_Prompt -- %s", strerror(errno)); /* Log Entry */ goto pam_fail_conv; } if (string) { reply[count].resp_retcode = 0; reply[count].resp = string; string = NULL; } } *resp = reply; /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: PAM Success"); /* Log Entry */ return PAM_SUCCESS; pam_fail_conv: for (count = 0; count < num_msg; count++) { if (!reply[count].resp) continue; switch (msg[count]->msg_style) { case PAM_PROMPT_ECHO_OFF: case PAM_PROMPT_ECHO_ON: free(reply[count].resp); break; } } free(reply); /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM DHX Conversation Err -- %s", strerror(errno)); /* Log Entry */ return PAM_CONV_ERR; } static struct pam_conv PAM_conversation = { &PAM_conv, NULL }; static int dhx_setup(void *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { u_int16_t sessid; size_t i; BIGNUM *bn, *gbn, *pbn; DH *dh; /* get the client's public key */ if (!(bn = BN_bin2bn(ibuf, KEYSIZE, NULL))) { /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM No Public Key -- %s", strerror(errno)); /* Log Entry */ return AFPERR_PARAM; } /* get our primes */ if (!(gbn = BN_bin2bn(&g, sizeof(g), NULL))) { BN_clear_free(bn); /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM No Primes: GBN -- %s", strerror(errno)); /* Log Entry */ return AFPERR_PARAM; } if (!(pbn = BN_bin2bn(p, sizeof(p), NULL))) { BN_free(gbn); BN_clear_free(bn); /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM No Primes: PBN -- %s", strerror(errno)); /* Log Entry */ return AFPERR_PARAM; } /* okay, we're ready */ if (!(dh = DH_new())) { BN_free(pbn); BN_free(gbn); BN_clear_free(bn); /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM DH was equal to DH_New... Go figure... -- %s", strerror(errno)); /* Log Entry */ return AFPERR_PARAM; } /* generate key and make sure that we have enough space */ dh->p = pbn; dh->g = gbn; if (DH_generate_key(dh) == 0) { unsigned long dherror; char errbuf[256]; ERR_load_crypto_strings(); dherror = ERR_get_error(); ERR_error_string_n(dherror, errbuf, 256); LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Err Generating Key (OpenSSL error code: %u, %s)", dherror, errbuf); ERR_free_strings(); goto pam_fail; } if (BN_num_bytes(dh->pub_key) > KEYSIZE) { LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Err Generating Key -- Not enough Space? -- %s", strerror(errno)); goto pam_fail; } /* figure out the key. store the key in rbuf for now. */ i = DH_compute_key(rbuf, bn, dh); /* set the key */ CAST_set_key(&castkey, i, rbuf); /* session id. it's just a hashed version of the object pointer. */ sessid = dhxhash(obj); memcpy(rbuf, &sessid, sizeof(sessid)); rbuf += sizeof(sessid); *rbuflen += sizeof(sessid); /* public key */ BN_bn2bin(dh->pub_key, rbuf); rbuf += KEYSIZE; *rbuflen += KEYSIZE; /* buffer to be encrypted */ i = sizeof(randbuf); if (uam_afpserver_option(obj, UAM_OPTION_RANDNUM, (void *) randbuf, &i) < 0) { *rbuflen = 0; /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Buffer Encryption Err. -- %s", strerror(errno)); /* Log Entry */ goto pam_fail; } memcpy(rbuf, &randbuf, sizeof(randbuf)); /* get the signature. it's always 16 bytes. */ #if 0 if (uam_afpserver_option(obj, UAM_OPTION_SIGNATURE, (void *) &buf, NULL) < 0) { *rbuflen = 0; /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Signature Retieval Failure -- %s", strerror(errno)); /* Log Entry */ goto pam_fail; } memcpy(rbuf + KEYSIZE, buf, KEYSIZE); #else /* 0 */ memset(rbuf + KEYSIZE, 0, KEYSIZE); #endif /* 0 */ /* encrypt using cast */ CAST_cbc_encrypt(rbuf, rbuf, CRYPTBUFLEN, &castkey, msg2_iv, CAST_ENCRYPT); *rbuflen += CRYPTBUFLEN; BN_free(bn); DH_free(dh); return AFPERR_AUTHCONT; pam_fail: BN_free(bn); DH_free(dh); /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Fail - Cast Encryption -- %s", strerror(errno)); /* Log Entry */ return AFPERR_PARAM; } /* -------------------------------- */ static int login(void *obj, char *username, int ulen, struct passwd **uam_pwd _U_, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { if (( dhxpwd = uam_getname(obj, username, ulen)) == NULL ) { LOG(log_info, logtype_uams, "uams_dhx_pam.c: unknown username"); return AFPERR_NOTAUTH; } PAM_username = username; LOG(log_info, logtype_uams, "dhx login: %s", username); return dhx_setup(obj, ibuf, ibuflen, rbuf, rbuflen); } /* -------------------------------- */ /* dhx login: things are done in a slightly bizarre order to avoid * having to clean things up if there's an error. */ static int pam_login(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { char *username; size_t len, ulen; *rbuflen = 0; /* grab some of the options */ if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) { LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: uam_afpserver_option didn't meet uam_option_username -- %s", strerror(errno)); return AFPERR_PARAM; } len = (unsigned char) *ibuf++; if ( len > ulen ) { LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Signature Retieval Failure -- %s", strerror(errno)); return AFPERR_PARAM; } memcpy(username, ibuf, len ); ibuf += len; username[ len ] = '\0'; if ((unsigned long) ibuf & 1) /* pad to even boundary */ ++ibuf; return (login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen)); } /* ----------------------------- */ static int pam_login_ext(void *obj, char *uname, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { char *username; int len, ulen; u_int16_t temp16; *rbuflen = 0; /* grab some of the options */ if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) { LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: uam_afpserver_option didn't meet uam_option_username -- %s", strerror(errno)); return AFPERR_PARAM; } if (*uname != 3) return AFPERR_PARAM; uname++; memcpy(&temp16, uname, sizeof(temp16)); len = ntohs(temp16); if ( !len || len > ulen ) { LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Signature Retrieval Failure -- %s", strerror(errno)); return AFPERR_PARAM; } memcpy(username, uname +2, len ); username[ len ] = '\0'; return (login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen)); } /* -------------------------------- */ static int pam_logincont(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { const char *hostname; BIGNUM *bn1, *bn2, *bn3; u_int16_t sessid; int err, PAM_error; *rbuflen = 0; /* check for session id */ memcpy(&sessid, ibuf, sizeof(sessid)); if (sessid != dhxhash(obj)) { /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM Session ID - DHXHash Mismatch -- %s", strerror(errno)); /* Log Entry */ return AFPERR_PARAM; } ibuf += sizeof(sessid); if (uam_afpserver_option(obj, UAM_OPTION_CLIENTNAME, (void *) &hostname, NULL) < 0) { LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: unable to retrieve client hostname"); hostname = NULL; } CAST_cbc_encrypt(ibuf, rbuf, CRYPT2BUFLEN, &castkey, msg3_iv, CAST_DECRYPT); memset(&castkey, 0, sizeof(castkey)); /* check to make sure that the random number is the same. we * get sent back an incremented random number. */ if (!(bn1 = BN_bin2bn(rbuf, KEYSIZE, NULL))) return AFPERR_PARAM; if (!(bn2 = BN_bin2bn(randbuf, sizeof(randbuf), NULL))) { BN_free(bn1); return AFPERR_PARAM; } /* zero out the random number */ memset(rbuf, 0, sizeof(randbuf)); memset(randbuf, 0, sizeof(randbuf)); rbuf += KEYSIZE; if (!(bn3 = BN_new())) { BN_free(bn2); BN_free(bn1); return AFPERR_PARAM; } BN_sub(bn3, bn1, bn2); BN_free(bn2); BN_free(bn1); /* okay. is it one more? */ if (!BN_is_one(bn3)) { BN_free(bn3); return AFPERR_PARAM; } BN_free(bn3); /* Set these things up for the conv function */ rbuf[PASSWDLEN] = '\0'; PAM_password = rbuf; err = AFPERR_NOTAUTH; PAM_error = pam_start("netatalk", PAM_username, &PAM_conversation, &pamh); if (PAM_error != PAM_SUCCESS) { /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: PAM_Error: %s", pam_strerror(pamh,PAM_error)); /* Log Entry */ goto logincont_err; } /* solaris craps out if PAM_TTY and PAM_RHOST aren't set. */ pam_set_item(pamh, PAM_TTY, "afpd"); pam_set_item(pamh, PAM_RHOST, hostname); PAM_error = pam_authenticate(pamh,0); if (PAM_error != PAM_SUCCESS) { if (PAM_error == PAM_MAXTRIES) err = AFPERR_PWDEXPR; /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: PAM_Error: %s", pam_strerror(pamh, PAM_error)); /* Log Entry */ goto logincont_err; } PAM_error = pam_acct_mgmt(pamh, 0); if (PAM_error != PAM_SUCCESS ) { /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: PAM_Error: %s", pam_strerror(pamh, PAM_error)); /* Log Entry */ if (PAM_error == PAM_NEW_AUTHTOK_REQD) /* password expired */ err = AFPERR_PWDEXPR; #ifdef PAM_AUTHTOKEN_REQD else if (PAM_error == PAM_AUTHTOKEN_REQD) err = AFPERR_PWDCHNG; #endif else goto logincont_err; } #ifndef PAM_CRED_ESTABLISH #define PAM_CRED_ESTABLISH PAM_ESTABLISH_CRED #endif PAM_error = pam_setcred(pamh, PAM_CRED_ESTABLISH); if (PAM_error != PAM_SUCCESS) { /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: PAM_Error: %s", pam_strerror(pamh, PAM_error)); /* Log Entry */ goto logincont_err; } PAM_error = pam_open_session(pamh, 0); if (PAM_error != PAM_SUCCESS) { /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: PAM_Error: %s", pam_strerror(pamh, PAM_error)); /* Log Entry */ goto logincont_err; } memset(rbuf, 0, PASSWDLEN); /* zero out the password */ *uam_pwd = dhxpwd; /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: PAM Auth OK!"); /* Log Entry */ if ( err == AFPERR_PWDEXPR) return err; return AFP_OK; logincont_err: pam_end(pamh, PAM_error); pamh = NULL; memset(rbuf, 0, CRYPT2BUFLEN); return err; } /* logout */ static void pam_logout(void) { pam_close_session(pamh, 0); pam_end(pamh, 0); pamh = NULL; } /* change pw for dhx needs a couple passes to get everything all * right. basically, it's like the login/logincont sequence */ static int pam_changepw(void *obj, char *username, struct passwd *pwd _U_, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { BIGNUM *bn1, *bn2, *bn3; char *hostname; pam_handle_t *lpamh; uid_t uid; u_int16_t sessid; int PAM_error; if (ibuflen < sizeof(sessid)) { return AFPERR_PARAM; } /* grab the id */ memcpy(&sessid, ibuf, sizeof(sessid)); ibuf += sizeof(sessid); if (!sessid) { /* no sessid -> initialization phase */ PAM_username = username; ibuflen -= sizeof(sessid); return dhx_setup(obj, ibuf, ibuflen, rbuf, rbuflen); } /* otherwise, it's like logincont but different. */ /* check out the session id */ if (sessid != dhxhash(obj)) { /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Session ID not Equal to DHX Hash -- %s", strerror(errno)); /* Log Entry */ return AFPERR_PARAM; } /* we need this for pam */ if (uam_afpserver_option(obj, UAM_OPTION_HOSTNAME, (void *) &hostname, NULL) < 0) { /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Hostname Null?? -- %s", strerror(errno)); /* Log Entry */ return AFPERR_MISC; } /* grab the client's nonce, old password, and new password. */ CAST_cbc_encrypt(ibuf, ibuf, CHANGEPWBUFLEN, &castkey, msg3_iv, CAST_DECRYPT); memset(&castkey, 0, sizeof(castkey)); /* check to make sure that the random number is the same. we * get sent back an incremented random number. */ if (!(bn1 = BN_bin2bn(ibuf, KEYSIZE, NULL))) { /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Random Number Not the same or not incremented-- %s", strerror(errno)); /* Log Entry */ return AFPERR_PARAM; } if (!(bn2 = BN_bin2bn(randbuf, sizeof(randbuf), NULL))) { BN_free(bn1); /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Random Number Not the same or not incremented -- %s", strerror(errno)); /* Log Entry */ return AFPERR_PARAM; } /* zero out the random number */ memset(rbuf, 0, sizeof(randbuf)); memset(randbuf, 0, sizeof(randbuf)); if (!(bn3 = BN_new())) { BN_free(bn2); BN_free(bn1); /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Random Number did not Zero -- %s", strerror(errno)); /* Log Entry */ return AFPERR_PARAM; } BN_sub(bn3, bn1, bn2); BN_free(bn2); BN_free(bn1); /* okay. is it one more? */ #if 0 if (!BN_is_one(bn3)) { BN_free(bn3); /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: After Random Number not Zero, is it one more? -- %s", strerror(errno)); /* Log Entry */ return AFPERR_PARAM; } #endif BN_free(bn3); /* Set these things up for the conv function. the old password * is at the end. */ ibuf += KEYSIZE; ibuf[PASSWDLEN + PASSWDLEN] = '\0'; PAM_password = ibuf + PASSWDLEN; PAM_error = pam_start("netatalk", username, &PAM_conversation, &lpamh); if (PAM_error != PAM_SUCCESS) { /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Needless to say, PAM_error is != to PAM_SUCCESS -- %s", strerror(errno)); /* Log Entry */ return AFPERR_PARAM; } pam_set_item(lpamh, PAM_TTY, "afpd"); pam_set_item(lpamh, PAM_RHOST, hostname); /* we might need to do this as root */ uid = geteuid(); seteuid(0); PAM_error = pam_authenticate(lpamh, 0); if (PAM_error != PAM_SUCCESS) { seteuid(uid); pam_end(lpamh, PAM_error); return AFPERR_NOTAUTH; } /* clear out old passwd */ memset(ibuf + PASSWDLEN, 0, PASSWDLEN); /* new password */ PAM_password = ibuf; ibuf[PASSWDLEN] = '\0'; /* this really does need to be done as root */ PAM_error = pam_chauthtok(lpamh, 0); seteuid(uid); /* un-root ourselves. */ memset(ibuf, 0, PASSWDLEN); if (PAM_error != PAM_SUCCESS) { pam_end(lpamh, PAM_error); return AFPERR_ACCESS; } pam_end(lpamh, 0); return AFP_OK; } static int uam_setup(const char *path) { if (uam_register(UAM_SERVER_LOGIN_EXT, path, "DHCAST128", pam_login, pam_logincont, pam_logout, pam_login_ext) < 0) return -1; if (uam_register(UAM_SERVER_CHANGEPW, path, "DHCAST128", pam_changepw) < 0) { uam_unregister(UAM_SERVER_LOGIN, "DHCAST128"); return -1; } /*uam_register(UAM_SERVER_PRINTAUTH, path, "DHCAST128", pam_printer);*/ return 0; } static void uam_cleanup(void) { uam_unregister(UAM_SERVER_LOGIN, "DHCAST128"); uam_unregister(UAM_SERVER_CHANGEPW, "DHCAST128"); /*uam_unregister(UAM_SERVER_PRINTAUTH, "DHCAST128"); */ } UAM_MODULE_EXPORT struct uam_export uams_dhx = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; UAM_MODULE_EXPORT struct uam_export uams_dhx_pam = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; #endif /* USE_PAM && UAM_DHX */ netatalk-2.2.2/etc/uams/uams_pam.c0000644000175200017500000003021211655731126013736 00000000000000/* * $Id: uams_pam.c,v 1.24 2010-03-30 10:25:49 franklahm Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ /* STDC check */ #if STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #include #ifdef HAVE_SECURITY_PAM_APPL_H #include #endif #ifdef HAVE_PAM_PAM_APPL_H #include #endif #include #include #include #define PASSWDLEN 8 #ifndef MIN #define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif /* MIN */ /* Static variables used to communicate between the conversation function * and the server_login function */ static pam_handle_t *pamh = NULL; static const char *hostname; static char *PAM_username; static char *PAM_password; /*XXX in etc/papd/file.h */ struct papfile; extern UAM_MODULE_EXPORT void append(struct papfile *, const char *, int); /* PAM conversation function * Here we assume (for now, at least) that echo on means login name, and * echo off means password. */ static int PAM_conv (int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr _U_) { struct pam_response *reply; int count; #define COPY_STRING(s) (s) ? strdup(s) : NULL if (num_msg < 1) return PAM_CONV_ERR; reply = (struct pam_response *) calloc(num_msg, sizeof(struct pam_response)); if (!reply) return PAM_CONV_ERR; for (count = 0; count < num_msg; count++) { char *string = NULL; switch (msg[count]->msg_style) { case PAM_PROMPT_ECHO_ON: if (!(string = COPY_STRING(PAM_username))) goto pam_fail_conv; break; case PAM_PROMPT_ECHO_OFF: if (!(string = COPY_STRING(PAM_password))) goto pam_fail_conv; break; case PAM_TEXT_INFO: #ifdef PAM_BINARY_PROMPT case PAM_BINARY_PROMPT: #endif /* PAM_BINARY_PROMPT */ /* ignore it... */ break; case PAM_ERROR_MSG: default: goto pam_fail_conv; } if (string) { reply[count].resp_retcode = 0; reply[count].resp = string; string = NULL; } } *resp = reply; return PAM_SUCCESS; pam_fail_conv: for (count = 0; count < num_msg; count++) { if (!reply[count].resp) continue; switch (msg[count]->msg_style) { case PAM_PROMPT_ECHO_OFF: case PAM_PROMPT_ECHO_ON: free(reply[count].resp); break; } } free(reply); return PAM_CONV_ERR; } static struct pam_conv PAM_conversation = { &PAM_conv, NULL }; static int login(void *obj, char *username, int ulen, struct passwd **uam_pwd, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen _U_) { struct passwd *pwd; int err, PAM_error; if (uam_afpserver_option(obj, UAM_OPTION_CLIENTNAME, (void *) &hostname, NULL) < 0) { LOG(log_info, logtype_uams, "uams_pam.c :PAM: unable to retrieve client hostname"); hostname = NULL; } ibuf[ PASSWDLEN ] = '\0'; if (( pwd = uam_getname(obj, username, ulen)) == NULL ) { return AFPERR_NOTAUTH; } LOG(log_info, logtype_uams, "cleartext login: %s", username); PAM_username = username; PAM_password = ibuf; /* Set these things up for the conv function */ err = AFPERR_NOTAUTH; PAM_error = pam_start("netatalk", username, &PAM_conversation, &pamh); if (PAM_error != PAM_SUCCESS) goto login_err; pam_set_item(pamh, PAM_TTY, "afpd"); pam_set_item(pamh, PAM_RHOST, hostname); /* use PAM_DISALLOW_NULL_AUTHTOK if passwdminlen > 0 */ PAM_error = pam_authenticate(pamh,0); if (PAM_error != PAM_SUCCESS) { if (PAM_error == PAM_MAXTRIES) err = AFPERR_PWDEXPR; goto login_err; } PAM_error = pam_acct_mgmt(pamh, 0); if (PAM_error != PAM_SUCCESS) { if (PAM_error == PAM_NEW_AUTHTOK_REQD) /* Password change required */ err = AFPERR_PWDEXPR; #ifdef PAM_AUTHTOKEN_REQD else if (PAM_error == PAM_AUTHTOKEN_REQD) err = AFPERR_PWDCHNG; #endif /* PAM_AUTHTOKEN_REQD */ else goto login_err; } #ifndef PAM_CRED_ESTABLISH #define PAM_CRED_ESTABLISH PAM_ESTABLISH_CRED #endif /* PAM_CRED_ESTABLISH */ PAM_error = pam_setcred(pamh, PAM_CRED_ESTABLISH); if (PAM_error != PAM_SUCCESS) goto login_err; PAM_error = pam_open_session(pamh, 0); if (PAM_error != PAM_SUCCESS) goto login_err; *uam_pwd = pwd; if (err == AFPERR_PWDEXPR) return err; return AFP_OK; login_err: pam_end(pamh, PAM_error); pamh = NULL; return err; } /* -------------------------- cleartxt login */ static int pam_login(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { char *username; size_t len, ulen; *rbuflen = 0; if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) { return AFPERR_MISC; } len = (unsigned char) *ibuf++; if ( len > ulen ) { return( AFPERR_PARAM ); } memcpy(username, ibuf, len ); ibuf += len; username[ len ] = '\0'; if ((unsigned long) ibuf & 1) /* pad character */ ++ibuf; return (login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen)); } /* ----------------------------- */ static int pam_login_ext(void *obj, char *uname, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { char *username; size_t len, ulen; u_int16_t temp16; *rbuflen = 0; if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) return AFPERR_MISC; if (*uname != 3) return AFPERR_PARAM; uname++; memcpy(&temp16, uname, sizeof(temp16)); len = ntohs(temp16); if (!len || len > ulen ) { return( AFPERR_PARAM ); } memcpy(username, uname +2, len ); username[ len ] = '\0'; return (login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen)); } /* logout */ static void pam_logout(void) { pam_close_session(pamh, 0); pam_end(pamh, 0); pamh = NULL; } /* change passwd */ static int pam_changepw(void *obj _U_, char *username, struct passwd *pwd _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen _U_) { char pw[PASSWDLEN + 1]; pam_handle_t *lpamh; uid_t uid; int PAM_error; /* old password */ memcpy(pw, ibuf, PASSWDLEN); memset(ibuf, 0, PASSWDLEN); pw[PASSWDLEN] = '\0'; /* let's do a quick check for the same password */ if (memcmp(pw, ibuf + PASSWDLEN, PASSWDLEN) == 0) return AFPERR_PWDSAME; /* Set these things up for the conv function */ PAM_username = username; PAM_password = pw; PAM_error = pam_start("netatalk", username, &PAM_conversation, &lpamh); if (PAM_error != PAM_SUCCESS) return AFPERR_PARAM; pam_set_item(lpamh, PAM_TTY, "afpd"); pam_set_item(lpamh, PAM_RHOST, hostname); /* we might need to do this as root */ uid = geteuid(); seteuid(0); PAM_error = pam_authenticate(lpamh,0); if (PAM_error != PAM_SUCCESS) { seteuid(uid); pam_end(lpamh, PAM_error); return AFPERR_NOTAUTH; } /* new password */ ibuf += PASSWDLEN; PAM_password = ibuf; ibuf[PASSWDLEN] = '\0'; /* this really does need to be done as root */ PAM_error = pam_chauthtok(lpamh, 0); seteuid(uid); /* un-root ourselves. */ memset(pw, 0, PASSWDLEN); memset(ibuf, 0, PASSWDLEN); if (PAM_error != PAM_SUCCESS) { pam_end(lpamh, PAM_error); return AFPERR_ACCESS; } pam_end(lpamh, 0); return AFP_OK; } /* Printer ClearTxtUAM login */ static int pam_printer(char *start, char *stop, char *username, struct papfile *out) { int PAM_error; char *data, *p, *q; char password[PASSWDLEN + 1] = "\0"; static const char *loginok = "0\r"; struct passwd *pwd; data = (char *)malloc(stop - start + 1); if (!data) { LOG(log_info, logtype_uams,"Bad Login ClearTxtUAM: malloc"); return(-1); } strlcpy(data, start, stop - start + 1); /* We are looking for the following format in data: * (username) (password) * * Let's hope username doesn't contain ") ("! */ /* Parse input for username in () */ if ((p = strchr(data, '(' )) == NULL) { LOG(log_info, logtype_uams,"Bad Login ClearTxtUAM: username not found in string"); free(data); return(-1); } p++; if ((q = strstr(p, ") (" )) == NULL) { LOG(log_info, logtype_uams,"Bad Login ClearTxtUAM: username not found in string"); free(data); return(-1); } memcpy(username, p, MIN(UAM_USERNAMELEN, q - p) ); /* Parse input for password in next () */ p = q + 3; if ((q = strrchr(p, ')' )) == NULL) { LOG(log_info, logtype_uams,"Bad Login ClearTxtUAM: password not found in string"); free(data); return(-1); } memcpy(password, p, MIN(PASSWDLEN, (q - p)) ); /* Done copying username and password, clean up */ free(data); if (( pwd = uam_getname(NULL, username, strlen(username))) == NULL ) { LOG(log_info, logtype_uams, "Bad Login ClearTxtUAM: ( %s ) not found ", username); return(-1); } if (uam_checkuser(pwd) < 0) { /* syslog of error happens in uam_checkuser */ return(-1); } PAM_username = username; PAM_password = password; PAM_error = pam_start("netatalk", username, &PAM_conversation, &pamh); if (PAM_error != PAM_SUCCESS) { LOG(log_info, logtype_uams, "Bad Login ClearTxtUAM: %s: %s", username, pam_strerror(pamh, PAM_error)); pam_end(pamh, PAM_error); pamh = NULL; return(-1); } pam_set_item(pamh, PAM_TTY, "papd"); pam_set_item(pamh, PAM_RHOST, hostname); PAM_error = pam_authenticate(pamh,0); if (PAM_error != PAM_SUCCESS) { LOG(log_info, logtype_uams, "Bad Login ClearTxtUAM: %s: %s", username, pam_strerror(pamh, PAM_error)); pam_end(pamh, PAM_error); pamh = NULL; return(-1); } PAM_error = pam_acct_mgmt(pamh, 0); if (PAM_error != PAM_SUCCESS) { LOG(log_info, logtype_uams, "Bad Login ClearTxtUAM: %s: %s", username, pam_strerror(pamh, PAM_error)); pam_end(pamh, PAM_error); pamh = NULL; return(-1); } PAM_error = pam_open_session(pamh, 0); if (PAM_error != PAM_SUCCESS) { LOG(log_info, logtype_uams, "Bad Login ClearTxtUAM: %s: %s", username, pam_strerror(pamh, PAM_error)); pam_end(pamh, PAM_error); pamh = NULL; return(-1); } /* Login successful, but no need to hang onto it, so logout immediately */ append(out, loginok, strlen(loginok)); LOG(log_info, logtype_uams, "Login ClearTxtUAM: %s", username); pam_close_session(pamh, 0); pam_end(pamh, 0); pamh = NULL; return(0); } static int uam_setup(const char *path) { if (uam_register(UAM_SERVER_LOGIN_EXT, path, "Cleartxt Passwrd", pam_login, NULL, pam_logout, pam_login_ext) < 0) return -1; if (uam_register(UAM_SERVER_CHANGEPW, path, "Cleartxt Passwrd", pam_changepw) < 0) { uam_unregister(UAM_SERVER_LOGIN, "Cleartxt Passwrd"); return -1; } if (uam_register(UAM_SERVER_PRINTAUTH, path, "ClearTxtUAM", pam_printer) < 0) { return -1; } return 0; } static void uam_cleanup(void) { uam_unregister(UAM_SERVER_LOGIN, "Cleartxt Passwrd"); uam_unregister(UAM_SERVER_CHANGEPW, "Cleartxt Passwrd"); uam_unregister(UAM_SERVER_PRINTAUTH, "ClearTxtUAM"); } UAM_MODULE_EXPORT struct uam_export uams_clrtxt = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; UAM_MODULE_EXPORT struct uam_export uams_pam = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; netatalk-2.2.2/etc/uams/uams_randnum.c0000644000175200017500000003777511655731126014652 00000000000000/* * $Id: uams_randnum.c,v 1.21 2010-03-30 10:25:49 franklahm Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include /* STDC check */ #if STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #include #include #include #include #include #include #include #include #ifdef USE_CRACKLIB #include #endif /* USE_CRACKLIB */ #define PASSWDLEN 8 static C_Block seskey; static Key_schedule seskeysched; static struct passwd *randpwd; static u_int8_t randbuf[8]; /* hash to a 16-bit number. this will generate completely harmless * warnings on 64-bit machines. */ #define randhash(a) (((((unsigned long) a) >> 8) ^ \ ((unsigned long)a)) & 0xffff) /* handle ~/.passwd. courtesy of shirsch@ibm.net. */ static int home_passwd(const struct passwd *pwd, const char *path, const int pathlen _U_, unsigned char *passwd, const int len, const int set) { struct stat st; int fd, i; if ( (fd = open(path, (set) ? O_WRONLY : O_RDONLY)) < 0 ) { LOG(log_error, logtype_uams, "Failed to open %s", path); return AFPERR_ACCESS; } if ( fstat( fd, &st ) < 0 ) goto home_passwd_fail; /* If any of these are true, disallow login: * - not a regular file * - gid or uid don't match user * - anyone else has permissions of any sort */ if (!S_ISREG(st.st_mode) || (pwd->pw_uid != st.st_uid) || (pwd->pw_gid != st.st_gid) || (st.st_mode & ( S_IRWXG | S_IRWXO )) ) { LOG(log_info, logtype_uams, "Insecure permissions found for %s.", path); goto home_passwd_fail; } /* get the password */ if (set) { if (write(fd, passwd, len) < 0) { LOG(log_error, logtype_uams, "Failed to write to %s", path ); goto home_passwd_fail; } } else { if (read(fd, passwd, len) < 0) { LOG(log_error, logtype_uams, "Failed to read from %s", path ); goto home_passwd_fail; } /* get rid of pesky characters */ for (i = 0; i < len; i++) if ((passwd[i] != ' ') && isspace(passwd[i])) passwd[i] = '\0'; } close(fd); return AFP_OK; home_passwd_fail: close(fd); return AFPERR_ACCESS; } /* * handle /path/afppasswd with an optional key file. we're a lot more * trusting of this file. NOTE: we use our own password entry writing * bits as we want to avoid tromping over global variables. in addition, * we look for a key file and use that if it's there. here are the * formats: * password file: * username:password:last login date:failedcount * * password is just the hex equivalent of either the ASCII password * (if the key file doesn't exist) or the des encrypted password. * * key file: * key (in hex) */ #define PASSWD_ILLEGAL '*' #define unhex(x) (isdigit(x) ? (x) - '0' : toupper(x) + 10 - 'A') static int afppasswd(const struct passwd *pwd, const char *path, const int pathlen, unsigned char *passwd, int len, const int set) { u_int8_t key[DES_KEY_SZ*2]; char buf[MAXPATHLEN + 1], *p; Key_schedule schedule; FILE *fp; unsigned int i, j; int keyfd = -1, err = 0; off_t pos; if ((fp = fopen(path, (set) ? "r+" : "r")) == NULL) { LOG(log_error, logtype_uams, "Failed to open %s", path); return AFPERR_ACCESS; } /* open the key file if it exists */ strcpy(buf, path); if (pathlen < (int) sizeof(buf) - 5) { strcat(buf, ".key"); keyfd = open(buf, O_RDONLY); } pos = ftell(fp); memset(buf, 0, sizeof(buf)); while (fgets(buf, sizeof(buf), fp)) { if ((p = strchr(buf, ':'))) { if ( strlen(pwd->pw_name) == (p - buf) && strncmp(buf, pwd->pw_name, p - buf) == 0) { p++; if (*p == PASSWD_ILLEGAL) { LOG(log_info, logtype_uams, "invalid password entry for %s", pwd->pw_name); err = AFPERR_ACCESS; goto afppasswd_done; } goto afppasswd_found; } } pos = ftell(fp); memset(buf, 0, sizeof(buf)); } err = AFPERR_PARAM; goto afppasswd_done; afppasswd_found: if (!set) { /* convert to binary. */ for (i = j = 0; i < sizeof(key); i += 2, j++) p[j] = (unhex(p[i]) << 4) | unhex(p[i + 1]); if (j <= DES_KEY_SZ) memset(p + j, 0, sizeof(key) - j); } if (keyfd > -1) { /* read in the hex representation of an 8-byte key */ read(keyfd, key, sizeof(key)); /* convert to binary key */ for (i = j = 0; i < strlen((char *) key); i += 2, j++) key[j] = (unhex(key[i]) << 4) | unhex(key[i + 1]); if (j <= DES_KEY_SZ) memset(key + j, 0, sizeof(key) - j); key_sched((C_Block *) key, schedule); memset(key, 0, sizeof(key)); if (set) { /* NOTE: this takes advantage of the fact that passwd doesn't * get used after this call if it's being set. */ ecb_encrypt((C_Block *) passwd, (C_Block *) passwd, schedule, DES_ENCRYPT); } else { /* decrypt the password */ ecb_encrypt((C_Block *) p, (C_Block *) p, schedule, DES_DECRYPT); } memset(&schedule, 0, sizeof(schedule)); } if (set) { const unsigned char hextable[] = "0123456789ABCDEF"; struct flock lock; int fd = fileno(fp); /* convert to hex password */ for (i = j = 0; i < DES_KEY_SZ; i++, j += 2) { key[j] = hextable[(passwd[i] & 0xF0) >> 4]; key[j + 1] = hextable[passwd[i] & 0x0F]; } memcpy(p, key, sizeof(key)); /* get exclusive access to the user's password entry. we don't * worry so much on reads. in the worse possible case there, the * user will just need to re-enter their password. */ lock.l_type = F_WRLCK; lock.l_start = pos; lock.l_len = 1; lock.l_whence = SEEK_SET; fseek(fp, pos, SEEK_SET); fcntl(fd, F_SETLKW, &lock); fwrite(buf, p - buf + sizeof(key), 1, fp); lock.l_type = F_UNLCK; fcntl(fd, F_SETLK, &lock); } else memcpy(passwd, p, len); memset(buf, 0, sizeof(buf)); afppasswd_done: if (keyfd > -1) close(keyfd); fclose(fp); return err; } /* this sets the uid. it needs to do slightly different things * depending upon whether or not the password is in ~/.passwd * or in a global location */ static int randpass(const struct passwd *pwd, const char *file, unsigned char *passwd, const int len, const int set) { int i; uid_t uid = geteuid(); /* Build pathname to user's '.passwd' file */ i = strlen(file); if (*file == '~') { char path[MAXPATHLEN + 1]; if ( (strlen(pwd->pw_dir) + i - 1) > MAXPATHLEN) return AFPERR_PARAM; strcpy(path, pwd->pw_dir ); strcat(path, "/" ); strcat(path, file + 2); if (!uid) seteuid(pwd->pw_uid); /* change ourselves to the user */ i = home_passwd(pwd, path, i, passwd, len, set); if (!uid) seteuid(0); /* change ourselves back to root */ return i; } if (i > MAXPATHLEN) return AFPERR_PARAM; /* handle afppasswd file. we need to make sure that we're root * when we do this. */ if (uid) seteuid(0); i = afppasswd(pwd, file, i, passwd, len, set); if (uid) seteuid(uid); return i; } /* randnum sends an 8-byte number and uses the user's password to * check against the encrypted reply. */ static int rand_login(void *obj, char *username, int ulen, struct passwd **uam_pwd _U_, char *ibuf _U_, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { char *passwdfile; u_int16_t sessid; size_t len; int err; if (( randpwd = uam_getname(obj, username, ulen)) == NULL ) return AFPERR_NOTAUTH; /* unknown user */ LOG(log_info, logtype_uams, "randnum/rand2num login: %s", username); if (uam_checkuser(randpwd) < 0) return AFPERR_NOTAUTH; len = UAM_PASSWD_FILENAME; if (uam_afpserver_option(obj, UAM_OPTION_PASSWDOPT, (void *) &passwdfile, &len) < 0) return AFPERR_PARAM; if ((err = randpass(randpwd, passwdfile, seskey, sizeof(seskey), 0)) != AFP_OK) return err; /* get a random number */ len = sizeof(randbuf); if (uam_afpserver_option(obj, UAM_OPTION_RANDNUM, (void *) randbuf, &len) < 0) return AFPERR_PARAM; /* session id is a hashed version of the obj pointer */ sessid = randhash(obj); memcpy(rbuf, &sessid, sizeof(sessid)); rbuf += sizeof(sessid); *rbuflen = sizeof(sessid); /* send the random number off */ memcpy(rbuf, randbuf, sizeof(randbuf)); *rbuflen += sizeof(randbuf); return AFPERR_AUTHCONT; } /* check encrypted reply. we actually setup the encryption stuff * here as the first part of randnum and rand2num are identical. */ static int randnum_logincont(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { u_int16_t sessid; *rbuflen = 0; memcpy(&sessid, ibuf, sizeof(sessid)); if (sessid != randhash(obj)) return AFPERR_PARAM; ibuf += sizeof(sessid); /* encrypt. this saves a little space by using the fact that * des can encrypt in-place without side-effects. */ key_sched((C_Block *) seskey, seskeysched); memset(seskey, 0, sizeof(seskey)); ecb_encrypt((C_Block *) randbuf, (C_Block *) randbuf, seskeysched, DES_ENCRYPT); memset(&seskeysched, 0, sizeof(seskeysched)); /* test against what the client sent */ if (memcmp( randbuf, ibuf, sizeof(randbuf) )) { /* != */ memset(randbuf, 0, sizeof(randbuf)); return AFPERR_NOTAUTH; } memset(randbuf, 0, sizeof(randbuf)); *uam_pwd = randpwd; return AFP_OK; } /* differences from randnum: * 1) each byte of the key is shifted left one bit * 2) client sends the server a 64-bit number. the server encrypts it * and sends it back as part of the reply. */ static int rand2num_logincont(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { u_int16_t sessid; unsigned int i; *rbuflen = 0; /* compare session id */ memcpy(&sessid, ibuf, sizeof(sessid)); if (sessid != randhash(obj)) return AFPERR_PARAM; ibuf += sizeof(sessid); /* shift key elements left one bit */ for (i = 0; i < sizeof(seskey); i++) seskey[i] <<= 1; /* encrypt randbuf */ key_sched((C_Block *) seskey, seskeysched); memset(seskey, 0, sizeof(seskey)); ecb_encrypt( (C_Block *) randbuf, (C_Block *) randbuf, seskeysched, DES_ENCRYPT); /* test against client's reply */ if (memcmp(randbuf, ibuf, sizeof(randbuf))) { /* != */ memset(randbuf, 0, sizeof(randbuf)); memset(&seskeysched, 0, sizeof(seskeysched)); return AFPERR_NOTAUTH; } ibuf += sizeof(randbuf); memset(randbuf, 0, sizeof(randbuf)); /* encrypt client's challenge and send back */ ecb_encrypt( (C_Block *) ibuf, (C_Block *) rbuf, seskeysched, DES_ENCRYPT); memset(&seskeysched, 0, sizeof(seskeysched)); *rbuflen = sizeof(randbuf); *uam_pwd = randpwd; return AFP_OK; } /* change password -- * NOTE: an FPLogin must already have completed successfully for this * to work. */ static int randnum_changepw(void *obj, const char *username _U_, struct passwd *pwd, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen _U_) { char *passwdfile; int err; size_t len; if (uam_checkuser(pwd) < 0) return AFPERR_ACCESS; len = UAM_PASSWD_FILENAME; if (uam_afpserver_option(obj, UAM_OPTION_PASSWDOPT, (void *) &passwdfile, &len) < 0) return AFPERR_PARAM; /* old password is encrypted with new password and new password is * encrypted with old. */ if ((err = randpass(pwd, passwdfile, seskey, sizeof(seskey), 0)) != AFP_OK) return err; /* use old passwd to decrypt new passwd */ key_sched((C_Block *) seskey, seskeysched); ibuf += PASSWDLEN; /* new passwd */ ibuf[PASSWDLEN] = '\0'; ecb_encrypt( (C_Block *) ibuf, (C_Block *) ibuf, seskeysched, DES_DECRYPT); /* now use new passwd to decrypt old passwd */ key_sched((C_Block *) ibuf, seskeysched); ibuf -= PASSWDLEN; /* old passwd */ ecb_encrypt((C_Block *) ibuf, (C_Block *) ibuf, seskeysched, DES_DECRYPT); if (memcmp(seskey, ibuf, sizeof(seskey))) err = AFPERR_NOTAUTH; else if (memcmp(seskey, ibuf + PASSWDLEN, sizeof(seskey)) == 0) err = AFPERR_PWDSAME; #ifdef USE_CRACKLIB else if (FascistCheck(ibuf + PASSWDLEN, _PATH_CRACKLIB)) err = AFPERR_PWDPOLCY; #endif /* USE_CRACKLIB */ if (!err) err = randpass(pwd, passwdfile, (unsigned char *)ibuf + PASSWDLEN, sizeof(seskey), 1); /* zero out some fields */ memset(&seskeysched, 0, sizeof(seskeysched)); memset(seskey, 0, sizeof(seskey)); memset(ibuf, 0, sizeof(seskey)); /* old passwd */ memset(ibuf + PASSWDLEN, 0, sizeof(seskey)); /* new passwd */ if (err) return err; return( AFP_OK ); } /* randnum login */ static int randnum_login(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { char *username; size_t len, ulen; *rbuflen = 0; if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) return AFPERR_MISC; if (ibuflen < 2) { return( AFPERR_PARAM ); } len = (unsigned char) *ibuf++; ibuflen--; if (!len || len > ibuflen || len > ulen ) { return( AFPERR_PARAM ); } memcpy(username, ibuf, len ); ibuf += len; ibuflen -=len; username[ len ] = '\0'; if ((unsigned long) ibuf & 1) { /* pad character */ ++ibuf; ibuflen--; } return (rand_login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen)); } /* randnum login ext */ static int randnum_login_ext(void *obj, char *uname, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { char *username; size_t len, ulen; u_int16_t temp16; *rbuflen = 0; if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &ulen) < 0) return AFPERR_MISC; if (*uname != 3) return AFPERR_PARAM; uname++; memcpy(&temp16, uname, sizeof(temp16)); len = ntohs(temp16); if (!len || len > ulen ) { return( AFPERR_PARAM ); } memcpy(username, uname +2, len ); username[ len ] = '\0'; return (rand_login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen)); } static int uam_setup(const char *path) { if (uam_register(UAM_SERVER_LOGIN_EXT, path, "Randnum exchange", randnum_login, randnum_logincont, NULL, randnum_login_ext) < 0) return -1; if (uam_register(UAM_SERVER_LOGIN_EXT, path, "2-Way Randnum exchange", randnum_login, rand2num_logincont, NULL, randnum_login_ext) < 0) { uam_unregister(UAM_SERVER_LOGIN, "Randnum exchange"); return -1; } if (uam_register(UAM_SERVER_CHANGEPW, path, "Randnum Exchange", randnum_changepw) < 0) { uam_unregister(UAM_SERVER_LOGIN, "Randnum exchange"); uam_unregister(UAM_SERVER_LOGIN, "2-Way Randnum exchange"); return -1; } /*uam_register(UAM_SERVER_PRINTAUTH, path, "Randnum Exchange", pam_printer);*/ return 0; } static void uam_cleanup(void) { uam_unregister(UAM_SERVER_LOGIN, "Randnum exchange"); uam_unregister(UAM_SERVER_LOGIN, "2-Way Randnum exchange"); uam_unregister(UAM_SERVER_CHANGEPW, "Randnum Exchange"); /*uam_unregister(UAM_SERVER_PRINTAUTH, "Randnum Exchange");*/ } UAM_MODULE_EXPORT struct uam_export uams_randnum = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; netatalk-2.2.2/etc/uams/uams_gss.c0000644000175200017500000005147411655731126013772 00000000000000/* * $Id: uams_gss.c,v 1.12 2010-03-30 10:25:49 franklahm Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) * Copyright (c) 2003 The Reed Institute * Copyright (c) 2004 Bjoern Fernhomberg * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ /* STDC check */ #if STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #include #include #include #include #include /* Kerberos includes */ #if HAVE_GSSAPI_H #include #endif #if HAVE_GSSAPI_GSSAPI_H #include #endif #if HAVE_GSSAPI_GSSAPI_GENERIC_H #include #endif #if HAVE_GSSAPI_GSSAPI_KRB5_H #include #endif #if HAVE_COM_ERR_H #include #endif /* We work around something I don't entirely understand... */ /* BF: This is a Heimdal/MIT compatibility fix */ #ifndef HAVE_GSS_C_NT_HOSTBASED_SERVICE #define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name #endif #ifdef MIN #undef MIN #endif #define MIN(a, b) ((a > b) ? b : a) static void log_status( char *s, OM_uint32 major_status, OM_uint32 minor_status ) { gss_buffer_desc msg = GSS_C_EMPTY_BUFFER; OM_uint32 min_status, maj_status; OM_uint32 maj_ctx = 0, min_ctx = 0; while (1) { maj_status = gss_display_status( &min_status, major_status, GSS_C_GSS_CODE, GSS_C_NULL_OID, &maj_ctx, &msg ); LOG(log_info, logtype_uams, "uams_gss.c :do_gss_auth: %s %.*s (error %s)", s, (int)msg.length, msg.value, strerror(errno)); gss_release_buffer(&min_status, &msg); if (!maj_ctx) break; } while (1) { maj_status = gss_display_status( &min_status, minor_status, GSS_C_MECH_CODE, GSS_C_NULL_OID, // gss_mech_krb5, &min_ctx, &msg ); LOG(log_info, logtype_uams, "uams_gss.c :do_gss_auth: %s %.*s (error %s)", s, (int)msg.length, msg.value, strerror(errno)); gss_release_buffer(&min_status, &msg); if (!min_ctx) break; } } static void log_ctx_flags( OM_uint32 flags ) { #ifdef DEBUG1 if (flags & GSS_C_DELEG_FLAG) LOG(log_debug, logtype_uams, "uams_gss.c :context flag: GSS_C_DELEG_FLAG" ); if (flags & GSS_C_MUTUAL_FLAG) LOG(log_debug, logtype_uams, "uams_gss.c :context flag: GSS_C_MUTUAL_FLAG" ); if (flags & GSS_C_REPLAY_FLAG) LOG(log_debug, logtype_uams, "uams_gss.c :context flag: GSS_C_REPLAY_FLAG" ); if (flags & GSS_C_SEQUENCE_FLAG) LOG(log_debug, logtype_uams, "uams_gss.c :context flag: GSS_C_SEQUENCE_FLAG" ); if (flags & GSS_C_CONF_FLAG) LOG(log_debug, logtype_uams, "uams_gss.c :context flag: GSS_C_CONF_FLAG" ); if (flags & GSS_C_INTEG_FLAG) LOG(log_debug, logtype_uams, "uams_gss.c :context flag: GSS_C_INTEG_FLAG" ); #endif } static void log_principal(gss_name_t server_name) { #if 0 /* FIXME: must call gss_canonicalize_name before gss_export_name */ OM_uint32 major_status = 0, minor_status = 0; gss_buffer_desc exported_name; /* Only for debugging purposes, check the gssapi internal representation */ major_status = gss_export_name(&minor_status, server_name, &exported_name); LOG(log_debug, logtype_uams, "log_principal: exported server name is %s", (char*) exported_name.value); gss_release_buffer( &minor_status, &exported_name ); #endif } /* get the principal from afpd and import it into server_name */ static int get_afpd_principal(void *obj, gss_name_t *server_name) { OM_uint32 major_status = 0, minor_status = 0; char *fqdn, *service, *principal, *p; size_t fqdnlen=0, servicelen=0; size_t principal_length; gss_buffer_desc s_princ_buffer; /* get all the required information from afpd */ if (uam_afpserver_option(obj, UAM_OPTION_FQDN, (void*) &fqdn, &fqdnlen) < 0) return 1; LOG(log_debug, logtype_uams, "get_afpd_principal: fqdn: %s", fqdn); if (uam_afpserver_option(obj, UAM_OPTION_KRB5SERVICE, (void *)&service, &servicelen) < 0) return 1; LOG(log_debug, logtype_uams, "get_afpd_principal: service: %s", service); /* we need all the info, log error and return if one's missing */ if (!service || !servicelen || !fqdn || !fqdnlen) { LOG(log_error, logtype_uams, "get_afpd_principal: could not retrieve required information from afpd."); return 1; } /* allocate memory to hold the temporary principal string */ principal_length = servicelen + 1 + fqdnlen + 1; if ( NULL == (principal = (char*) malloc( principal_length)) ) { LOG(log_error, logtype_uams, "get_afpd_principal: out of memory allocating %u bytes", principal_length); return 1; } /* * Build the principal string. * Format: 'service@fqdn' */ strlcpy( principal, service, principal_length); strlcat( principal, "@", principal_length); /* * The fqdn we get from afpd may contain a port. * We need to strip the port from fqdn for principal. */ if ((p = strchr(fqdn, ':'))) *p = '\0'; strlcat( principal, fqdn, principal_length); if (p) *p = ':'; /* * Import our principal into the gssapi internal representation * stored in server_name. */ s_princ_buffer.value = principal; s_princ_buffer.length = strlen( principal ) + 1; LOG(log_debug, logtype_uams, "get_afpd_principal: importing principal `%s'", principal); major_status = gss_import_name( &minor_status, &s_princ_buffer, GSS_C_NT_HOSTBASED_SERVICE, server_name ); /* * Get rid of malloc'ed memmory. * Don't release the s_princ_buffer, we free principal instead. */ free(principal); if (major_status != GSS_S_COMPLETE) { /* Importing our service principal failed, bail out. */ log_status( "import_principal", major_status, minor_status ); return 1; } return 0; } /* get the username */ static int get_client_username(char *username, int ulen, gss_name_t *client_name) { OM_uint32 major_status = 0, minor_status = 0; gss_buffer_desc client_name_buffer; char *p; int namelen, ret=0; /* * To extract the unix username, use gss_display_name on client_name. * We do rely on gss_display_name returning a zero terminated string. * The username returned contains the realm and possibly an instance. * We only want the username for afpd, so we have to strip those from * the username before copying it to afpd's buffer. */ major_status = gss_display_name( &minor_status, *client_name, &client_name_buffer, (gss_OID *)NULL ); if (major_status != GSS_S_COMPLETE) { log_status( "display_name", major_status, minor_status ); return 1; } LOG(log_debug, logtype_uams, "get_client_username: user is `%s'", client_name_buffer.value); /* chop off realm */ p = strchr( client_name_buffer.value, '@' ); if (p) *p = 0; /* FIXME: chop off instance? */ p = strchr( client_name_buffer.value, '/' ); if (p) *p = 0; /* check if this username fits into afpd's username buffer */ namelen = strlen(client_name_buffer.value); if ( namelen >= ulen ) { /* The username is too long for afpd's buffer, bail out */ LOG(log_error, logtype_uams, "get_client_username: username `%s' too long", client_name_buffer.value); ret = 1; } else { /* copy stripped username to afpd's buffer */ strlcpy(username, client_name_buffer.value, ulen); } /* we're done with client_name_buffer, release it */ gss_release_buffer(&minor_status, &client_name_buffer ); return ret; } /* wrap afpd's sessionkey */ static int wrap_sessionkey(gss_ctx_id_t context, struct session_info *sinfo) { OM_uint32 status = 0; int ret=0; gss_buffer_desc sesskey_buff, wrap_buff; /* * gss_wrap afpd's session_key. * This is needed fo OS X 10.3 clients. They request this information * with type 8 (kGetKerberosSessionKey) on FPGetSession. * See AFP 3.1 specs, page 77. */ sesskey_buff.value = sinfo->sessionkey; sesskey_buff.length = sinfo->sessionkey_len; /* gss_wrap the session key with the default machanism. Require both confidentiality and integrity services */ gss_wrap (&status, context, 1, GSS_C_QOP_DEFAULT, &sesskey_buff, NULL, &wrap_buff); if ( status != GSS_S_COMPLETE) { LOG(log_error, logtype_uams, "wrap_sessionkey: failed to gss_wrap sessionkey"); log_status( "GSS wrap", 0, status ); return 1; } /* store the wrapped session key in afpd's session_info struct */ if ( NULL == (sinfo->cryptedkey = malloc ( wrap_buff.length )) ) { LOG(log_error, logtype_uams, "wrap_sessionkey: out of memory tyring to allocate %u bytes", wrap_buff.length); ret = 1; } else { /* cryptedkey is binary data */ memcpy (sinfo->cryptedkey, wrap_buff.value, wrap_buff.length); sinfo->cryptedkey_len = wrap_buff.length; } /* we're done with buffer, release */ gss_release_buffer( &status, &wrap_buff ); return ret; } /*-------------*/ static int acquire_credentials (gss_name_t *server_name, gss_cred_id_t *server_creds) { OM_uint32 major_status = 0, minor_status = 0; char *envp; if ((envp = getenv("KRB5_KTNAME"))) LOG(log_debug, logtype_uams, "acquire credentials: acquiring credentials (uid = %d, keytab = %s)", (int)geteuid(), envp); else LOG(log_debug, logtype_uams, "acquire credentials: acquiring credentials (uid = %d) - $KRB5_KTNAME not found in env", (int)geteuid()); /* * Acquire credentials usable for accepting context negotiations. * Credentials are for server_name, have an indefinite lifetime, * have no specific mechanisms, are to be used for accepting context * negotiations and are to be placed in server_creds. * We don't care about the mechanisms or about the time for which they are valid. */ major_status = gss_acquire_cred( &minor_status, *server_name, GSS_C_INDEFINITE, GSS_C_NO_OID_SET, GSS_C_ACCEPT, server_creds, NULL, NULL ); if (major_status != GSS_S_COMPLETE) { log_status( "acquire_cred", major_status, minor_status ); return 1; } return 0; } /*-------------*/ static int accept_sec_context (gss_ctx_id_t *context, gss_cred_id_t server_creds, gss_buffer_desc *ticket_buffer, gss_name_t *client_name, gss_buffer_desc *authenticator_buff) { OM_uint32 major_status = 0, minor_status = 0, ret_flags; /* Initialize autheticator buffer. */ authenticator_buff->length = 0; authenticator_buff->value = NULL; LOG(log_debug, logtype_uams, "accept_context: accepting context (ticketlen: %u)", ticket_buffer->length); /* * Try to accept the secondary context using the tocken in ticket_buffer. * We don't care about the mechanisms used, nor for the time. * We don't act as a proxy either. */ major_status = gss_accept_sec_context( &minor_status, context, server_creds, ticket_buffer, GSS_C_NO_CHANNEL_BINDINGS, client_name, NULL, authenticator_buff, &ret_flags, NULL, NULL ); if (major_status != GSS_S_COMPLETE) { log_status( "accept_sec_context", major_status, minor_status ); return 1; } log_ctx_flags( ret_flags ); return 0; } /* return 0 on success */ static int do_gss_auth(void *obj, char *ibuf, int ticket_len, char *rbuf, int *rbuflen, char *username, int ulen, struct session_info *sinfo ) { OM_uint32 status = 0; gss_name_t server_name, client_name; gss_cred_id_t server_creds; gss_ctx_id_t context_handle = GSS_C_NO_CONTEXT; gss_buffer_desc ticket_buffer, authenticator_buff; int ret = 0; /* import our principal name from afpd */ if (get_afpd_principal(obj, &server_name) != 0) { return 1; } log_principal(server_name); /* Now we have to acquire our credentials */ if ((ret = acquire_credentials (&server_name, &server_creds))) goto cleanup_vars; /* * Try to accept the secondary context, using the ticket/token the * client sent us. Ticket is stored at current ibuf position. * Don't try to release ticket_buffer later, it points into ibuf! */ ticket_buffer.length = ticket_len; ticket_buffer.value = ibuf; ret = accept_sec_context (&context_handle, server_creds, &ticket_buffer, &client_name, &authenticator_buff); if (!ret) { /* We succesfully acquired the secondary context, now get the username for afpd and gss_wrap the sessionkey */ if ( 0 == (ret = get_client_username(username, ulen, &client_name)) ) { ret = wrap_sessionkey(context_handle, sinfo); } if (!ret) { /* FIXME: Is copying the authenticator really necessary? Where is this documented? */ u_int16_t auth_len = htons( authenticator_buff.length ); /* copy the authenticator length into the reply buffer */ memcpy( rbuf, &auth_len, sizeof(auth_len) ); *rbuflen += sizeof(auth_len); rbuf += sizeof(auth_len); /* copy the authenticator value into the reply buffer */ memcpy( rbuf, authenticator_buff.value, authenticator_buff.length ); *rbuflen += authenticator_buff.length; } /* Clean up after ourselves */ gss_release_name( &status, &client_name ); if ( authenticator_buff.value) gss_release_buffer( &status, &authenticator_buff ); gss_delete_sec_context( &status, &context_handle, NULL ); } gss_release_cred( &status, &server_creds ); cleanup_vars: gss_release_name( &status, &server_name ); return ret; } /* -------------------------- */ static int gss_login(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { u_int16_t temp16; *rbuflen = 0; /* The reply contains a two-byte ID value - note * that Apple's implementation seems to always return 1 as well */ temp16 = htons( 1 ); memcpy(rbuf, &temp16, sizeof(temp16)); *rbuflen += sizeof(temp16); return AFPERR_AUTHCONT; } static int gss_logincont(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { struct passwd *pwd = NULL; u_int16_t login_id; char *username; u_int16_t ticket_len; char *p; int rblen; size_t userlen; struct session_info *sinfo; /* Apple's AFP 3.1 documentation specifies that this command * takes the following format: * pad (byte) * id returned in LoginExt response (u_int16_t) * username (format unspecified) padded, when necessary, to end on an even boundary * ticket length (u_int16_t) * ticket */ /* Observation of AFP clients in the wild indicate that the actual * format of this request is as follows: * pad (byte) [consumed before login_ext is called] * ?? (byte) - always observed to be 0 * id returned in LoginExt response (u_int16_t) * username, encoding unspecified, null terminated C string, * padded when the terminating null is an even numbered byte. * The packet is formated such that the username begins on an * odd numbered byte. Eg if the username is 3 characters and the * terminating null makes 4, expect to pad the the result. * The encoding of this string is unknown. * ticket length (u_int16_t) * ticket */ rblen = *rbuflen = 0; if (ibuflen < 1 +sizeof(login_id)) { LOG(log_info, logtype_uams, "uams_gss.c :LoginCont: received incomplete packet"); return AFPERR_PARAM; } ibuf++, ibuflen--; /* ?? */ /* 2 byte ID from LoginExt -- always '00 01' in this implementation */ memcpy( &login_id, ibuf, sizeof(login_id) ); ibuf += sizeof(login_id), ibuflen -= sizeof(login_id); login_id = ntohs( login_id ); /* get the username buffer from apfd */ if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &username, &userlen) < 0) return AFPERR_MISC; /* get the session_info structure from afpd. We need the session key */ if (uam_afpserver_option(obj, UAM_OPTION_SESSIONINFO, (void *)&sinfo, NULL) < 0) return AFPERR_MISC; if (sinfo->sessionkey == NULL || sinfo->sessionkey_len == 0) { /* Should never happen. Most likely way too old afpd version */ LOG(log_info, logtype_uams, "internal error: afpd's sessionkey not set"); return AFPERR_MISC; } /* We skip past the 'username' parameter because all that matters is the ticket */ p = ibuf; while( *ibuf && ibuflen ) { ibuf++, ibuflen--; } if (ibuflen < 4) { LOG(log_info, logtype_uams, "uams_gss.c :LoginCont: user is %s, no ticket", p); return AFPERR_PARAM; } ibuf++, ibuflen--; /* null termination */ if ((ibuf - p + 1) % 2) ibuf++, ibuflen--; /* deal with potential padding */ LOG(log_debug, logtype_uams, "uams_gss.c :LoginCont: client thinks user is %s", p); /* get the length of the ticket the client sends us */ memcpy(&ticket_len, ibuf, sizeof(ticket_len)); ibuf += sizeof(ticket_len); ibuflen -= sizeof(ticket_len); ticket_len = ntohs( ticket_len ); /* a little bounds checking */ if (ticket_len > ibuflen) { LOG(log_info, logtype_uams, "uams_gss.c :LoginCont: invalid ticket length (%u > %u)", ticket_len, ibuflen); return AFPERR_PARAM; } /* now try to authenticate */ if (!do_gss_auth(obj, ibuf, ticket_len, rbuf, &rblen, username, userlen, sinfo)) { /* We use the username we got back from the gssapi client_name. Should we compare this to the username the client sent in the clear? We know the character encoding of the cleartext username (UTF8), what encoding is the gssapi name in? */ if((pwd = uam_getname( obj, username, userlen )) == NULL) { LOG(log_info, logtype_uams, "uam_getname() failed for %s", username); return AFPERR_NOTAUTH; } if (uam_checkuser(pwd) < 0) { LOG(log_info, logtype_uams, "%s not a valid user", username); return AFPERR_NOTAUTH; } *rbuflen = rblen; *uam_pwd = pwd; return AFP_OK; } else { LOG(log_info, logtype_uams, "do_gss_auth failed" ); *rbuflen = 0; return AFPERR_MISC; } } /* * For the krb5 uam, this function only needs to return a two-byte * login-session id. None of the data provided by the client up to this * point is trustworthy as we'll have a signed ticket to parse in logincont. */ static int gss_login_ext(void *obj, char *uname, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { u_int16_t temp16; *rbuflen = 0; /* The reply contains a two-byte ID value - note * that Apple's implementation seems to always return 1 as well */ temp16 = htons( 1 ); memcpy(rbuf, &temp16, sizeof(temp16)); *rbuflen += sizeof(temp16); return AFPERR_AUTHCONT; } /* logout */ static void gss_logout() { } int uam_setup(const char *path) { if (uam_register(UAM_SERVER_LOGIN_EXT, path, "Client Krb v2", gss_login, gss_logincont, gss_logout, gss_login_ext) < 0) if (uam_register(UAM_SERVER_LOGIN, path, "Client Krb v2", gss_login, gss_logincont, gss_logout) < 0) return -1; return 0; } static void uam_cleanup(void) { uam_unregister(UAM_SERVER_LOGIN_EXT, "Client Krb v2"); } UAM_MODULE_EXPORT struct uam_export uams_gss = { UAM_MODULE_SERVER, UAM_MODULE_VERSION, uam_setup, uam_cleanup }; netatalk-2.2.2/etc/cnid_dbd/0000777000175200017500000000000011704770427012641 500000000000000netatalk-2.2.2/etc/cnid_dbd/Makefile.am0000644000175200017500000000175411655731126014616 00000000000000# Makefile.am for etc/cnid_dbd/ if BUILD_DBD_DAEMON sbin_PROGRAMS = cnid_dbd cnid_metad bin_PROGRAMS = dbd else sbin_PROGRAMS = endif cnid_dbd_SOURCES = dbif.c pack.c comm.c db_param.c main.c \ dbd_add.c dbd_get.c dbd_resolve.c dbd_lookup.c \ dbd_update.c dbd_delete.c dbd_getstamp.c \ dbd_rebuild_add.c dbd_dbcheck.c dbd_search.c cnid_dbd_LDADD = $(top_builddir)/libatalk/libatalk.la @BDB_LIBS@ @ACL_LIBS@ cnid_metad_SOURCES = cnid_metad.c usockfd.c db_param.c cnid_metad_LDADD = $(top_builddir)/libatalk/libatalk.la @ACL_LIBS@ dbd_SOURCES = cmd_dbd.c \ cmd_dbd_scanvol.c \ dbif.c pack.c \ dbd_add.c \ dbd_delete.c \ dbd_getstamp.c \ dbd_lookup.c \ dbd_rebuild_add.c \ dbd_resolve.c \ dbd_update.c dbd_LDADD = $(top_builddir)/libatalk/libatalk.la @BDB_LIBS@ @ACL_LIBS@ noinst_HEADERS = dbif.h pack.h db_param.h dbd.h usockfd.h comm.h cmd_dbd.h EXTRA_DIST = README AM_CFLAGS = @BDB_CFLAGS@ -D_PATH_CNID_DBD=\"$(sbindir)/cnid_dbd\" netatalk-2.2.2/etc/cnid_dbd/usockfd.h0000644000175200017500000000177111655731126014370 00000000000000/* * $Id: usockfd.h,v 1.5 2009-11-05 14:38:07 franklahm Exp $ * * Copyright (C) Joerg Lenneis 2003 * All Rights Reserved. See COPYING. */ #ifndef CNID_DBD_USOCKFD_H #define CNID_DBD_USOCKFD_H 1 #include extern int usockfd_create (char *, mode_t, int); extern int tsockfd_create (char *, char *, int); extern int usockfd_check (int, const sigset_t *); #ifndef OSSH_ALIGNBYTES #define OSSH_ALIGNBYTES (sizeof(int) - 1) #endif #ifndef __CMSG_ALIGN #ifndef u_int #define u_int unsigned int #endif #define __CMSG_ALIGN(p) (((u_int)(p) + OSSH_ALIGNBYTES) &~ OSSH_ALIGNBYTES) #endif /* Length of the contents of a control message of length len */ #ifndef CMSG_LEN #define CMSG_LEN(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + (len)) #endif /* Length of the space taken up by a padded control message of length len */ #ifndef CMSG_SPACE #define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len)) #endif #endif /* CNID_DBD_USOCKFD_H */ netatalk-2.2.2/etc/cnid_dbd/Makefile.in0000644000175200017500000005242711703521725014626 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for etc/cnid_dbd/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @BUILD_DBD_DAEMON_TRUE@sbin_PROGRAMS = cnid_dbd$(EXEEXT) \ @BUILD_DBD_DAEMON_TRUE@ cnid_metad$(EXEEXT) @BUILD_DBD_DAEMON_TRUE@bin_PROGRAMS = dbd$(EXEEXT) subdir = etc/cnid_dbd DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) am_cnid_dbd_OBJECTS = dbif.$(OBJEXT) pack.$(OBJEXT) comm.$(OBJEXT) \ db_param.$(OBJEXT) main.$(OBJEXT) dbd_add.$(OBJEXT) \ dbd_get.$(OBJEXT) dbd_resolve.$(OBJEXT) dbd_lookup.$(OBJEXT) \ dbd_update.$(OBJEXT) dbd_delete.$(OBJEXT) \ dbd_getstamp.$(OBJEXT) dbd_rebuild_add.$(OBJEXT) \ dbd_dbcheck.$(OBJEXT) dbd_search.$(OBJEXT) cnid_dbd_OBJECTS = $(am_cnid_dbd_OBJECTS) cnid_dbd_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la am_cnid_metad_OBJECTS = cnid_metad.$(OBJEXT) usockfd.$(OBJEXT) \ db_param.$(OBJEXT) cnid_metad_OBJECTS = $(am_cnid_metad_OBJECTS) cnid_metad_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la am_dbd_OBJECTS = cmd_dbd.$(OBJEXT) cmd_dbd_scanvol.$(OBJEXT) \ dbif.$(OBJEXT) pack.$(OBJEXT) dbd_add.$(OBJEXT) \ dbd_delete.$(OBJEXT) dbd_getstamp.$(OBJEXT) \ dbd_lookup.$(OBJEXT) dbd_rebuild_add.$(OBJEXT) \ dbd_resolve.$(OBJEXT) dbd_update.$(OBJEXT) dbd_OBJECTS = $(am_dbd_OBJECTS) dbd_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(cnid_dbd_SOURCES) $(cnid_metad_SOURCES) $(dbd_SOURCES) DIST_SOURCES = $(cnid_dbd_SOURCES) $(cnid_metad_SOURCES) \ $(dbd_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ cnid_dbd_SOURCES = dbif.c pack.c comm.c db_param.c main.c \ dbd_add.c dbd_get.c dbd_resolve.c dbd_lookup.c \ dbd_update.c dbd_delete.c dbd_getstamp.c \ dbd_rebuild_add.c dbd_dbcheck.c dbd_search.c cnid_dbd_LDADD = $(top_builddir)/libatalk/libatalk.la @BDB_LIBS@ @ACL_LIBS@ cnid_metad_SOURCES = cnid_metad.c usockfd.c db_param.c cnid_metad_LDADD = $(top_builddir)/libatalk/libatalk.la @ACL_LIBS@ dbd_SOURCES = cmd_dbd.c \ cmd_dbd_scanvol.c \ dbif.c pack.c \ dbd_add.c \ dbd_delete.c \ dbd_getstamp.c \ dbd_lookup.c \ dbd_rebuild_add.c \ dbd_resolve.c \ dbd_update.c dbd_LDADD = $(top_builddir)/libatalk/libatalk.la @BDB_LIBS@ @ACL_LIBS@ noinst_HEADERS = dbif.h pack.h db_param.h dbd.h usockfd.h comm.h cmd_dbd.h EXTRA_DIST = README AM_CFLAGS = @BDB_CFLAGS@ -D_PATH_CNID_DBD=\"$(sbindir)/cnid_dbd\" all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign etc/cnid_dbd/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign etc/cnid_dbd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done cnid_dbd$(EXEEXT): $(cnid_dbd_OBJECTS) $(cnid_dbd_DEPENDENCIES) @rm -f cnid_dbd$(EXEEXT) $(LINK) $(cnid_dbd_OBJECTS) $(cnid_dbd_LDADD) $(LIBS) cnid_metad$(EXEEXT): $(cnid_metad_OBJECTS) $(cnid_metad_DEPENDENCIES) @rm -f cnid_metad$(EXEEXT) $(LINK) $(cnid_metad_OBJECTS) $(cnid_metad_LDADD) $(LIBS) dbd$(EXEEXT): $(dbd_OBJECTS) $(dbd_DEPENDENCIES) @rm -f dbd$(EXEEXT) $(LINK) $(dbd_OBJECTS) $(dbd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmd_dbd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmd_dbd_scanvol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnid_metad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/db_param.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbd_add.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbd_dbcheck.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbd_delete.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbd_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbd_getstamp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbd_lookup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbd_rebuild_add.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbd_resolve.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbd_search.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbd_update.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbif.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usockfd.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-sbinPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-sbinPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-sbinPROGRAMS install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-sbinPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/etc/cnid_dbd/db_param.h0000644000175200017500000000174511655731244014501 00000000000000/* * Copyright (C) Joerg Lenneis 2003 * Copyright (C) Frank Lahm 2010 * All Rights Reserved. See COPYING. */ #ifndef CNID_DBD_DB_PARAM_H #define CNID_DBD_DB_PARAM_H 1 #include #include #define DEFAULT_LOGFILE_AUTOREMOVE 1 #define DEFAULT_CACHESIZE (8 * 1024) /* KB, so 8 MB */ #define DEFAULT_MAXLOCKS 20000 #define DEFAULT_MAXLOCKOBJS 20000 #define DEFAULT_FLUSH_FREQUENCY 1000 #define DEFAULT_FLUSH_INTERVAL 1800 #define DEFAULT_USOCK_FILE "usock" #define DEFAULT_FD_TABLE_SIZE 512 #define DEFAULT_IDLE_TIMEOUT (10 * 60) struct db_param { char *dir; int logfile_autoremove; int cachesize; /* in KB */ int maxlocks; int maxlockobjs; int flush_interval; int flush_frequency; char usock_file[MAXPATHLEN + 1]; int fd_table_size; int idle_timeout; int max_vols; }; extern struct db_param *db_param_read (char *); #endif /* CNID_DBD_DB_PARAM_H */ netatalk-2.2.2/etc/cnid_dbd/dbd_getstamp.c0000644000175200017500000000254311655731126015360 00000000000000 /* * $Id: dbd_getstamp.c,v 1.4 2009-05-06 11:54:24 franklahm Exp $ * * Copyright (C) Joerg Lenneis 2003 * All Rights Reserved. See COPYING. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include "dbif.h" #include "dbd.h" #include "pack.h" /* Return the unique stamp associated with this database */ int dbd_getstamp(DBD *dbd, struct cnid_dbd_rqst *rqst _U_, struct cnid_dbd_rply *rply) { DBT key, data; int rc; memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); rply->namelen = 0; key.data = ROOTINFO_KEY; key.size = ROOTINFO_KEYLEN; if ((rc = dbif_get(dbd, DBIF_CNID, &key, &data, 0)) < 0) { LOG(log_error, logtype_cnid, "dbd_getstamp: Error getting rootinfo record"); rply->result = CNID_DBD_RES_ERR_DB; return -1; } if (rc == 0) { LOG(log_error, logtype_cnid, "dbd_getstamp: No rootinfo record found"); rply->result = CNID_DBD_RES_NOTFOUND; return 1; } rply->namelen = CNID_DEV_LEN; rply->name = (char *)data.data + CNID_DEV_OFS; LOG(log_debug, logtype_cnid, "cnid_getstamp: Returning stamp '%08x'", *(uint32_t *)rply->name); rply->result = CNID_DBD_RES_OK; return 1; } netatalk-2.2.2/etc/cnid_dbd/dbif.h0000644000175200017500000000717011655731126013635 00000000000000/* Copyright (C) Joerg Lenneis 2003 Copyright (C) Frank Lahm 2009 All Rights Reserved. See COPYING. API usage ========= Initialisation -------------- 1. Provide storage for a DBD * handle DBD *dbd; 2. Call dbif_init with a filename to receive a DBD handle: dbd = dbif_init("cnid2.db"); Pass NULL to create an in-memory db. Note: the DBD type is NOT from BerkeleyDB ! We've defined it. 3. Call dbif_env_open to open an dbd environment if you called dbif_init with a filename. Pass a db_param here for on-disk databases. 4. Call dbif_open to finally open the CNID database itself. Pass db_param here for in-memory database. Querying the CNID database -------------------------- Call dbif_[get|pget|put|del]. They map to the corresponding BerkeleyDB calls with the same names. Transactions ------------ We use AUTO_COMMIT for the BDB database accesses. This avoids explicit transactions for every bdb access which speeds up reads. But in order to be able to rollback in case of errors we start a transaction once we encounter the first write from dbif_put or dbif_del. Thus you shouldn't call dbif_txn_[begin|abort|commit], they're used internally. Checkpoiting ------------ Call dbif_txn_checkpoint. Closing ------- Call dbif_close. Silent Upgrade Support ---------------------- On cnid_dbd shutdown we reopen the environment with recovery, close and then remove it. This enables an upgraded netatalk installation possibly linked against a newer bdb lib to succesfully open/create an environment and then silently upgrade the database itself. How nice! */ #ifndef CNID_DBD_DBIF_H #define CNID_DBD_DBIF_H 1 #include #include #include #include "db_param.h" #define DBIF_DB_CNT 4 #define DBIF_CNID 0 #define DBIF_IDX_DEVINO 1 #define DBIF_IDX_DIDNAME 2 #define DBIF_IDX_NAME 3 /* get_lock cmd and return value */ #define LOCKFILENAME "lock" #define LOCK_FREE 0 #define LOCK_UNLOCK 1 #define LOCK_EXCL 2 #define LOCK_SHRD 3 /* Structures */ typedef struct { char *name; DB *db; uint32_t flags; uint32_t openflags; DBTYPE type; } db_table; typedef struct { DB_ENV *db_env; struct db_param db_param; DB_TXN *db_txn; DBC *db_cur; /* for dbif_walk */ char *db_envhome; char *db_filename; FILE *db_errlog; db_table db_table[DBIF_DB_CNT]; } DBD; /* Functions */ extern int get_lock(int cmd, const char *dbpath); extern DBD *dbif_init(const char *envhome, const char *dbname); extern int dbif_env_open(DBD *dbd, struct db_param *dbp, uint32_t dbenv_oflags); extern int dbif_open(DBD *dbd, struct db_param *dbp, int reindex); extern int dbif_close(DBD *dbd); extern int dbif_env_remove(const char *path); extern int dbif_get(DBD *, const int, DBT *, DBT *, u_int32_t); extern int dbif_pget(DBD *, const int, DBT *, DBT *, DBT *, u_int32_t); extern int dbif_put(DBD *, const int, DBT *, DBT *, u_int32_t); extern int dbif_del(DBD *, const int, DBT *, u_int32_t); extern int dbif_count(DBD *, const int, u_int32_t *); extern int dbif_search(DBD *dbd, DBT *key, char *resbuf); extern int dbif_copy_rootinfokey(DBD *srcdbd, DBD *destdbd); extern int dbif_txn_begin(DBD *); extern int dbif_txn_commit(DBD *); extern int dbif_txn_abort(DBD *); extern int dbif_txn_close(DBD *dbd, int ret); /* Switch between commit+abort */ extern int dbif_txn_checkpoint(DBD *, u_int32_t, u_int32_t, u_int32_t); extern int dbif_dump(DBD *dbd, int dumpindexes); extern int dbif_idwalk(DBD *dbd, cnid_t *cnid, int close); #endif netatalk-2.2.2/etc/cnid_dbd/dbd_rebuild_add.c0000644000175200017500000000434311655731244015773 00000000000000/* * $Id: dbd_rebuild_add.c,v 1.4 2009-12-23 10:18:48 franklahm Exp $ * * Copyright (C) Joerg Lenneis 2005 * All Rights Reserved. See COPYING. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include "pack.h" #include "dbif.h" #include "dbd.h" /* rebuild_add: Enter all fields (including the CNID) into the database and update the current cnid, for emergency repairs. */ int dbd_rebuild_add(DBD *dbd, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply) { DBT key, data; cnid_t cur, tmp, id; memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); rply->namelen = 0; key.data = &rqst->cnid; key.size = sizeof(cnid_t); data.data = pack_cnid_data(rqst); data.size = CNID_HEADER_LEN + rqst->namelen + 1; memcpy(data.data, &rqst->cnid, sizeof(cnid_t)); /* FIXME: In cnid_cdb.c Bjoern does a lookup here and returns the CNID found if sucessful. Why? */ if (dbif_put(dbd, DBIF_CNID, &key, &data, 0) < 0) { rply->result = CNID_DBD_RES_ERR_DB; return -1; } LOG(log_debug, logtype_cnid, "dbd_rebuild_add(CNID: %u, did: %u, name: \"%s\", dev/ino:0x%llx/0x%llx): success", ntohl(rqst->cnid), ntohl(rqst->did), rqst->name, (unsigned long long)rqst->dev, (unsigned long long)rqst->ino); key.data = ROOTINFO_KEY; key.size = ROOTINFO_KEYLEN; if (dbif_get(dbd, DBIF_CNID, &key, &data, 0) <= 0) { /* FIXME: If we cannot find ROOTINFO_KEY, should this be considered fatal or should we just return 0 and roll back? */ rply->result = CNID_DBD_RES_ERR_DB; return -1; } memcpy(&tmp, (char *) data.data + CNID_TYPE_OFS, sizeof(cnid_t)); cur = ntohl(tmp); id = ntohl(rqst->cnid); if (id > cur) { data.size = ROOTINFO_DATALEN; memcpy((char *) data.data + CNID_TYPE_OFS, &rqst->cnid, sizeof(cnid_t)); if (dbif_put(dbd, DBIF_CNID, &key, &data, 0) < 0) { rply->result = CNID_DBD_RES_ERR_DB; return -1; } } rply->cnid = rqst->cnid; rply->result = CNID_DBD_RES_OK; return 1; } netatalk-2.2.2/etc/cnid_dbd/comm.h0000644000175200017500000000077711655731126013672 00000000000000/* * Copyright (C) Joerg Lenneis 2003 * All Rights Reserved. See COPYING. */ #ifndef CNID_DBD_COMM_H #define CNID_DBD_COMM_H 1 /* number of seconds to try reading in readt */ #define CNID_DBD_TIMEOUT 1 #include extern int comm_init (struct db_param *, int, int); extern int comm_rcv (struct cnid_dbd_rqst *, time_t, const sigset_t *, time_t *); extern int comm_snd (struct cnid_dbd_rply *); extern int comm_nbe (void); #endif /* CNID_DBD_COMM_H */ netatalk-2.2.2/etc/cnid_dbd/dbd_lookup.c0000644000175200017500000002571311655731126015051 00000000000000/* * $Id: dbd_lookup.c,v 1.18 2010-01-19 14:57:11 franklahm Exp $ * * Copyright (C) Joerg Lenneis 2003 * Copyright (C) Frank Lahm 2009 * All Rights Reserved. See COPYING. */ /* CNID salvation spec: general rule: better safe then sorry, so we always delete CNIDs and assign new ones in case of a lookup mismatch. afpd also sends us the CNID found in the adouble file (for AFPVOL_CACHE volumes). In certain cases we can use this hint to determince the right CNID. The lines... Id Did T Dev Inode Name ============================ a b c d e name1 --> f g h i h name2 ...are the expected results of certain operations. (f) is the speced CNID, in some cases it's only intermediate as described in the text and is overridden by another spec. 1) UNIX rename (via mv) or inode reusage(!) ------------------------------------------- Name is possibly changed (rename case) but inode is the same. We should try to keep the CNID, but we cant, because inode reusage is probably much to frequent. rename: 15 2 f 1 1 file --> 15 x f 1 1 renamedfile inode reusage: 15 2 f 1 1 file --> 16 y f 1 1 inodereusagefile Result in dbd_lookup (-: not found, +: found): + devino - didname Possible solution: None. Delete old data, file gets new CNID in both cases (rename and inode). If we got a hint and hint matches the CNID from devino we keep it and update the record. 2) UNIX mv from one folder to another ---------------------------------------- Name is unchanged and inode stays the same, but DID is different. We should try to keep the CNID. 15 2 f 1 1 file --> 15 x f 1 1 file Result in dbd_lookup: + devino - didname Possible solution: strcmp names, if they match keep CNID. Unfortunately this also can't be distinguished from a new file with a reused inode. So me must assign a new CNID. If we got a hint and hint matches the CNID from devino we keep it and update the record. 3) Restore from backup ie change of inode number -- or emacs ------------------------------------------------------------ 15 2 f 1 1 file --> 15 2 f 1 2 file Result in dbd_lookup: - devino + didname Possible fixup solution: test-suite test235 tests and ensures that the CNID is _changed_. The reason for this is somewhat lost in time, but nevertheless we believe our test suite. Similar things happen with emas: emacs uses a backup file (file~). When saving because of inode reusage of the fs, both files most likely exchange inodes. 15 2 f 1 1 file 16 2 f 1 2 file~ --> this would be nice: 15 2 f 1 2 file 16 2 f 1 1 file~ --> but for the reasons described above we must implement 17 2 f 1 2 file 18 2 f 1 1 file~ Result in dbd_lookup for the emacs case: + devino --> CNID: 16 + didname -> CNID: 15 devino search and didname search result in different CNIDs !! Possible fixup solution: to be safe we must assign new CNIDs to both files. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include "pack.h" #include "dbif.h" #include "dbd.h" /* * This returns the CNID corresponding to a particular file. It will also fix * up the database if there's a problem. */ int dbd_lookup(DBD *dbd, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply, int roflag) { unsigned char *buf; DBT key, devdata, diddata; int devino = 1, didname = 1; int rc; cnid_t id_devino, id_didname; u_int32_t type_devino = (unsigned)-1; u_int32_t type_didname = (unsigned)-1; int update = 0; memset(&key, 0, sizeof(key)); memset(&diddata, 0, sizeof(diddata)); memset(&devdata, 0, sizeof(devdata)); rply->namelen = 0; rply->cnid = 0; LOG(log_maxdebug, logtype_cnid, "dbd_lookup(): START"); buf = pack_cnid_data(rqst); /* Look for a CNID. We have two options: dev/ino or did/name. If we only get a match in one of them, that means a file has moved. */ key.data = buf + CNID_DEVINO_OFS; key.size = CNID_DEVINO_LEN; if ((rc = dbif_get(dbd, DBIF_IDX_DEVINO, &key, &devdata, 0)) < 0) { LOG(log_error, logtype_cnid, "dbd_lookup: Unable to get CNID %u, name %s", ntohl(rqst->did), rqst->name); rply->result = CNID_DBD_RES_ERR_DB; return -1; } if (rc == 0) { devino = 0; } else { memcpy(&id_devino, devdata.data, sizeof(rply->cnid)); memcpy(&type_devino, (char *)devdata.data +CNID_TYPE_OFS, sizeof(type_devino)); type_devino = ntohl(type_devino); } key.data = buf + CNID_DID_OFS; key.size = CNID_DID_LEN + rqst->namelen + 1; if ((rc = dbif_get(dbd, DBIF_IDX_DIDNAME, &key, &diddata, 0)) < 0) { LOG(log_error, logtype_cnid, "dbd_lookup: Unable to get CNID %u, name %s", ntohl(rqst->did), rqst->name); rply->result = CNID_DBD_RES_ERR_DB; return -1; } if (rc == 0) { didname = 0; } else { memcpy(&id_didname, diddata.data, sizeof(rply->cnid)); memcpy(&type_didname, (char *)diddata.data +CNID_TYPE_OFS, sizeof(type_didname)); type_didname = ntohl(type_didname); } LOG(log_maxdebug, logtype_cnid, "dbd_lookup(name:'%s', did:%u, dev/ino:0x%llx/0x%llx) {devino: %u, didname: %u}", rqst->name, ntohl(rqst->did), (unsigned long long)rqst->dev, (unsigned long long)rqst->ino, devino, didname); /* Have we found anything at all ? */ if (!devino && !didname) { /* nothing found */ LOG(log_debug, logtype_cnid, "dbd_lookup: name: '%s', did: %u, dev/ino: 0x%llx/0x%llx is not in the CNID database", rqst->name, ntohl(rqst->did), (unsigned long long)rqst->dev, (unsigned long long)rqst->ino); rply->result = CNID_DBD_RES_NOTFOUND; return 1; } /* Check for type (file/dir) mismatch */ if ((devino && (type_devino != rqst->type)) || (didname && (type_didname != rqst->type))) { if (devino && (type_devino != rqst->type)) { /* one is a dir one is a file, remove from db */ LOG(log_debug, logtype_cnid, "dbd_lookup(name:'%s', did:%u, dev/ino:0x%llx/0x%llx): type mismatch for devino", rqst->name, ntohl(rqst->did), (unsigned long long)rqst->dev, (unsigned long long)rqst->ino); if (! roflag) { rqst->cnid = id_devino; rc = dbd_delete(dbd, rqst, rply, DBIF_CNID); rc += dbd_delete(dbd, rqst, rply, DBIF_IDX_DEVINO); rc += dbd_delete(dbd, rqst, rply, DBIF_IDX_DIDNAME); if (rc < 0) { LOG(log_error, logtype_cnid, "dbd_lookup(name:'%s', did:%u, dev/ino:0x%llx/0x%llx): error deleting type mismatch for devino", rqst->name, ntohl(rqst->did), (unsigned long long)rqst->dev, (unsigned long long)rqst->ino); return -1; } } } if (didname && (type_didname != rqst->type)) { /* same: one is a dir one is a file, remove from db */ LOG(log_debug, logtype_cnid, "dbd_lookup(name:'%s', did:%u, dev/ino:0x%llx/0x%llx): type mismatch for didname", rqst->name, ntohl(rqst->did), (unsigned long long)rqst->dev, (unsigned long long)rqst->ino); if (! roflag) { rqst->cnid = id_didname; rc = dbd_delete(dbd, rqst, rply, DBIF_CNID); rc += dbd_delete(dbd, rqst, rply, DBIF_IDX_DEVINO); rc += dbd_delete(dbd, rqst, rply, DBIF_IDX_DIDNAME); if (rc < 0) { LOG(log_error, logtype_cnid, "dbd_lookup(name:'%s', did:%u, dev/ino:0x%llx/0x%llx): error deleting type mismatch for didname", rqst->name, ntohl(rqst->did), (unsigned long long)rqst->dev, (unsigned long long)rqst->ino); return -1; } } } rply->result = CNID_DBD_RES_NOTFOUND; return 1; } if (devino && didname && id_devino == id_didname) { /* everything is fine */ LOG(log_debug, logtype_cnid, "dbd_lookup(DID:%u/'%s',0x%llx/0x%llx): Got CNID: %u", ntohl(rqst->did), rqst->name, (unsigned long long)rqst->dev, (unsigned long long)rqst->ino, htonl(id_didname)); rply->cnid = id_didname; rply->result = CNID_DBD_RES_OK; return 1; } if (devino && didname && id_devino != id_didname) { /* CNIDs don't match, something of a worst case, or possibly 3) emacs! */ LOG(log_debug, logtype_cnid, "dbd_lookup: CNID mismatch: (DID:%u/'%s') --> %u , (0x%llx/0x%llx) --> %u", ntohl(rqst->did), rqst->name, ntohl(id_didname), (unsigned long long)rqst->dev, (unsigned long long)rqst->ino, ntohl(id_devino)); if (! roflag) { rqst->cnid = id_devino; if (dbd_delete(dbd, rqst, rply, DBIF_CNID) < 0) return -1; rqst->cnid = id_didname; if (dbd_delete(dbd, rqst, rply, DBIF_CNID) < 0) return -1; } rply->result = CNID_DBD_RES_NOTFOUND; return 1; } if ( ! didname) { LOG(log_debug, logtype_cnid, "dbd_lookup(CNID hint: %u, DID:%u, \"%s\", 0x%llx/0x%llx): CNID resolve problem: server side rename oder reused inode", ntohl(rqst->cnid), ntohl(rqst->did), rqst->name, (unsigned long long)rqst->dev, (unsigned long long)rqst->ino); if (rqst->cnid == id_devino) { LOG(log_debug, logtype_cnid, "dbd_lookup: server side mv (with resource fork)"); update = 1; } else { if ( ! roflag) { rqst->cnid = id_devino; if (dbd_delete(dbd, rqst, rply, DBIF_CNID) < 0) return -1; } rply->result = CNID_DBD_RES_NOTFOUND; return 1; } } if ( ! devino) { LOG(log_debug, logtype_cnid, "dbd_lookup(DID:%u/'%s',0x%llx/0x%llx): CNID resolve problem: changed dev/ino", ntohl(rqst->did), rqst->name, (unsigned long long)rqst->dev, (unsigned long long)rqst->ino); if ( ! roflag) { rqst->cnid = id_didname; if (dbd_delete(dbd, rqst, rply, DBIF_CNID) < 0) return -1; } rply->result = CNID_DBD_RES_NOTFOUND; return 1; } /* This is also a catch all if we've forgot to catch some possibility with the preceding ifs*/ if (!update || roflag) { rply->result = CNID_DBD_RES_NOTFOUND; return 1; } /* Fix up the database */ rc = dbd_update(dbd, rqst, rply); if (rc >0) { rply->cnid = rqst->cnid; } LOG(log_debug, logtype_cnid, "dbd_lookup(DID:%u/'%s',0x%llx/0x%llx): Got CNID (needed update): %u", ntohl(rqst->did), rqst->name, (unsigned long long)rqst->dev, (unsigned long long)rqst->ino, ntohl(rply->cnid)); return rc; } netatalk-2.2.2/etc/cnid_dbd/cmd_dbd.h0000644000175200017500000000221411671417704014300 00000000000000#ifndef CMD_DBD_H #define CMD_DBD_H #include #include #include #include "dbif.h" enum logtype {LOGSTD, LOGDEBUG}; typedef unsigned int dbd_flags_t; #define DBD_FLAGS_SCAN (1 << 0) #define DBD_FLAGS_FORCE (1 << 1) #define DBD_FLAGS_EXCL (1 << 2) #define DBD_FLAGS_CLEANUP (1 << 3) /* Dont create AD stuff, but cleanup orphaned */ #define DBD_FLAGS_STATS (1 << 4) #define ADv2_DIRNAME ".AppleDouble" #define DIR_DOT_OR_DOTDOT(a) \ ((strcmp(a, ".") == 0) || (strcmp(a, "..") == 0)) #define STRCMP(a,b,c) \ (strcmp(a,c) b 0) extern int nocniddb; /* Dont open CNID database, only scan filesystem */ extern int db_locked; /* have we got the fcntl lock on lockfd ? */ extern volatile sig_atomic_t alarmed; extern void dbd_log(enum logtype lt, char *fmt, ...); extern int cmd_dbd_scanvol(DBD *dbd, struct volinfo *volinfo, dbd_flags_t flags); /* Functions for querying the database which couldn't be reused from the existing funcs pool of dbd_* for one reason or another */ extern int cmd_dbd_add(DBD *dbd, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply); #endif /* CMD_DBD_H */ netatalk-2.2.2/etc/cnid_dbd/dbd.h0000644000175200017500000000225511655731126013461 00000000000000/* * Copyright (C) Joerg Lenneis 2003 * Copyright (C) Frank Lahm 2009, 2010 * All Rights Reserved. See COPYING. */ #ifndef CNID_DBD_DBD_H #define CNID_DBD_DBD_H 1 #include extern int add_cnid(DBD *dbd, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply); extern int get_cnid(DBD *dbd, struct cnid_dbd_rply *rply); extern int dbd_add(DBD *dbd, struct cnid_dbd_rqst *, struct cnid_dbd_rply *, int nolookup); extern int dbd_lookup(DBD *dbd, struct cnid_dbd_rqst *, struct cnid_dbd_rply *, int roflag); extern int dbd_get(DBD *dbd, struct cnid_dbd_rqst *, struct cnid_dbd_rply *); extern int dbd_resolve(DBD *dbd, struct cnid_dbd_rqst *, struct cnid_dbd_rply *); extern int dbd_update(DBD *dbd, struct cnid_dbd_rqst *, struct cnid_dbd_rply *); extern int dbd_delete(DBD *dbd, struct cnid_dbd_rqst *, struct cnid_dbd_rply *, int idx); extern int dbd_getstamp(DBD *dbd, struct cnid_dbd_rqst *, struct cnid_dbd_rply *); extern int dbd_rebuild_add(DBD *dbd, struct cnid_dbd_rqst *, struct cnid_dbd_rply *); extern int dbd_search(DBD *dbd, struct cnid_dbd_rqst *, struct cnid_dbd_rply *); extern int dbd_check_indexes(DBD *dbd, char *); #endif /* CNID_DBD_DBD_H */ netatalk-2.2.2/etc/cnid_dbd/cmd_dbd.c0000644000175200017500000003637411700766070014305 00000000000000/* Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ /* dbd specs and implementation progress ===================================== St := Status Force option ------------ St Spec -- ---- OK If -f is requested, ensure -e is too. Check if volumes is using AFPVOL_CACHE, then wipe db from disk. Rebuild from ad-files. 1st pass: Scan volume -------------------- St Type Check -- ---- ----- OK F/D Make sure ad file exists OK D Make sure .AppleDouble dir exist, create if missing. Error creating it is fatal as that shouldn't happen as root. OK F/D Delete orphaned ad-files, log dirs in ad-dir OK F/D Check name encoding by roundtripping, log on error OK F/D try: read CNID from ad file (if cnid caching is on) try: fetch CNID from database -> on mismatch: use CNID from file, update database (deleting both found CNIDs first) -> if no CNID in ad file: write CNID from database to ad file -> if no CNID in database: add CNID from ad file to database -> on no CNID at all: create one and store in both places OK F/D Add found CNID, DID, filename, dev/inode, stamp to rebuild database OK F/D Check/update stamp (implicitly done while checking CNIDs) 2nd pass: Delete unused CNIDs ----------------------------- St Spec -- ---- OK Step through dbd (the one on disk) and rebuild-db from pass 1 and delete any CNID from dbd not in rebuild db. This in only done in exclusive mode. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "cmd_dbd.h" #include "dbd.h" #include "dbif.h" #include "db_param.h" #define DBOPTIONS (DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN) int nocniddb = 0; /* Dont open CNID database, only scan filesystem */ struct volinfo volinfo; /* needed by pack.c:idxname() */ volatile sig_atomic_t alarmed; /* flags for signals */ int db_locked; /* have we got the fcntl lock on lockfile ? */ static DBD *dbd; static int verbose; /* Logging flag */ static int exclusive; /* Exclusive volume access */ static struct db_param db_param = { NULL, /* Volume dirpath */ 1, /* bdb logfile autoremove */ 64 * 1024, /* bdb cachesize (64 MB) */ DEFAULT_MAXLOCKS, /* maxlocks */ DEFAULT_MAXLOCKOBJS, /* maxlockobjs */ 0, /* flush_interval */ 0, /* flush_frequency */ 0, /* usock_file */ -1, /* fd_table_size */ -1, /* idle_timeout */ -1 /* max_vols */ }; static char dbpath[MAXPATHLEN+1]; /* Path to the dbd database */ /* Provide some logging */ void dbd_log(enum logtype lt, char *fmt, ...) { int len; static char logbuffer[1024]; va_list args; if ( (lt == LOGSTD) || (verbose == 1)) { va_start(args, fmt); len = vsnprintf(logbuffer, 1023, fmt, args); va_end(args); logbuffer[1023] = 0; printf("%s\n", logbuffer); } } /* SIGNAL handling: catch SIGINT and SIGTERM which cause clean exit. Ignore anything else. */ static void sig_handler(int signo) { alarmed = 1; return; } static void set_signal(void) { struct sigaction sv; sv.sa_handler = sig_handler; sv.sa_flags = SA_RESTART; sigemptyset(&sv.sa_mask); if (sigaction(SIGTERM, &sv, NULL) < 0) { dbd_log( LOGSTD, "error in sigaction(SIGTERM): %s", strerror(errno)); exit(EXIT_FAILURE); } if (sigaction(SIGINT, &sv, NULL) < 0) { dbd_log( LOGSTD, "error in sigaction(SIGINT): %s", strerror(errno)); exit(EXIT_FAILURE); } memset(&sv, 0, sizeof(struct sigaction)); sv.sa_handler = SIG_IGN; sigemptyset(&sv.sa_mask); if (sigaction(SIGABRT, &sv, NULL) < 0) { dbd_log( LOGSTD, "error in sigaction(SIGABRT): %s", strerror(errno)); exit(EXIT_FAILURE); } if (sigaction(SIGHUP, &sv, NULL) < 0) { dbd_log( LOGSTD, "error in sigaction(SIGHUP): %s", strerror(errno)); exit(EXIT_FAILURE); } if (sigaction(SIGQUIT, &sv, NULL) < 0) { dbd_log( LOGSTD, "error in sigaction(SIGQUIT): %s", strerror(errno)); exit(EXIT_FAILURE); } } static void usage (void) { printf("dbd (Netatalk %s)\n" "Usage: dbd [-e|-t|-v|-x] -d [-i] | -s [-c|-n]| -r [-c|-f] | -u \n" "dbd can dump, scan, reindex and rebuild Netatalk dbd CNID databases.\n" "dbd must be run with appropiate permissions i.e. as root.\n\n" "Main commands are:\n" " -d Dump CNID database\n" " Option: -i dump indexes too\n\n" " -s Scan volume:\n" " 1. Compare CNIDs in database with volume\n" " 2. Check if .AppleDouble dirs exist\n" " 3. Check if AppleDouble file exist\n" " 4. Report orphaned AppleDouble files\n" " 5. Check for directories inside AppleDouble directories\n" " 6. Check name encoding by roundtripping, log on error\n" " 7. Check for orphaned CNIDs in database (requires -e)\n" " 8. Open and close adouble files\n" " Options: -c Don't check .AppleDouble stuff, only ckeck orphaned.\n" " -n Don't open CNID database, skip CNID checks.\n\n" " -r Rebuild volume:\n" " 1. Sync CNIDSs in database with volume\n" " 2. Make sure .AppleDouble dir exist, create if missing\n" " 3. Make sure AppleDouble file exists, create if missing\n" " 4. Delete orphaned AppleDouble files\n" " 5. Check for directories inside AppleDouble directories\n" " 6. Check name encoding by roundtripping, log on error\n" " 7. Check for orphaned CNIDs in database (requires -e)\n" " 8. Open and close adouble files\n" " Options: -c Don't create .AppleDouble stuff, only cleanup orphaned.\n" " -f wipe database and rebuild from IDs stored in AppleDouble\n" " files, only available for volumes without 'nocnidcache'\n" " option. Implies -e.\n\n" " -u Upgrade:\n" " Opens the database which triggers any necessary upgrades,\n" " then closes and exits.\n\n" "General options:\n" " -e only work on inactive volumes and lock them (exclusive)\n" " -x rebuild indexes (just for completeness, mostly useless!)\n" " -t show statistics while running\n" " -v verbose\n\n" "WARNING:\n" "For -r -f restore of the CNID database from the adouble files,\n" "the CNID must of course be synched to them files first with a plain -r rebuild!\n" , VERSION ); } int main(int argc, char **argv) { int c, lockfd, ret = -1; int dump=0, scan=0, rebuild=0, prep_upgrade=0, rebuildindexes=0, dumpindexes=0, force=0; dbd_flags_t flags = 0; char *volpath; int cdir; if (geteuid() != 0) { usage(); exit(EXIT_FAILURE); } /* Inhereting perms in ad_mkdir etc requires this */ ad_setfuid(0); while ((c = getopt(argc, argv, ":cdefinrstuvx")) != -1) { switch(c) { case 'c': flags |= DBD_FLAGS_CLEANUP; break; case 'd': dump = 1; break; case 'i': dumpindexes = 1; break; case 's': scan = 1; flags |= DBD_FLAGS_SCAN; break; case 'n': nocniddb = 1; /* FIXME: this could/should be a flag too for consistency */ break; case 'r': rebuild = 1; break; case 't': flags |= DBD_FLAGS_STATS; break; case 'u': prep_upgrade = 1; break; case 'v': verbose = 1; break; case 'e': exclusive = 1; flags |= DBD_FLAGS_EXCL; break; case 'x': rebuildindexes = 1; break; case 'f': force = 1; exclusive = 1; flags |= DBD_FLAGS_FORCE | DBD_FLAGS_EXCL; break; case ':': case '?': usage(); exit(EXIT_FAILURE); break; } } if ((dump + scan + rebuild + prep_upgrade) != 1) { usage(); exit(EXIT_FAILURE); } if ( (optind + 1) != argc ) { usage(); exit(EXIT_FAILURE); } volpath = argv[optind]; setvbuf(stdout, (char *) NULL, _IONBF, 0); /* Remember cwd */ if ((cdir = open(".", O_RDONLY)) < 0) { dbd_log( LOGSTD, "Can't open dir: %s", strerror(errno)); exit(EXIT_FAILURE); } /* Setup signal handling */ set_signal(); /* Setup logging. Should be portable among *NIXes */ if (!verbose) setuplog("default log_info /dev/tty"); else setuplog("default log_debug /dev/tty"); /* Load .volinfo file */ if (loadvolinfo(volpath, &volinfo) == -1) { dbd_log( LOGSTD, "Not a Netatalk volume at '%s', no .volinfo file at '%s/.AppleDesktop/.volinfo' or unknown volume options", volpath, volpath); exit(EXIT_FAILURE); } if (vol_load_charsets(&volinfo) == -1) { dbd_log( LOGSTD, "Error loading charsets!"); exit(EXIT_FAILURE); } /* Sanity checks to ensure we can touch this volume */ if (volinfo.v_vfs_ea != AFPVOL_EA_AD && volinfo.v_vfs_ea != AFPVOL_EA_SYS) { dbd_log( LOGSTD, "Unknown Extended Attributes option: %u", volinfo.v_vfs_ea); exit(EXIT_FAILURE); } /* Enuser dbpath is there, create if necessary */ struct stat st; if (stat(volinfo.v_dbpath, &st) != 0) { if (errno != ENOENT) { dbd_log( LOGSTD, "Can't stat dbpath \"%s\": %s", volinfo.v_dbpath, strerror(errno)); exit(EXIT_FAILURE); } if ((mkdir(volinfo.v_dbpath, 0755)) != 0) { dbd_log( LOGSTD, "Can't create dbpath \"%s\": %s", dbpath, strerror(errno)); exit(EXIT_FAILURE); } } /* Put "/.AppleDB" at end of volpath, get path from volinfo file */ if ( (strlen(volinfo.v_dbpath) + strlen("/.AppleDB")) > MAXPATHLEN ) { dbd_log( LOGSTD, "Volume pathname too long"); exit(EXIT_FAILURE); } strncpy(dbpath, volinfo.v_dbpath, MAXPATHLEN - strlen("/.AppleDB")); strcat(dbpath, "/.AppleDB"); /* Check or create dbpath */ int dbdirfd = open(dbpath, O_RDONLY); if (dbdirfd == -1 && errno == ENOENT) { if (errno == ENOENT) { if ((mkdir(dbpath, 0755)) != 0) { dbd_log( LOGSTD, "Can't create .AppleDB for \"%s\": %s", dbpath, strerror(errno)); exit(EXIT_FAILURE); } } else { dbd_log( LOGSTD, "Somethings wrong with .AppleDB for \"%s\", giving up: %s", dbpath, strerror(errno)); exit(EXIT_FAILURE); } } else { close(dbdirfd); } /* Get db lock */ if ((db_locked = get_lock(LOCK_EXCL, dbpath)) == -1) goto exit_noenv; if (db_locked != LOCK_EXCL) { /* Couldn't get exclusive lock, try shared lock if -e wasn't requested */ if (exclusive) { dbd_log(LOGSTD, "Database is in use and exlusive was requested"); goto exit_noenv; } if ((db_locked = get_lock(LOCK_SHRD, NULL)) != LOCK_SHRD) goto exit_noenv; } /* Check if -f is requested and wipe db if yes */ if ((flags & DBD_FLAGS_FORCE) && rebuild && (volinfo.v_flags & AFPVOL_CACHE)) { char cmd[8 + MAXPATHLEN]; if ((db_locked = get_lock(LOCK_FREE, NULL)) != 0) goto exit_noenv; snprintf(cmd, 8 + MAXPATHLEN, "rm -rf \"%s\"", dbpath); dbd_log( LOGDEBUG, "Removing old database of volume: '%s'", volpath); system(cmd); if ((mkdir(dbpath, 0755)) != 0) { dbd_log( LOGSTD, "Can't create dbpath \"%s\": %s", dbpath, strerror(errno)); exit(EXIT_FAILURE); } dbd_log( LOGDEBUG, "Removed old database."); if ((db_locked = get_lock(LOCK_EXCL, dbpath)) == -1) goto exit_noenv; } /* Lets start with the BerkeleyDB stuff */ if ( ! nocniddb) { if ((dbd = dbif_init(dbpath, "cnid2.db")) == NULL) goto exit_noenv; if (dbif_env_open(dbd, &db_param, (db_locked == LOCK_EXCL) ? (DBOPTIONS | DB_RECOVER) : DBOPTIONS) < 0) { dbd_log( LOGSTD, "error opening database!"); goto exit_noenv; } if (db_locked == LOCK_EXCL) dbd_log( LOGDEBUG, "Finished recovery."); if (dbif_open(dbd, NULL, rebuildindexes) < 0) { dbif_close(dbd); goto exit_failure; } /* Prepare upgrade ? We're done */ if (prep_upgrade) { (void)dbif_txn_close(dbd, 1); goto cleanup; } } /* Downgrade db lock if not running exclusive */ if (!exclusive && (db_locked == LOCK_EXCL)) { if (get_lock(LOCK_UNLOCK, NULL) != 0) goto exit_failure; if (get_lock(LOCK_SHRD, NULL) != LOCK_SHRD) goto exit_failure; } /* Now execute given command scan|rebuild|dump */ if (dump && ! nocniddb) { if (dbif_dump(dbd, dumpindexes) < 0) { dbd_log( LOGSTD, "Error dumping database"); } } else if ((rebuild && ! nocniddb) || scan) { if (cmd_dbd_scanvol(dbd, &volinfo, flags) < 0) { dbd_log( LOGSTD, "Error repairing database."); } } cleanup: /* Cleanup */ dbd_log(LOGDEBUG, "Closing db"); if (! nocniddb) { if (dbif_close(dbd) < 0) { dbd_log( LOGSTD, "Error closing database"); goto exit_failure; } } exit_success: ret = 0; exit_failure: if (dbif_env_remove(dbpath) < 0) { dbd_log( LOGSTD, "Error removing BerkeleyDB database environment"); ret++; } get_lock(0, NULL); exit_noenv: if ((fchdir(cdir)) < 0) dbd_log(LOGSTD, "fchdir: %s", strerror(errno)); if (ret == 0) exit(EXIT_SUCCESS); else exit(EXIT_FAILURE); } netatalk-2.2.2/etc/cnid_dbd/pack.c0000644000175200017500000000747011655731126013645 00000000000000/* * Copyright (C) Joerg Lenneis 2003 * Copyright (C) Frank Lahm 2010 * All Rights Reserved. See COPYING. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include "pack.h" /* in main.c for `cnid_dbd` or cmd_dbd.c for `dbd` */ extern struct volinfo volinfo; /* --------------- */ /* * This implementation is portable, but could probably be faster by using htonl * where appropriate. Also, this again doubles code from the cdb backend. */ static void pack_devino(unsigned char *buf, dev_t dev, ino_t ino) { buf[CNID_DEV_LEN - 1] = dev; dev >>= 8; buf[CNID_DEV_LEN - 2] = dev; dev >>= 8; buf[CNID_DEV_LEN - 3] = dev; dev >>= 8; buf[CNID_DEV_LEN - 4] = dev; dev >>= 8; buf[CNID_DEV_LEN - 5] = dev; dev >>= 8; buf[CNID_DEV_LEN - 6] = dev; dev >>= 8; buf[CNID_DEV_LEN - 7] = dev; dev >>= 8; buf[CNID_DEV_LEN - 8] = dev; buf[CNID_DEV_LEN + CNID_INO_LEN - 1] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 2] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 3] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 4] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 5] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 6] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 7] = ino; ino >>= 8; buf[CNID_DEV_LEN + CNID_INO_LEN - 8] = ino; } /* --------------- */ int didname(DB *dbp _U_, const DBT *pkey _U_, const DBT *pdata, DBT *skey) { int len; memset(skey, 0, sizeof(DBT)); skey->data = (char *)pdata->data + CNID_DID_OFS; /* FIXME: At least DB 4.0.14 and 4.1.25 pass in the correct length of pdata.size. strlen is therefore not needed. Also, skey should be zeroed out already. */ len = strlen((char *)skey->data + CNID_DID_LEN); skey->size = CNID_DID_LEN + len + 1; return (0); } /* --------------- */ int devino(DB *dbp _U_, const DBT *pkey _U_, const DBT *pdata, DBT *skey) { memset(skey, 0, sizeof(DBT)); skey->data = (char *)pdata->data + CNID_DEVINO_OFS; skey->size = CNID_DEVINO_LEN; return (0); } /* --------------- */ int idxname(DB *dbp _U_, const DBT *pkey _U_, const DBT *pdata, DBT *skey) { static char buffer[MAXPATHLEN +2]; uint16_t flags = CONV_TOLOWER; memset(skey, 0, sizeof(DBT)); if (convert_charset(volinfo.v_volcharset, volinfo.v_volcharset, volinfo.v_maccharset, (char *)pdata->data + CNID_NAME_OFS, strlen((char *)pdata->data + CNID_NAME_OFS), buffer, MAXPATHLEN, &flags) == (size_t)-1) { LOG(log_error, logtype_cnid, "idxname: conversion error"); } skey->data = buffer; skey->size = strlen(skey->data); return (0); } /* The equivalent to make_cnid_data in the cnid library. Non re-entrant. We differ from make_cnid_data in that we never return NULL, rqst->name cannot ever cause start[] to overflow because name length is checked in libatalk. */ unsigned char *pack_cnid_data(struct cnid_dbd_rqst *rqst) { static unsigned char start[CNID_HEADER_LEN + MAXPATHLEN + 1]; unsigned char *buf = start +CNID_LEN; u_int32_t i; pack_devino(buf, rqst->dev, rqst->ino); buf += CNID_DEVINO_LEN; i = htonl(rqst->type); memcpy(buf, &i, sizeof(i)); buf += sizeof(i); /* did is already in network byte order */ buf = memcpy(buf, &rqst->did, sizeof(rqst->did)); buf += sizeof(rqst->did); buf = memcpy(buf, rqst->name, rqst->namelen); *(buf + rqst->namelen) = '\0'; return start; } netatalk-2.2.2/etc/cnid_dbd/dbd_delete.c0000644000175200017500000000614011655731126014773 00000000000000/* * $Id: dbd_delete.c,v 1.5 2009-07-12 09:21:34 franklahm Exp $ * * Copyright (C) Joerg Lenneis 2003 * All Rights Reserved. See COPYING. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include "dbif.h" #include "dbd.h" #include "pack.h" int dbd_delete(DBD *dbd, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply, int idx) { DBT key; int rc; unsigned char *buf; memset(&key, 0, sizeof(key)); rply->namelen = 0; switch (idx) { case DBIF_IDX_DEVINO: buf = pack_cnid_data(rqst); key.data = buf + CNID_DEVINO_OFS; key.size = CNID_DEVINO_LEN; if ((rc = dbif_del(dbd, DBIF_IDX_DEVINO, &key, 0)) < 0) { LOG(log_error, logtype_cnid, "dbd_delete: Unable to delete entry for dev/ino: 0x%llx/0x%llx", (unsigned long long)rqst->dev, (unsigned long long)rqst->ino); rply->result = CNID_DBD_RES_ERR_DB; return -1; } if (rc) { LOG(log_debug, logtype_cnid, "cnid_delete: deleted dev/ino: 0x%llx/0x%llx", (unsigned long long)rqst->dev, (unsigned long long)rqst->ino); rply->result = CNID_DBD_RES_OK; } else { LOG(log_debug, logtype_cnid, "cnid_delete: dev/ino: 0x%llx/0x%llx not in database", (unsigned long long)rqst->dev, (unsigned long long)rqst->ino); rply->result = CNID_DBD_RES_NOTFOUND; } break; case DBIF_IDX_DIDNAME: buf = pack_cnid_data(rqst); key.data = buf + CNID_DID_OFS; key.size = CNID_DID_LEN + rqst->namelen + 1; if ((rc = dbif_del(dbd, DBIF_IDX_DIDNAME, &key, 0)) < 0) { LOG(log_error, logtype_cnid, "dbd_delete: Unable to delete entry for DID: %lu, name: %s", ntohl(rqst->did), rqst->name); rply->result = CNID_DBD_RES_ERR_DB; return -1; } if (rc) { LOG(log_debug, logtype_cnid, "cnid_delete: deleted DID: %lu, name: %s", ntohl(rqst->did), rqst->name); rply->result = CNID_DBD_RES_OK; } else { LOG(log_debug, logtype_cnid, "cnid_delete: DID: %lu, name: %s not in database", ntohl(rqst->did), rqst->name); rply->result = CNID_DBD_RES_NOTFOUND; } break; default: key.data = (void *) &rqst->cnid; key.size = sizeof(rqst->cnid); if ((rc = dbif_del(dbd, DBIF_CNID, &key, 0)) < 0) { LOG(log_error, logtype_cnid, "dbd_delete: Unable to delete entry for CNID %u", ntohl(rqst->cnid)); rply->result = CNID_DBD_RES_ERR_DB; return -1; } if (rc) { LOG(log_debug, logtype_cnid, "cnid_delete: CNID %u deleted", ntohl(rqst->cnid)); rply->result = CNID_DBD_RES_OK; } else { LOG(log_debug, logtype_cnid, "cnid_delete: CNID %u not in database", ntohl(rqst->cnid)); rply->result = CNID_DBD_RES_NOTFOUND; } } return 1; } netatalk-2.2.2/etc/cnid_dbd/dbd_get.c0000644000175200017500000000323511655731126014312 00000000000000/* * $Id: dbd_get.c,v 1.4 2009-05-06 11:54:24 franklahm Exp $ * * Copyright (C) Joerg Lenneis 2003 * All Rights Reserved. See COPYING. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include "dbif.h" #include "dbd.h" #include "pack.h" /* Return CNID for a given did/name. */ int dbd_get(DBD *dbd, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply) { char start[CNID_DID_LEN + MAXPATHLEN + 1], *buf; DBT key, data; int rc; memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); rply->namelen = 0; buf = start; memcpy(buf, &rqst->did, sizeof(rqst->did)); buf += sizeof(rqst->did); memcpy(buf, rqst->name, rqst->namelen); *(buf + rqst->namelen) = '\0'; /* Make it a C-string. */ key.data = start; key.size = CNID_DID_LEN + rqst->namelen + 1; if ((rc = dbif_get(dbd, DBIF_IDX_DIDNAME, &key, &data, 0)) < 0) { LOG(log_error, logtype_cnid, "dbd_get: Unable to get CNID %u, name %s", ntohl(rqst->did), rqst->name); rply->result = CNID_DBD_RES_ERR_DB; return -1; } if (rc == 0) { LOG(log_debug, logtype_cnid, "cnid_get: CNID not found for did %u name %s", ntohl(rqst->did), rqst->name); rply->result = CNID_DBD_RES_NOTFOUND; return 1; } memcpy(&rply->cnid, data.data, sizeof(rply->cnid)); LOG(log_debug, logtype_cnid, "cnid_get: Returning CNID did %u name %s as %u", ntohl(rqst->did), rqst->name, ntohl(rply->cnid)); rply->result = CNID_DBD_RES_OK; return 1; } netatalk-2.2.2/etc/cnid_dbd/main.c0000644000175200017500000002766711700340470013652 00000000000000/* * Copyright (C) Joerg Lenneis 2003 * Copyright (c) Frank Lahm 2009 * All Rights Reserved. See COPYING. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #include #include #include #include #ifdef HAVE_SYS_TYPES_H #include #endif /* HAVE_SYS_TYPES_H */ #include #ifdef HAVE_SYS_STAT_H #include #endif /* HAVE_SYS_STAT_H */ #include #include #include #include #include #include #include "db_param.h" #include "dbif.h" #include "dbd.h" #include "comm.h" /* Note: DB_INIT_LOCK is here so we can run the db_* utilities while netatalk is running. It's a likey performance hit, but it might we worth it. */ #define DBOPTIONS (DB_CREATE | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN) /* Global, needed by pack.c:idxname() */ struct volinfo volinfo; static DBD *dbd; static int exit_sig = 0; static int db_locked; static void sig_exit(int signo) { exit_sig = signo; return; } static void block_sigs_onoff(int block) { sigset_t set; sigemptyset(&set); sigaddset(&set, SIGINT); sigaddset(&set, SIGTERM); if (block) sigprocmask(SIG_BLOCK, &set, NULL); else sigprocmask(SIG_UNBLOCK, &set, NULL); return; } /* The dbd_XXX and comm_XXX functions all obey the same protocol for return values: 1: Success, if transactions are used commit. 0: Failure, but we continue to serve requests. If transactions are used abort/rollback. -1: Fatal error, either from t he database or from the socket. Abort the transaction if applicable (which might fail as well) and then exit. We always try to notify the client process about the outcome, the result field of the cnid_dbd_rply structure contains further details. */ #ifndef min #define min(a,b) ((a)<(b)?(a):(b)) #endif static int loop(struct db_param *dbp) { struct cnid_dbd_rqst rqst; struct cnid_dbd_rply rply; time_t timeout; int ret, cret; int count; time_t now, time_next_flush, time_last_rqst; char timebuf[64]; static char namebuf[MAXPATHLEN + 1]; sigset_t set; sigemptyset(&set); sigprocmask(SIG_SETMASK, NULL, &set); sigdelset(&set, SIGINT); sigdelset(&set, SIGTERM); count = 0; now = time(NULL); time_next_flush = now + dbp->flush_interval; time_last_rqst = now; rqst.name = namebuf; strftime(timebuf, 63, "%b %d %H:%M:%S.",localtime(&time_next_flush)); LOG(log_debug, logtype_cnid, "Checkpoint interval: %d seconds. Next checkpoint: %s", dbp->flush_interval, timebuf); while (1) { timeout = min(time_next_flush, time_last_rqst +dbp->idle_timeout); if (timeout > now) timeout -= now; else timeout = 1; if ((cret = comm_rcv(&rqst, timeout, &set, &now)) < 0) return -1; if (cret == 0) { /* comm_rcv returned from select without receiving anything. */ if (exit_sig) { /* Received signal (TERM|INT) */ return 0; } if (now - time_last_rqst >= dbp->idle_timeout && comm_nbe() <= 0) { /* Idle timeout */ return 0; } /* still active connections, reset time_last_rqst */ time_last_rqst = now; } else { /* We got a request */ time_last_rqst = now; memset(&rply, 0, sizeof(rply)); switch(rqst.op) { /* ret gets set here */ case CNID_DBD_OP_OPEN: case CNID_DBD_OP_CLOSE: /* open/close are noops for now. */ rply.namelen = 0; ret = 1; break; case CNID_DBD_OP_ADD: ret = dbd_add(dbd, &rqst, &rply, 0); break; case CNID_DBD_OP_GET: ret = dbd_get(dbd, &rqst, &rply); break; case CNID_DBD_OP_RESOLVE: ret = dbd_resolve(dbd, &rqst, &rply); break; case CNID_DBD_OP_LOOKUP: ret = dbd_lookup(dbd, &rqst, &rply, 0); break; case CNID_DBD_OP_UPDATE: ret = dbd_update(dbd, &rqst, &rply); break; case CNID_DBD_OP_DELETE: ret = dbd_delete(dbd, &rqst, &rply, DBIF_CNID); break; case CNID_DBD_OP_GETSTAMP: ret = dbd_getstamp(dbd, &rqst, &rply); break; case CNID_DBD_OP_REBUILD_ADD: ret = dbd_rebuild_add(dbd, &rqst, &rply); break; case CNID_DBD_OP_SEARCH: ret = dbd_search(dbd, &rqst, &rply); break; default: LOG(log_error, logtype_cnid, "loop: unknown op %d", rqst.op); ret = -1; break; } if ((cret = comm_snd(&rply)) < 0 || ret < 0) { dbif_txn_abort(dbd); return -1; } if (ret == 0 || cret == 0) { if (dbif_txn_abort(dbd) < 0) return -1; } else { ret = dbif_txn_commit(dbd); if ( ret < 0) return -1; else if ( ret > 0 ) /* We had a designated txn because we wrote to the db */ count++; } } /* got a request */ /* Shall we checkpoint bdb ? "flush_interval" seconds passed ? */ if (now >= time_next_flush) { LOG(log_info, logtype_cnid, "Checkpointing BerkeleyDB for volume '%s'", dbp->dir); if (dbif_txn_checkpoint(dbd, 0, 0, 0) < 0) return -1; count = 0; time_next_flush = now + dbp->flush_interval; strftime(timebuf, 63, "%b %d %H:%M:%S.",localtime(&time_next_flush)); LOG(log_debug, logtype_cnid, "Checkpoint interval: %d seconds. Next checkpoint: %s", dbp->flush_interval, timebuf); } /* Shall we checkpoint bdb ? Have we commited "count" more changes than "flush_frequency" ? */ if (count > dbp->flush_frequency) { LOG(log_info, logtype_cnid, "Checkpointing BerkeleyDB after %d writes for volume '%s'", count, dbp->dir); if (dbif_txn_checkpoint(dbd, 0, 0, 0) < 0) return -1; count = 0; } } /* while(1) */ } /* ------------------------ */ static void switch_to_user(char *dir) { struct stat st; if (chdir(dir) < 0) { LOG(log_error, logtype_cnid, "chdir to %s failed: %s", dir, strerror(errno)); exit(1); } if (stat(".", &st) < 0) { LOG(log_error, logtype_cnid, "error in stat for %s: %s", dir, strerror(errno)); exit(1); } if (!getuid()) { LOG(log_info, logtype_cnid, "Setting uid/gid to %i/%i", st.st_uid, st.st_gid); if (setgid(st.st_gid) < 0 || setuid(st.st_uid) < 0) { LOG(log_error, logtype_cnid, "uid/gid: %s", strerror(errno)); exit(1); } } } /* ----------------------- */ static void set_signal(void) { struct sigaction sv; sv.sa_handler = sig_exit; sv.sa_flags = 0; sigemptyset(&sv.sa_mask); sigaddset(&sv.sa_mask, SIGINT); sigaddset(&sv.sa_mask, SIGTERM); if (sigaction(SIGINT, &sv, NULL) < 0 || sigaction(SIGTERM, &sv, NULL) < 0) { LOG(log_error, logtype_cnid, "main: sigaction: %s", strerror(errno)); exit(1); } sv.sa_handler = SIG_IGN; sigemptyset(&sv.sa_mask); if (sigaction(SIGPIPE, &sv, NULL) < 0) { LOG(log_error, logtype_cnid, "main: sigaction: %s", strerror(errno)); exit(1); } } /* ------------------------ */ int main(int argc, char *argv[]) { struct db_param *dbp; int err = 0, ret, delete_bdb = 0; int ctrlfd, clntfd; char *logconfig; set_processname("cnid_dbd"); while (( ret = getopt( argc, argv, "vVd")) != -1 ) { switch (ret) { case 'v': case 'V': printf("cnid_dbd (Netatalk %s)\n", VERSION); return -1; case 'd': delete_bdb = 1; break; } } if (argc - optind != 4) { LOG(log_error, logtype_cnid, "main: not enough arguments"); exit(EXIT_FAILURE); } /* Load .volinfo file */ if (loadvolinfo(argv[optind], &volinfo) == -1) { LOG(log_error, logtype_cnid, "Cant load volinfo for \"%s\"", argv[1]); exit(EXIT_FAILURE); } /* Put "/.AppleDB" at end of volpath, get path from volinfo file */ char dbpath[MAXPATHLEN+1]; if ((strlen(volinfo.v_dbpath) + strlen("/.AppleDB")) > MAXPATHLEN ) { LOG(log_error, logtype_cnid, "CNID db pathname too long: \"%s\"", volinfo.v_dbpath); exit(EXIT_FAILURE); } strncpy(dbpath, volinfo.v_dbpath, MAXPATHLEN - strlen("/.AppleDB")); strcat(dbpath, "/.AppleDB"); ctrlfd = atoi(argv[optind + 1]); clntfd = atoi(argv[optind + 2]); logconfig = strdup(argv[optind + 3]); setuplog(logconfig); if (vol_load_charsets(&volinfo) == -1) { LOG(log_error, logtype_cnid, "Error loading charsets!"); exit(EXIT_FAILURE); } LOG(log_debug, logtype_cnid, "db dir: \"%s\"", dbpath); switch_to_user(dbpath); /* Get db lock */ if ((db_locked = get_lock(LOCK_EXCL, dbpath)) == -1) { LOG(log_error, logtype_cnid, "main: fatal db lock error"); exit(1); } if (db_locked != LOCK_EXCL) { /* Couldn't get exclusive lock, try shared lock */ if ((db_locked = get_lock(LOCK_SHRD, NULL)) != LOCK_SHRD) { LOG(log_error, logtype_cnid, "main: fatal db lock error"); exit(1); } } if (delete_bdb && (db_locked == LOCK_EXCL)) { LOG(log_warning, logtype_cnid, "main: too many CNID db opening attempts, wiping the slate clean"); chdir(dbpath); system("rm -f cnid2.db lock log.* __db.*"); if ((db_locked = get_lock(LOCK_EXCL, dbpath)) != LOCK_EXCL) { LOG(log_error, logtype_cnid, "main: fatal db lock error"); exit(EXIT_FAILURE); } } set_signal(); /* SIGINT and SIGTERM are always off, unless we are in pselect */ block_sigs_onoff(1); if ((dbp = db_param_read(dbpath)) == NULL) exit(1); LOG(log_maxdebug, logtype_cnid, "Finished parsing db_param config file"); if (NULL == (dbd = dbif_init(dbpath, "cnid2.db"))) exit(2); /* Only recover if we got the lock */ if (dbif_env_open(dbd, dbp, (db_locked == LOCK_EXCL) ? DBOPTIONS | DB_RECOVER : DBOPTIONS) < 0) exit(2); /* FIXME: same exit code as failure for dbif_open() */ LOG(log_debug, logtype_cnid, "Finished initializing BerkeleyDB environment"); if (dbif_open(dbd, dbp, 0) < 0) { dbif_close(dbd); exit(2); } LOG(log_debug, logtype_cnid, "Finished opening BerkeleyDB databases"); /* Downgrade db lock */ if (db_locked == LOCK_EXCL) { if (get_lock(LOCK_UNLOCK, NULL) != 0) { dbif_close(dbd); exit(2); } if (get_lock(LOCK_SHRD, NULL) != LOCK_SHRD) { dbif_close(dbd); exit(2); } } if (comm_init(dbp, ctrlfd, clntfd) < 0) { dbif_close(dbd); exit(3); } if (loop(dbp) < 0) err++; if (dbif_close(dbd) < 0) err++; if (dbif_env_remove(dbpath) < 0) err++; if (err) exit(4); else if (exit_sig) LOG(log_info, logtype_cnid, "main: Exiting on signal %i", exit_sig); else LOG(log_info, logtype_cnid, "main: Idle timeout, exiting"); return 0; } netatalk-2.2.2/etc/cnid_dbd/db_param.c0000644000175200017500000001417311655731126014472 00000000000000/* * $Id: db_param.c,v 1.9 2009-11-23 19:04:14 franklahm Exp $ * * Copyright (C) Joerg Lenneis 2003 * Copyright (c) Frank Lahm 2009 * All Rights Reserved. See COPYING. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include "db_param.h" #define DB_PARAM_FN "db_param" #define MAXKEYLEN 64 static struct db_param params; static int parse_err; static size_t usock_maxlen(void) { struct sockaddr_un addr; return sizeof(addr.sun_path) - 1; } static int make_pathname(char *path, char *dir, char *fn, size_t maxlen) { size_t len; if (fn[0] != '/') { len = strlen(dir); if (len + 1 + strlen(fn) > maxlen) return -1; strcpy(path, dir); if (path[len - 1] != '/') strcat(path, "/"); strcat(path, fn); } else { if (strlen(fn) > maxlen) return -1; strcpy(path, fn); } return 0; } static void default_params(struct db_param *dbp, char *dir) { dbp->logfile_autoremove = DEFAULT_LOGFILE_AUTOREMOVE; dbp->cachesize = DEFAULT_CACHESIZE; dbp->maxlocks = DEFAULT_MAXLOCKS; dbp->maxlockobjs = DEFAULT_MAXLOCKOBJS; dbp->flush_frequency = DEFAULT_FLUSH_FREQUENCY; dbp->flush_interval = DEFAULT_FLUSH_INTERVAL; if (make_pathname(dbp->usock_file, dir, DEFAULT_USOCK_FILE, usock_maxlen()) < 0) { /* Not an error yet, it might be set in the config file */ dbp->usock_file[0] = '\0'; } dbp->fd_table_size = DEFAULT_FD_TABLE_SIZE; if ( dbp->fd_table_size > FD_SETSIZE -1) dbp->fd_table_size = FD_SETSIZE -1; dbp->idle_timeout = DEFAULT_IDLE_TIMEOUT; return; } static int parse_int(char *val) { char *tmp; int result = 0; result = strtol(val, &tmp, 10); if (tmp[0] != '\0') { LOG(log_error, logtype_cnid, "invalid characters in token %s", val); parse_err++; } return result; } /* TODO: This configuration file reading routine is neither very robust (%s buffer overflow) nor elegant, we need to add support for whitespace in filenames as well. */ struct db_param *db_param_read(char *dir) { FILE *fp; static char key[MAXKEYLEN + 1]; static char val[MAXPATHLEN + 1]; static char pfn[MAXPATHLEN + 1]; int items; default_params(¶ms, dir); params.dir = dir; if (make_pathname(pfn, dir, DB_PARAM_FN, MAXPATHLEN) < 0) { LOG(log_error, logtype_cnid, "Parameter filename too long"); return NULL; } if ((fp = fopen(pfn, "r")) == NULL) { if (errno == ENOENT) { if (strlen(params.usock_file) == 0) { LOG(log_error, logtype_cnid, "default usock filename too long"); return NULL; } else { return ¶ms; } } else { LOG(log_error, logtype_cnid, "error opening %s: %s", pfn, strerror(errno)); return NULL; } } parse_err = 0; while ((items = fscanf(fp, " %s %s", key, val)) != EOF) { if (items != 2) { LOG(log_error, logtype_cnid, "error parsing config file"); parse_err++; break; } /* Config for both cnid_meta and dbd */ if (! strcmp(key, "usock_file")) { if (make_pathname(params.usock_file, dir, val, usock_maxlen()) < 0) { LOG(log_error, logtype_cnid, "usock filename %s too long", val); parse_err++; } else LOG(log_info, logtype_cnid, "db_param: setting UNIX domain socket filename to %s", params.usock_file); } if (! strcmp(key, "fd_table_size")) { params.fd_table_size = parse_int(val); LOG(log_info, logtype_cnid, "db_param: setting max number of concurrent afpd connections per volume (fd_table_size) to %d", params.fd_table_size); } else if (! strcmp(key, "logfile_autoremove")) { params.logfile_autoremove = parse_int(val); LOG(log_info, logtype_cnid, "db_param: setting logfile_autoremove to %d", params.logfile_autoremove); } else if (! strcmp(key, "cachesize")) { params.cachesize = parse_int(val); LOG(log_info, logtype_cnid, "db_param: setting cachesize to %d", params.cachesize); } else if (! strcmp(key, "maxlocks")) { params.maxlocks = parse_int(val); LOG(log_info, logtype_cnid, "db_param: setting maxlocks to %d", params.maxlocks); } else if (! strcmp(key, "maxlockobjs")) { params.maxlockobjs = parse_int(val); LOG(log_info, logtype_cnid, "db_param: setting maxlockobjs to %d", params.maxlockobjs); } else if (! strcmp(key, "flush_frequency")) { params.flush_frequency = parse_int(val); LOG(log_info, logtype_cnid, "db_param: setting flush_frequency to %d", params.flush_frequency); } else if (! strcmp(key, "flush_interval")) { params.flush_interval = parse_int(val); LOG(log_info, logtype_cnid, "db_param: setting flush_interval to %d", params.flush_interval); } else if (! strcmp(key, "idle_timeout")) { params.idle_timeout = parse_int(val); LOG(log_info, logtype_cnid, "db_param: setting idle timeout to %d", params.idle_timeout); } if (parse_err) break; } if (strlen(params.usock_file) == 0) { LOG(log_error, logtype_cnid, "default usock filename too long"); parse_err++; } fclose(fp); if (! parse_err) { /* sanity checks */ if (params.flush_frequency <= 0) params.flush_frequency = 86400; if (params.flush_interval <= 0) params.flush_interval = 1000000; if (params.fd_table_size <= 2) params.fd_table_size = 32; if (params.idle_timeout <= 0) params.idle_timeout = 86400; return ¶ms; } else return NULL; } netatalk-2.2.2/etc/cnid_dbd/dbd_update.c0000644000175200017500000000353011655731126015013 00000000000000/* * Copyright (C) Joerg Lenneis 2003 * Copyright (C) Frank Lahm 2009,2010 * All Rights Reserved. See COPYING. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include "pack.h" #include "dbif.h" #include "dbd.h" /* cnid_update: takes the given cnid and updates the metadata. First, delete given CNID, then re-insert. */ int dbd_update(DBD *dbd, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply) { DBT key, data; memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); rply->namelen = 0; /* Try to wipe everything, also using the indexes */ if (dbd_delete(dbd, rqst, rply, DBIF_CNID) < 0) goto err_db; if (dbd_delete(dbd, rqst, rply, DBIF_IDX_DEVINO) < 0) goto err_db; if (dbd_delete(dbd, rqst, rply, DBIF_IDX_DIDNAME) < 0) goto err_db; /* Make a new entry. */ key.data = &rqst->cnid; key.size = sizeof(rqst->cnid); data.data = pack_cnid_data(rqst); data.size = CNID_HEADER_LEN + rqst->namelen + 1; memcpy(data.data, &rqst->cnid, sizeof(rqst->cnid)); if (dbif_put(dbd, DBIF_CNID, &key, &data, 0) < 0) goto err_db; LOG(log_debug, logtype_cnid, "dbd_update: Updated dbd with dev/ino: 0x%llx/0x%llx, did: %u, name: %s, cnid: %u", (unsigned long long)rqst->dev, (unsigned long long)rqst->ino, ntohl(rqst->did), rqst->name, ntohl(rqst->cnid)); rply->result = CNID_DBD_RES_OK; return 1; err_db: LOG(log_error, logtype_cnid, "dbd_update: Unable to update CNID: %u, dev/ino: 0x%llx/0x%llx, DID: %u: %s", ntohl(rqst->cnid), (unsigned long long)rqst->dev, (unsigned long long)rqst->ino, ntohl(rqst->did), rqst->name); rply->result = CNID_DBD_RES_ERR_DB; return -1; } netatalk-2.2.2/etc/cnid_dbd/dbd_dbcheck.c0000644000175200017500000000247411655731126015122 00000000000000/* * $Id: dbd_dbcheck.c,v 1.4 2009-05-06 11:54:24 franklahm Exp $ * * Copyright (C) Joerg Lenneis 2003 * All Rights Reserved. See COPYING. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include "pack.h" #include "dbif.h" #include "dbd.h" int dbd_check_indexes(DBD *dbd, char *dbdir) { u_int32_t c_didname = 0, c_devino = 0, c_cnid = 0; LOG(log_note, logtype_cnid, "CNID database at `%s' is being checked (quick)", dbdir); if (dbif_count(dbd, DBIF_CNID, &c_cnid)) return -1; if (dbif_count(dbd, DBIF_IDX_DEVINO, &c_devino)) return -1; /* bailout after the first error */ if ( c_cnid != c_devino) { LOG(log_error, logtype_cnid, "CNID database at `%s' corrupted (%u/%u)", dbdir, c_cnid, c_devino); return 1; } if (dbif_count(dbd, DBIF_IDX_DIDNAME, &c_didname)) return -1; if ( c_cnid != c_didname) { LOG(log_error, logtype_cnid, "CNID database at `%s' corrupted (%u/%u)", dbdir, c_cnid, c_didname); return 1; } LOG(log_note, logtype_cnid, "CNID database at `%s' seems ok, %u entries.", dbdir, c_cnid); return 0; } netatalk-2.2.2/etc/cnid_dbd/dbif.c0000644000175200017500000012361311665651044013632 00000000000000/* * Copyright (C) Joerg Lenneis 2003 * Copyright (C) Frank Lahm 2009 * All Rights Reserved. See COPYING. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include "db_param.h" #include "dbif.h" #include "pack.h" #define DB_ERRLOGFILE "db_errlog" /*! * Get the db stamp which is the st_ctime of the file "cnid2.db" and store it in buffer */ static int dbif_stamp(DBD *dbd, void *buffer, int size) { EC_INIT; struct stat st; int cwd = -1; if (size < 8) EC_FAIL; /* Remember cwd */ if ((cwd = open(".", O_RDONLY)) < 0) { LOG(log_error, logtype_cnid, "error opening cwd: %s", strerror(errno)); EC_FAIL; } /* chdir to db_envhome */ if ((chdir(dbd->db_envhome)) != 0) { LOG(log_error, logtype_cnid, "error chdiring to db_env '%s': %s", dbd->db_envhome, strerror(errno)); EC_FAIL; } if (stat(dbd->db_table[DBIF_CNID].name, &st) < 0) { LOG(log_error, logtype_cnid, "error stating database %s: %s", dbd->db_table[DBIF_CNID].name, db_strerror(errno)); EC_FAIL; } LOG(log_maxdebug, logtype_cnid,"stamp: %s", asctime(localtime(&st.st_ctime))); memset(buffer, 0, size); memcpy(buffer, &st.st_ctime, sizeof(st.st_ctime)); EC_CLEANUP: if (cwd != -1) { if (fchdir(cwd) != 0) { LOG(log_error, logtype_cnid, "error chdiring back: %s", strerror(errno)); EC_STATUS(-1); } close(cwd); } EC_EXIT; } /*! * Inititialize rootinfo key (which has CNID 0 as key) * * This also "stamps" the database, which means storing st.st_ctime of the * "cnid2.db" file in the rootinfo data at the DEV offset * * @param dbd (rw) database handle * @param version (r) database version number * * @returns -1 on error, 0 on success */ static int dbif_init_rootinfo(DBD *dbd, int version) { DBT key, data; uint32_t v; char buf[ROOTINFO_DATALEN]; LOG(log_debug, logtype_cnid, "Setting CNID database version to %u", version); v = version; v = htonl(v); memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); key.data = ROOTINFO_KEY; key.size = ROOTINFO_KEYLEN; data.data = buf; data.size = ROOTINFO_DATALEN; memcpy(buf, ROOTINFO_DATA, ROOTINFO_DATALEN); memcpy(buf + CNID_DID_OFS, &v, sizeof(v)); if (dbif_stamp(dbd, buf + CNID_DEV_OFS, CNID_DEV_LEN) < 0) return -1; if (dbif_put(dbd, DBIF_CNID, &key, &data, 0) < 0) return -1; if (dbif_txn_commit(dbd) != 1) { LOG(log_error, logtype_cnid, "dbif_init_rootinfo: cant commit txn"); return -1; } return 0; } /*! * Return CNID database version number * * Returns version in *version * * @returns -1 on error, 0 if theres no rootinfo key yet, 1 if *version is returned */ static int dbif_getversion(DBD *dbd, uint32_t *version) { DBT key, data; int ret; LOG(log_maxdebug, logtype_cnid, "dbif_getversion: reading version info"); *version = -1; memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); key.data = ROOTINFO_KEY; key.size = ROOTINFO_KEYLEN; switch (dbif_get(dbd, DBIF_CNID, &key, &data, 0)) { case 1: /* found */ memcpy(version, (char *)data.data + CNID_DID_OFS, sizeof(uint32_t)); *version = ntohl(*version); LOG(log_debug, logtype_cnid, "CNID database version %u", *version); ret = 1; break; case 0: /* not found */ LOG(log_debug, logtype_cnid, "dbif_getversion: no version info found"); ret = 0; break; default: LOG(log_error, logtype_cnid, "dbif_getversion: database error"); ret = -1; break; } return ret; } /*! * Set CNID database version number * * Initializes rootinfo key as neccessary * @returns -1 on error, 0 on success */ static int dbif_setversion(DBD *dbd, uint32_t version) { int ret; DBT key, data; uint32_t v; LOG(log_debug, logtype_cnid, "Setting CNID database version to %u", version); v = version; v = htonl(v); memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); key.data = ROOTINFO_KEY; key.size = ROOTINFO_KEYLEN; if ((ret = dbif_get(dbd, DBIF_CNID, &key, &data, 0)) == -1) return -1; if (ret == 0) { /* No rootinfo key yet, init it */ if (dbif_init_rootinfo(dbd, CNID_VERSION) != 0) return -1; /* Now try again */ if (dbif_get(dbd, DBIF_CNID, &key, &data, 0) == -1) return -1; } memcpy((char *)data.data + CNID_DID_OFS, &v, sizeof(v)); data.size = ROOTINFO_DATALEN; if (dbif_put(dbd, DBIF_CNID, &key, &data, 0) < 0) return -1; return 0; } /*! * Upgrade CNID database versions, initialize rootinfo key as as necessary in dbif_setversion() * * For now this does nothing, as upgrading from ver. 0 to 1 is done in dbif_open */ #define UNINTIALIZED_DB UINT32_MAX static int dbif_upgrade(DBD *dbd) { uint32_t version = CNID_VERSION_UNINTIALIZED_DB; if (dbif_getversion(dbd, &version) == -1) return -1; if (version == CNID_VERSION_UNINTIALIZED_DB) { version = CNID_VERSION; if (dbif_setversion(dbd, CNID_VERSION) != 0) return -1; } /* * Do upgrade stuff ... */ /* Write current version to database */ if (version != CNID_VERSION) { if (dbif_setversion(dbd, CNID_VERSION) != 0) return -1; } LOG(log_debug, logtype_cnid, "Finished CNID database version upgrade check"); return 0; } /* --------------- */ static int dbif_openlog(DBD *dbd) { int ret = 0; int cwd = -1; if ( ! dbd->db_filename) /* in memory db */ return 0; /* Remember cwd */ if ((cwd = open(".", O_RDONLY)) < 0) { LOG(log_error, logtype_cnid, "error opening cwd: %s", strerror(errno)); return -1; } /* chdir to db_envhome */ if ((chdir(dbd->db_envhome)) != 0) { LOG(log_error, logtype_cnid, "error chdiring to db_env '%s': %s", dbd->db_envhome, strerror(errno)); ret = -1; goto exit; } if ((dbd->db_errlog = fopen(DB_ERRLOGFILE, "a")) == NULL) LOG(log_warning, logtype_cnid, "error creating/opening DB errlogfile: %s", strerror(errno)); if (dbd->db_errlog != NULL) { dbd->db_env->set_errfile(dbd->db_env, dbd->db_errlog); dbd->db_env->set_msgfile(dbd->db_env, dbd->db_errlog); } exit: if (cwd != -1) { if ((fchdir(cwd)) != 0) { LOG(log_error, logtype_cnid, "error chdiring back: %s", strerror(errno)); ret = -1; } close(cwd); } return ret; } /* --------------- */ static int dbif_logautorem(DBD *dbd) { int ret = 0; int cwd = -1; char **logfiles = NULL; char **file; if ( ! dbd->db_filename) /* in memory db */ return 0; /* Remember cwd */ if ((cwd = open(".", O_RDONLY)) < 0) { LOG(log_error, logtype_cnid, "error opening cwd: %s", strerror(errno)); return -1; } /* chdir to db_envhome */ if ((chdir(dbd->db_envhome)) != 0) { LOG(log_error, logtype_cnid, "error chdiring to db_env '%s': %s", dbd->db_envhome, strerror(errno)); ret = -1; goto exit; } if ((ret = dbd->db_env->log_archive(dbd->db_env, &logfiles, 0)) != 0) { LOG(log_error, logtype_cnid, "error getting list of stale logfiles: %s", db_strerror(ret)); dbd->db_env->close(dbd->db_env, 0); dbd->db_env = NULL; ret = -1; goto exit; } if (logfiles != NULL) { for (file = logfiles; *file != NULL; file++) { if (unlink(*file) < 0) LOG(log_warning, logtype_cnid, "Error removing stale logfile %s: %s", *file, strerror(errno)); } free(logfiles); } exit: if (cwd != -1) { if ((fchdir(cwd)) != 0) { LOG(log_error, logtype_cnid, "error chdiring back: %s", strerror(errno)); ret = -1; } close(cwd); } return ret; } /*! * Get lock on db lock file * * @args cmd (r) lock command: * LOCK_FREE: close lockfd * LOCK_UNLOCK: unlock lockm keep lockfd open * LOCK_EXCL: F_WRLCK on lockfd * LOCK_SHRD: F_RDLCK on lockfd * @args dbpath (r) path to lockfile, only used on first call, * later the stored fd is used * @returns LOCK_FREE/LOCK_UNLOCK return 0 on success, -1 on error * LOCK_EXCL/LOCK_SHRD return LOCK_EXCL or LOCK_SHRD respectively on * success, 0 if the lock couldn't be acquired, -1 on other errors */ int get_lock(int cmd, const char *dbpath) { static int lockfd = -1; int ret; char lockpath[PATH_MAX]; struct stat st; switch (cmd) { case LOCK_FREE: if (lockfd == -1) return -1; close(lockfd); lockfd = -1; return 0; case LOCK_UNLOCK: if (lockfd == -1) return -1; return unlock(lockfd, 0, SEEK_SET, 0); case LOCK_EXCL: case LOCK_SHRD: if (lockfd == -1) { if ( (strlen(dbpath) + strlen(LOCKFILENAME+1)) > (PATH_MAX - 1) ) { LOG(log_error, logtype_cnid, ".AppleDB pathname too long"); return -1; } strncpy(lockpath, dbpath, PATH_MAX - 1); strcat(lockpath, "/"); strcat(lockpath, LOCKFILENAME); if ((lockfd = open(lockpath, O_RDWR | O_CREAT, 0644)) < 0) { LOG(log_error, logtype_cnid, "Error opening lockfile: %s", strerror(errno)); return -1; } if ((stat(dbpath, &st)) != 0) { LOG(log_error, logtype_cnid, "Error statting lockfile: %s", strerror(errno)); return -1; } if ((chown(lockpath, st.st_uid, st.st_gid)) != 0) { LOG(log_error, logtype_cnid, "Error inheriting lockfile permissions: %s", strerror(errno)); return -1; } } if (cmd == LOCK_EXCL) ret = write_lock(lockfd, 0, SEEK_SET, 0); else ret = read_lock(lockfd, 0, SEEK_SET, 0); if (ret != 0) { if (cmd == LOCK_SHRD) LOG(log_error, logtype_cnid, "Volume CNID db is locked, try again..."); return 0; } LOG(log_debug, logtype_cnid, "get_lock: got %s lock", cmd == LOCK_EXCL ? "LOCK_EXCL" : "LOCK_SHRD"); return cmd; default: return -1; } /* switch(cmd) */ /* deadc0de, never get here */ return -1; } /* --------------- */ DBD *dbif_init(const char *envhome, const char *filename) { DBD *dbd; if ( NULL == (dbd = calloc(sizeof(DBD), 1)) ) return NULL; /* filename == NULL means in memory db */ if (filename) { if (! envhome) return NULL; dbd->db_envhome = strdup(envhome); if (NULL == dbd->db_envhome) { free(dbd); return NULL; } dbd->db_filename = strdup(filename); if (NULL == dbd->db_filename) { free(dbd->db_envhome); free(dbd); return NULL; } } dbd->db_table[DBIF_CNID].name = "cnid2.db"; dbd->db_table[DBIF_IDX_DEVINO].name = "devino.db"; dbd->db_table[DBIF_IDX_DIDNAME].name = "didname.db"; dbd->db_table[DBIF_IDX_NAME].name = "name.db"; dbd->db_table[DBIF_CNID].type = DB_BTREE; dbd->db_table[DBIF_IDX_DEVINO].type = DB_BTREE; dbd->db_table[DBIF_IDX_DIDNAME].type = DB_BTREE; dbd->db_table[DBIF_IDX_NAME].type = DB_BTREE; dbd->db_table[DBIF_CNID].openflags = DB_CREATE; dbd->db_table[DBIF_IDX_DEVINO].openflags = DB_CREATE; dbd->db_table[DBIF_IDX_DIDNAME].openflags = DB_CREATE; dbd->db_table[DBIF_IDX_NAME].openflags = DB_CREATE; dbd->db_table[DBIF_IDX_NAME].flags = DB_DUPSORT; return dbd; } /* We must open the db_env with an absolute pathname, as `dbd` keeps chdir'ing, which breaks e.g. bdb logfile-rotation with relative pathnames. But still we use relative paths with DB_ERRLOGFILE in order to avoid creating absolute paths by copying. Both have no problem with a relative path. */ int dbif_env_open(DBD *dbd, struct db_param *dbp, uint32_t dbenv_oflags) { int ret; if ((ret = db_env_create(&dbd->db_env, 0))) { LOG(log_error, logtype_cnid, "error creating DB environment: %s", db_strerror(ret)); dbd->db_env = NULL; return -1; } dbd->db_param = *dbp; if ((dbif_openlog(dbd)) != 0) return -1; if (dbenv_oflags & DB_RECOVER) { LOG(log_debug, logtype_cnid, "Running recovery"); dbd->db_env->set_verbose(dbd->db_env, DB_VERB_RECOVERY, 1); /* Open the database for recovery using DB_PRIVATE option which is faster */ if ((ret = dbd->db_env->open(dbd->db_env, dbd->db_envhome, dbenv_oflags | DB_PRIVATE, 0))) { LOG(log_error, logtype_cnid, "error opening DB environment: %s", db_strerror(ret)); dbd->db_env->close(dbd->db_env, 0); dbd->db_env = NULL; return -1; } dbenv_oflags = (dbenv_oflags & ~DB_RECOVER); if (dbd->db_errlog != NULL) fflush(dbd->db_errlog); if ((ret = dbd->db_env->close(dbd->db_env, 0))) { LOG(log_error, logtype_cnid, "error closing DB environment after recovery: %s", db_strerror(ret)); dbd->db_env = NULL; return -1; } dbd->db_errlog = NULL; if ((ret = db_env_create(&dbd->db_env, 0))) { LOG(log_error, logtype_cnid, "error creating DB environment after recovery: %s", db_strerror(ret)); dbd->db_env = NULL; return -1; } if ((dbif_openlog(dbd)) != 0) return -1; LOG(log_debug, logtype_cnid, "Finished recovery."); } if ((ret = dbd->db_env->set_cachesize(dbd->db_env, 0, 1024 * dbp->cachesize, 0))) { LOG(log_error, logtype_cnid, "error setting DB environment cachesize to %i: %s", dbp->cachesize, db_strerror(ret)); dbd->db_env->close(dbd->db_env, 0); dbd->db_env = NULL; return -1; } if ((ret = dbd->db_env->set_lk_max_locks(dbd->db_env, dbp->maxlocks))) { LOG(log_error, logtype_cnid, "error setting DB environment maxlocks to %i: %s", 10000, db_strerror(ret)); dbd->db_env->close(dbd->db_env, 0); dbd->db_env = NULL; return -1; } if ((ret = dbd->db_env->set_lk_max_objects(dbd->db_env, dbp->maxlockobjs))) { LOG(log_error, logtype_cnid, "error setting DB environment max lockobjects to %i: %s", 10000, db_strerror(ret)); dbd->db_env->close(dbd->db_env, 0); dbd->db_env = NULL; return -1; } if ((ret = dbd->db_env->open(dbd->db_env, dbd->db_envhome, dbenv_oflags, 0))) { LOG(log_error, logtype_cnid, "error opening DB environment after recovery: %s", db_strerror(ret)); dbd->db_env->close(dbd->db_env, 0); dbd->db_env = NULL; return -1; } if ((ret = dbd->db_env->set_flags(dbd->db_env, DB_AUTO_COMMIT, 1))) { LOG(log_error, logtype_cnid, "error setting DB_AUTO_COMMIT flag: %s", db_strerror(ret)); dbd->db_env->close(dbd->db_env, 0); dbd->db_env = NULL; return -1; } if (dbp->logfile_autoremove) { if ((dbif_logautorem(dbd)) != 0) return -1; #if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 7) if ((ret = dbd->db_env->log_set_config(dbd->db_env, DB_LOG_AUTO_REMOVE, 1))) { LOG(log_error, logtype_cnid, "error setting DB_LOG_AUTO_REMOVE flag: %s", db_strerror(ret)); dbd->db_env->close(dbd->db_env, 0); dbd->db_env = NULL; return -1; } #else if ((ret = dbd->db_env->set_flags(dbd->db_env, DB_LOG_AUTOREMOVE, 1))) { LOG(log_error, logtype_cnid, "error setting DB_LOG_AUTOREMOVE flag: %s", db_strerror(ret)); dbd->db_env->close(dbd->db_env, 0); dbd->db_env = NULL; return -1; } #endif } return 0; } /* --------------- */ int dbif_open(DBD *dbd, struct db_param *dbp, int reindex) { int ret, i, cwd; u_int32_t count; struct stat st; DB *upgrade_db; /* Try to upgrade if it's a normal on-disk database */ if (dbd->db_envhome) { /* Remember cwd */ if ((cwd = open(".", O_RDONLY)) < 0) { LOG(log_error, logtype_cnid, "error opening cwd: %s", strerror(errno)); return -1; } /* chdir to db_envhome. makes it easier checking for old db files and creating db_errlog file */ if ((chdir(dbd->db_envhome)) != 0) { LOG(log_error, logtype_cnid, "error chdiring to db_env '%s': %s", dbd->db_envhome, strerror(errno)); return -1; } if ((stat(dbd->db_filename, &st)) == 0) { LOG(log_debug, logtype_cnid, "See if we can upgrade the CNID database..."); if ((ret = db_create(&upgrade_db, dbd->db_env, 0))) { LOG(log_error, logtype_cnid, "error creating handle for database: %s", db_strerror(ret)); return -1; } if ((ret = upgrade_db->upgrade(upgrade_db, dbd->db_filename, 0))) { LOG(log_error, logtype_cnid, "error upgarding database: %s", db_strerror(ret)); return -1; } if ((ret = upgrade_db->close(upgrade_db, 0))) { LOG(log_error, logtype_cnid, "error closing database: %s", db_strerror(ret)); return -1; } if ((ret = dbd->db_env->txn_checkpoint(dbd->db_env, 0, 0, DB_FORCE))) { LOG(log_error, logtype_cnid, "error forcing checkpoint: %s", db_strerror(ret)); return -1; } LOG(log_debug, logtype_cnid, "Finished BerkeleyBD upgrade check"); } if ((fchdir(cwd)) != 0) { LOG(log_error, logtype_cnid, "error chdiring back: %s", strerror(errno)); return -1; } } /* Now open databases ... */ for (i = 0; i != DBIF_DB_CNT; i++) { if ((ret = db_create(&dbd->db_table[i].db, dbd->db_env, 0))) { LOG(log_error, logtype_cnid, "error creating handle for database %s: %s", dbd->db_table[i].name, db_strerror(ret)); return -1; } if (dbd->db_table[i].flags) { if ((ret = dbd->db_table[i].db->set_flags(dbd->db_table[i].db, dbd->db_table[i].flags))) { LOG(log_error, logtype_cnid, "error setting flags for database %s: %s", dbd->db_table[i].name, db_strerror(ret)); return -1; } } if ( ! dbd->db_env) { /* In memory db */ if ((ret = dbd->db_table[i].db->set_cachesize(dbd->db_table[i].db, 0, dbp->cachesize, 4)) /* split in 4 memory chunks */ < 0) { LOG(log_error, logtype_cnid, "error setting cachesize %u KB for database %s: %s", dbp->cachesize / 1024, dbd->db_table[i].name, db_strerror(ret)); return -1; } } if (dbd->db_table[i].db->open(dbd->db_table[i].db, dbd->db_txn, dbd->db_filename, dbd->db_table[i].name, dbd->db_table[i].type, dbd->db_table[i].openflags, 0664) < 0) { LOG(log_error, logtype_cnid, "Cant open database"); return -1; } if (reindex && i > 0) { LOG(log_info, logtype_cnid, "Truncating CNID index."); if ((ret = dbd->db_table[i].db->truncate(dbd->db_table[i].db, NULL, &count, 0))) { LOG(log_error, logtype_cnid, "error truncating database %s: %s", dbd->db_table[i].name, db_strerror(ret)); return -1; } } } /* TODO: Implement CNID DB versioning info on new databases. */ /* Associate the secondary with the primary. */ if (reindex) LOG(log_info, logtype_cnid, "Reindexing did/name index..."); if ((ret = dbd->db_table[0].db->associate(dbd->db_table[DBIF_CNID].db, dbd->db_txn, dbd->db_table[DBIF_IDX_DIDNAME].db, didname, (reindex) ? DB_CREATE : 0)) != 0) { LOG(log_error, logtype_cnid, "Failed to associate didname database: %s",db_strerror(ret)); return -1; } if (reindex) LOG(log_info, logtype_cnid, "... done."); if (reindex) LOG(log_info, logtype_cnid, "Reindexing dev/ino index..."); if ((ret = dbd->db_table[0].db->associate(dbd->db_table[0].db, dbd->db_txn, dbd->db_table[DBIF_IDX_DEVINO].db, devino, (reindex) ? DB_CREATE : 0)) != 0) { LOG(log_error, logtype_cnid, "Failed to associate devino database: %s",db_strerror(ret)); return -1; } if (reindex) LOG(log_info, logtype_cnid, "... done."); if (reindex) LOG(log_info, logtype_cnid, "Reindexing name index..."); /* * Upgrading from version 0 to 1 requires adding the name index below which * must be done by specifying the DB_CREATE flag */ uint32_t version = CNID_VERSION; if (dbd->db_envhome && !reindex) { if (dbif_getversion(dbd, &version) == -1) return -1; } if ((ret = dbd->db_table[0].db->associate(dbd->db_table[0].db, dbd->db_txn, dbd->db_table[DBIF_IDX_NAME].db, idxname, (reindex || ((CNID_VERSION == CNID_VERSION_1) && (version == CNID_VERSION_0))) ? DB_CREATE : 0)) != 0) { LOG(log_error, logtype_cnid, "Failed to associate name index: %s", db_strerror(ret)); return -1; } if (reindex) LOG(log_info, logtype_cnid, "... done."); if ((dbd->db_envhome) && ((ret = dbif_upgrade(dbd)) != 0)) { LOG(log_error, logtype_cnid, "Error upgrading CNID database to version %d", CNID_VERSION); return -1; } return 0; } /* ------------------------ */ static int dbif_closedb(DBD *dbd) { int i; int ret; int err = 0; for (i = DBIF_DB_CNT -1; i >= 0; i--) { if (dbd->db_table[i].db != NULL && (ret = dbd->db_table[i].db->close(dbd->db_table[i].db, 0))) { LOG(log_error, logtype_cnid, "error closing database %s: %s", dbd->db_table[i].name, db_strerror(ret)); err++; } } if (err) return -1; return 0; } /* ------------------------ */ int dbif_close(DBD *dbd) { int ret; int err = 0; if (dbif_closedb(dbd)) err++; if (dbd->db_env != NULL && (ret = dbd->db_env->close(dbd->db_env, 0))) { LOG(log_error, logtype_cnid, "error closing DB environment: %s", db_strerror(ret)); err++; } if (dbd->db_errlog != NULL && fclose(dbd->db_errlog) == EOF) { LOG(log_error, logtype_cnid, "error closing DB logfile: %s", strerror(errno)); err++; } free(dbd->db_filename); free(dbd); dbd = NULL; if (err) return -1; return 0; } /* In order to support silent database upgrades: destroy env at cnid_dbd shutdown. */ int dbif_env_remove(const char *path) { int ret; DBD *dbd; LOG(log_debug, logtype_cnid, "Reopening BerkeleyDB environment"); if (NULL == (dbd = dbif_init(path, "cnid2.db"))) return -1; /* Get db_env handle */ if ((ret = db_env_create(&dbd->db_env, 0))) { LOG(log_error, logtype_cnid, "error creating DB environment: %s", db_strerror(ret)); dbd->db_env = NULL; return -1; } if ((dbif_openlog(dbd)) != 0) return -1; /* Open environment with recovery */ if ((ret = dbd->db_env->open(dbd->db_env, dbd->db_envhome, DB_CREATE | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN | DB_RECOVER | DB_PRIVATE, 0))) { LOG(log_error, logtype_cnid, "error opening DB environment: %s", db_strerror(ret)); dbd->db_env->close(dbd->db_env, 0); dbd->db_env = NULL; return -1; } if (dbd->db_errlog != NULL) fflush(dbd->db_errlog); /* Remove logfiles */ if ((ret = dbd->db_env->log_archive(dbd->db_env, NULL, DB_ARCH_REMOVE))) { LOG(log_error, logtype_cnid, "error removing transaction logfiles: %s", db_strerror(ret)); return -1; } if ((ret = dbd->db_env->close(dbd->db_env, 0))) { LOG(log_error, logtype_cnid, "error closing DB environment after recovery: %s", db_strerror(ret)); dbd->db_env = NULL; return -1; } LOG(log_debug, logtype_cnid, "BerkeleyDB environment recovery done."); /* Get a new db_env handle and then remove environment */ if ((ret = db_env_create(&dbd->db_env, 0))) { LOG(log_error, logtype_cnid, "error acquiring db_end handle: %s", db_strerror(ret)); dbd->db_env = NULL; return -1; } if ((ret = dbd->db_env->remove(dbd->db_env, dbd->db_envhome, 0))) { LOG(log_error, logtype_cnid, "error removing BerkeleyDB environment: %s", db_strerror(ret)); return -1; } LOG(log_debug, logtype_cnid, "Removed BerkeleyDB environment."); return 0; } /* * The following three functions are wrappers for DB->get(), DB->put() and DB->del(). * All three return -1 on error. dbif_get()/dbif_del return 1 if the key was found and 0 * otherwise. dbif_put() returns 0 if key/val was successfully updated and 1 if * the DB_NOOVERWRITE flag was specified and the key already exists. * * All return codes other than DB_NOTFOUND and DB_KEYEXIST from the DB->() * functions are not expected and therefore error conditions. */ int dbif_get(DBD *dbd, const int dbi, DBT *key, DBT *val, u_int32_t flags) { int ret; ret = dbd->db_table[dbi].db->get(dbd->db_table[dbi].db, dbd->db_txn, key, val, flags); if (ret == DB_NOTFOUND) return 0; if (ret) { LOG(log_error, logtype_cnid, "error retrieving value from %s: %s", dbd->db_table[dbi].name, db_strerror(ret)); return -1; } else return 1; } /* search by secondary return primary */ int dbif_pget(DBD *dbd, const int dbi, DBT *key, DBT *pkey, DBT *val, u_int32_t flags) { int ret; ret = dbd->db_table[dbi].db->pget(dbd->db_table[dbi].db, dbd->db_txn, key, pkey, val, flags); if (ret == DB_NOTFOUND || ret == DB_SECONDARY_BAD) { return 0; } if (ret) { LOG(log_error, logtype_cnid, "error retrieving value from %s: %s", dbd->db_table[dbi].name, db_strerror(ret)); return -1; } else return 1; } /* -------------------------- */ int dbif_put(DBD *dbd, const int dbi, DBT *key, DBT *val, u_int32_t flags) { int ret; if (dbif_txn_begin(dbd) < 0) { LOG(log_error, logtype_cnid, "error setting key/value in %s", dbd->db_table[dbi].name); return -1; } ret = dbd->db_table[dbi].db->put(dbd->db_table[dbi].db, dbd->db_txn, key, val, flags); if (ret) { if ((flags & DB_NOOVERWRITE) && ret == DB_KEYEXIST) { return 1; } else { LOG(log_error, logtype_cnid, "error setting key/value in %s: %s", dbd->db_table[dbi].name, db_strerror(ret)); return -1; } } else return 0; } int dbif_del(DBD *dbd, const int dbi, DBT *key, u_int32_t flags) { int ret; /* For cooperation with the dbd utility and its usage of a cursor */ if (dbd->db_cur) { dbd->db_cur->close(dbd->db_cur); dbd->db_cur = NULL; } if (dbif_txn_begin(dbd) < 0) { LOG(log_error, logtype_cnid, "error deleting key/value from %s", dbd->db_table[dbi].name); return -1; } ret = dbd->db_table[dbi].db->del(dbd->db_table[dbi].db, dbd->db_txn, key, flags); if (ret == DB_NOTFOUND) { LOG(log_debug, logtype_cnid, "key not found"); return 0; } if (ret) { LOG(log_error, logtype_cnid, "error deleting key/value from %s: %s", dbd->db_table[dbi].name, db_strerror(ret)); return -1; } else return 1; } /*! * Search the database by name * * @param resbuf (w) buffer for search results CNIDs, maxsize is assumed to be * DBD_MAX_SRCH_RSLTS * sizefof(cnid_t) * * @returns -1 on error, 0 when nothing found, else the number of matches */ int dbif_search(DBD *dbd, DBT *key, char *resbuf) { int ret = 0; int count = 0; DBC *cursorp = NULL; DBT pkey, data; char *cnids = resbuf; cnid_t cnid; char *namebkp = key->data; int namelenbkp = key->size; memset(&pkey, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); /* Get a cursor */ ret = dbd->db_table[DBIF_IDX_NAME].db->cursor(dbd->db_table[DBIF_IDX_NAME].db, NULL, &cursorp, 0); if (ret != 0) { LOG(log_error, logtype_cnid, "Couldn't create cursor: %s", db_strerror(ret)); ret = -1; goto exit; } ret = cursorp->pget(cursorp, key, &pkey, &data, DB_SET_RANGE); while (count < DBD_MAX_SRCH_RSLTS && ret != DB_NOTFOUND) { if (!((namelenbkp <= key->size) && (strncmp(namebkp, key->data, namelenbkp) == 0))) break; count++; memcpy(cnids, pkey.data, sizeof(cnid_t)); memcpy(&cnid, pkey.data, sizeof(cnid_t)); cnids += sizeof(cnid_t); LOG(log_debug, logtype_cnid, "match: CNID %" PRIu32, ntohl(cnid)); ret = cursorp->pget(cursorp, key, &pkey, &data, DB_NEXT); } ret = count; exit: if (cursorp != NULL) cursorp->close(cursorp); return ret; } int dbif_txn_begin(DBD *dbd) { int ret; /* If we already have an active txn, just return */ if (dbd->db_txn) return 0; /* If our DBD has no env, just return (-> in memory db) */ if (dbd->db_env == NULL) return 0; ret = dbd->db_env->txn_begin(dbd->db_env, NULL, &dbd->db_txn, 0); if (ret) { LOG(log_error, logtype_cnid, "error starting transaction: %s", db_strerror(ret)); return -1; } else return 0; } int dbif_txn_commit(DBD *dbd) { int ret; if (! dbd->db_txn) return 0; /* If our DBD has no env, just return (-> in memory db) */ if (dbd->db_env == NULL) return 0; ret = dbd->db_txn->commit(dbd->db_txn, 0); dbd->db_txn = NULL; if (ret) { LOG(log_error, logtype_cnid, "error committing transaction: %s", db_strerror(ret)); return -1; } else return 1; } int dbif_txn_abort(DBD *dbd) { int ret; if (! dbd->db_txn) return 0; /* If our DBD has no env, just return (-> in memory db) */ if (dbd->db_env == NULL) return 0; ret = dbd->db_txn->abort(dbd->db_txn); dbd->db_txn = NULL; if (ret) { LOG(log_error, logtype_cnid, "error aborting transaction: %s", db_strerror(ret)); return -1; } else return 0; } /* ret = 1 -> commit txn if db_param.txn_frequency ret = 0 -> abort txn db_param.txn_frequency -> exit! anything else -> exit! @returns 0 on success (abort or commit), -1 on error */ int dbif_txn_close(DBD *dbd, int ret) { if (ret == 0) { if (dbif_txn_abort(dbd) < 0) { LOG( log_error, logtype_cnid, "Fatal error aborting transaction. Exiting!"); return -1; } } else if (ret == 1) { ret = dbif_txn_commit(dbd); if ( ret < 0) { LOG( log_error, logtype_cnid, "Fatal error committing transaction. Exiting!"); return -1; } } else { return -1; } return 0; } int dbif_txn_checkpoint(DBD *dbd, u_int32_t kbyte, u_int32_t min, u_int32_t flags) { int ret; ret = dbd->db_env->txn_checkpoint(dbd->db_env, kbyte, min, flags); if (ret) { LOG(log_error, logtype_cnid, "error checkpointing transaction susystem: %s", db_strerror(ret)); return -1; } else return 0; } int dbif_count(DBD *dbd, const int dbi, u_int32_t *count) { int ret; DB_BTREE_STAT *sp; DB *db = dbd->db_table[dbi].db; ret = db->stat(db, NULL, &sp, 0); if (ret) { LOG(log_error, logtype_cnid, "error getting stat infotmation on database: %s", db_strerror(ret)); return -1; } *count = sp->bt_ndata; free(sp); return 0; } int dbif_copy_rootinfokey(DBD *srcdbd, DBD *destdbd) { DBT key, data; int rc; memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); key.data = ROOTINFO_KEY; key.size = ROOTINFO_KEYLEN; if ((rc = dbif_get(srcdbd, DBIF_CNID, &key, &data, 0)) <= 0) { LOG(log_error, logtype_cnid, "dbif_copy_rootinfokey: Error getting rootinfo record"); return -1; } memset(&key, 0, sizeof(key)); key.data = ROOTINFO_KEY; key.size = ROOTINFO_KEYLEN; if ((rc = dbif_put(destdbd, DBIF_CNID, &key, &data, 0))) { LOG(log_error, logtype_cnid, "dbif_copy_rootinfokey: Error writing rootinfo key"); return -1; } return 0; } int dbif_dump(DBD *dbd, int dumpindexes) { int rc; uint32_t max = 0, count = 0, cnid, type, did, lastid, version; uint64_t dev, ino; time_t stamp; DBC *cur; DBT key = { 0 }, data = { 0 }; DB *db = dbd->db_table[DBIF_CNID].db; char *typestring[2] = {"f", "d"}; char timebuf[64]; printf("CNID database dump:\n"); rc = db->cursor(db, NULL, &cur, 0); if (rc) { LOG(log_error, logtype_cnid, "Couldn't create cursor: %s", db_strerror(rc)); return -1; } cur->c_get(cur, &key, &data, DB_FIRST); while (rc == 0) { /* Parse and print data */ memcpy(&cnid, key.data, 4); cnid = ntohl(cnid); if (cnid > max) max = cnid; /* Rootinfo node ? */ if (cnid == 0) { memcpy(&stamp, (char *)data.data + CNID_DEV_OFS, sizeof(time_t)); memcpy(&lastid, (char *)data.data + CNID_TYPE_OFS, CNID_TYPE_LEN); lastid = ntohl(lastid); memcpy(&version, (char *)data.data + CNID_DID_OFS, CNID_DID_LEN); version = ntohl(version); strftime(timebuf, sizeof(timebuf), "%b %d %Y %H:%M:%S", localtime(&stamp)); printf("CNID db version: %u, dbd stamp: 0x%08x (%s), next free CNID: %u\n", version, (unsigned int)stamp, timebuf, lastid + 1); } else { /* dev */ memcpy(&dev, (char *)data.data + CNID_DEV_OFS, 8); dev = ntoh64(dev); /* ino */ memcpy(&ino, (char *)data.data + CNID_INO_OFS, 8); ino = ntoh64(ino); /* type */ memcpy(&type, (char *)data.data + CNID_TYPE_OFS, 4); type = ntohl(type); /* did */ memcpy(&did, (char *)data.data + CNID_DID_OFS, 4); did = ntohl(did); count++; printf("id: %10u, did: %10u, type: %s, dev: 0x%llx, ino: 0x%016llx, name: %s\n", cnid, did, typestring[type], (long long unsigned int)dev, (long long unsigned int)ino, (char *)data.data + CNID_NAME_OFS); } rc = cur->c_get(cur, &key, &data, DB_NEXT); } if (rc != DB_NOTFOUND) { LOG(log_error, logtype_cnid, "Error iterating over btree: %s", db_strerror(rc)); return -1; } rc = cur->c_close(cur); if (rc) { LOG(log_error, logtype_cnid, "Couldn't close cursor: %s", db_strerror(rc)); return -1; } printf("%u CNIDs in database. Max CNID: %u.\n", count, max); /* Dump indexes too ? */ if (dumpindexes) { /* DBIF_IDX_DEVINO */ printf("\ndev/inode index:\n"); count = 0; db = dbd->db_table[DBIF_IDX_DEVINO].db; rc = db->cursor(db, NULL, &cur, 0); if (rc) { LOG(log_error, logtype_cnid, "Couldn't create cursor: %s", db_strerror(rc)); return -1; } cur->c_get(cur, &key, &data, DB_FIRST); while (rc == 0) { /* Parse and print data */ /* cnid */ memcpy(&cnid, data.data, CNID_LEN); cnid = ntohl(cnid); if (cnid == 0) { /* Rootinfo node */ } else { /* dev */ memcpy(&dev, key.data, CNID_DEV_LEN); dev = ntoh64(dev); /* ino */ memcpy(&ino, (char *)key.data + CNID_DEV_LEN, CNID_INO_LEN); ino = ntoh64(ino); printf("id: %10u <== dev: 0x%llx, ino: 0x%016llx\n", cnid, (unsigned long long int)dev, (unsigned long long int)ino); count++; } rc = cur->c_get(cur, &key, &data, DB_NEXT); } if (rc != DB_NOTFOUND) { LOG(log_error, logtype_cnid, "Error iterating over btree: %s", db_strerror(rc)); return -1; } rc = cur->c_close(cur); if (rc) { LOG(log_error, logtype_cnid, "Couldn't close cursor: %s", db_strerror(rc)); return -1; } printf("%u items\n", count); /* Now dump DBIF_IDX_DIDNAME */ printf("\ndid/name index:\n"); count = 0; db = dbd->db_table[DBIF_IDX_DIDNAME].db; rc = db->cursor(db, NULL, &cur, 0); if (rc) { LOG(log_error, logtype_cnid, "Couldn't create cursor: %s", db_strerror(rc)); return -1; } cur->c_get(cur, &key, &data, DB_FIRST); while (rc == 0) { /* Parse and print data */ /* cnid */ memcpy(&cnid, data.data, CNID_LEN); cnid = ntohl(cnid); if (cnid == 0) { /* Rootinfo node */ } else { /* did */ memcpy(&did, key.data, CNID_LEN); did = ntohl(did); printf("id: %10u <== did: %10u, name: %s\n", cnid, did, (char *)key.data + CNID_LEN); count++; } rc = cur->c_get(cur, &key, &data, DB_NEXT); } if (rc != DB_NOTFOUND) { LOG(log_error, logtype_cnid, "Error iterating over btree: %s", db_strerror(rc)); return -1; } rc = cur->c_close(cur); if (rc) { LOG(log_error, logtype_cnid, "Couldn't close cursor: %s", db_strerror(rc)); return -1; } printf("%u items\n", count); } return 0; } /* Iterates over dbd, returning cnids. Uses in-value of cnid to seek to that cnid, then gets next and return that in cnid. If close=1, close cursor. Return -1 on error, 0 on EOD (end-of-database), 1 if returning cnid. */ int dbif_idwalk(DBD *dbd, cnid_t *cnid, int close) { int rc; int flag; cnid_t id; static DBT key = { 0 }, data = { 0 }; DB *db = dbd->db_table[DBIF_CNID].db; if (close) { if (dbd->db_cur) { dbd->db_cur->close(dbd->db_cur); dbd->db_cur = NULL; } return 0; } /* An dbif_del will have closed our cursor too */ if ( ! dbd->db_cur ) { if ((rc = db->cursor(db, NULL, &dbd->db_cur, 0)) != 0) { LOG(log_error, logtype_cnid, "Couldn't create cursor: %s", db_strerror(rc)); return -1; } flag = DB_SET_RANGE; /* This will seek to next cnid after the one just deleted */ id = htonl(*cnid); key.data = &id; key.size = sizeof(cnid_t); } else flag = DB_NEXT; if ((rc = dbd->db_cur->get(dbd->db_cur, &key, &data, flag)) == 0) { memcpy(cnid, key.data, sizeof(cnid_t)); *cnid = ntohl(*cnid); return 1; } if (rc != DB_NOTFOUND) { LOG(log_error, logtype_cnid, "Error iterating over btree: %s", db_strerror(rc)); dbd->db_cur->close(dbd->db_cur); dbd->db_cur = NULL; return -1; } if (dbd->db_cur) { dbd->db_cur->close(dbd->db_cur); dbd->db_cur = NULL; } return 0; } netatalk-2.2.2/etc/cnid_dbd/dbd_search.c0000644000175200017500000000242011655731126014773 00000000000000/* * Copyright (C) Frank Lahm 2010 * All Rights Reserved. See COPYING. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include "dbif.h" #include "dbd.h" #include "pack.h" int dbd_search(DBD *dbd, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply) { DBT key; int results; static char resbuf[DBD_MAX_SRCH_RSLTS * sizeof(cnid_t)]; LOG(log_debug, logtype_cnid, "dbd_search(\"%s\"):", rqst->name); memset(&key, 0, sizeof(key)); rply->name = resbuf; rply->namelen = 0; key.data = rqst->name; key.size = rqst->namelen; if ((results = dbif_search(dbd, &key, resbuf)) < 0) { LOG(log_error, logtype_cnid, "dbd_search(\"%s\"): db error", rqst->name); rply->result = CNID_DBD_RES_ERR_DB; return -1; } if (results) { LOG(log_debug, logtype_cnid, "dbd_search(\"%s\"): %d matches", rqst->name, results); rply->namelen = results * sizeof(cnid_t); rply->result = CNID_DBD_RES_OK; } else { LOG(log_debug, logtype_cnid, "dbd_search(\"%s\"): no matches", rqst->name); rply->result = CNID_DBD_RES_NOTFOUND; } return 1; } netatalk-2.2.2/etc/cnid_dbd/README0000644000175200017500000000776711655731126013454 00000000000000This is a implementation of the netatalk CNID database support that attempts to put all functionality into a separate daemon called cnid_dbd. There is one such daemon per netatalk volume. The underlying database structure is based on Berkeley DB and the database format is the same as in the cdb CNID backend, so this can be used as a drop-in replacement. Advantages: - No locking issues or leftover locks due to crashed afpd daemons any more. Since there is only one thread of control accessing the database, no locking is needed and changes appear atomic. - Berkeley DB transactions are difficult to get right with several processes attempting to access the CNID database simultanously. This is much easier with a single process and the database can be made nearly crashproof this way (at a performance cost). - No problems with user permissions and access to underlying database files, the cnid_dbd process runs under a configurable user ID that normally also owns the underlying database and can be contacted by whatever afpd daemon accesses a volume. - If an afpd process crashes, the CNID database is unaffected. If the process was making changes to the database at the time of the crash, those changes will be rolled back entirely (transactions). If the process was not using the database at the time of the crash, no corrective action is necessary. In any case, database consistency is assured. Disadvantages: - Performance in an environment of processes sharing the database (files) is potentially better for two reasons: i) IPC overhead. ii) r/o access to database pages is possible by more than one process at once, r/w access is possible for nonoverlapping regions. The current implementation of cnid_dbd uses unix domain sockets as the IPC mechanism. While this is not the fastest possible method, it is very portable and the cnid_dbd IPC mechanisms can be extended to use faster IPC (like mmap) on architectures where it is supported. As a ballpark figure, 20000 requests/replies to the cnid_dbd daemon take about 0.6 seconds on a Pentium III 733 Mhz running Linux Kernel 2.4.18 using unix domain sockets. The requests are "empty" (no database lookups/changes), so this is just the IPC overhead. I have not measured the effects of the advantages of simultanous database access. Installation and configuration cnid_dbd is part of the CNID framework whereby various CNID backends can be selected for afpd as a runtime option for a given volume. By default only last and dbd backend are built and dbd is the default. There are two executeables that will be built in etc/cnid_dbd and installed into the systems binaries directories of netatalk (e.g. /usr/local/netatalk/sbin or whatever you specify with --sbindir to configure): cnid_metad and cnid_dbd. cnid_metad should run all the time with root permissions. It will be notified when an instance of afpd starts up and will in turn make sure that a cnid_dbd daemon is started for the volume that afpd wishes to access. The daemon runs as long as necessary (see the idle_timeout option below) and services any other instances of afpd that access the volume. You can safely kill it with SIGTERM, it will be restarted automatically by cnid_metad as soon as the volume is accessed again. cnid_dbd changes to the Berkeley DB directory on startup and sets effective UID and GID to owner and group of that directory. Database and supporting files should therefore be writeable by that user/group. Current shortcomings: - The parameter file parsing of db_param is very simpleminded. It is easy to cause buffer overruns and the like. Also, there is no support for blanks (or weird characters) in filenames for the usock_file parameter. - There is no protection against a malicious user connecting to the cnid_dbd socket and changing the database. Please feel free to grep the source in etc/cnid_dbd and the file libatalk/cnid/dbd/cnid_dbd.c for the string TODO, which indicates comments that adress other, less important points. The Netatalk Team netatalk-2.2.2/etc/cnid_dbd/cmd_dbd_scanvol.c0000644000175200017500000012221211671417704016021 00000000000000/* Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "cmd_dbd.h" #include "dbif.h" #include "db_param.h" #include "dbd.h" /* Some defines to ease code parsing */ #define ADDIR_OK (addir_ok == 0) #define ADFILE_OK (adfile_ok == 0) static struct volinfo *myvolinfo; static char cwdbuf[MAXPATHLEN+1]; static DBD *dbd; static DBD *dbd_rebuild; static dbd_flags_t dbd_flags; static char stamp[CNID_DEV_LEN]; static char *netatalk_dirs[] = { ".AppleDB", ".AppleDesktop", NULL }; static char *special_dirs[] = { ".zfs", NULL }; static struct cnid_dbd_rqst rqst; static struct cnid_dbd_rply rply; static jmp_buf jmp; static struct vol volume; /* fake it for ea_open */ static char pname[MAXPATHLEN] = "../"; /* Taken form afpd/desktop.c */ static char *utompath(char *upath) { static char mpath[ MAXPATHLEN + 2]; /* for convert_charset dest_len parameter +2 */ char *m, *u; uint16_t flags = CONV_IGNORE | CONV_UNESCAPEHEX; size_t outlen; if (!upath) return NULL; m = mpath; u = upath; outlen = strlen(upath); if ((myvolinfo->v_casefold & AFPVOL_UTOMUPPER)) flags |= CONV_TOUPPER; else if ((myvolinfo->v_casefold & AFPVOL_UTOMLOWER)) flags |= CONV_TOLOWER; if ((myvolinfo->v_flags & AFPVOL_EILSEQ)) { flags |= CONV__EILSEQ; } /* convert charsets */ if ((size_t)-1 == ( outlen = convert_charset(myvolinfo->v_volcharset, CH_UTF8_MAC, myvolinfo->v_maccharset, u, outlen, mpath, MAXPATHLEN, &flags)) ) { dbd_log( LOGSTD, "Conversion from %s to %s for %s failed.", myvolinfo->v_volcodepage, myvolinfo->v_maccodepage, u); return NULL; } return(m); } /* Taken form afpd/desktop.c */ static char *mtoupath(char *mpath) { static char upath[ MAXPATHLEN + 2]; /* for convert_charset dest_len parameter +2 */ char *m, *u; size_t inplen; size_t outlen; u_int16_t flags = 0; if (!mpath) return NULL; if ( *mpath == '\0' ) { return( "." ); } /* set conversion flags */ if (!(myvolinfo->v_flags & AFPVOL_NOHEX)) flags |= CONV_ESCAPEHEX; if (!(myvolinfo->v_flags & AFPVOL_USEDOTS)) flags |= CONV_ESCAPEDOTS; if ((myvolinfo->v_casefold & AFPVOL_MTOUUPPER)) flags |= CONV_TOUPPER; else if ((myvolinfo->v_casefold & AFPVOL_MTOULOWER)) flags |= CONV_TOLOWER; if ((myvolinfo->v_flags & AFPVOL_EILSEQ)) { flags |= CONV__EILSEQ; } m = mpath; u = upath; inplen = strlen(m); outlen = MAXPATHLEN; if ((size_t)-1 == (outlen = convert_charset(CH_UTF8_MAC, myvolinfo->v_volcharset, myvolinfo->v_maccharset, m, inplen, u, outlen, &flags)) ) { dbd_log( LOGSTD, "conversion from UTF8-MAC to %s for %s failed.", myvolinfo->v_volcodepage, mpath); return NULL; } return( upath ); } #if 0 /* Check if "name" is pointing to a) an object inside the current volume (return 0) b) an object outside the current volume (return 1) Then stats the pointed to object and if it is a dir ors ADFLAGS_DIR to *adflags Return -1 on any serious error. */ static int check_symlink(const char *name, int *adflags) { int cwd; ssize_t len; char pathbuf[MAXPATHLEN + 1]; char *sep; struct stat st; if ((len = readlink(name, pathbuf, MAXPATHLEN)) == -1) { dbd_log(LOGSTD, "Error reading link info for '%s/%s': %s", cwdbuf, name, strerror(errno)); return -1; } pathbuf[len] = 0; if ((stat(pathbuf, &st)) != 0) { dbd_log(LOGSTD, "stat error '%s': %s", pathbuf, strerror(errno)); } /* Remember cwd */ if ((cwd = open(".", O_RDONLY)) < 0) { dbd_log(LOGSTD, "error opening cwd '%s': %s", cwdbuf, strerror(errno)); return -1; } if (S_ISDIR(st.st_mode)) { *adflags |= ADFLAGS_DIR; } else { /* file */ /* get basename from path */ if ((sep = strrchr(pathbuf, '/')) == NULL) /* just a file at the same level */ return 0; sep = 0; /* pathbuf now contains the directory*/ } /* fchdir() to pathbuf so we can easily get its path with getcwd() */ if ((chdir(pathbuf)) != 0) { dbd_log(LOGSTD, "Cant chdir to '%s': %s", pathbuf, strerror(errno)); return -1; } if ((getcwd(pathbuf, MAXPATHLEN)) == NULL) { dbd_log(LOGSTD, "Cant get symlink'ed dir '%s/%s': %s", cwdbuf, pathbuf, strerror(errno)); if ((fchdir(cwd)) != 0) /* We're foobared */ longjmp(jmp, 1); /* this jumps back to cmd_dbd_scanvol() */ return -1; } if ((fchdir(cwd)) != 0) /* We're foobared */ longjmp(jmp, 1); /* this jumps back to cmd_dbd_scanvol() */ /* We now have the symlink target dir as absoulte path in pathbuf and can compare it with the currents volume path */ int i = 0; while (myvolinfo->v_path[i]) { if ((pathbuf[i] == 0) || (myvolinfo->v_path[i] != pathbuf[i])) { dbd_log( LOGDEBUG, "extra-share symlink '%s/%s', following", cwdbuf, name); return 1; } i++; } dbd_log( LOGDEBUG, "intra-share symlink '%s/%s', not following", cwdbuf, name); return 0; } #endif /* Check for wrong encoding e.g. "." at the beginning is not CAP encoded (:2e) although volume is default !AFPVOL_USEDOTS. We do it by roundtripiping from volcharset to UTF8-MAC and back and then compare the result. */ static int check_name_encoding(char *uname) { char *roundtripped; roundtripped = mtoupath(utompath(uname)); if (!roundtripped) { dbd_log( LOGSTD, "Error checking encoding for '%s/%s'", cwdbuf, uname); return -1; } if ( STRCMP(uname, !=, roundtripped)) { dbd_log( LOGSTD, "Bad encoding for '%s/%s'", cwdbuf, uname); return -1; } return 0; } /* Check for netatalk special folders e.g. ".AppleDB" or ".AppleDesktop" Returns pointer to name or NULL. */ static const char *check_netatalk_dirs(const char *name) { int c; for (c=0; netatalk_dirs[c]; c++) { if ((strcmp(name, netatalk_dirs[c])) == 0) return netatalk_dirs[c]; } return NULL; } /* Check for special names Returns pointer to name or NULL. */ static const char *check_special_dirs(const char *name) { int c; for (c=0; special_dirs[c]; c++) { if ((strcmp(name, special_dirs[c])) == 0) return special_dirs[c]; } return NULL; } /* Check for .AppleDouble file, create if missing */ static int check_adfile(const char *fname, const struct stat *st) { int ret, adflags; struct adouble ad; char *adname; if (dbd_flags & DBD_FLAGS_CLEANUP) return 0; if (S_ISREG(st->st_mode)) adflags = 0; else adflags = ADFLAGS_DIR; adname = myvolinfo->ad_path(fname, adflags); if ((ret = access( adname, F_OK)) != 0) { if (errno != ENOENT) { dbd_log(LOGSTD, "Access error for ad-file '%s/%s': %s", cwdbuf, adname, strerror(errno)); return -1; } /* Missing. Log and create it */ dbd_log(LOGSTD, "Missing AppleDouble file '%s/%s'", cwdbuf, adname); if (dbd_flags & DBD_FLAGS_SCAN) /* Scan only requested, dont change anything */ return -1; /* Create ad file */ ad_init(&ad, myvolinfo->v_adouble, myvolinfo->v_ad_options); if ((ret = ad_open_metadata( fname, adflags, O_CREAT, &ad)) != 0) { dbd_log( LOGSTD, "Error creating AppleDouble file '%s/%s': %s", cwdbuf, adname, strerror(errno)); return -1; } /* Set name in ad-file */ ad_setname(&ad, utompath((char *)fname)); ad_flush(&ad); ad_close_metadata(&ad); chown(adname, st->st_uid, st->st_gid); /* FIXME: should we inherit mode too here ? */ #if 0 chmod(adname, st->st_mode); #endif } else { ad_init(&ad, myvolinfo->v_adouble, myvolinfo->v_ad_options); if (ad_open_metadata( fname, adflags, O_RDONLY, &ad) != 0) { dbd_log( LOGSTD, "Error opening AppleDouble file for '%s/%s'", cwdbuf, fname); return -1; } ad_close_metadata(&ad); } return 0; } /* Remove all files with file::EA* from adouble dir */ static void remove_eafiles(const char *name, struct ea *ea) { DIR *dp = NULL; struct dirent *ep; char eaname[MAXPATHLEN]; strlcpy(eaname, name, sizeof(eaname)); if (strlcat(eaname, "::EA", sizeof(eaname)) >= sizeof(eaname)) { dbd_log(LOGSTD, "name too long: '%s/%s/%s'", cwdbuf, ADv2_DIRNAME, name); return; } if ((chdir(ADv2_DIRNAME)) != 0) { dbd_log(LOGSTD, "Couldn't chdir to '%s/%s': %s", cwdbuf, ADv2_DIRNAME, strerror(errno)); return; } if ((dp = opendir(".")) == NULL) { dbd_log(LOGSTD, "Couldn't open the directory '%s/%s': %s", cwdbuf, ADv2_DIRNAME, strerror(errno)); goto exit; } while ((ep = readdir(dp))) { if (strstr(ep->d_name, eaname) != NULL) { dbd_log(LOGSTD, "Removing EA file: '%s/%s/%s'", cwdbuf, ADv2_DIRNAME, ep->d_name); if ((unlink(ep->d_name)) != 0) { dbd_log(LOGSTD, "Error unlinking EA file '%s/%s/%s': %s", cwdbuf, ADv2_DIRNAME, ep->d_name, strerror(errno)); } } /* if */ } /* while */ exit: if (dp) closedir(dp); if ((chdir("..")) != 0) { dbd_log(LOGSTD, "Couldn't chdir to '%s': %s", cwdbuf, strerror(errno)); /* we can't proceed */ longjmp(jmp, 1); /* this jumps back to cmd_dbd_scanvol() */ } } /* Check Extended Attributes files */ static int check_eafiles(const char *fname) { unsigned int count = 0; int ret = 0, remove; struct ea ea; struct stat st; char *eaname; if ((ret = ea_open(&volume, fname, EA_RDWR, &ea)) != 0) { if (errno == ENOENT) return 0; dbd_log(LOGSTD, "Error calling ea_open for file: %s/%s, removing EA files", cwdbuf, fname); if ( ! (dbd_flags & DBD_FLAGS_SCAN)) remove_eafiles(fname, &ea); return -1; } /* Check all EAs */ while (count < ea.ea_count) { dbd_log(LOGDEBUG, "EA: %s", (*ea.ea_entries)[count].ea_name); remove = 0; eaname = ea_path(&ea, (*ea.ea_entries)[count].ea_name, 0); if (lstat(eaname, &st) != 0) { if (errno == ENOENT) dbd_log(LOGSTD, "Missing EA: %s/%s", cwdbuf, eaname); else dbd_log(LOGSTD, "Bogus EA: %s/%s", cwdbuf, eaname); remove = 1; } else if (st.st_size != (*ea.ea_entries)[count].ea_size) { dbd_log(LOGSTD, "Bogus EA: %s/%s, removing it...", cwdbuf, eaname); remove = 1; if ((unlink(eaname)) != 0) dbd_log(LOGSTD, "Error removing EA file '%s/%s': %s", cwdbuf, eaname, strerror(errno)); } if (remove) { /* Be CAREFUL here! This should do what ea_delentry does. ea_close relies on it !*/ free((*ea.ea_entries)[count].ea_name); (*ea.ea_entries)[count].ea_name = NULL; } count++; } /* while */ ea_close(&ea); return ret; } /* Check for .AppleDouble folder and .Parent, create if missing */ static int check_addir(int volroot) { int addir_ok, adpar_ok; struct stat st; struct adouble ad; char *mname = NULL; if (dbd_flags & DBD_FLAGS_CLEANUP) return 0; /* Check for ad-dir */ if ( (addir_ok = access(ADv2_DIRNAME, F_OK)) != 0) { if (errno != ENOENT) { dbd_log(LOGSTD, "Access error in directory %s: %s", cwdbuf, strerror(errno)); return -1; } dbd_log(LOGSTD, "Missing %s for '%s'", ADv2_DIRNAME, cwdbuf); } /* Check for ".Parent" */ if ( (adpar_ok = access(myvolinfo->ad_path(".", ADFLAGS_DIR), F_OK)) != 0) { if (errno != ENOENT) { dbd_log(LOGSTD, "Access error on '%s/%s': %s", cwdbuf, myvolinfo->ad_path(".", ADFLAGS_DIR), strerror(errno)); return -1; } dbd_log(LOGSTD, "Missing .AppleDouble/.Parent for '%s'", cwdbuf); } /* Is one missing ? */ if ((addir_ok != 0) || (adpar_ok != 0)) { /* Yes, but are we only scanning ? */ if (dbd_flags & DBD_FLAGS_SCAN) { /* Yes: missing .Parent is not a problem, but missing ad-dir causes later checking of ad-files to fail. So we have to return appropiately */ if (addir_ok != 0) return -1; else /* (adpar_ok != 0) */ return 0; } /* Create ad dir and set name */ ad_init(&ad, myvolinfo->v_adouble, myvolinfo->v_ad_options); if (ad_open_metadata( ".", ADFLAGS_DIR, O_CREAT, &ad) != 0) { dbd_log( LOGSTD, "Error creating AppleDouble dir in %s: %s", cwdbuf, strerror(errno)); return -1; } /* Get basename of cwd from cwdbuf */ mname = utompath(strrchr(cwdbuf, '/') + 1); /* Update name in ad file */ ad_setname(&ad, mname); ad_flush(&ad); ad_close_metadata(&ad); /* Inherit owner/group from "." to ".AppleDouble" and ".Parent" */ if ((lstat(".", &st)) != 0) { dbd_log( LOGSTD, "Couldnt stat %s: %s", cwdbuf, strerror(errno)); return -1; } chown(ADv2_DIRNAME, st.st_uid, st.st_gid); chown(myvolinfo->ad_path(".", ADFLAGS_DIR), st.st_uid, st.st_gid); } return 0; } /* Check if file cotains "::EA" and if it does check if its correspondig data fork exists. Returns: 0 = name is not an EA file 1 = name is an EA file and no problem was found -1 = name is an EA file and data fork is gone */ static int check_eafile_in_adouble(const char *name) { int ret = 0; char *namep, *namedup = NULL; /* Check if this is an AFPVOL_EA_AD vol */ if (myvolinfo->v_vfs_ea == AFPVOL_EA_AD) { /* Does the filename contain "::EA" ? */ namedup = strdup(name); if ((namep = strstr(namedup, "::EA")) == NULL) { ret = 0; goto ea_check_done; } else { /* File contains "::EA" so it's an EA file. Check for data file */ /* Get string before "::EA" from EA filename */ namep[0] = 0; strlcpy(pname + 3, namedup, sizeof(pname)); /* Prepends "../" */ if ((access( pname, F_OK)) == 0) { ret = 1; goto ea_check_done; } else { ret = -1; if (errno != ENOENT) { dbd_log(LOGSTD, "Access error for file '%s/%s': %s", cwdbuf, name, strerror(errno)); goto ea_check_done; } /* Orphaned EA file*/ dbd_log(LOGSTD, "Orphaned Extended Attribute file '%s/%s/%s'", cwdbuf, ADv2_DIRNAME, name); if (dbd_flags & DBD_FLAGS_SCAN) /* Scan only requested, dont change anything */ goto ea_check_done; if ((unlink(name)) != 0) { dbd_log(LOGSTD, "Error unlinking orphaned Extended Attribute file '%s/%s/%s'", cwdbuf, ADv2_DIRNAME, name); } } /* if (access) */ } /* if strstr */ } /* if AFPVOL_EA_AD */ ea_check_done: if (namedup) free(namedup); return ret; } /* Check files and dirs inside .AppleDouble folder: - remove orphaned files - bail on dirs */ static int read_addir(void) { DIR *dp; struct dirent *ep; struct stat st; if ((chdir(ADv2_DIRNAME)) != 0) { dbd_log(LOGSTD, "Couldn't chdir to '%s/%s': %s", cwdbuf, ADv2_DIRNAME, strerror(errno)); return -1; } if ((dp = opendir(".")) == NULL) { dbd_log(LOGSTD, "Couldn't open the directory '%s/%s': %s", cwdbuf, ADv2_DIRNAME, strerror(errno)); return -1; } while ((ep = readdir(dp))) { /* Check if its "." or ".." */ if (DIR_DOT_OR_DOTDOT(ep->d_name)) continue; /* Skip ".Parent" */ if (STRCMP(ep->d_name, ==, ".Parent")) continue; if ((lstat(ep->d_name, &st)) < 0) { dbd_log( LOGSTD, "Lost file or dir while enumeratin dir '%s/%s/%s', probably removed: %s", cwdbuf, ADv2_DIRNAME, ep->d_name, strerror(errno)); continue; } /* Check for dirs */ if (S_ISDIR(st.st_mode)) { dbd_log( LOGSTD, "Unexpected directory '%s' in AppleDouble dir '%s/%s'", ep->d_name, cwdbuf, ADv2_DIRNAME); continue; } /* Check if for orphaned and corrupt Extended Attributes file */ if (check_eafile_in_adouble(ep->d_name) != 0) continue; /* Check for data file */ strcpy(pname + 3, ep->d_name); if ((access( pname, F_OK)) != 0) { if (errno != ENOENT) { dbd_log(LOGSTD, "Access error for file '%s/%s': %s", cwdbuf, pname, strerror(errno)); continue; } /* Orphaned ad-file*/ dbd_log(LOGSTD, "Orphaned AppleDoube file '%s/%s/%s'", cwdbuf, ADv2_DIRNAME, ep->d_name); if (dbd_flags & DBD_FLAGS_SCAN) /* Scan only requested, dont change anything */ continue;; if ((unlink(ep->d_name)) != 0) { dbd_log(LOGSTD, "Error unlinking orphaned AppleDoube file '%s/%s/%s'", cwdbuf, ADv2_DIRNAME, ep->d_name); } } } if ((chdir("..")) != 0) { dbd_log(LOGSTD, "Couldn't chdir back to '%s' from AppleDouble dir: %s", cwdbuf, strerror(errno)); /* This really is EOT! */ longjmp(jmp, 1); /* this jumps back to cmd_dbd_scanvol() */ } closedir(dp); return 0; } /* Check CNID for a file/dir, both from db and from ad-file. For detailed specs see intro. @return Correct CNID of object or CNID_INVALID (ie 0) on error */ static cnid_t check_cnid(const char *name, cnid_t did, struct stat *st, int adfile_ok, int adflags) { int ret; cnid_t db_cnid, ad_cnid; struct adouble ad; /* Force checkout every X items */ static int cnidcount = 0; cnidcount++; if (cnidcount > 10000) { cnidcount = 0; if (dbif_txn_checkpoint(dbd, 0, 0, 0) < 0) { dbd_log(LOGSTD, "Error checkpointing!"); return CNID_INVALID; } } /* Get CNID from ad-file if volume is using AFPVOL_CACHE */ ad_cnid = 0; if ( (myvolinfo->v_flags & AFPVOL_CACHE) && ADFILE_OK) { ad_init(&ad, myvolinfo->v_adouble, myvolinfo->v_ad_options); if (ad_open_metadata( name, adflags, O_RDWR, &ad) != 0) { if (dbd_flags & DBD_FLAGS_CLEANUP) return CNID_INVALID; dbd_log( LOGSTD, "Error opening AppleDouble file for '%s/%s': %s", cwdbuf, name, strerror(errno)); return CNID_INVALID; } if (dbd_flags & DBD_FLAGS_FORCE) { ad_cnid = ad_forcegetid(&ad); /* This ensures the changed stamp is written */ ad_setid( &ad, st->st_dev, st->st_ino, ad_cnid, did, stamp); ad_flush(&ad); } else ad_cnid = ad_getid(&ad, st->st_dev, st->st_ino, 0, stamp); if (ad_cnid == 0) dbd_log( LOGSTD, "Bad CNID in adouble file of '%s/%s'", cwdbuf, name); else dbd_log( LOGDEBUG, "CNID from .AppleDouble file for '%s/%s': %u", cwdbuf, name, ntohl(ad_cnid)); ad_close_metadata(&ad); } /* Get CNID from database */ /* Prepare request data */ memset(&rqst, 0, sizeof(struct cnid_dbd_rqst)); memset(&rply, 0, sizeof(struct cnid_dbd_rply)); rqst.did = did; rqst.cnid = ad_cnid; if ( ! (myvolinfo->v_flags & AFPVOL_NODEV)) rqst.dev = st->st_dev; rqst.ino = st->st_ino; rqst.type = S_ISDIR(st->st_mode)?1:0; rqst.name = (char *)name; rqst.namelen = strlen(name); /* Query the database */ ret = dbd_lookup(dbd, &rqst, &rply, (dbd_flags & DBD_FLAGS_SCAN) ? 1 : 0); if (dbif_txn_close(dbd, ret) != 0) return CNID_INVALID; if (rply.result == CNID_DBD_RES_OK) { db_cnid = rply.cnid; } else if (rply.result == CNID_DBD_RES_NOTFOUND) { if ( ! (dbd_flags & DBD_FLAGS_FORCE)) dbd_log( LOGSTD, "No CNID for '%s/%s' in database", cwdbuf, name); db_cnid = 0; } else { dbd_log( LOGSTD, "Fatal error resolving '%s/%s'", cwdbuf, name); db_cnid = 0; } /* Compare results from both CNID searches */ if (ad_cnid && db_cnid && (ad_cnid == db_cnid)) { /* Everything is fine */ return db_cnid; } else if (ad_cnid && db_cnid && (ad_cnid != db_cnid)) { /* Mismatch, overwrite ad file with value from db */ dbd_log( LOGSTD, "CNID mismatch for '%s/%s', db: %u, ad-file: %u", cwdbuf, name, ntohl(db_cnid), ntohl(ad_cnid)); if ( ! (dbd_flags & DBD_FLAGS_SCAN)) { dbd_log(LOGSTD, "Updating AppleDouble file for '%s/%s' with CNID: %u from database", cwdbuf, name, ntohl(db_cnid)); ad_init(&ad, myvolinfo->v_adouble, myvolinfo->v_ad_options); if (ad_open_metadata( name, adflags, O_RDWR, &ad) != 0) { dbd_log(LOGSTD, "Error opening AppleDouble file for '%s/%s': %s", cwdbuf, name, strerror(errno)); return CNID_INVALID; } ad_setid( &ad, st->st_dev, st->st_ino, db_cnid, did, stamp); ad_flush(&ad); ad_close_metadata(&ad); } return db_cnid; } else if (ad_cnid && (db_cnid == 0)) { /* in ad-file but not in db */ if ( ! (dbd_flags & DBD_FLAGS_SCAN)) { /* Ensure the cnid from the ad-file is not already occupied by another file */ dbd_log(LOGDEBUG, "Checking whether CNID %u from ad-file is occupied", ntohl(ad_cnid)); rqst.cnid = ad_cnid; ret = dbd_resolve(dbd, &rqst, &rply); if (rply.result == CNID_DBD_RES_OK) { /* Occupied! Choose another, update ad-file */ ret = dbd_add(dbd, &rqst, &rply, 1); if (dbif_txn_close(dbd, ret) != 0) return CNID_INVALID; db_cnid = rply.cnid; dbd_log(LOGSTD, "New CNID for '%s/%s': %u", cwdbuf, name, ntohl(db_cnid)); if ((myvolinfo->v_flags & AFPVOL_CACHE) && ADFILE_OK && ( ! (dbd_flags & DBD_FLAGS_SCAN))) { dbd_log(LOGSTD, "Writing CNID data for '%s/%s' to AppleDouble file", cwdbuf, name, ntohl(db_cnid)); ad_init(&ad, myvolinfo->v_adouble, myvolinfo->v_ad_options); if (ad_open_metadata( name, adflags, O_RDWR, &ad) != 0) { dbd_log(LOGSTD, "Error opening AppleDouble file for '%s/%s': %s", cwdbuf, name, strerror(errno)); return CNID_INVALID; } ad_setid( &ad, st->st_dev, st->st_ino, db_cnid, did, stamp); ad_flush(&ad); ad_close_metadata(&ad); } return db_cnid; } dbd_log(LOGDEBUG, "CNID rebuild add '%s/%s' with CNID from ad-file %u", cwdbuf, name, ntohl(ad_cnid)); rqst.cnid = ad_cnid; ret = dbd_rebuild_add(dbd, &rqst, &rply); if (dbif_txn_close(dbd, ret) != 0) return CNID_INVALID; } return ad_cnid; } else if ((db_cnid == 0) && (ad_cnid == 0)) { /* No CNID at all, we clearly have to allocate a fresh one... */ /* Note: the next test will use this new CNID too! */ if ( ! (dbd_flags & DBD_FLAGS_SCAN)) { /* add to db */ ret = dbd_add(dbd, &rqst, &rply, 1); if (dbif_txn_close(dbd, ret) != 0) return CNID_INVALID; db_cnid = rply.cnid; dbd_log(LOGSTD, "New CNID for '%s/%s': %u", cwdbuf, name, ntohl(db_cnid)); } } if ((ad_cnid == 0) && db_cnid) { /* in db but zeroID in ad-file, write it to ad-file if AFPVOL_CACHE */ if ((myvolinfo->v_flags & AFPVOL_CACHE) && ADFILE_OK) { if ( ! (dbd_flags & DBD_FLAGS_SCAN)) { dbd_log(LOGSTD, "Writing CNID data for '%s/%s' to AppleDouble file", cwdbuf, name, ntohl(db_cnid)); ad_init(&ad, myvolinfo->v_adouble, myvolinfo->v_ad_options); if (ad_open_metadata( name, adflags, O_RDWR, &ad) != 0) { dbd_log(LOGSTD, "Error opening AppleDouble file for '%s/%s': %s", cwdbuf, name, strerror(errno)); return CNID_INVALID; } ad_setid( &ad, st->st_dev, st->st_ino, db_cnid, did, stamp); ad_flush(&ad); ad_close_metadata(&ad); } } return db_cnid; } return CNID_INVALID; } /* This is called recursively for all dirs. volroot=1 means we're in the volume root dir, 0 means we aren't. We use this when checking for netatalk private folders like .AppleDB. did is our parents CNID. */ static int dbd_readdir(int volroot, cnid_t did) { int cwd, ret = 0, adflags, adfile_ok, addir_ok, encoding_ok; cnid_t cnid = 0; const char *name; DIR *dp; struct dirent *ep; static struct stat st; /* Save some stack space */ /* Check again for .AppleDouble folder, check_adfile also checks/creates it */ if ((addir_ok = check_addir(volroot)) != 0) if ( ! (dbd_flags & DBD_FLAGS_SCAN)) /* Fatal on rebuild run, continue if only scanning ! */ return -1; /* Check AppleDouble files in AppleDouble folder, but only if it exists or could be created */ if (ADDIR_OK) if ((read_addir()) != 0) if ( ! (dbd_flags & DBD_FLAGS_SCAN)) /* Fatal on rebuild run, continue if only scanning ! */ return -1; if ((dp = opendir (".")) == NULL) { dbd_log(LOGSTD, "Couldn't open the directory: %s",strerror(errno)); return -1; } while ((ep = readdir (dp))) { /* Check if we got a termination signal */ if (alarmed) longjmp(jmp, 1); /* this jumps back to cmd_dbd_scanvol() */ /* Check if its "." or ".." */ if (DIR_DOT_OR_DOTDOT(ep->d_name)) continue; /* Check for netatalk special folders e.g. ".AppleDB" or ".AppleDesktop" */ if ((name = check_netatalk_dirs(ep->d_name)) != NULL) { if (! volroot) dbd_log(LOGSTD, "Nested %s in %s", name, cwdbuf); continue; } /* Check for special folders in volume root e.g. ".zfs" */ if (volroot) { if ((name = check_special_dirs(ep->d_name)) != NULL) { dbd_log(LOGSTD, "Ignoring special dir \"%s\"", name); continue; } } /* Skip .AppleDouble dir in this loop */ if (STRCMP(ep->d_name, == , ADv2_DIRNAME)) continue; if ((ret = lstat(ep->d_name, &st)) < 0) { dbd_log( LOGSTD, "Lost file while reading dir '%s/%s', probably removed: %s", cwdbuf, ep->d_name, strerror(errno)); continue; } switch (st.st_mode & S_IFMT) { case S_IFREG: adflags = 0; break; case S_IFDIR: adflags = ADFLAGS_DIR; break; case S_IFLNK: dbd_log(LOGDEBUG, "Ignoring symlink %s/%s", cwdbuf, ep->d_name); #if 0 ret = check_symlink(ep->d_name, &adflags); if (ret == 1) break; if (ret == -1) dbd_log(LOGSTD, "Error checking symlink %s/%s", cwdbuf, ep->d_name); #endif continue; default: dbd_log(LOGSTD, "Bad filetype: %s/%s", cwdbuf, ep->d_name); if ( ! (dbd_flags & DBD_FLAGS_SCAN)) { if ((unlink(ep->d_name)) != 0) { dbd_log(LOGSTD, "Error removing: %s/%s: %s", cwdbuf, ep->d_name, strerror(errno)); } } continue; } /************************************************************************** Statistics **************************************************************************/ static unsigned long long statcount = 0; static time_t t = 0; if (t == 0) t = time(NULL); statcount++; if ((statcount % 10000) == 0) { if (dbd_flags & DBD_FLAGS_STATS) dbd_log(LOGSTD, "Scanned: %10llu, time: %10llu s", statcount, (unsigned long long)(time(NULL) - t)); } /************************************************************************** Tests **************************************************************************/ /* Check encoding */ if ( -1 == (encoding_ok = check_name_encoding(ep->d_name)) ) { /* If its a file: skipp all other tests now ! */ /* For dirs we could try to get a CNID for it and recurse, but currently I prefer not to */ continue; } /* Check for appledouble file, create if missing, but only if we have addir */ adfile_ok = -1; if (ADDIR_OK) adfile_ok = check_adfile(ep->d_name, &st); if ( ! nocniddb) { /* Check CNIDs */ cnid = check_cnid(ep->d_name, did, &st, adfile_ok, adflags); /* Now add this object to our rebuild dbd */ if (cnid && dbd_rebuild) { static uint count = 0; rqst.cnid = rply.cnid; ret = dbd_rebuild_add(dbd_rebuild, &rqst, &rply); if (dbif_txn_close(dbd_rebuild, ret) != 0) return -1; if (rply.result != CNID_DBD_RES_OK) { dbd_log( LOGSTD, "Fatal error adding CNID: %u for '%s/%s' to in-memory rebuild-db", cnid, cwdbuf, ep->d_name); return -1; } count++; if (count == 10000) { if (dbif_txn_checkpoint(dbd_rebuild, 0, 0, 0) < 0) { dbd_log(LOGSTD, "Error checkpointing!"); return -1; } count = 0; } } } /* Check EA files */ if (myvolinfo->v_vfs_ea == AFPVOL_EA_AD) check_eafiles(ep->d_name); /************************************************************************** Recursion **************************************************************************/ if (S_ISDIR(st.st_mode) && (cnid || nocniddb)) { /* If we have no cnid for it we cant recur */ strcat(cwdbuf, "/"); strcat(cwdbuf, ep->d_name); dbd_log( LOGDEBUG, "Entering directory: %s", cwdbuf); if (-1 == (cwd = open(".", O_RDONLY))) { dbd_log( LOGSTD, "Cant open directory '%s': %s", cwdbuf, strerror(errno)); continue; } if (0 != chdir(ep->d_name)) { dbd_log( LOGSTD, "Cant chdir to directory '%s': %s", cwdbuf, strerror(errno)); close(cwd); continue; } ret = dbd_readdir(0, cnid); fchdir(cwd); close(cwd); *(strrchr(cwdbuf, '/')) = 0; if (ret < 0) return -1; } } /* Use results of previous checks */ closedir(dp); return ret; } static int scanvol(struct volinfo *vi, dbd_flags_t flags) { /* Dont scanvol on no-appledouble vols */ if (vi->v_flags & AFPVOL_NOADOUBLE) { dbd_log( LOGSTD, "Volume without AppleDouble support: skipping volume scanning."); return 0; } /* Make this stuff accessible from all funcs easily */ myvolinfo = vi; dbd_flags = flags; /* Init a fake struct vol with just enough so we can call ea_open and friends */ volume.v_adouble = AD_VERSION2; volume.v_vfs_ea = myvolinfo->v_vfs_ea; initvol_vfs(&volume); /* Run with umask 0 */ umask(0); /* Remove trailing slash from volume, chdir to vol */ if (myvolinfo->v_path[strlen(myvolinfo->v_path) - 1] == '/') myvolinfo->v_path[strlen(myvolinfo->v_path) - 1] = 0; strcpy(cwdbuf, myvolinfo->v_path); chdir(myvolinfo->v_path); /* Start recursion */ if (dbd_readdir(1, htonl(2)) < 0) /* 2 = volumeroot CNID */ return -1; return 0; } /* Remove all CNIDs from dbd that are not in dbd_rebuild */ static void delete_orphaned_cnids(DBD *dbd, DBD *dbd_rebuild, dbd_flags_t flags) { int ret = 0, deleted = 0; cnid_t dbd_cnid = 0, rebuild_cnid = 0; struct cnid_dbd_rqst rqst; struct cnid_dbd_rply rply; /* jump over rootinfo key */ if ( dbif_idwalk(dbd, &dbd_cnid, 0) != 1) return; if ( dbif_idwalk(dbd_rebuild, &rebuild_cnid, 0) != 1) return; /* Get first id from dbd_rebuild */ if ((dbif_idwalk(dbd_rebuild, &rebuild_cnid, 0)) == -1) return; /* Start main loop through dbd: get CNID from dbd */ while ((dbif_idwalk(dbd, &dbd_cnid, 0)) == 1) { /* Check if we got a termination signal */ if (alarmed) longjmp(jmp, 1); /* this jumps back to cmd_dbd_scanvol() */ if (deleted > 1000) { deleted = 0; if (dbif_txn_checkpoint(dbd, 0, 0, 0) < 0) { dbd_log(LOGSTD, "Error checkpointing!"); goto cleanup; } } /* This should be the normal case: CNID is in both dbs */ if (dbd_cnid == rebuild_cnid) { /* Get next CNID from rebuild db */ if ((ret = dbif_idwalk(dbd_rebuild, &rebuild_cnid, 0)) == -1) { /* Some error */ goto cleanup; } else if (ret == 0) { /* end of rebuild_cnid, delete all remaining CNIDs from dbd */ while ((dbif_idwalk(dbd, &dbd_cnid, 0)) == 1) { dbd_log(LOGSTD, "Orphaned CNID in database: %u", dbd_cnid); if ( ! (dbd_flags & DBD_FLAGS_SCAN)) { rqst.cnid = htonl(dbd_cnid); if ((ret = dbd_delete(dbd, &rqst, &rply, DBIF_CNID)) == -1) { dbd_log(LOGSTD, "Error deleting CNID %u", dbd_cnid); (void)dbif_txn_abort(dbd); goto cleanup; } if (dbif_txn_close(dbd, ret) != 0) return; deleted++; } /* Check if we got a termination signal */ if (alarmed) longjmp(jmp, 1); /* this jumps back to cmd_dbd_scanvol() */ } return; } else /* Normal case (ret=1): continue while loop */ continue; } if (dbd_cnid < rebuild_cnid) { /* CNID is orphaned -> delete */ dbd_log(LOGSTD, "One orphaned CNID in database: %u.", dbd_cnid); if ( ! (dbd_flags & DBD_FLAGS_SCAN)) { rqst.cnid = htonl(dbd_cnid); if ((ret = dbd_delete(dbd, &rqst, &rply, DBIF_CNID)) == -1) { dbd_log(LOGSTD, "Error deleting CNID %u", dbd_cnid); (void)dbif_txn_abort(dbd); goto cleanup; } if (dbif_txn_close(dbd, ret) != 0) return; deleted++; } continue; } if (dbd_cnid > rebuild_cnid) { dbif_idwalk(dbd, NULL, 1); /* Close cursor */ dbif_idwalk(dbd_rebuild, NULL, 1); /* Close cursor */ (void)dbif_txn_close(dbd, 2); (void)dbif_txn_close(dbd_rebuild, 2); dbd_log(LOGSTD, "Ghost CNID: %u. This is fatal! Dumping rebuild db:\n", rebuild_cnid); dbif_dump(dbd_rebuild, 0); dbd_log(LOGSTD, "Send this dump and a `dbd -d ...` dump to the Netatalk Dev team!"); goto cleanup; } } /* while ((dbif_idwalk(dbd, &dbd_cnid, 0)) == 1) */ cleanup: dbif_idwalk(dbd, NULL, 1); /* Close cursor */ dbif_idwalk(dbd_rebuild, NULL, 1); /* Close cursor */ return; } static const char *get_tmpdb_path(void) { pid_t pid = getpid(); static char path[MAXPATHLEN]; snprintf(path, MAXPATHLEN, "/tmp/tmpdb-dbd.%u", pid); if (mkdir(path, 0755) != 0) return NULL; return path; } /* Main func called from cmd_dbd.c */ int cmd_dbd_scanvol(DBD *dbd_ref, struct volinfo *vi, dbd_flags_t flags) { int ret = 0; struct db_param db_param = { 0 }; const char *tmpdb_path = NULL; /* Set cachesize for in-memory rebuild db */ db_param.cachesize = 64 * 1024; /* 64 MB */ db_param.maxlocks = DEFAULT_MAXLOCKS; db_param.maxlockobjs = DEFAULT_MAXLOCKOBJS; db_param.logfile_autoremove = 1; /* Make it accessible for all funcs */ dbd = dbd_ref; /* We only support unicode volumes ! */ if ( vi->v_volcharset != CH_UTF8) { dbd_log( LOGSTD, "Not a Unicode volume: %s, %u != %u", vi->v_volcodepage, vi->v_volcharset, CH_UTF8); return -1; } /* Get volume stamp */ dbd_getstamp(dbd, &rqst, &rply); if (rply.result != CNID_DBD_RES_OK) { ret = -1; goto exit; } memcpy(stamp, rply.name, CNID_DEV_LEN); /* temporary rebuild db, used with -re rebuild to delete unused CNIDs, not used with -f */ if (! nocniddb && (flags & DBD_FLAGS_EXCL) && !(flags & DBD_FLAGS_FORCE)) { tmpdb_path = get_tmpdb_path(); if (NULL == (dbd_rebuild = dbif_init(tmpdb_path, "cnid2.db"))) { ret = -1; goto exit; } if (dbif_env_open(dbd_rebuild, &db_param, DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN) < 0) { dbd_log(LOGSTD, "error opening tmp database!"); goto exit; } if (0 != (dbif_open(dbd_rebuild, NULL, 0))) { ret = -1; goto exit; } if (0 != (dbif_copy_rootinfokey(dbd, dbd_rebuild))) { ret = -1; goto exit; } } if (setjmp(jmp) != 0) { ret = 0; /* Got signal, jump from dbd_readdir */ goto exit; } /* scanvol */ if ( (scanvol(vi, flags)) != 0) { ret = -1; goto exit; } exit: if (! nocniddb) { if (dbif_txn_close(dbd, ret == 0 ? 1 : 0) != 0) ret = -1; if (dbd_rebuild) if (dbif_txn_close(dbd_rebuild, ret == 0 ? 1 : 0) != 0) ret = -1; if ((ret == 0) && dbd_rebuild && (flags & DBD_FLAGS_EXCL) && !(flags & DBD_FLAGS_FORCE)) /* We can only do this in exclusive mode, otherwise we might delete CNIDs added from other clients in between our pass 1 and 2 */ delete_orphaned_cnids(dbd, dbd_rebuild, flags); } if (dbd_rebuild) { dbd_log(LOGDEBUG, "Closing tmp db"); dbif_close(dbd_rebuild); if (tmpdb_path) { char cmd[8 + MAXPATHLEN]; snprintf(cmd, 8 + MAXPATHLEN, "rm -f %s/*", tmpdb_path); dbd_log( LOGDEBUG, "Removing temp database '%s'", tmpdb_path); system(cmd); snprintf(cmd, 8 + MAXPATHLEN, "rmdir %s", tmpdb_path); system(cmd); } } return ret; } netatalk-2.2.2/etc/cnid_dbd/dbd_resolve.c0000644000175200017500000000276511655731244015222 00000000000000/* * $Id: dbd_resolve.c,v 1.4 2009-05-06 11:54:24 franklahm Exp $ * * Copyright (C) Joerg Lenneis 2003 * All Rights Reserved. See COPYING. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include "dbif.h" #include "dbd.h" #include "pack.h" /* Return the did/name pair corresponding to a CNID. */ int dbd_resolve(DBD *dbd, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply) { DBT key, data; int rc; memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); rply->namelen = 0; key.data = (void *) &rqst->cnid; key.size = sizeof(cnid_t); if ((rc = dbif_get(dbd, DBIF_CNID, &key, &data, 0)) < 0) { LOG(log_error, logtype_cnid, "dbd_resolve: DB Error resolving CNID %u", ntohl(rqst->cnid)); rply->result = CNID_DBD_RES_ERR_DB; return -1; } if (rc == 0) { LOG(log_debug, logtype_cnid, "dbd_resolve: Could not resolve CNID %u", ntohl(rqst->cnid)); rply->result = CNID_DBD_RES_NOTFOUND; return 1; } memcpy(&rply->did, (char *) data.data + CNID_DID_OFS, sizeof(cnid_t)); rply->namelen = data.size; rply->name = (char *)data.data; LOG(log_debug, logtype_cnid, "dbd_resolve(CNID: %u): did: %u, name: \"%s\"", ntohl(rqst->cnid), ntohl(rply->did), rply->name + CNID_NAME_OFS); rply->result = CNID_DBD_RES_OK; return 1; } netatalk-2.2.2/etc/cnid_dbd/dbd_add.c0000644000175200017500000001375411655731126014272 00000000000000/* * Copyright (C) Joerg Lenneis 2003 * Copyright (C) Frank Lahm 2010 * All Rights Reserved. See COPYING. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #ifdef HAVE_SYS_TIME_H #include #endif /* HAVE_SYS_TIME_H */ #include #include #include #ifdef HAVE_DB4_DB_H #include #else #include #endif #include "dbif.h" #include "pack.h" #include "dbd.h" int add_cnid(DBD *dbd, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply) { DBT key, data; int rc; memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); key.data = &rply->cnid; key.size = sizeof(rply->cnid); data.data = pack_cnid_data(rqst); data.size = CNID_HEADER_LEN + rqst->namelen + 1; memcpy(data.data, &rply->cnid, sizeof(rply->cnid)); /* main database */ if ((rc = dbif_put(dbd, DBIF_CNID, &key, &data, DB_NOOVERWRITE))) { /* This could indicate a database error or that the key already exists (because of DB_NOOVERWRITE). In that case we still look at some sort of database corruption since that is not supposed to happen. */ switch (rc) { case 1: rply->result = CNID_DBD_RES_ERR_DUPLCNID; break; case -1: /* FIXME: Should that not be logged for case 1:? */ LOG(log_error, logtype_cnid, "add_cnid: duplicate %x %s", rply->cnid , (char *)data.data + CNID_NAME_OFS); rqst->cnid = rply->cnid; rc = dbd_update(dbd, rqst, rply); if (rc < 0) { rply->result = CNID_DBD_RES_ERR_DB; return -1; } else return 0; break; } return -1; } return 0; } /* ---------------------- */ int get_cnid(DBD *dbd, struct cnid_dbd_rply *rply) { static cnid_t id; static char buf[ROOTINFO_DATALEN]; DBT rootinfo_key, rootinfo_data; int rc; cnid_t hint; memset(&rootinfo_key, 0, sizeof(rootinfo_key)); memset(&rootinfo_data, 0, sizeof(rootinfo_data)); rootinfo_key.data = ROOTINFO_KEY; rootinfo_key.size = ROOTINFO_KEYLEN; if (id == 0) { if ((rc = dbif_get(dbd, DBIF_CNID, &rootinfo_key, &rootinfo_data, 0)) < 0) { rply->result = CNID_DBD_RES_ERR_DB; return -1; } if (rc == 0) { /* no rootinfo key yet */ memcpy(buf, ROOTINFO_DATA, ROOTINFO_DATALEN); id = CNID_START - 1; } else { memcpy(buf, (char *)rootinfo_data.data, ROOTINFO_DATALEN); memcpy(&hint, buf + CNID_TYPE_OFS, sizeof(hint)); id = ntohl(hint); if (id < CNID_START - 1) id = CNID_START - 1; } } /* If we've hit the max CNID allowed, we return an error. CNID * needs to be recycled before proceding. */ if (++id == CNID_INVALID) { rply->result = CNID_DBD_RES_ERR_MAX; return -1; } rootinfo_data.data = buf; rootinfo_data.size = ROOTINFO_DATALEN; hint = htonl(id); memcpy(buf + CNID_TYPE_OFS, &hint, sizeof(hint)); if (dbif_put(dbd, DBIF_CNID, &rootinfo_key, &rootinfo_data, 0) < 0) { rply->result = CNID_DBD_RES_ERR_DB; return -1; } rply->cnid = hint; return 0; } /* ------------------------ */ /* We need a nolookup version for `dbd` */ int dbd_add(DBD *dbd, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply, int nolookup) { rply->namelen = 0; LOG(log_debug, logtype_cnid, "dbd_add(did:%u, '%s', dev/ino:0x%llx/0x%llx) {start}", ntohl(rqst->did), rqst->name, (unsigned long long)rqst->dev, (unsigned long long)rqst->ino); /* See if we have an entry already and return it if yes */ if (! nolookup) { if (dbd_lookup(dbd, rqst, rply, 0) < 0) { LOG(log_debug, logtype_cnid, "dbd_add(did:%u, '%s', dev/ino:0x%llx/0x%llx): error in dbd_lookup", ntohl(rqst->did), rqst->name, (unsigned long long)rqst->dev, (unsigned long long)rqst->ino); return -1; } if (rply->result == CNID_DBD_RES_OK) { /* Found it. rply->cnid is the correct CNID now. */ LOG(log_debug, logtype_cnid, "dbd_add: dbd_lookup success --> CNID: %u", ntohl(rply->cnid)); return 1; } } LOG(log_debug, logtype_cnid, "dbd_add(did:%u, '%s', dev/ino:0x%llx/0x%llx): {adding to database ...}", ntohl(rqst->did), rqst->name, (unsigned long long)rqst->dev, (unsigned long long)rqst->ino); if (get_cnid(dbd, rply) < 0) { if (rply->result == CNID_DBD_RES_ERR_MAX) { LOG(log_error, logtype_cnid, "dbd_add: FATAL: CNID database has reached its limit."); /* This will cause an abort/rollback if transactions are used */ return 0; } else { LOG(log_error, logtype_cnid, "dbd_add: Failed to compute CNID for %s, error reading/updating Rootkey", rqst->name); return -1; } } if (add_cnid(dbd, rqst, rply) < 0) { if (rply->result == CNID_DBD_RES_ERR_DUPLCNID) { LOG(log_error, logtype_cnid, "dbd_add(DID: %u/\"%s\", dev/ino 0x%llx/0x%llx): Cannot add CNID: %u", ntohl(rqst->did), rqst->name, (unsigned long long)rqst->dev, (unsigned long long)rqst->ino, ntohl(rply->cnid)); /* abort/rollback, see above */ return 0; } else { LOG(log_error, logtype_cnid, "dbd_add: Failed to add CNID for %s to database", rqst->name); return -1; } } LOG(log_debug, logtype_cnid, "dbd_add(did:%u, '%s', dev/ino:0x%llx/0x%llx): Added with CNID: %u", ntohl(rqst->did), rqst->name, (unsigned long long)rqst->dev, (unsigned long long)rqst->ino, ntohl(rply->cnid)); rply->result = CNID_DBD_RES_OK; return 1; } netatalk-2.2.2/etc/cnid_dbd/usockfd.c0000644000175200017500000001122411700765720014353 00000000000000/* * Copyright (C) Joerg Lenneis 2003 * All Rights Reserved. See COPYING. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #include #include #ifdef HAVE_SYS_TYPES_H #include #endif /* HAVE_SYS_TYPES_H */ #ifdef HAVE_SYS_TIME_H #include #endif /* HAVE_SYS_TIME_H */ #include #include #include "usockfd.h" #include int usockfd_create(char *usock_fn, mode_t mode, int backlog) { int sockfd; struct sockaddr_un addr; if ((sockfd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { LOG(log_error, logtype_cnid, "error in socket call: %s", strerror(errno)); return -1; } if (unlink(usock_fn) < 0 && errno != ENOENT) { LOG(log_error, logtype_cnid, "error unlinking unix socket file %s: %s", usock_fn, strerror(errno)); return -1; } memset((char *) &addr, 0, sizeof(struct sockaddr_un)); addr.sun_family = AF_UNIX; strncpy(addr.sun_path, usock_fn, sizeof(addr.sun_path) - 1); if (bind(sockfd, (struct sockaddr *) &addr, sizeof(struct sockaddr_un)) < 0) { LOG(log_error, logtype_cnid, "error binding to socket for %s: %s", usock_fn, strerror(errno)); return -1; } if (listen(sockfd, backlog) < 0) { LOG(log_error, logtype_cnid, "error in listen for %s: %s", usock_fn, strerror(errno)); return -1; } #ifdef chmod #undef chmod #endif if (chmod(usock_fn, mode) < 0) { LOG(log_error, logtype_cnid, "error changing permissions for %s: %s", usock_fn, strerror(errno)); close(sockfd); return -1; } return sockfd; } /* --------------- * create a tcp socket */ int tsockfd_create(char *host, char *port, int backlog) { int sockfd, flag, ret; struct addrinfo hints, *servinfo, *p; /* Prepare hint for getaddrinfo */ memset(&hints, 0, sizeof hints); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; if ((ret = getaddrinfo(host, port, &hints, &servinfo)) != 0) { LOG(log_error, logtype_default, "tsockfd_create: getaddrinfo: %s\n", gai_strerror(ret)); return 0; } /* create a socket */ /* loop through all the results and bind to the first we can */ for (p = servinfo; p != NULL; p = p->ai_next) { if ((sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) { LOG(log_info, logtype_default, "tsockfd_create: socket: %s", strerror(errno)); continue; } /* * Set some socket options: * SO_REUSEADDR deals w/ quick close/opens * TCP_NODELAY diables Nagle */ #ifdef SO_REUSEADDR flag = 1; setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &flag, sizeof(flag)); #endif #ifdef USE_TCP_NODELAY #ifndef SOL_TCP #define SOL_TCP IPPROTO_TCP #endif flag = 1; setsockopt(sockfd, SOL_TCP, TCP_NODELAY, &flag, sizeof(flag)); #endif /* USE_TCP_NODELAY */ if (bind(sockfd, p->ai_addr, p->ai_addrlen) == -1) { close(sockfd); LOG(log_info, logtype_default, "tsockfd_create: bind: %s\n", strerror(errno)); continue; } if (listen(sockfd, backlog) < 0) { close(sockfd); LOG(log_info, logtype_default, "tsockfd_create: listen: %s\n", strerror(errno)); continue; } /* We got a socket */ break; } if (p == NULL) { LOG(log_error, logtype_default, "tsockfd_create: no suitable network config %s:%s", host, port); freeaddrinfo(servinfo); return -1; } freeaddrinfo(servinfo); return sockfd; } /* --------------------- */ int usockfd_check(int sockfd, const sigset_t *sigset) { int fd; socklen_t size; fd_set readfds; int ret; FD_ZERO(&readfds); FD_SET(sockfd, &readfds); if ((ret = pselect(sockfd + 1, &readfds, NULL, NULL, NULL, sigset)) < 0) { if (errno == EINTR) return 0; LOG(log_error, logtype_cnid, "error in select: %s", strerror(errno)); return -1; } if (ret) { size = 0; if ((fd = accept(sockfd, NULL, &size)) < 0) { if (errno == EINTR) return 0; LOG(log_error, logtype_cnid, "error in accept: %s", strerror(errno)); return -1; } return fd; } else return 0; } netatalk-2.2.2/etc/cnid_dbd/pack.h0000644000175200017500000000203111655731126013636 00000000000000/* * Copyright (C) Joerg Lenneis 2003 * Copyright (C) Frank Lahm 2010 * All Rights Reserved. See COPYING. */ #ifndef CNID_DBD_PACK_H #define CNID_DBD_PACK_H 1 #include #include #define ntoh64(x) (((uint64_t)(x) << 56) | \ (((uint64_t)(x) << 40) & 0xff000000000000ULL) | \ (((uint64_t)(x) << 24) & 0xff0000000000ULL) | \ (((uint64_t)(x) << 8) & 0xff00000000ULL) | \ (((uint64_t)(x) >> 8) & 0xff000000ULL) | \ (((uint64_t)(x) >> 24) & 0xff0000ULL) | \ (((uint64_t)(x) >> 40) & 0xff00ULL) | \ ((uint64_t)(x) >> 56)) extern unsigned char *pack_cnid_data(struct cnid_dbd_rqst *); extern int didname(DB *dbp, const DBT *pkey, const DBT *pdata, DBT *skey); extern int devino(DB *dbp, const DBT *pkey, const DBT *pdata, DBT *skey); extern int idxname(DB *dbp, const DBT *pkey, const DBT *pdata, DBT *skey); #endif /* CNID_DBD_PACK_H */ netatalk-2.2.2/etc/cnid_dbd/comm.c0000644000175200017500000001577011700765704013664 00000000000000/* * Copyright (C) Joerg Lenneis 2003 * Copyright (C) Frank Lahm 2010 * * All Rights Reserved. See COPYING. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "db_param.h" #include "usockfd.h" #include "comm.h" /* Length of the space taken up by a padded control message of length len */ #ifndef CMSG_SPACE #define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len)) #endif struct connection { time_t tm; /* When respawned last */ int fd; }; static int control_fd; static int cur_fd; static struct connection *fd_table; static int fd_table_size; static int fds_in_use = 0; static void invalidate_fd(int fd) { int i; if (fd == control_fd) return; for (i = 0; i != fds_in_use; i++) if (fd_table[i].fd == fd) break; assert(i < fds_in_use); fds_in_use--; fd_table[i] = fd_table[fds_in_use]; fd_table[fds_in_use].fd = -1; close(fd); return; } /* * Check for client requests. We keep up to fd_table_size open descriptors in * fd_table. If the table is full and we get a new descriptor via * control_fd, we close a random decriptor in the table to make space. The * affected client will automatically reconnect. For an EOF (descriptor is * closed by the client, so a read here returns 0) comm_rcv will take care of * things and clean up fd_table. The same happens for any read/write errors. */ static int check_fd(time_t timeout, const sigset_t *sigmask, time_t *now) { int fd; fd_set readfds; struct timespec tv; int ret; int i; int maxfd = control_fd; time_t t; FD_ZERO(&readfds); FD_SET(control_fd, &readfds); for (i = 0; i != fds_in_use; i++) { FD_SET(fd_table[i].fd, &readfds); if (maxfd < fd_table[i].fd) maxfd = fd_table[i].fd; } tv.tv_nsec = 0; tv.tv_sec = timeout; if ((ret = pselect(maxfd + 1, &readfds, NULL, NULL, &tv, sigmask)) < 0) { if (errno == EINTR) return 0; LOG(log_error, logtype_cnid, "error in select: %s",strerror(errno)); return -1; } time(&t); if (now) *now = t; if (!ret) return 0; if (FD_ISSET(control_fd, &readfds)) { int l = 0; fd = recv_fd(control_fd, 0); if (fd < 0) { return -1; } if (fds_in_use < fd_table_size) { fd_table[fds_in_use].fd = fd; fd_table[fds_in_use].tm = t; fds_in_use++; } else { time_t older = t; for (i = 0; i != fds_in_use; i++) { if (older <= fd_table[i].tm) { older = fd_table[i].tm; l = i; } } close(fd_table[l].fd); fd_table[l].fd = fd; fd_table[l].tm = t; } return 0; } for (i = 0; i != fds_in_use; i++) { if (FD_ISSET(fd_table[i].fd, &readfds)) { fd_table[i].tm = t; return fd_table[i].fd; } } /* We should never get here */ return 0; } int comm_init(struct db_param *dbp, int ctrlfd, int clntfd) { int i; fds_in_use = 0; fd_table_size = dbp->fd_table_size; if ((fd_table = malloc(fd_table_size * sizeof(struct connection))) == NULL) { LOG(log_error, logtype_cnid, "Out of memory"); return -1; } for (i = 0; i != fd_table_size; i++) fd_table[i].fd = -1; /* from dup2 */ control_fd = ctrlfd; #if 0 int b = 1; /* this one dump core in recvmsg, great */ if ( setsockopt(control_fd, SOL_SOCKET, SO_PASSCRED, &b, sizeof (b)) < 0) { LOG(log_error, logtype_cnid, "setsockopt SO_PASSCRED %s", strerror(errno)); return -1; } #endif /* push the first client fd */ fd_table[fds_in_use].fd = clntfd; fds_in_use++; return 0; } /* ------------ nbe of clients */ int comm_nbe(void) { return fds_in_use; } /* ------------ */ int comm_rcv(struct cnid_dbd_rqst *rqst, time_t timeout, const sigset_t *sigmask, time_t *now) { char *nametmp; int b; if ((cur_fd = check_fd(timeout, sigmask, now)) < 0) return -1; if (!cur_fd) return 0; LOG(log_maxdebug, logtype_cnid, "comm_rcv: got data on fd %u", cur_fd); if (setnonblock(cur_fd, 1) != 0) { LOG(log_error, logtype_cnid, "comm_rcv: setnonblock: %s", strerror(errno)); return -1; } nametmp = rqst->name; if ((b = readt(cur_fd, rqst, sizeof(struct cnid_dbd_rqst), 1, CNID_DBD_TIMEOUT)) != sizeof(struct cnid_dbd_rqst)) { if (b) LOG(log_error, logtype_cnid, "error reading message header: %s", strerror(errno)); invalidate_fd(cur_fd); rqst->name = nametmp; return 0; } rqst->name = nametmp; if (rqst->namelen && readt(cur_fd, rqst->name, rqst->namelen, 1, CNID_DBD_TIMEOUT) != rqst->namelen) { LOG(log_error, logtype_cnid, "error reading message name: %s", strerror(errno)); invalidate_fd(cur_fd); return 0; } /* We set this to make life easier for logging. None of the other stuff needs zero terminated strings. */ rqst->name[rqst->namelen] = '\0'; LOG(log_maxdebug, logtype_cnid, "comm_rcv: got %u bytes", b + rqst->namelen); return 1; } /* ------------ */ #define USE_WRITEV int comm_snd(struct cnid_dbd_rply *rply) { #ifdef USE_WRITEV struct iovec iov[2]; size_t towrite; #endif if (!rply->namelen) { if (write(cur_fd, rply, sizeof(struct cnid_dbd_rply)) != sizeof(struct cnid_dbd_rply)) { LOG(log_error, logtype_cnid, "error writing message header: %s", strerror(errno)); invalidate_fd(cur_fd); return 0; } return 1; } #ifdef USE_WRITEV iov[0].iov_base = rply; iov[0].iov_len = sizeof(struct cnid_dbd_rply); iov[1].iov_base = rply->name; iov[1].iov_len = rply->namelen; towrite = sizeof(struct cnid_dbd_rply) +rply->namelen; if (writev(cur_fd, iov, 2) != towrite) { LOG(log_error, logtype_cnid, "error writing message : %s", strerror(errno)); invalidate_fd(cur_fd); return 0; } #else if (write(cur_fd, rply, sizeof(struct cnid_dbd_rply)) != sizeof(struct cnid_dbd_rply)) { LOG(log_error, logtype_cnid, "error writing message header: %s", strerror(errno)); invalidate_fd(cur_fd); return 0; } if (write(cur_fd, rply->name, rply->namelen) != rply->namelen) { LOG(log_error, logtype_cnid, "error writing message name: %s", strerror(errno)); invalidate_fd(cur_fd); return 0; } #endif return 1; } netatalk-2.2.2/etc/cnid_dbd/cnid_metad.c0000644000175200017500000004260111700340470014776 00000000000000/* * Copyright (C) Joerg Lenneis 2003 * Copyright (C) Frank Lahm 2009, 2010 * * All Rights Reserved. See COPYING. */ /* cnid_dbd metadaemon to start up cnid_dbd upon request from afpd. Here is how it works: via TCP socket 1. afpd -------> cnid_metad via UNIX domain socket 2. cnid_metad -------> cnid_dbd passes afpd client fd 3. cnid_metad -------> cnid_dbd Result: via TCP socket 4. afpd -------> cnid_dbd cnid_metad and cnid_dbd have been converted to non-blocking IO in 2010. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #undef __USE_GNU #include #include #include #include #include #include #include #include #include #include #include #define _XPG4_2 1 #include #include #include #ifndef WEXITSTATUS #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif /* ! WEXITSTATUS */ #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif /* ! WIFEXITED */ #ifndef WIFSTOPPED #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) #endif #ifndef WIFSIGNALED #define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status)) #endif #ifndef WTERMSIG #define WTERMSIG(status) ((status) & 0x7f) #endif /* functions for username and group */ #include #include /* FIXME */ #ifdef linux #ifndef USE_SETRESUID #define USE_SETRESUID 1 #define SWITCH_TO_GID(gid) ((setresgid(gid,gid,gid) < 0 || setgid(gid) < 0) ? -1 : 0) #define SWITCH_TO_UID(uid) ((setresuid(uid,uid,uid) < 0 || setuid(uid) < 0) ? -1 : 0) #endif /* USE_SETRESUID */ #else /* ! linux */ #ifndef USE_SETEUID #define USE_SETEUID 1 #define SWITCH_TO_GID(gid) ((setegid(gid) < 0 || setgid(gid) < 0) ? -1 : 0) #define SWITCH_TO_UID(uid) ((setuid(uid) < 0 || seteuid(uid) < 0 || setuid(uid) < 0) ? -1 : 0) #endif /* USE_SETEUID */ #endif /* linux */ #include #include #include #include #include #include "usockfd.h" #define DBHOME ".AppleDB" #define DBHOMELEN 8 static int srvfd; static int rqstfd; static volatile sig_atomic_t sigchild = 0; static uint maxvol; #define MAXSPAWN 3 /* Max times respawned in.. */ #define TESTTIME 42 /* this much seconds apfd client tries to * * to reconnect every 5 secondes, catch it */ #define MAXVOLS 4096 #define DEFAULTHOST "localhost" #define DEFAULTPORT "4700" struct server { struct volinfo *volinfo; pid_t pid; time_t tm; /* When respawned last */ int count; /* Times respawned in the last TESTTIME secondes */ int control_fd; /* file descriptor to child cnid_dbd process */ }; static struct server srv[MAXVOLS]; /* Default logging config: log to syslog with level log_note */ static char logconfig[MAXPATHLEN + 21 + 1] = "default log_note"; static void daemon_exit(int i) { server_unlock(_PATH_CNID_METAD_LOCK); exit(i); } /* ------------------ */ static void sigterm_handler(int sig) { switch( sig ) { case SIGTERM : LOG(log_info, logtype_afpd, "shutting down on signal %d", sig ); break; default : LOG(log_error, logtype_afpd, "unexpected signal: %d", sig); } daemon_exit(0); } static struct server *test_usockfn(struct volinfo *volinfo) { int i; for (i = 0; i < maxvol; i++) { if ((srv[i].volinfo) && (strcmp(srv[i].volinfo->v_path, volinfo->v_path) == 0)) { return &srv[i]; } } return NULL; } /* -------------------- */ static int maybe_start_dbd(char *dbdpn, struct volinfo *volinfo) { pid_t pid; struct server *up; int sv[2]; int i; time_t t; char buf1[8]; char buf2[8]; char *volpath = volinfo->v_path; LOG(log_debug, logtype_cnid, "maybe_start_dbd: Volume: \"%s\"", volpath); up = test_usockfn(volinfo); if (up && up->pid) { /* we already have a process, send our fd */ if (send_fd(up->control_fd, rqstfd) < 0) { /* FIXME */ return -1; } return 0; } LOG(log_maxdebug, logtype_cnid, "maybe_start_dbd: no cnid_dbd for that volume yet"); time(&t); if (!up) { /* find an empty slot (i < maxvol) or the first free slot (i == maxvol)*/ for (i = 0; i <= maxvol; i++) { if (srv[i].volinfo == NULL && i < MAXVOLS) { up = &srv[i]; up->volinfo = volinfo; retainvolinfo(volinfo); up->tm = t; up->count = 0; if (i == maxvol) maxvol++; break; } } if (!up) { LOG(log_error, logtype_cnid, "no free slot for cnid_dbd child. Configured maximum: %d. Do you have so many volumes?", MAXVOLS); return -1; } } else { /* we have a slot but no process, check for respawn too fast */ if ( (t < (up->tm + TESTTIME)) /* We're in the respawn time window */ && (up->count > MAXSPAWN) ) { /* ...and already tried to fork too often */ LOG(log_maxdebug, logtype_cnid, "maybe_start_dbd: respawn too fast just exiting"); return -1; /* just exit, dont sleep, because we might have work to do for another client */ } if ( t >= (up->tm + TESTTIME) ) { /* out of respawn too fast windows reset the count */ LOG(log_maxdebug, logtype_cnid, "maybe_start_dbd: respawn window ended"); up->tm = t; up->count = 0; } up->count++; LOG(log_maxdebug, logtype_cnid, "maybe_start_dbd: respawn count now is: %u", up->count); if (up->count > MAXSPAWN) { /* We spawned too fast. From now until the first time we tried + TESTTIME seconds we will just return -1 above */ LOG(log_maxdebug, logtype_cnid, "maybe_start_dbd: reached MAXSPAWN threshhold"); } } /* Create socketpair for comm between parent and child. We use it to pass fds from connecting afpd processes to our cnid_dbd child via fd passing. */ if (socketpair(PF_UNIX, SOCK_STREAM, 0, sv) < 0) { LOG(log_error, logtype_cnid, "error in socketpair: %s", strerror(errno)); return -1; } if ((pid = fork()) < 0) { LOG(log_error, logtype_cnid, "error in fork: %s", strerror(errno)); return -1; } if (pid == 0) { int ret; /* * Child. Close descriptors and start the daemon. If it fails * just log it. The client process will fail connecting * afterwards anyway. */ close(srvfd); close(sv[0]); for (i = 0; i < MAXVOLS; i++) { if (srv[i].pid && up != &srv[i]) { close(srv[i].control_fd); } } sprintf(buf1, "%i", sv[1]); sprintf(buf2, "%i", rqstfd); if (up->count == MAXSPAWN) { /* there's a pb with the db inform child, it will delete the db */ LOG(log_warning, logtype_cnid, "Multiple attempts to start CNID db daemon for \"%s\" failed, wiping the slate clean...", up->volinfo->v_path); ret = execlp(dbdpn, dbdpn, "-d", volpath, buf1, buf2, logconfig, NULL); } else { ret = execlp(dbdpn, dbdpn, volpath, buf1, buf2, logconfig, NULL); } /* Yikes! We're still here, so exec failed... */ LOG(log_error, logtype_cnid, "Fatal error in exec: %s", strerror(errno)); daemon_exit(0); } /* * Parent. */ up->pid = pid; close(sv[1]); up->control_fd = sv[0]; return 0; } /* ------------------ */ static int set_dbdir(char *dbdir) { int len; struct stat st; len = strlen(dbdir); if (stat(dbdir, &st) < 0 && mkdir(dbdir, 0755) < 0) { LOG(log_error, logtype_cnid, "set_dbdir: mkdir failed for %s", dbdir); return -1; } if (dbdir[len - 1] != '/') { strcat(dbdir, "/"); len++; } strcpy(dbdir + len, DBHOME); if (stat(dbdir, &st) < 0 && mkdir(dbdir, 0755 ) < 0) { LOG(log_error, logtype_cnid, "set_dbdir: mkdir failed for %s", dbdir); return -1; } return 0; } /* ------------------ */ static uid_t user_to_uid (char *username) { struct passwd *this_passwd; /* check for anything */ if ( !username || strlen ( username ) < 1 ) return 0; /* grab the /etc/passwd record relating to username */ this_passwd = getpwnam ( username ); /* return false if there is no structure returned */ if (this_passwd == NULL) return 0; /* return proper uid */ return this_passwd->pw_uid; } /* ------------------ */ static gid_t group_to_gid ( char *group) { struct group *this_group; /* check for anything */ if ( !group || strlen ( group ) < 1 ) return 0; /* grab the /etc/groups record relating to group */ this_group = getgrnam ( group ); /* return false if there is no structure returned */ if (this_group == NULL) return 0; /* return proper gid */ return this_group->gr_gid; } /* ------------------ */ static void catch_child(int sig _U_) { sigchild = 1; } /* ----------------------- */ static void set_signal(void) { struct sigaction sv; sigset_t set; memset(&sv, 0, sizeof(sv)); /* Catch SIGCHLD */ sv.sa_handler = catch_child; sv.sa_flags = SA_NOCLDSTOP; sigemptyset(&sv.sa_mask); if (sigaction(SIGCHLD, &sv, NULL) < 0) { LOG(log_error, logtype_cnid, "cnid_metad: sigaction: %s", strerror(errno)); daemon_exit(EXITERR_SYS); } /* Catch SIGTERM */ sv.sa_handler = sigterm_handler; sigfillset(&sv.sa_mask ); if (sigaction(SIGTERM, &sv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "sigaction: %s", strerror(errno) ); daemon_exit(EXITERR_SYS); } /* Ignore the rest */ sv.sa_handler = SIG_IGN; sigemptyset(&sv.sa_mask ); if (sigaction(SIGALRM, &sv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "sigaction: %s", strerror(errno) ); daemon_exit(EXITERR_SYS); } sv.sa_handler = SIG_IGN; sigemptyset(&sv.sa_mask ); if (sigaction(SIGHUP, &sv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "sigaction: %s", strerror(errno) ); daemon_exit(EXITERR_SYS); } sv.sa_handler = SIG_IGN; sigemptyset(&sv.sa_mask ); if (sigaction(SIGUSR1, &sv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "sigaction: %s", strerror(errno) ); daemon_exit(EXITERR_SYS); } sv.sa_handler = SIG_IGN; sigemptyset(&sv.sa_mask ); if (sigaction(SIGUSR2, &sv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "sigaction: %s", strerror(errno) ); daemon_exit(EXITERR_SYS); } sv.sa_handler = SIG_IGN; sigemptyset(&sv.sa_mask ); if (sigaction(SIGPIPE, &sv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "sigaction: %s", strerror(errno) ); daemon_exit(EXITERR_SYS); } /* block everywhere but in pselect */ sigemptyset(&set); sigaddset(&set, SIGCHLD); sigprocmask(SIG_BLOCK, &set, NULL); } static int setlimits(void) { struct rlimit rlim; if (getrlimit(RLIMIT_NOFILE, &rlim) != 0) { LOG(log_error, logtype_afpd, "setlimits: %s", strerror(errno)); exit(1); } if (rlim.rlim_cur != RLIM_INFINITY && rlim.rlim_cur < 65535) { rlim.rlim_cur = 65535; if (rlim.rlim_max != RLIM_INFINITY && rlim.rlim_max < 65535) rlim.rlim_max = 65535; if (setrlimit(RLIMIT_NOFILE, &rlim) != 0) { LOG(log_error, logtype_afpd, "setlimits: %s", strerror(errno)); exit(1); } } return 0; } /* ------------------ */ int main(int argc, char *argv[]) { char volpath[MAXPATHLEN + 1]; int len, actual_len; pid_t pid; int status; char *dbdpn = _PATH_CNID_DBD; char *host = DEFAULTHOST; char *port = DEFAULTPORT; int i; int cc; uid_t uid = 0; gid_t gid = 0; int err = 0; int debug = 0; int ret; char *loglevel = NULL; char *logfile = NULL; sigset_t set; struct volinfo *volinfo; set_processname("cnid_metad"); while (( cc = getopt( argc, argv, "vVds:p:h:u:g:l:f:")) != -1 ) { switch (cc) { case 'v': case 'V': printf("cnid_metad (Netatalk %s)\n", VERSION); return -1; case 'd': debug = 1; break; case 'h': host = strdup(optarg); break; case 'u': uid = user_to_uid (optarg); if (!uid) { LOG(log_error, logtype_cnid, "main: bad user %s", optarg); err++; } break; case 'g': gid =group_to_gid (optarg); if (!gid) { LOG(log_error, logtype_cnid, "main: bad group %s", optarg); err++; } break; case 'p': port = strdup(optarg); break; case 's': dbdpn = strdup(optarg); break; case 'l': loglevel = strdup(optarg); break; case 'f': logfile = strdup(optarg); break; default: err++; break; } } /* Check for PID lockfile */ if (check_lockfile("cnid_metad", _PATH_CNID_METAD_LOCK)) return -1; if (!debug && daemonize(0, 0) != 0) exit(EXITERR_SYS); /* Create PID lockfile */ if (create_lockfile("cnid_metad", _PATH_CNID_METAD_LOCK)) return -1; if (loglevel) { strlcpy(logconfig + 8, loglevel, 13); free(loglevel); strcat(logconfig, " "); } if (logfile) { strlcat(logconfig, logfile, MAXPATHLEN); free(logfile); } setuplog(logconfig); if (err) { LOG(log_error, logtype_cnid, "main: bad arguments"); daemon_exit(1); } (void)setlimits(); if ((srvfd = tsockfd_create(host, port, 10)) < 0) daemon_exit(1); /* switch uid/gid */ if (uid || gid) { LOG(log_debug, logtype_cnid, "Setting uid/gid to %i/%i", uid, gid); if (gid) { if (SWITCH_TO_GID(gid) < 0) { LOG(log_info, logtype_cnid, "unable to switch to group %d", gid); daemon_exit(1); } } if (uid) { if (SWITCH_TO_UID(uid) < 0) { LOG(log_info, logtype_cnid, "unable to switch to user %d", uid); daemon_exit(1); } } } set_signal(); sigemptyset(&set); sigprocmask(SIG_SETMASK, NULL, &set); sigdelset(&set, SIGCHLD); while (1) { rqstfd = usockfd_check(srvfd, &set); /* Collect zombie processes and log what happened to them */ if (sigchild) while ((pid = waitpid(-1, &status, WNOHANG)) > 0) { for (i = 0; i < maxvol; i++) { if (srv[i].pid == pid) { srv[i].pid = 0; close(srv[i].control_fd); break; } } if (WIFEXITED(status)) { LOG(log_info, logtype_cnid, "cnid_dbd pid %i exited with exit code %i", pid, WEXITSTATUS(status)); } else if (WIFSIGNALED(status)) { LOG(log_info, logtype_cnid, "cnid_dbd pid %i exited with signal %i", pid, WTERMSIG(status)); } sigchild = 0; } if (rqstfd <= 0) continue; ret = readt(rqstfd, &len, sizeof(int), 1, 4); if (!ret) { /* already close */ goto loop_end; } else if (ret < 0) { LOG(log_severe, logtype_cnid, "error read: %s", strerror(errno)); goto loop_end; } else if (ret != sizeof(int)) { LOG(log_error, logtype_cnid, "short read: got %d", ret); goto loop_end; } /* * checks for buffer overruns. The client libatalk side does it too * before handing the dir path over but who trusts clients? */ if (!len || len +DBHOMELEN +2 > MAXPATHLEN) { LOG(log_error, logtype_cnid, "wrong len parameter: %d", len); goto loop_end; } actual_len = readt(rqstfd, volpath, len, 1, 5); if (actual_len < 0) { LOG(log_severe, logtype_cnid, "Read(2) error : %s", strerror(errno)); goto loop_end; } if (actual_len != len) { LOG(log_error, logtype_cnid, "error/short read (dir): %s", strerror(errno)); goto loop_end; } volpath[len] = '\0'; /* Load .volinfo file */ if ((volinfo = allocvolinfo(volpath)) == NULL) { LOG(log_severe, logtype_cnid, "allocvolinfo(\"%s\"): %s", volpath, strerror(errno)); goto loop_end; } if (set_dbdir(volinfo->v_dbpath) < 0) { goto loop_end; } maybe_start_dbd(dbdpn, volinfo); (void)closevolinfo(volinfo); loop_end: close(rqstfd); } } netatalk-2.2.2/etc/afpd/0000777000175200017500000000000011704770426012024 500000000000000netatalk-2.2.2/etc/afpd/misc.h0000644000175200017500000000145411655731126013047 00000000000000/* * $Id: misc.h,v 1.5 2009-10-15 10:43:13 didg Exp $ */ #ifndef AFPD_MISC_H #define AFPD_MISC_H 1 #include #include /* FP functions */ /* messages.c */ int afp_getsrvrmesg (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); /* afs.c */ #ifdef AFS int afp_getdiracl (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_setdiracl (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); #else /* AFS */ #define afp_getdiracl NULL #define afp_setdiracl NULL #endif /* AFS */ #if defined( AFS ) && defined( UAM_AFSKRB ) int afp_afschangepw (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); #else /* AFS && UAM_AFSKRB */ #define afp_afschangepw NULL #endif /* AFS && UAM_AFSKRB */ #endif netatalk-2.2.2/etc/afpd/directory.h0000644000175200017500000001353711655731126014125 00000000000000/* * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef AFPD_DIRECTORY_H #define AFPD_DIRECTORY_H 1 #include #include /*#include */ /* including it here causes some confusion */ #include #include /* sys/types.h usually snarfs in major/minor macros. if they don't * try this file. */ #ifndef major #include #endif #include #include #include "volume.h" /* directory bits */ #define DIRPBIT_ATTR 0 #define DIRPBIT_PDID 1 #define DIRPBIT_CDATE 2 #define DIRPBIT_MDATE 3 #define DIRPBIT_BDATE 4 #define DIRPBIT_FINFO 5 #define DIRPBIT_LNAME 6 #define DIRPBIT_SNAME 7 #define DIRPBIT_DID 8 #define DIRPBIT_OFFCNT 9 #define DIRPBIT_UID 10 #define DIRPBIT_GID 11 #define DIRPBIT_ACCESS 12 #define DIRPBIT_PDINFO 13 /* ProDOS Info */ #define DIRPBIT_UNIXPR 15 #define FILDIRBIT_ISDIR (1 << 7) /* is a directory */ #define FILDIRBIT_ISFILE (0) /* is a file */ /* file/directory ids. what a mess. we scramble things in a vain attempt * to get something meaningful */ #ifndef AFS #if 0 #define CNID_XOR(a) (((a) >> 16) ^ (a)) #define CNID_DEV(a) ((((CNID_XOR(major((a)->st_dev)) & 0xf) << 3) | \ (CNID_XOR(minor((a)->st_dev)) & 0x7)) << 24) #define CNID_INODE(a) (((a)->st_ino ^ (((a)->st_ino & 0xff000000) >> 8)) \ & 0x00ffffff) #define CNID_FILE(a) (((a) & 0x1) << 31) #define CNID(a,b) (CNID_DEV(a) | CNID_INODE(a) | CNID_FILE(b)) #endif #define CNID(a,b) ((a)->st_ino & 0xffffffff) #else /* AFS */ #define CNID(a,b) (((a)->st_ino & 0x7fffffff) | CNID_FILE(b)) #endif /* AFS */ struct maccess { u_char ma_user; u_char ma_world; u_char ma_group; u_char ma_owner; }; #define AR_USEARCH (1<<0) #define AR_UREAD (1<<1) #define AR_UWRITE (1<<2) #define AR_UOWN (1<<7) q_t *invalid_dircache_entries; typedef int (*dir_loop)(struct dirent *, char *, void *); extern void dir_free_invalid_q(void); extern struct dir *dir_new(const char *mname, const char *uname, const struct vol *, cnid_t pdid, cnid_t did, bstring fullpath, struct stat *); extern void dir_free (struct dir *); extern struct dir *dir_add(struct vol *, const struct dir *, struct path *, int); extern int dir_modify(const struct vol *vol, struct dir *dir, cnid_t pdid, cnid_t did, const char *new_mname, const char *new_uname, bstring pdir_fullpath); extern int dir_remove(const struct vol *vol, struct dir *dir); extern struct dir *dirlookup (const struct vol *, cnid_t); extern struct dir *dirlookup_bypath(const struct vol *vol, const char *path); extern int movecwd (const struct vol *, struct dir *); extern struct path *cname (struct vol *, struct dir *, char **); extern int deletecurdir (struct vol *); extern mode_t mtoumode (struct maccess *); extern void utommode (struct stat *, struct maccess *); extern int getdirparams (const struct vol *, u_int16_t, struct path *, struct dir *, char *, size_t *); extern int setdirparams(struct vol *, struct path *, u_int16_t, char *); extern int renamedir(const struct vol *, int, char *, char *, struct dir *, struct dir *, char *); extern int path_error(struct path *, int error); extern void setdiroffcnt(struct dir *dir, struct stat *st, u_int32_t count); extern int dirreenumerate(struct dir *dir, struct stat *st); extern int for_each_dirent(const struct vol *, char *, dir_loop , void *); extern int check_access(char *name , int mode); extern int file_access(struct path *path, int mode); extern int netatalk_unlink (const char *name); extern int caseenumerate (const struct vol *, struct path *, struct dir *); /* from enumerate.c */ extern char *check_dirent (const struct vol *, char *); /* FP functions */ int afp_createdir (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_opendir (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_setdirparams (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_closedir (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_mapid (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_mapname (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_syncdir (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); /* from enumerate.c */ int afp_enumerate (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_enumerate_ext (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_enumerate_ext2 (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); /* from catsearch.c */ int afp_catsearch (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_catsearch_ext (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); #endif netatalk-2.2.2/etc/afpd/auth.c0000644000175200017500000010366511655731244013060 00000000000000/* * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef TRU64 #include #include #include #include extern void afp_get_cmdline( int *ac, char ***av ); #endif /* TRU64 */ #include #include #include #include #include "auth.h" #include "uam_auth.h" #include "switch.h" #include "status.h" #include "fork.h" #include "extattrs.h" #ifdef HAVE_ACLS #include "acls.h" #endif int afp_version = 11; static int afp_version_index; uid_t uuid; #if defined( sun ) && !defined( __svr4__ ) || defined( ultrix ) int *groups; #define GROUPS_SIZE sizeof(int) #else /* sun __svr4__ ultrix */ gid_t *groups; #define GROUPS_SIZE sizeof(gid_t) #endif /* sun ultrix */ int ngroups; static struct uam_mod uam_modules = {NULL, NULL, &uam_modules, &uam_modules}; static struct uam_obj uam_login = {"", "", 0, {{NULL, NULL, NULL, NULL }}, &uam_login, &uam_login}; static struct uam_obj uam_changepw = {"", "", 0, {{NULL, NULL, NULL, NULL}}, &uam_changepw, &uam_changepw}; static struct uam_obj *afp_uam = NULL; void status_versions(char *data, #ifndef NO_DDP const ASP asp, #endif const DSI *dsi) { char *start = data; u_int16_t status; int len, num, i, count = 0; memcpy(&status, start + AFPSTATUS_VERSOFF, sizeof(status)); num = sizeof( afp_versions ) / sizeof( afp_versions[ 0 ] ); for ( i = 0; i < num; i++ ) { #ifndef NO_DDP if ( !asp && (afp_versions[ i ].av_number <= 21)) continue; #endif /* ! NO_DDP */ if ( !dsi && (afp_versions[ i ].av_number >= 22)) continue; count++; } data += ntohs( status ); *data++ = count; for ( i = 0; i < num; i++ ) { #ifndef NO_DDP if ( !asp && (afp_versions[ i ].av_number <= 21)) continue; #endif /* ! NO_DDP */ if ( !dsi && (afp_versions[ i ].av_number >= 22)) continue; len = strlen( afp_versions[ i ].av_name ); *data++ = len; memcpy( data, afp_versions[ i ].av_name , len ); data += len; } status = htons( data - start ); memcpy(start + AFPSTATUS_UAMSOFF, &status, sizeof(status)); } void status_uams(char *data, const char *authlist) { char *start = data; u_int16_t status; struct uam_obj *uams; int len, num = 0; memcpy(&status, start + AFPSTATUS_UAMSOFF, sizeof(status)); uams = &uam_login; while ((uams = uams->uam_prev) != &uam_login) { if (strstr(authlist, uams->uam_path)) num++; } data += ntohs( status ); *data++ = num; while ((uams = uams->uam_prev) != &uam_login) { if (strstr(authlist, uams->uam_path)) { LOG(log_info, logtype_afpd, "uam: \"%s\" available", uams->uam_name); len = strlen( uams->uam_name); *data++ = len; memcpy( data, uams->uam_name, len ); data += len; } } /* icon offset */ status = htons(data - start); memcpy(start + AFPSTATUS_ICONOFF, &status, sizeof(status)); } /* handle errors by closing the connection. this is only needed * by the afp_* functions. */ static int send_reply(const AFPObj *obj, const int err) { if ((err == AFP_OK) || (err == AFPERR_AUTHCONT)) return err; obj->reply(obj->handle, err); obj->exit(0); return AFP_OK; } static int afp_errpwdexpired(AFPObj *obj _U_, char *ibuf _U_, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { *rbuflen = 0; return AFPERR_PWDEXPR; } static int afp_null_nolog(AFPObj *obj _U_, char *ibuf _U_, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { *rbuflen = 0; return( AFPERR_NOOP ); } static int set_auth_switch(int expired) { int i; if (expired) { /* * BF: expired password handling * to allow the user to change his/her password we have to allow login * but every following call except for FPChangePassword will be thrown * away with an AFPERR_PWDEXPR error. (thanks to Leland Wallace from Apple * for clarifying this) */ for (i=0; i<=0xff; i++) { uam_afpserver_action(i, UAM_AFPSERVER_PREAUTH, afp_errpwdexpired, NULL); } uam_afpserver_action(AFP_LOGOUT, UAM_AFPSERVER_PREAUTH, afp_logout, NULL); uam_afpserver_action(AFP_CHANGEPW, UAM_AFPSERVER_PREAUTH, afp_changepw, NULL); } else { afp_switch = postauth_switch; switch (afp_version) { case 33: case 32: #ifdef HAVE_ACLS uam_afpserver_action(AFP_GETACL, UAM_AFPSERVER_POSTAUTH, afp_getacl, NULL); uam_afpserver_action(AFP_SETACL, UAM_AFPSERVER_POSTAUTH, afp_setacl, NULL); uam_afpserver_action(AFP_ACCESS, UAM_AFPSERVER_POSTAUTH, afp_access, NULL); #endif /* HAVE_ACLS */ uam_afpserver_action(AFP_GETEXTATTR, UAM_AFPSERVER_POSTAUTH, afp_getextattr, NULL); uam_afpserver_action(AFP_SETEXTATTR, UAM_AFPSERVER_POSTAUTH, afp_setextattr, NULL); uam_afpserver_action(AFP_REMOVEATTR, UAM_AFPSERVER_POSTAUTH, afp_remextattr, NULL); uam_afpserver_action(AFP_LISTEXTATTR, UAM_AFPSERVER_POSTAUTH, afp_listextattr, NULL); case 31: uam_afpserver_action(AFP_SYNCDIR, UAM_AFPSERVER_POSTAUTH, afp_syncdir, NULL); uam_afpserver_action(AFP_SYNCFORK, UAM_AFPSERVER_POSTAUTH, afp_syncfork, NULL); uam_afpserver_action(AFP_SPOTLIGHT_PRIVATE, UAM_AFPSERVER_POSTAUTH, afp_null_nolog, NULL); uam_afpserver_action(AFP_ENUMERATE_EXT2, UAM_AFPSERVER_POSTAUTH, afp_enumerate_ext2, NULL); case 30: uam_afpserver_action(AFP_ENUMERATE_EXT, UAM_AFPSERVER_POSTAUTH, afp_enumerate_ext, NULL); uam_afpserver_action(AFP_BYTELOCK_EXT, UAM_AFPSERVER_POSTAUTH, afp_bytelock_ext, NULL); /* catsearch_ext uses the same packet as catsearch FIXME double check this, it wasn't true for enue enumerate_ext */ uam_afpserver_action(AFP_CATSEARCH_EXT, UAM_AFPSERVER_POSTAUTH, afp_catsearch_ext, NULL); uam_afpserver_action(AFP_GETSESSTOKEN, UAM_AFPSERVER_POSTAUTH, afp_getsession, NULL); uam_afpserver_action(AFP_READ_EXT, UAM_AFPSERVER_POSTAUTH, afp_read_ext, NULL); uam_afpserver_action(AFP_WRITE_EXT, UAM_AFPSERVER_POSTAUTH, afp_write_ext, NULL); uam_afpserver_action(AFP_DISCTOLDSESS, UAM_AFPSERVER_POSTAUTH, afp_disconnect, NULL); case 22: /* * If first connection to a server is done in classic AFP2.2 version is used * but OSX uses AFP3.x FPzzz command ! */ uam_afpserver_action(AFP_ZZZ, UAM_AFPSERVER_POSTAUTH, afp_zzz, NULL); break; } } return AFP_OK; } #define GROUPSTR_BUFSIZE 1024 static const char *print_groups(int ngroups, gid_t *groups) { static char groupsstr[GROUPSTR_BUFSIZE]; int i; char *s = groupsstr; if (ngroups == 0) return "-"; for (i = 0; (i < ngroups) && (s < &groupsstr[GROUPSTR_BUFSIZE]); i++) { s += snprintf(s, &groupsstr[GROUPSTR_BUFSIZE] - s, " %u", groups[i]); } return groupsstr; } static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void), int expired) { #ifdef ADMIN_GRP int admin = 0; #endif /* ADMIN_GRP */ if ( pwd->pw_uid == 0 ) { /* don't allow root login */ LOG(log_error, logtype_afpd, "login: root login denied!" ); return AFPERR_NOTAUTH; } LOG(log_note, logtype_afpd, "%s Login by %s", afp_versions[afp_version_index].av_name, pwd->pw_name); #ifndef NO_DDP if (obj->proto == AFPPROTO_ASP) { ASP asp = obj->handle; int addr_net = ntohs( asp->asp_sat.sat_addr.s_net ); int addr_node = asp->asp_sat.sat_addr.s_node; if (obj->options.authprintdir) { if(addr_net && addr_node) { /* Do we have a valid Appletalk address? */ char nodename[256]; FILE *fp; int mypid = getpid(); struct stat stat_buf; sprintf(nodename, "%s/net%d.%dnode%d", obj->options.authprintdir, addr_net / 256, addr_net % 256, addr_node); LOG(log_info, logtype_afpd, "registering %s (uid %d) on %u.%u as %s", pwd->pw_name, pwd->pw_uid, addr_net, addr_node, nodename); if (stat(nodename, &stat_buf) == 0) { /* file exists */ if (S_ISREG(stat_buf.st_mode)) { /* normal file */ unlink(nodename); fp = fopen(nodename, "w"); fprintf(fp, "%s:%d\n", pwd->pw_name, mypid); fclose(fp); chown( nodename, pwd->pw_uid, -1 ); } else { /* somebody is messing with us */ LOG(log_error, logtype_afpd, "print authfile %s is not a normal file, it will not be modified", nodename ); } } else { /* file 'nodename' does not exist */ fp = fopen(nodename, "w"); fprintf(fp, "%s:%d\n", pwd->pw_name, mypid); fclose(fp); chown( nodename, pwd->pw_uid, -1 ); } } /* if (addr_net && addr_node ) */ } /* if (options->authprintdir) */ } /* if (obj->proto == AFPPROTO_ASP) */ #endif if (initgroups( pwd->pw_name, pwd->pw_gid ) < 0) { #ifdef RUN_AS_USER LOG(log_info, logtype_afpd, "running with uid %d", geteuid()); #else /* RUN_AS_USER */ LOG(log_error, logtype_afpd, "login: %s", strerror(errno)); return AFPERR_BADUAM; #endif /* RUN_AS_USER */ } /* Basically if the user is in the admin group, we stay root */ if (( ngroups = getgroups( 0, NULL )) < 0 ) { LOG(log_error, logtype_afpd, "login: %s getgroups: %s", pwd->pw_name, strerror(errno) ); return AFPERR_BADUAM; } if ( NULL == (groups = calloc(ngroups, GROUPS_SIZE)) ) { LOG(log_error, logtype_afpd, "login: %s calloc: %d", ngroups); return AFPERR_BADUAM; } if (( ngroups = getgroups( ngroups, groups )) < 0 ) { LOG(log_error, logtype_afpd, "login: %s getgroups: %s", pwd->pw_name, strerror(errno) ); return AFPERR_BADUAM; } #ifdef ADMIN_GRP LOG(log_debug, logtype_afpd, "obj->options.admingid == %d", obj->options.admingid); if (obj->options.admingid != 0) { int i; for (i = 0; i < ngroups; i++) { if (groups[i] == obj->options.admingid) admin = 1; } } if (admin) { ad_setfuid(0); LOG(log_info, logtype_afpd, "admin login -- %s", pwd->pw_name ); } if (!admin) #endif /* ADMIN_GRP */ #ifdef TRU64 { struct DSI *dsi = obj->handle; struct hostent *hp; char *clientname; int argc; char **argv; char hostname[256]; afp_get_cmdline( &argc, &argv ); hp = gethostbyaddr( (char *) &dsi->client.sin_addr, sizeof( struct in_addr ), dsi->client.sin_family ); if( hp ) clientname = hp->h_name; else clientname = inet_ntoa( dsi->client.sin_addr ); sprintf( hostname, "%s@%s", pwd->pw_name, clientname ); if( sia_become_user( NULL, argc, argv, hostname, pwd->pw_name, NULL, FALSE, NULL, NULL, SIA_BEU_REALLOGIN ) != SIASUCCESS ) return AFPERR_BADUAM; LOG(log_info, logtype_afpd, "session from %s (%s)", hostname, inet_ntoa( dsi->client.sin_addr ) ); if (setegid( pwd->pw_gid ) < 0 || seteuid( pwd->pw_uid ) < 0) { LOG(log_error, logtype_afpd, "login: %s %s", pwd->pw_name, strerror(errno) ); return AFPERR_BADUAM; } } #else /* TRU64 */ if (setegid( pwd->pw_gid ) < 0 || seteuid( pwd->pw_uid ) < 0) { LOG(log_error, logtype_afpd, "login: %s %s", pwd->pw_name, strerror(errno) ); return AFPERR_BADUAM; } #endif /* TRU64 */ LOG(log_debug, logtype_afpd, "login: supplementary groups: %s", print_groups(ngroups, groups)); /* There's probably a better way to do this, but for now, we just play root */ #ifdef ADMIN_GRP if (admin) uuid = 0; else #endif /* ADMIN_GRP */ uuid = pwd->pw_uid; set_auth_switch(expired); /* save our euid, we need it for preexec_close */ obj->uid = geteuid(); obj->logout = logout; #ifdef FORCE_UIDGID obj->force_uid = 1; save_uidgid ( &obj->uidgid ); #endif return( AFP_OK ); } /* ---------------------- */ int afp_zzz(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { uint32_t data; DSI *dsi = (DSI *)AFPobj->handle; *rbuflen = 0; ibuf += 2; ibuflen -= 2; if (ibuflen < 4) return AFPERR_MISC; memcpy(&data, ibuf, 4); /* flag */ data = ntohl(data); /* * Possible sleeping states: * 1) normal sleep: DSI_SLEEPING (up to 10.3) * 2) extended sleep: DSI_SLEEPING | DSI_EXTSLEEP (starting with 10.4) */ if (data & AFPZZZ_EXT_WAKEUP) { /* wakeup request from exetended sleep */ if (dsi->flags & DSI_EXTSLEEP) { LOG(log_note, logtype_afpd, "afp_zzz: waking up from extended sleep"); dsi->flags &= ~(DSI_SLEEPING | DSI_EXTSLEEP); } } else { /* sleep request */ dsi->flags |= DSI_SLEEPING; if (data & AFPZZZ_EXT_SLEEP) { LOG(log_note, logtype_afpd, "afp_zzz: entering extended sleep"); dsi->flags |= DSI_EXTSLEEP; } else { LOG(log_note, logtype_afpd, "afp_zzz: entering normal sleep"); } } /* * According to AFP 3.3 spec we should not return anything, * but eg 10.5.8 server still returns the numbers of hours * the server is keeping the sessino (ie max sleeptime). */ data = obj->options.sleep / 120; /* hours */ if (!data) { data = 1; } *rbuflen = sizeof(data); data = htonl(data); memcpy(rbuf, &data, sizeof(data)); rbuf += sizeof(data); return AFP_OK; } /* ---------------------- */ static int create_session_token(AFPObj *obj) { pid_t pid; /* use 8 bytes for token as OSX, don't know if it helps */ if ( sizeof(pid_t) > SESSIONTOKEN_LEN) { LOG(log_error, logtype_afpd, "sizeof(pid_t) > %u", SESSIONTOKEN_LEN ); return AFPERR_MISC; } if ( NULL == (obj->sinfo.sessiontoken = malloc(SESSIONTOKEN_LEN)) ) return AFPERR_MISC; memset(obj->sinfo.sessiontoken, 0, SESSIONTOKEN_LEN); obj->sinfo.sessiontoken_len = SESSIONTOKEN_LEN; pid = getpid(); memcpy(obj->sinfo.sessiontoken, &pid, sizeof(pid_t)); return 0; } static int create_session_key(AFPObj *obj) { /* create session key */ if (obj->sinfo.sessionkey == NULL) { if (NULL == (obj->sinfo.sessionkey = malloc(SESSIONKEY_LEN)) ) return AFPERR_MISC; uam_random_string(obj, obj->sinfo.sessionkey, SESSIONKEY_LEN); obj->sinfo.sessionkey_len = SESSIONKEY_LEN; } return AFP_OK; } /* ---------------------- */ int afp_getsession( AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { u_int16_t type; u_int32_t idlen = 0; u_int32_t boottime; u_int32_t tklen, tp; char *token; char *p; *rbuflen = 0; tklen = 0; if (ibuflen < 2 + sizeof(type)) { return AFPERR_PARAM; } ibuf += 2; ibuflen -= 2; memcpy(&type, ibuf, sizeof(type)); type = ntohs(type); ibuf += sizeof(type); ibuflen -= sizeof(type); if ( obj->sinfo.sessiontoken == NULL ) { if ( create_session_token( obj ) ) return AFPERR_MISC; } /* * */ switch (type) { case 0: /* old version ?*/ tklen = obj->sinfo.sessiontoken_len; token = obj->sinfo.sessiontoken; break; case 1: /* disconnect */ case 2: /* reconnect update id */ if (ibuflen >= sizeof(idlen)) { memcpy(&idlen, ibuf, sizeof(idlen)); idlen = ntohl(idlen); ibuf += sizeof(idlen); ibuflen -= sizeof(idlen); if (ibuflen < idlen) { return AFPERR_PARAM; } /* memcpy (id, ibuf, idlen) */ tklen = obj->sinfo.sessiontoken_len; token = obj->sinfo.sessiontoken; } break; case 3: case 4: if (ibuflen >= 8 ) { p = ibuf; memcpy( &idlen, ibuf, sizeof(idlen)); idlen = ntohl(idlen); ibuf += sizeof(idlen); ibuflen -= sizeof(idlen); ibuf += sizeof(boottime); ibuflen -= sizeof(boottime); if (ibuflen < idlen || idlen > (90-10)) { return AFPERR_PARAM; } if (!obj->sinfo.clientid) { obj->sinfo.clientid = malloc(idlen + 8); memcpy(obj->sinfo.clientid, p, idlen + 8); obj->sinfo.clientid_len = idlen + 8; } if (ipc_child_write(obj->ipc_fd, IPC_GETSESSION, idlen+8, p) != 0) return AFPERR_MISC; tklen = obj->sinfo.sessiontoken_len; token = obj->sinfo.sessiontoken; } break; case 8: /* Panther Kerberos Token */ tklen = obj->sinfo.cryptedkey_len; token = obj->sinfo.cryptedkey; break; default: return AFPERR_NOOP; break; } if (tklen == 0) return AFPERR_MISC; tp = htonl(tklen); memcpy(rbuf, &tp, sizeof(tklen)); rbuf += sizeof(tklen); *rbuflen += sizeof(tklen); memcpy(rbuf, token, tklen); *rbuflen += tklen; return AFP_OK; } /* ---------------------- */ int afp_disconnect(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { DSI *dsi = (DSI *)obj->handle; u_int16_t type; u_int32_t tklen; pid_t token; int i; *rbuflen = 0; ibuf += 2; #if 0 /* check for guest user */ if ( 0 == (strcasecmp(obj->username, obj->options.guest)) ) { return AFPERR_MISC; } #endif memcpy(&type, ibuf, sizeof(type)); type = ntohs(type); ibuf += sizeof(type); memcpy(&tklen, ibuf, sizeof(tklen)); tklen = ntohl(tklen); ibuf += sizeof(tklen); if ( sizeof(pid_t) > SESSIONTOKEN_LEN) { LOG(log_error, logtype_afpd, "sizeof(pid_t) > %u", SESSIONTOKEN_LEN ); return AFPERR_MISC; } if (tklen != SESSIONTOKEN_LEN) { return AFPERR_MISC; } tklen = sizeof(pid_t); memcpy(&token, ibuf, tklen); /* our stuff is pid + zero pad */ ibuf += tklen; for (i = tklen; i < SESSIONTOKEN_LEN; i++, ibuf++) { if (*ibuf != 0) { return AFPERR_MISC; } } LOG(log_note, logtype_afpd, "afp_disconnect: trying primary reconnect"); dsi->flags |= DSI_RECONINPROG; /* Deactivate tickle timer */ const struct itimerval none = {{0, 0}, {0, 0}}; setitimer(ITIMER_REAL, &none, NULL); /* check for old session, possibly transfering session from here to there */ if (ipc_child_write(obj->ipc_fd, IPC_DISCOLDSESSION, tklen, &token) != 0) goto exit; /* write uint16_t DSI request ID */ if (writet(obj->ipc_fd, &dsi->header.dsi_requestID, 2, 0, 2) != 2) { LOG(log_error, logtype_afpd, "afp_disconnect: couldn't send DSI request ID"); goto exit; } /* now send our connected AFP client socket */ if (send_fd(obj->ipc_fd, dsi->socket) != 0) goto exit; /* Now see what happens: either afpd master sends us SIGTERM because our session */ /* has been transfered to a old disconnected session, or we continue */ sleep(5); if (!(dsi->flags & DSI_RECONINPROG)) { /* deleted in SIGTERM handler */ /* Reconnect succeeded, we exit now after sleeping some more */ sleep(2); /* sleep some more to give the recon. session time */ LOG(log_note, logtype_afpd, "afp_disconnect: primary reconnect succeeded"); exit(0); } exit: /* Reinstall tickle timer */ setitimer(ITIMER_REAL, &dsi->timer, NULL); LOG(log_error, logtype_afpd, "afp_disconnect: primary reconnect failed"); return AFPERR_MISC; } /* ---------------------- */ static int get_version(AFPObj *obj, char *ibuf, size_t ibuflen, size_t len) { int num,i; if (!len || len > ibuflen) return AFPERR_BADVERS; num = sizeof( afp_versions ) / sizeof( afp_versions[ 0 ]); for ( i = 0; i < num; i++ ) { if ( strncmp( ibuf, afp_versions[ i ].av_name , len ) == 0 ) { afp_version = afp_versions[ i ].av_number; afp_version_index = i; break; } } if ( i == num ) /* An inappropo version */ return AFPERR_BADVERS ; if (afp_version >= 30 && obj->proto != AFPPROTO_DSI) return AFPERR_BADVERS ; /* FIXME Hack */ if (afp_version >= 30 && sizeof(off_t) != 8) { LOG(log_error, logtype_afpd, "get_version: no LARGE_FILE support recompile!" ); return AFPERR_BADVERS ; } return 0; } /* ---------------------- */ int afp_login(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { struct passwd *pwd = NULL; size_t len; int i; *rbuflen = 0; if ( nologin & 1) return send_reply(obj, AFPERR_SHUTDOWN ); if (ibuflen < 2) return send_reply(obj, AFPERR_BADVERS ); ibuf++; len = (unsigned char) *ibuf++; ibuflen -= 2; i = get_version(obj, ibuf, ibuflen, len); if (i) return send_reply(obj, i ); if (ibuflen <= len) return send_reply(obj, AFPERR_BADUAM); ibuf += len; ibuflen -= len; len = (unsigned char) *ibuf++; ibuflen--; if (!len || len > ibuflen) return send_reply(obj, AFPERR_BADUAM); if (NULL == (afp_uam = auth_uamfind(UAM_SERVER_LOGIN, ibuf, len)) ) return send_reply(obj, AFPERR_BADUAM); ibuf += len; ibuflen -= len; if (AFP_OK != (i = create_session_key(obj)) ) return send_reply(obj, i); i = afp_uam->u.uam_login.login(obj, &pwd, ibuf, ibuflen, rbuf, rbuflen); if (!pwd || ( i != AFP_OK && i != AFPERR_PWDEXPR)) return send_reply(obj, i); return send_reply(obj, login(obj, pwd, afp_uam->u.uam_login.logout, ((i==AFPERR_PWDEXPR)?1:0))); } /* ---------------------- */ int afp_login_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { struct passwd *pwd = NULL; size_t len; int i; char type; u_int16_t len16; char *username; *rbuflen = 0; if ( nologin & 1) return send_reply(obj, AFPERR_SHUTDOWN ); if (ibuflen < 5) return send_reply(obj, AFPERR_BADVERS ); ibuf++; ibuf++; /* pad */ ibuf +=2; /* flag */ len = (unsigned char) *ibuf; ibuf++; ibuflen -= 5; i = get_version(obj, ibuf, ibuflen, len); if (i) return send_reply(obj, i ); if (ibuflen <= len) return send_reply(obj, AFPERR_BADUAM); ibuf += len; ibuflen -= len; len = (unsigned char) *ibuf; ibuf++; ibuflen--; if (!len || len > ibuflen) return send_reply(obj, AFPERR_BADUAM); if ((afp_uam = auth_uamfind(UAM_SERVER_LOGIN, ibuf, len)) == NULL) return send_reply(obj, AFPERR_BADUAM); ibuf += len; ibuflen -= len; if (!afp_uam->u.uam_login.login_ext) { LOG(log_error, logtype_afpd, "login_ext: uam %s not AFP 3 ready!", afp_uam->uam_name ); return send_reply(obj, AFPERR_BADUAM); } /* user name */ if (ibuflen <= 1 +sizeof(len16)) return send_reply(obj, AFPERR_PARAM); type = *ibuf; username = ibuf; ibuf++; ibuflen--; if (type != 3) return send_reply(obj, AFPERR_PARAM); memcpy(&len16, ibuf, sizeof(len16)); ibuf += sizeof(len16); ibuflen -= sizeof(len16); len = ntohs(len16); if (len > ibuflen) return send_reply(obj, AFPERR_PARAM); ibuf += len; ibuflen -= len; /* directory service name */ if (!ibuflen) return send_reply(obj, AFPERR_PARAM); type = *ibuf; ibuf++; ibuflen--; switch(type) { case 1: case 2: if (!ibuflen) return send_reply(obj, AFPERR_PARAM); len = (unsigned char) *ibuf; ibuf++; ibuflen--; break; case 3: /* With "No User Authen" it is equal */ if (ibuflen < sizeof(len16)) return send_reply(obj, AFPERR_PARAM); memcpy(&len16, ibuf, sizeof(len16)); ibuf += sizeof(len16); ibuflen -= sizeof(len16); len = ntohs(len16); break; default: return send_reply(obj, AFPERR_PARAM); } #if 0 if (len != 0) { LOG(log_error, logtype_afpd, "login_ext: directory service path not null!" ); return send_reply(obj, AFPERR_PARAM); } #endif ibuf += len; ibuflen -= len; /* Pad */ if (ibuflen && ((unsigned long) ibuf & 1)) { /* pad character */ ibuf++; ibuflen--; } if (AFP_OK != (i = create_session_key(obj)) ) { return send_reply(obj, i); } /* FIXME user name are in UTF8 */ i = afp_uam->u.uam_login.login_ext(obj, username, &pwd, ibuf, ibuflen, rbuf, rbuflen); if (!pwd || ( i != AFP_OK && i != AFPERR_PWDEXPR)) return send_reply(obj, i); return send_reply(obj, login(obj, pwd, afp_uam->u.uam_login.logout, ((i==AFPERR_PWDEXPR)?1:0))); } /* ---------------------- */ int afp_logincont(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { struct passwd *pwd = NULL; int err; if ( afp_uam == NULL || afp_uam->u.uam_login.logincont == NULL || ibuflen < 2 ) { *rbuflen = 0; return send_reply(obj, AFPERR_NOTAUTH ); } ibuf += 2; ibuflen -= 2; err = afp_uam->u.uam_login.logincont(obj, &pwd, ibuf, ibuflen, rbuf, rbuflen); if (!pwd || ( err != AFP_OK && err != AFPERR_PWDEXPR)) return send_reply(obj, err); return send_reply(obj, login(obj, pwd, afp_uam->u.uam_login.logout, ((err==AFPERR_PWDEXPR)?1:0))); } int afp_logout(AFPObj *obj, char *ibuf _U_, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { DSI *dsi = (DSI *)(obj->handle); LOG(log_note, logtype_afpd, "AFP logout by %s", obj->username); of_close_all_forks(); close_all_vol(); dsi->flags = DSI_AFP_LOGGED_OUT; *rbuflen = 0; return AFP_OK; } /* change password -- * NOTE: an FPLogin must already have completed successfully for this * to work. this also does a little pre-processing before it hands * it off to the uam. */ int afp_changepw(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { char username[MACFILELEN + 1], *start = ibuf; struct uam_obj *uam; struct passwd *pwd; size_t len; int ret; *rbuflen = 0; ibuf += 2; /* check if password change is allowed, OS-X ignores the flag. * we shouldn't trust the client on this anyway. * not sure about the "right" error code, NOOP for now */ if (!(obj->options.passwdbits & PASSWD_SET)) return AFPERR_NOOP; /* make sure we can deal w/ this uam */ len = (unsigned char) *ibuf++; if ((uam = auth_uamfind(UAM_SERVER_CHANGEPW, ibuf, len)) == NULL) return AFPERR_BADUAM; ibuf += len; if ((len + 1) & 1) /* pad byte */ ibuf++; if ( afp_version < 30) { len = (unsigned char) *ibuf++; if ( len > sizeof(username) - 1) { return AFPERR_PARAM; } memcpy(username, ibuf, len); username[ len ] = '\0'; ibuf += len; if ((len + 1) & 1) /* pad byte */ ibuf++; } else { /* AFP > 3.0 doesn't pass the username, APF 3.1 specs page 124 */ if ( ibuf[0] != '\0' || ibuf[1] != '\0') return AFPERR_PARAM; ibuf += 2; len = MIN(sizeof(username), strlen(obj->username)); memcpy(username, obj->username, len); username[ len ] = '\0'; } LOG(log_info, logtype_afpd, "changing password for <%s>", username); if (( pwd = uam_getname( obj, username, sizeof(username))) == NULL ) return AFPERR_PARAM; /* send it off to the uam. we really don't use ibuflen right now. */ if (ibuflen < (size_t)(ibuf - start)) return AFPERR_PARAM; ibuflen -= (ibuf - start); ret = uam->u.uam_changepw(obj, username, pwd, ibuf, ibuflen, rbuf, rbuflen); LOG(log_info, logtype_afpd, "password change %s.", (ret == AFPERR_AUTHCONT) ? "continued" : (ret ? "failed" : "succeeded")); if ( ret == AFP_OK ) set_auth_switch(0); return ret; } /* FPGetUserInfo */ int afp_getuserinfo(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { u_int8_t thisuser; u_int32_t id; u_int16_t bitmap; char *bitmapp; LOG(log_debug, logtype_afpd, "begin afp_getuserinfo:"); *rbuflen = 0; ibuf++; thisuser = *ibuf++; ibuf += sizeof(id); /* userid is not used in AFP 2.0 */ memcpy(&bitmap, ibuf, sizeof(bitmap)); bitmap = ntohs(bitmap); /* deal with error cases. we don't have to worry about * AFPERR_ACCESS or AFPERR_NOITEM as geteuid and getegid always * succeed. */ if (!thisuser) return AFPERR_PARAM; if ((bitmap & USERIBIT_ALL) != bitmap) return AFPERR_BITMAP; /* remember place where we store the possibly modified bitmap later */ memcpy(rbuf, ibuf, sizeof(bitmap)); bitmapp = rbuf; rbuf += sizeof(bitmap); *rbuflen = sizeof(bitmap); /* copy the user/group info */ if (bitmap & USERIBIT_USER) { id = htonl(geteuid()); memcpy(rbuf, &id, sizeof(id)); rbuf += sizeof(id); *rbuflen += sizeof(id); } if (bitmap & USERIBIT_GROUP) { id = htonl(getegid()); memcpy(rbuf, &id, sizeof(id)); rbuf += sizeof(id); *rbuflen += sizeof(id); } if (bitmap & USERIBIT_UUID) { if ( ! (obj->options.flags & OPTION_UUID)) { bitmap &= ~USERIBIT_UUID; bitmap = htons(bitmap); memcpy(bitmapp, &bitmap, sizeof(bitmap)); } else { LOG(log_debug, logtype_afpd, "afp_getuserinfo: get UUID for \'%s\'", obj->username); int ret; atalk_uuid_t uuid; ret = getuuidfromname( obj->username, UUID_USER, uuid); if (ret != 0) { LOG(log_info, logtype_afpd, "afp_getuserinfo: error getting UUID !"); return AFPERR_NOITEM; } LOG(log_debug, logtype_afpd, "afp_getuserinfo: got UUID: %s", uuid_bin2string(uuid)); memcpy(rbuf, uuid, UUID_BINSIZE); rbuf += UUID_BINSIZE; *rbuflen += UUID_BINSIZE; } } LOG(log_debug, logtype_afpd, "END afp_getuserinfo:"); return AFP_OK; } #define UAM_LIST(type) (((type) == UAM_SERVER_LOGIN || (type) == UAM_SERVER_LOGIN_EXT) ? &uam_login : \ (((type) == UAM_SERVER_CHANGEPW) ? \ &uam_changepw : NULL)) /* just do a linked list search. this could be sped up with a hashed * list, but i doubt anyone's going to have enough uams to matter. */ struct uam_obj *auth_uamfind(const int type, const char *name, const int len) { struct uam_obj *prev, *start; if (!name || !(start = UAM_LIST(type))) return NULL; prev = start; while ((prev = prev->uam_prev) != start) if (strndiacasecmp(prev->uam_name, name, len) == 0) return prev; return NULL; } int auth_register(const int type, struct uam_obj *uam) { struct uam_obj *start; if (!uam || !uam->uam_name || (*uam->uam_name == '\0')) return -1; if (!(start = UAM_LIST(type))) return 1; /* we don't know what to do with it, caller must free it */ uam_attach(start, uam); return 0; } /* load all of the modules */ int auth_load(const char *path, const char *list) { char name[MAXPATHLEN + 1], buf[MAXPATHLEN + 1], *p; struct uam_mod *mod; struct stat st; size_t len; if (!path || !*path || !list || (len = strlen(path)) > sizeof(name) - 2) return -1; strlcpy(buf, list, sizeof(buf)); if ((p = strtok(buf, ",")) == NULL) return -1; strcpy(name, path); if (name[len - 1] != '/') { strcat(name, "/"); len++; } while (p) { strlcpy(name + len, p, sizeof(name) - len); LOG(log_debug, logtype_afpd, "uam: loading (%s)", name); /* if ((stat(name, &st) == 0) && (mod = uam_load(name, p))) { */ if (stat(name, &st) == 0) { if ((mod = uam_load(name, p))) { uam_attach(&uam_modules, mod); LOG(log_debug, logtype_afpd, "uam: %s loaded", p); } else { LOG(log_error, logtype_afpd, "uam: %s load failure",p); } } else { LOG(log_info, logtype_afpd, "uam: uam not found (status=%d)", stat(name, &st)); } p = strtok(NULL, ","); } return 0; } /* get rid of all of the uams */ void auth_unload(void) { struct uam_mod *mod, *prev, *start = &uam_modules; prev = start->uam_prev; while ((mod = prev) != start) { prev = prev->uam_prev; uam_detach(mod); uam_unload(mod); } } netatalk-2.2.2/etc/afpd/Makefile.am0000644000175200017500000000360711655731244014002 00000000000000# Makefile.am for etc/afpd/ pkgconfdir = @PKGCONFDIR@ sbin_PROGRAMS = afpd noinst_PROGRAMS = hash fce afpd_SOURCES = \ afp_asp.c \ afp_avahi.c \ afp_config.c \ afp_dsi.c \ afp_options.c \ afp_util.c \ afp_zeroconf.c \ afprun.c \ afs.c \ appl.c \ auth.c \ catsearch.c \ desktop.c \ dircache.c \ directory.c \ enumerate.c \ extattrs.c \ fce_api.c \ fce_util.c \ file.c \ filedir.c \ fork.c \ gettok.c \ hash.c \ main.c \ mangle.c \ messages.c \ nfsquota.c \ ofork.c \ quota.c \ status.c \ switch.c \ uam.c \ uid.c \ unix.c \ volume.c afpd_LDADD = \ $(top_builddir)/libatalk/cnid/libcnid.la \ $(top_builddir)/libatalk/libatalk.la \ @LIBGCRYPT_LIBS@ @ZEROCONF_LIBS@ @QUOTA_LIBS@ @SLP_LIBS@ @WRAP_LIBS@ @LIBADD_DL@ @ACL_LIBS@ @PTHREAD_LIBS@ afpd_LDFLAGS = -export-dynamic afpd_CFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/sys \ @SLP_CFLAGS@ @ZEROCONF_CFLAGS@ \ -DAPPLCNAME \ -DSERVERTEXT=\"$(SERVERTEXT)/\" \ -D_PATH_AFPDDEFVOL=\"$(pkgconfdir)/AppleVolumes.default\" \ -D_PATH_AFPDSYSVOL=\"$(pkgconfdir)/AppleVolumes.system\" \ -D_PATH_AFPDPWFILE=\"$(pkgconfdir)/afppasswd\" \ -D_PATH_AFPDCONF=\"$(pkgconfdir)/afpd.conf\" \ -D_PATH_AFPDSIGCONF=\"$(pkgconfdir)/afp_signature.conf\" \ -D_PATH_AFPDUAMPATH=\"$(UAMS_PATH)/\" \ -D_PATH_ACL_LDAPCONF=\"$(pkgconfdir)/afp_ldap.conf\" \ -D_PATH_AFPDUUIDCONF=\"$(pkgconfdir)/afp_voluuid.conf\" if HAVE_ACLS afpd_SOURCES += acls.c endif noinst_HEADERS = auth.h afp_config.h desktop.h directory.h fce_api_internal.h file.h \ filedir.h fork.h icon.h mangle.h misc.h status.h switch.h \ uam_auth.h uid.h unix.h volume.h hash.h acls.h acl_mappings.h extattrs.h \ dircache.h afp_zeroconf.h afp_avahi.h hash_SOURCES = hash.c hash_CFLAGS = -DKAZLIB_TEST_MAIN -I$(top_srcdir)/include fce_SOURCES = fce_api.c fce_util.c fce_CFLAGS = -DFCE_TEST_MAIN -I$(top_srcdir)/include fce_LDADD = $(top_builddir)/libatalk/libatalk.la netatalk-2.2.2/etc/afpd/nfsquota.c0000644000175200017500000001265111655731244013751 00000000000000/* * $Id: nfsquota.c,v 1.13 2009-10-13 22:55:37 didg Exp $ * * parts of this are lifted from the bsd quota program and are * therefore under the following copyright: * * Copyright (c) 1980, 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Robert Elz at The University of Melbourne. * * Ported for AIX (jfs) by Joerg Schumacher (J.Schumacher@tu-bs.de) at the * Technische Universitaet Braunschweig, FRG */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #if !defined(NO_QUOTA_SUPPORT) && !defined(HAVE_LIBQUOTA) #include /* STDC check */ #if STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #include #include #include /* for DEV_BSIZE */ #include /* on ultrix doesn't include this */ #ifdef HAVE_NETDB_H #include #endif /* HAVE_NETDB_H */ #include #ifndef PORTMAP #define PORTMAP 1 #endif #include #include #include #include #include #include "unix.h" /* lifted (with modifications) from the bsd quota program */ static int callaurpc(struct vol *vol, u_long prognum, u_long versnum, u_long procnum, xdrproc_t inproc, char *in, xdrproc_t outproc, char *out) { enum clnt_stat clnt_stat; struct timeval tottimeout; if (!vol->v_nfsclient) { struct hostent *hp; struct sockaddr_in server_addr; struct timeval timeout; int socket = RPC_ANYSOCK; if ((hp = gethostbyname(vol->v_gvs)) == NULL) return ((int) RPC_UNKNOWNHOST); timeout.tv_usec = 0; timeout.tv_sec = 6; memcpy(&server_addr.sin_addr, hp->h_addr, hp->h_length); server_addr.sin_family = AF_INET; server_addr.sin_port = 0; if ((vol->v_nfsclient = (void *) clntudp_create(&server_addr, prognum, versnum, timeout, &socket)) == NULL) return ((int) rpc_createerr.cf_stat); ((CLIENT *) vol->v_nfsclient)->cl_auth = authunix_create_default(); } tottimeout.tv_sec = 10; tottimeout.tv_usec = 0; clnt_stat = clnt_call((CLIENT *) vol->v_nfsclient, procnum, inproc, in, outproc, out, tottimeout); return ((int) clnt_stat); } /* sunos 4 machines structure things a little differently. */ #ifdef USE_OLD_RQUOTA #define GQR_STATUS gqr_status #define GQR_RQUOTA gqr_rquota #else /* USE_OLD_RQUOTA */ #define GQR_STATUS status #define GQR_RQUOTA getquota_rslt_u.gqr_rquota #endif /* USE_OLD_RQUOTA */ int getnfsquota(struct vol *vol, const int uid, const u_int32_t bsize, struct dqblk *dqp) { struct getquota_args gq_args; struct getquota_rslt gq_rslt; struct timeval tv; char *hostpath; /* figure out the host and path */ if ((hostpath = strchr(vol->v_gvs, ':')) == NULL) { LOG(log_error, logtype_afpd, "can't find hostname for %s", vol->v_gvs); return AFPERR_PARAM; } if (*(hostpath + 1) != '/') return AFPERR_PARAM; /* separate host from hostpath */ *hostpath = '\0'; gq_args.gqa_pathp = hostpath + 1; gq_args.gqa_uid = uid; if(callaurpc(vol, RQUOTAPROG, RQUOTAVERS, RQUOTAPROC_GETQUOTA, (xdrproc_t) xdr_getquota_args, (char *) &gq_args, (xdrproc_t) xdr_getquota_rslt, (char *) &gq_rslt) != 0) { LOG(log_info, logtype_afpd, "nfsquota: can't retrieve nfs quota information. \ make sure that rpc.rquotad is running on %s.", vol->v_gvs); *hostpath = ':'; return AFPERR_PARAM; } switch (gq_rslt.GQR_STATUS) { case Q_NOQUOTA: break; case Q_EPERM: LOG(log_error, logtype_afpd, "nfsquota: quota permission error, host: %s", vol->v_gvs); break; case Q_OK: /* we only copy the bits that we need. */ gettimeofday(&tv, NULL); #if defined(__svr4__) || defined(TRU64) /* why doesn't using bsize work? */ #define NFS_BSIZE gq_rslt.GQR_RQUOTA.rq_bsize / DEV_BSIZE #else /* __svr4__ || TRU64 */ /* NOTE: linux' rquotad program doesn't currently report the * correct rq_bsize. */ /* NOTE: This is integer division and can introduce rounding errors */ #define NFS_BSIZE gq_rslt.GQR_RQUOTA.rq_bsize / bsize #endif /* __svr4__ || TRU64 */ dqp->dqb_bhardlimit = gq_rslt.GQR_RQUOTA.rq_bhardlimit*NFS_BSIZE; dqp->dqb_bsoftlimit = gq_rslt.GQR_RQUOTA.rq_bsoftlimit*NFS_BSIZE; dqp->dqb_curblocks = gq_rslt.GQR_RQUOTA.rq_curblocks*NFS_BSIZE; #ifdef ultrix dqp->dqb_bwarn = gq_rslt.GQR_RQUOTA.rq_btimeleft; #else /* ultrix */ dqp->dqb_btimelimit = tv.tv_sec + gq_rslt.GQR_RQUOTA.rq_btimeleft; #endif /* ultrix */ *hostpath = ':'; return AFP_OK; break; default: LOG(log_info, logtype_afpd, "bad rpc result, host: %s", vol->v_gvs); break; } *hostpath = ':'; return AFPERR_PARAM; } #endif /* ! NO_QUOTA_SUPPORT && !HAVE_LIBQUOTA */ netatalk-2.2.2/etc/afpd/Makefile.in0000644000175200017500000025312611703521725014011 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for etc/afpd/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ sbin_PROGRAMS = afpd$(EXEEXT) noinst_PROGRAMS = hash$(EXEEXT) fce$(EXEEXT) @HAVE_ACLS_TRUE@am__append_1 = acls.c subdir = etc/afpd DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS) am__afpd_SOURCES_DIST = afp_asp.c afp_avahi.c afp_config.c afp_dsi.c \ afp_options.c afp_util.c afp_zeroconf.c afprun.c afs.c appl.c \ auth.c catsearch.c desktop.c dircache.c directory.c \ enumerate.c extattrs.c fce_api.c fce_util.c file.c filedir.c \ fork.c gettok.c hash.c main.c mangle.c messages.c nfsquota.c \ ofork.c quota.c status.c switch.c uam.c uid.c unix.c volume.c \ acls.c @HAVE_ACLS_TRUE@am__objects_1 = afpd-acls.$(OBJEXT) am_afpd_OBJECTS = afpd-afp_asp.$(OBJEXT) afpd-afp_avahi.$(OBJEXT) \ afpd-afp_config.$(OBJEXT) afpd-afp_dsi.$(OBJEXT) \ afpd-afp_options.$(OBJEXT) afpd-afp_util.$(OBJEXT) \ afpd-afp_zeroconf.$(OBJEXT) afpd-afprun.$(OBJEXT) \ afpd-afs.$(OBJEXT) afpd-appl.$(OBJEXT) afpd-auth.$(OBJEXT) \ afpd-catsearch.$(OBJEXT) afpd-desktop.$(OBJEXT) \ afpd-dircache.$(OBJEXT) afpd-directory.$(OBJEXT) \ afpd-enumerate.$(OBJEXT) afpd-extattrs.$(OBJEXT) \ afpd-fce_api.$(OBJEXT) afpd-fce_util.$(OBJEXT) \ afpd-file.$(OBJEXT) afpd-filedir.$(OBJEXT) afpd-fork.$(OBJEXT) \ afpd-gettok.$(OBJEXT) afpd-hash.$(OBJEXT) afpd-main.$(OBJEXT) \ afpd-mangle.$(OBJEXT) afpd-messages.$(OBJEXT) \ afpd-nfsquota.$(OBJEXT) afpd-ofork.$(OBJEXT) \ afpd-quota.$(OBJEXT) afpd-status.$(OBJEXT) \ afpd-switch.$(OBJEXT) afpd-uam.$(OBJEXT) afpd-uid.$(OBJEXT) \ afpd-unix.$(OBJEXT) afpd-volume.$(OBJEXT) $(am__objects_1) afpd_OBJECTS = $(am_afpd_OBJECTS) afpd_DEPENDENCIES = $(top_builddir)/libatalk/cnid/libcnid.la \ $(top_builddir)/libatalk/libatalk.la afpd_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(afpd_CFLAGS) $(CFLAGS) $(afpd_LDFLAGS) \ $(LDFLAGS) -o $@ am_fce_OBJECTS = fce-fce_api.$(OBJEXT) fce-fce_util.$(OBJEXT) fce_OBJECTS = $(am_fce_OBJECTS) fce_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la fce_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(fce_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_hash_OBJECTS = hash-hash.$(OBJEXT) hash_OBJECTS = $(am_hash_OBJECTS) hash_LDADD = $(LDADD) hash_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(hash_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(afpd_SOURCES) $(fce_SOURCES) $(hash_SOURCES) DIST_SOURCES = $(am__afpd_SOURCES_DIST) $(fce_SOURCES) $(hash_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgconfdir = @PKGCONFDIR@ afpd_SOURCES = afp_asp.c afp_avahi.c afp_config.c afp_dsi.c \ afp_options.c afp_util.c afp_zeroconf.c afprun.c afs.c appl.c \ auth.c catsearch.c desktop.c dircache.c directory.c \ enumerate.c extattrs.c fce_api.c fce_util.c file.c filedir.c \ fork.c gettok.c hash.c main.c mangle.c messages.c nfsquota.c \ ofork.c quota.c status.c switch.c uam.c uid.c unix.c volume.c \ $(am__append_1) afpd_LDADD = \ $(top_builddir)/libatalk/cnid/libcnid.la \ $(top_builddir)/libatalk/libatalk.la \ @LIBGCRYPT_LIBS@ @ZEROCONF_LIBS@ @QUOTA_LIBS@ @SLP_LIBS@ @WRAP_LIBS@ @LIBADD_DL@ @ACL_LIBS@ @PTHREAD_LIBS@ afpd_LDFLAGS = -export-dynamic afpd_CFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/sys \ @SLP_CFLAGS@ @ZEROCONF_CFLAGS@ \ -DAPPLCNAME \ -DSERVERTEXT=\"$(SERVERTEXT)/\" \ -D_PATH_AFPDDEFVOL=\"$(pkgconfdir)/AppleVolumes.default\" \ -D_PATH_AFPDSYSVOL=\"$(pkgconfdir)/AppleVolumes.system\" \ -D_PATH_AFPDPWFILE=\"$(pkgconfdir)/afppasswd\" \ -D_PATH_AFPDCONF=\"$(pkgconfdir)/afpd.conf\" \ -D_PATH_AFPDSIGCONF=\"$(pkgconfdir)/afp_signature.conf\" \ -D_PATH_AFPDUAMPATH=\"$(UAMS_PATH)/\" \ -D_PATH_ACL_LDAPCONF=\"$(pkgconfdir)/afp_ldap.conf\" \ -D_PATH_AFPDUUIDCONF=\"$(pkgconfdir)/afp_voluuid.conf\" noinst_HEADERS = auth.h afp_config.h desktop.h directory.h fce_api_internal.h file.h \ filedir.h fork.h icon.h mangle.h misc.h status.h switch.h \ uam_auth.h uid.h unix.h volume.h hash.h acls.h acl_mappings.h extattrs.h \ dircache.h afp_zeroconf.h afp_avahi.h hash_SOURCES = hash.c hash_CFLAGS = -DKAZLIB_TEST_MAIN -I$(top_srcdir)/include fce_SOURCES = fce_api.c fce_util.c fce_CFLAGS = -DFCE_TEST_MAIN -I$(top_srcdir)/include fce_LDADD = $(top_builddir)/libatalk/libatalk.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign etc/afpd/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign etc/afpd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done afpd$(EXEEXT): $(afpd_OBJECTS) $(afpd_DEPENDENCIES) @rm -f afpd$(EXEEXT) $(afpd_LINK) $(afpd_OBJECTS) $(afpd_LDADD) $(LIBS) fce$(EXEEXT): $(fce_OBJECTS) $(fce_DEPENDENCIES) @rm -f fce$(EXEEXT) $(fce_LINK) $(fce_OBJECTS) $(fce_LDADD) $(LIBS) hash$(EXEEXT): $(hash_OBJECTS) $(hash_DEPENDENCIES) @rm -f hash$(EXEEXT) $(hash_LINK) $(hash_OBJECTS) $(hash_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-acls.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-afp_asp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-afp_avahi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-afp_config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-afp_dsi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-afp_options.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-afp_util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-afp_zeroconf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-afprun.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-afs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-appl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-auth.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-catsearch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-desktop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-dircache.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-directory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-enumerate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-extattrs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-fce_api.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-fce_util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-filedir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-fork.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-gettok.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-mangle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-messages.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-nfsquota.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-ofork.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-quota.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-status.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-switch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-uam.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-uid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-unix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpd-volume.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fce-fce_api.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fce-fce_util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash-hash.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< afpd-afp_asp.o: afp_asp.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afp_asp.o -MD -MP -MF $(DEPDIR)/afpd-afp_asp.Tpo -c -o afpd-afp_asp.o `test -f 'afp_asp.c' || echo '$(srcdir)/'`afp_asp.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afp_asp.Tpo $(DEPDIR)/afpd-afp_asp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afp_asp.c' object='afpd-afp_asp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afp_asp.o `test -f 'afp_asp.c' || echo '$(srcdir)/'`afp_asp.c afpd-afp_asp.obj: afp_asp.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afp_asp.obj -MD -MP -MF $(DEPDIR)/afpd-afp_asp.Tpo -c -o afpd-afp_asp.obj `if test -f 'afp_asp.c'; then $(CYGPATH_W) 'afp_asp.c'; else $(CYGPATH_W) '$(srcdir)/afp_asp.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afp_asp.Tpo $(DEPDIR)/afpd-afp_asp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afp_asp.c' object='afpd-afp_asp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afp_asp.obj `if test -f 'afp_asp.c'; then $(CYGPATH_W) 'afp_asp.c'; else $(CYGPATH_W) '$(srcdir)/afp_asp.c'; fi` afpd-afp_avahi.o: afp_avahi.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afp_avahi.o -MD -MP -MF $(DEPDIR)/afpd-afp_avahi.Tpo -c -o afpd-afp_avahi.o `test -f 'afp_avahi.c' || echo '$(srcdir)/'`afp_avahi.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afp_avahi.Tpo $(DEPDIR)/afpd-afp_avahi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afp_avahi.c' object='afpd-afp_avahi.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afp_avahi.o `test -f 'afp_avahi.c' || echo '$(srcdir)/'`afp_avahi.c afpd-afp_avahi.obj: afp_avahi.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afp_avahi.obj -MD -MP -MF $(DEPDIR)/afpd-afp_avahi.Tpo -c -o afpd-afp_avahi.obj `if test -f 'afp_avahi.c'; then $(CYGPATH_W) 'afp_avahi.c'; else $(CYGPATH_W) '$(srcdir)/afp_avahi.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afp_avahi.Tpo $(DEPDIR)/afpd-afp_avahi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afp_avahi.c' object='afpd-afp_avahi.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afp_avahi.obj `if test -f 'afp_avahi.c'; then $(CYGPATH_W) 'afp_avahi.c'; else $(CYGPATH_W) '$(srcdir)/afp_avahi.c'; fi` afpd-afp_config.o: afp_config.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afp_config.o -MD -MP -MF $(DEPDIR)/afpd-afp_config.Tpo -c -o afpd-afp_config.o `test -f 'afp_config.c' || echo '$(srcdir)/'`afp_config.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afp_config.Tpo $(DEPDIR)/afpd-afp_config.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afp_config.c' object='afpd-afp_config.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afp_config.o `test -f 'afp_config.c' || echo '$(srcdir)/'`afp_config.c afpd-afp_config.obj: afp_config.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afp_config.obj -MD -MP -MF $(DEPDIR)/afpd-afp_config.Tpo -c -o afpd-afp_config.obj `if test -f 'afp_config.c'; then $(CYGPATH_W) 'afp_config.c'; else $(CYGPATH_W) '$(srcdir)/afp_config.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afp_config.Tpo $(DEPDIR)/afpd-afp_config.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afp_config.c' object='afpd-afp_config.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afp_config.obj `if test -f 'afp_config.c'; then $(CYGPATH_W) 'afp_config.c'; else $(CYGPATH_W) '$(srcdir)/afp_config.c'; fi` afpd-afp_dsi.o: afp_dsi.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afp_dsi.o -MD -MP -MF $(DEPDIR)/afpd-afp_dsi.Tpo -c -o afpd-afp_dsi.o `test -f 'afp_dsi.c' || echo '$(srcdir)/'`afp_dsi.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afp_dsi.Tpo $(DEPDIR)/afpd-afp_dsi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afp_dsi.c' object='afpd-afp_dsi.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afp_dsi.o `test -f 'afp_dsi.c' || echo '$(srcdir)/'`afp_dsi.c afpd-afp_dsi.obj: afp_dsi.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afp_dsi.obj -MD -MP -MF $(DEPDIR)/afpd-afp_dsi.Tpo -c -o afpd-afp_dsi.obj `if test -f 'afp_dsi.c'; then $(CYGPATH_W) 'afp_dsi.c'; else $(CYGPATH_W) '$(srcdir)/afp_dsi.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afp_dsi.Tpo $(DEPDIR)/afpd-afp_dsi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afp_dsi.c' object='afpd-afp_dsi.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afp_dsi.obj `if test -f 'afp_dsi.c'; then $(CYGPATH_W) 'afp_dsi.c'; else $(CYGPATH_W) '$(srcdir)/afp_dsi.c'; fi` afpd-afp_options.o: afp_options.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afp_options.o -MD -MP -MF $(DEPDIR)/afpd-afp_options.Tpo -c -o afpd-afp_options.o `test -f 'afp_options.c' || echo '$(srcdir)/'`afp_options.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afp_options.Tpo $(DEPDIR)/afpd-afp_options.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afp_options.c' object='afpd-afp_options.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afp_options.o `test -f 'afp_options.c' || echo '$(srcdir)/'`afp_options.c afpd-afp_options.obj: afp_options.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afp_options.obj -MD -MP -MF $(DEPDIR)/afpd-afp_options.Tpo -c -o afpd-afp_options.obj `if test -f 'afp_options.c'; then $(CYGPATH_W) 'afp_options.c'; else $(CYGPATH_W) '$(srcdir)/afp_options.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afp_options.Tpo $(DEPDIR)/afpd-afp_options.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afp_options.c' object='afpd-afp_options.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afp_options.obj `if test -f 'afp_options.c'; then $(CYGPATH_W) 'afp_options.c'; else $(CYGPATH_W) '$(srcdir)/afp_options.c'; fi` afpd-afp_util.o: afp_util.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afp_util.o -MD -MP -MF $(DEPDIR)/afpd-afp_util.Tpo -c -o afpd-afp_util.o `test -f 'afp_util.c' || echo '$(srcdir)/'`afp_util.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afp_util.Tpo $(DEPDIR)/afpd-afp_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afp_util.c' object='afpd-afp_util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afp_util.o `test -f 'afp_util.c' || echo '$(srcdir)/'`afp_util.c afpd-afp_util.obj: afp_util.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afp_util.obj -MD -MP -MF $(DEPDIR)/afpd-afp_util.Tpo -c -o afpd-afp_util.obj `if test -f 'afp_util.c'; then $(CYGPATH_W) 'afp_util.c'; else $(CYGPATH_W) '$(srcdir)/afp_util.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afp_util.Tpo $(DEPDIR)/afpd-afp_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afp_util.c' object='afpd-afp_util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afp_util.obj `if test -f 'afp_util.c'; then $(CYGPATH_W) 'afp_util.c'; else $(CYGPATH_W) '$(srcdir)/afp_util.c'; fi` afpd-afp_zeroconf.o: afp_zeroconf.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afp_zeroconf.o -MD -MP -MF $(DEPDIR)/afpd-afp_zeroconf.Tpo -c -o afpd-afp_zeroconf.o `test -f 'afp_zeroconf.c' || echo '$(srcdir)/'`afp_zeroconf.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afp_zeroconf.Tpo $(DEPDIR)/afpd-afp_zeroconf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afp_zeroconf.c' object='afpd-afp_zeroconf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afp_zeroconf.o `test -f 'afp_zeroconf.c' || echo '$(srcdir)/'`afp_zeroconf.c afpd-afp_zeroconf.obj: afp_zeroconf.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afp_zeroconf.obj -MD -MP -MF $(DEPDIR)/afpd-afp_zeroconf.Tpo -c -o afpd-afp_zeroconf.obj `if test -f 'afp_zeroconf.c'; then $(CYGPATH_W) 'afp_zeroconf.c'; else $(CYGPATH_W) '$(srcdir)/afp_zeroconf.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afp_zeroconf.Tpo $(DEPDIR)/afpd-afp_zeroconf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afp_zeroconf.c' object='afpd-afp_zeroconf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afp_zeroconf.obj `if test -f 'afp_zeroconf.c'; then $(CYGPATH_W) 'afp_zeroconf.c'; else $(CYGPATH_W) '$(srcdir)/afp_zeroconf.c'; fi` afpd-afprun.o: afprun.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afprun.o -MD -MP -MF $(DEPDIR)/afpd-afprun.Tpo -c -o afpd-afprun.o `test -f 'afprun.c' || echo '$(srcdir)/'`afprun.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afprun.Tpo $(DEPDIR)/afpd-afprun.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afprun.c' object='afpd-afprun.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afprun.o `test -f 'afprun.c' || echo '$(srcdir)/'`afprun.c afpd-afprun.obj: afprun.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afprun.obj -MD -MP -MF $(DEPDIR)/afpd-afprun.Tpo -c -o afpd-afprun.obj `if test -f 'afprun.c'; then $(CYGPATH_W) 'afprun.c'; else $(CYGPATH_W) '$(srcdir)/afprun.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afprun.Tpo $(DEPDIR)/afpd-afprun.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afprun.c' object='afpd-afprun.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afprun.obj `if test -f 'afprun.c'; then $(CYGPATH_W) 'afprun.c'; else $(CYGPATH_W) '$(srcdir)/afprun.c'; fi` afpd-afs.o: afs.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afs.o -MD -MP -MF $(DEPDIR)/afpd-afs.Tpo -c -o afpd-afs.o `test -f 'afs.c' || echo '$(srcdir)/'`afs.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afs.Tpo $(DEPDIR)/afpd-afs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afs.c' object='afpd-afs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afs.o `test -f 'afs.c' || echo '$(srcdir)/'`afs.c afpd-afs.obj: afs.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-afs.obj -MD -MP -MF $(DEPDIR)/afpd-afs.Tpo -c -o afpd-afs.obj `if test -f 'afs.c'; then $(CYGPATH_W) 'afs.c'; else $(CYGPATH_W) '$(srcdir)/afs.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-afs.Tpo $(DEPDIR)/afpd-afs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afs.c' object='afpd-afs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-afs.obj `if test -f 'afs.c'; then $(CYGPATH_W) 'afs.c'; else $(CYGPATH_W) '$(srcdir)/afs.c'; fi` afpd-appl.o: appl.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-appl.o -MD -MP -MF $(DEPDIR)/afpd-appl.Tpo -c -o afpd-appl.o `test -f 'appl.c' || echo '$(srcdir)/'`appl.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-appl.Tpo $(DEPDIR)/afpd-appl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='appl.c' object='afpd-appl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-appl.o `test -f 'appl.c' || echo '$(srcdir)/'`appl.c afpd-appl.obj: appl.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-appl.obj -MD -MP -MF $(DEPDIR)/afpd-appl.Tpo -c -o afpd-appl.obj `if test -f 'appl.c'; then $(CYGPATH_W) 'appl.c'; else $(CYGPATH_W) '$(srcdir)/appl.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-appl.Tpo $(DEPDIR)/afpd-appl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='appl.c' object='afpd-appl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-appl.obj `if test -f 'appl.c'; then $(CYGPATH_W) 'appl.c'; else $(CYGPATH_W) '$(srcdir)/appl.c'; fi` afpd-auth.o: auth.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-auth.o -MD -MP -MF $(DEPDIR)/afpd-auth.Tpo -c -o afpd-auth.o `test -f 'auth.c' || echo '$(srcdir)/'`auth.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-auth.Tpo $(DEPDIR)/afpd-auth.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='auth.c' object='afpd-auth.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-auth.o `test -f 'auth.c' || echo '$(srcdir)/'`auth.c afpd-auth.obj: auth.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-auth.obj -MD -MP -MF $(DEPDIR)/afpd-auth.Tpo -c -o afpd-auth.obj `if test -f 'auth.c'; then $(CYGPATH_W) 'auth.c'; else $(CYGPATH_W) '$(srcdir)/auth.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-auth.Tpo $(DEPDIR)/afpd-auth.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='auth.c' object='afpd-auth.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-auth.obj `if test -f 'auth.c'; then $(CYGPATH_W) 'auth.c'; else $(CYGPATH_W) '$(srcdir)/auth.c'; fi` afpd-catsearch.o: catsearch.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-catsearch.o -MD -MP -MF $(DEPDIR)/afpd-catsearch.Tpo -c -o afpd-catsearch.o `test -f 'catsearch.c' || echo '$(srcdir)/'`catsearch.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-catsearch.Tpo $(DEPDIR)/afpd-catsearch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='catsearch.c' object='afpd-catsearch.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-catsearch.o `test -f 'catsearch.c' || echo '$(srcdir)/'`catsearch.c afpd-catsearch.obj: catsearch.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-catsearch.obj -MD -MP -MF $(DEPDIR)/afpd-catsearch.Tpo -c -o afpd-catsearch.obj `if test -f 'catsearch.c'; then $(CYGPATH_W) 'catsearch.c'; else $(CYGPATH_W) '$(srcdir)/catsearch.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-catsearch.Tpo $(DEPDIR)/afpd-catsearch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='catsearch.c' object='afpd-catsearch.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-catsearch.obj `if test -f 'catsearch.c'; then $(CYGPATH_W) 'catsearch.c'; else $(CYGPATH_W) '$(srcdir)/catsearch.c'; fi` afpd-desktop.o: desktop.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-desktop.o -MD -MP -MF $(DEPDIR)/afpd-desktop.Tpo -c -o afpd-desktop.o `test -f 'desktop.c' || echo '$(srcdir)/'`desktop.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-desktop.Tpo $(DEPDIR)/afpd-desktop.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='desktop.c' object='afpd-desktop.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-desktop.o `test -f 'desktop.c' || echo '$(srcdir)/'`desktop.c afpd-desktop.obj: desktop.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-desktop.obj -MD -MP -MF $(DEPDIR)/afpd-desktop.Tpo -c -o afpd-desktop.obj `if test -f 'desktop.c'; then $(CYGPATH_W) 'desktop.c'; else $(CYGPATH_W) '$(srcdir)/desktop.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-desktop.Tpo $(DEPDIR)/afpd-desktop.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='desktop.c' object='afpd-desktop.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-desktop.obj `if test -f 'desktop.c'; then $(CYGPATH_W) 'desktop.c'; else $(CYGPATH_W) '$(srcdir)/desktop.c'; fi` afpd-dircache.o: dircache.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-dircache.o -MD -MP -MF $(DEPDIR)/afpd-dircache.Tpo -c -o afpd-dircache.o `test -f 'dircache.c' || echo '$(srcdir)/'`dircache.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-dircache.Tpo $(DEPDIR)/afpd-dircache.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dircache.c' object='afpd-dircache.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-dircache.o `test -f 'dircache.c' || echo '$(srcdir)/'`dircache.c afpd-dircache.obj: dircache.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-dircache.obj -MD -MP -MF $(DEPDIR)/afpd-dircache.Tpo -c -o afpd-dircache.obj `if test -f 'dircache.c'; then $(CYGPATH_W) 'dircache.c'; else $(CYGPATH_W) '$(srcdir)/dircache.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-dircache.Tpo $(DEPDIR)/afpd-dircache.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dircache.c' object='afpd-dircache.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-dircache.obj `if test -f 'dircache.c'; then $(CYGPATH_W) 'dircache.c'; else $(CYGPATH_W) '$(srcdir)/dircache.c'; fi` afpd-directory.o: directory.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-directory.o -MD -MP -MF $(DEPDIR)/afpd-directory.Tpo -c -o afpd-directory.o `test -f 'directory.c' || echo '$(srcdir)/'`directory.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-directory.Tpo $(DEPDIR)/afpd-directory.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='directory.c' object='afpd-directory.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-directory.o `test -f 'directory.c' || echo '$(srcdir)/'`directory.c afpd-directory.obj: directory.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-directory.obj -MD -MP -MF $(DEPDIR)/afpd-directory.Tpo -c -o afpd-directory.obj `if test -f 'directory.c'; then $(CYGPATH_W) 'directory.c'; else $(CYGPATH_W) '$(srcdir)/directory.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-directory.Tpo $(DEPDIR)/afpd-directory.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='directory.c' object='afpd-directory.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-directory.obj `if test -f 'directory.c'; then $(CYGPATH_W) 'directory.c'; else $(CYGPATH_W) '$(srcdir)/directory.c'; fi` afpd-enumerate.o: enumerate.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-enumerate.o -MD -MP -MF $(DEPDIR)/afpd-enumerate.Tpo -c -o afpd-enumerate.o `test -f 'enumerate.c' || echo '$(srcdir)/'`enumerate.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-enumerate.Tpo $(DEPDIR)/afpd-enumerate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='enumerate.c' object='afpd-enumerate.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-enumerate.o `test -f 'enumerate.c' || echo '$(srcdir)/'`enumerate.c afpd-enumerate.obj: enumerate.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-enumerate.obj -MD -MP -MF $(DEPDIR)/afpd-enumerate.Tpo -c -o afpd-enumerate.obj `if test -f 'enumerate.c'; then $(CYGPATH_W) 'enumerate.c'; else $(CYGPATH_W) '$(srcdir)/enumerate.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-enumerate.Tpo $(DEPDIR)/afpd-enumerate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='enumerate.c' object='afpd-enumerate.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-enumerate.obj `if test -f 'enumerate.c'; then $(CYGPATH_W) 'enumerate.c'; else $(CYGPATH_W) '$(srcdir)/enumerate.c'; fi` afpd-extattrs.o: extattrs.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-extattrs.o -MD -MP -MF $(DEPDIR)/afpd-extattrs.Tpo -c -o afpd-extattrs.o `test -f 'extattrs.c' || echo '$(srcdir)/'`extattrs.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-extattrs.Tpo $(DEPDIR)/afpd-extattrs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='extattrs.c' object='afpd-extattrs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-extattrs.o `test -f 'extattrs.c' || echo '$(srcdir)/'`extattrs.c afpd-extattrs.obj: extattrs.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-extattrs.obj -MD -MP -MF $(DEPDIR)/afpd-extattrs.Tpo -c -o afpd-extattrs.obj `if test -f 'extattrs.c'; then $(CYGPATH_W) 'extattrs.c'; else $(CYGPATH_W) '$(srcdir)/extattrs.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-extattrs.Tpo $(DEPDIR)/afpd-extattrs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='extattrs.c' object='afpd-extattrs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-extattrs.obj `if test -f 'extattrs.c'; then $(CYGPATH_W) 'extattrs.c'; else $(CYGPATH_W) '$(srcdir)/extattrs.c'; fi` afpd-fce_api.o: fce_api.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-fce_api.o -MD -MP -MF $(DEPDIR)/afpd-fce_api.Tpo -c -o afpd-fce_api.o `test -f 'fce_api.c' || echo '$(srcdir)/'`fce_api.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-fce_api.Tpo $(DEPDIR)/afpd-fce_api.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fce_api.c' object='afpd-fce_api.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-fce_api.o `test -f 'fce_api.c' || echo '$(srcdir)/'`fce_api.c afpd-fce_api.obj: fce_api.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-fce_api.obj -MD -MP -MF $(DEPDIR)/afpd-fce_api.Tpo -c -o afpd-fce_api.obj `if test -f 'fce_api.c'; then $(CYGPATH_W) 'fce_api.c'; else $(CYGPATH_W) '$(srcdir)/fce_api.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-fce_api.Tpo $(DEPDIR)/afpd-fce_api.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fce_api.c' object='afpd-fce_api.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-fce_api.obj `if test -f 'fce_api.c'; then $(CYGPATH_W) 'fce_api.c'; else $(CYGPATH_W) '$(srcdir)/fce_api.c'; fi` afpd-fce_util.o: fce_util.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-fce_util.o -MD -MP -MF $(DEPDIR)/afpd-fce_util.Tpo -c -o afpd-fce_util.o `test -f 'fce_util.c' || echo '$(srcdir)/'`fce_util.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-fce_util.Tpo $(DEPDIR)/afpd-fce_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fce_util.c' object='afpd-fce_util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-fce_util.o `test -f 'fce_util.c' || echo '$(srcdir)/'`fce_util.c afpd-fce_util.obj: fce_util.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-fce_util.obj -MD -MP -MF $(DEPDIR)/afpd-fce_util.Tpo -c -o afpd-fce_util.obj `if test -f 'fce_util.c'; then $(CYGPATH_W) 'fce_util.c'; else $(CYGPATH_W) '$(srcdir)/fce_util.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-fce_util.Tpo $(DEPDIR)/afpd-fce_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fce_util.c' object='afpd-fce_util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-fce_util.obj `if test -f 'fce_util.c'; then $(CYGPATH_W) 'fce_util.c'; else $(CYGPATH_W) '$(srcdir)/fce_util.c'; fi` afpd-file.o: file.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-file.o -MD -MP -MF $(DEPDIR)/afpd-file.Tpo -c -o afpd-file.o `test -f 'file.c' || echo '$(srcdir)/'`file.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-file.Tpo $(DEPDIR)/afpd-file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file.c' object='afpd-file.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-file.o `test -f 'file.c' || echo '$(srcdir)/'`file.c afpd-file.obj: file.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-file.obj -MD -MP -MF $(DEPDIR)/afpd-file.Tpo -c -o afpd-file.obj `if test -f 'file.c'; then $(CYGPATH_W) 'file.c'; else $(CYGPATH_W) '$(srcdir)/file.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-file.Tpo $(DEPDIR)/afpd-file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file.c' object='afpd-file.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-file.obj `if test -f 'file.c'; then $(CYGPATH_W) 'file.c'; else $(CYGPATH_W) '$(srcdir)/file.c'; fi` afpd-filedir.o: filedir.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-filedir.o -MD -MP -MF $(DEPDIR)/afpd-filedir.Tpo -c -o afpd-filedir.o `test -f 'filedir.c' || echo '$(srcdir)/'`filedir.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-filedir.Tpo $(DEPDIR)/afpd-filedir.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='filedir.c' object='afpd-filedir.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-filedir.o `test -f 'filedir.c' || echo '$(srcdir)/'`filedir.c afpd-filedir.obj: filedir.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-filedir.obj -MD -MP -MF $(DEPDIR)/afpd-filedir.Tpo -c -o afpd-filedir.obj `if test -f 'filedir.c'; then $(CYGPATH_W) 'filedir.c'; else $(CYGPATH_W) '$(srcdir)/filedir.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-filedir.Tpo $(DEPDIR)/afpd-filedir.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='filedir.c' object='afpd-filedir.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-filedir.obj `if test -f 'filedir.c'; then $(CYGPATH_W) 'filedir.c'; else $(CYGPATH_W) '$(srcdir)/filedir.c'; fi` afpd-fork.o: fork.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-fork.o -MD -MP -MF $(DEPDIR)/afpd-fork.Tpo -c -o afpd-fork.o `test -f 'fork.c' || echo '$(srcdir)/'`fork.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-fork.Tpo $(DEPDIR)/afpd-fork.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fork.c' object='afpd-fork.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-fork.o `test -f 'fork.c' || echo '$(srcdir)/'`fork.c afpd-fork.obj: fork.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-fork.obj -MD -MP -MF $(DEPDIR)/afpd-fork.Tpo -c -o afpd-fork.obj `if test -f 'fork.c'; then $(CYGPATH_W) 'fork.c'; else $(CYGPATH_W) '$(srcdir)/fork.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-fork.Tpo $(DEPDIR)/afpd-fork.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fork.c' object='afpd-fork.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-fork.obj `if test -f 'fork.c'; then $(CYGPATH_W) 'fork.c'; else $(CYGPATH_W) '$(srcdir)/fork.c'; fi` afpd-gettok.o: gettok.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-gettok.o -MD -MP -MF $(DEPDIR)/afpd-gettok.Tpo -c -o afpd-gettok.o `test -f 'gettok.c' || echo '$(srcdir)/'`gettok.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-gettok.Tpo $(DEPDIR)/afpd-gettok.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gettok.c' object='afpd-gettok.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-gettok.o `test -f 'gettok.c' || echo '$(srcdir)/'`gettok.c afpd-gettok.obj: gettok.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-gettok.obj -MD -MP -MF $(DEPDIR)/afpd-gettok.Tpo -c -o afpd-gettok.obj `if test -f 'gettok.c'; then $(CYGPATH_W) 'gettok.c'; else $(CYGPATH_W) '$(srcdir)/gettok.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-gettok.Tpo $(DEPDIR)/afpd-gettok.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gettok.c' object='afpd-gettok.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-gettok.obj `if test -f 'gettok.c'; then $(CYGPATH_W) 'gettok.c'; else $(CYGPATH_W) '$(srcdir)/gettok.c'; fi` afpd-hash.o: hash.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-hash.o -MD -MP -MF $(DEPDIR)/afpd-hash.Tpo -c -o afpd-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-hash.Tpo $(DEPDIR)/afpd-hash.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hash.c' object='afpd-hash.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c afpd-hash.obj: hash.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-hash.obj -MD -MP -MF $(DEPDIR)/afpd-hash.Tpo -c -o afpd-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-hash.Tpo $(DEPDIR)/afpd-hash.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hash.c' object='afpd-hash.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi` afpd-main.o: main.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-main.o -MD -MP -MF $(DEPDIR)/afpd-main.Tpo -c -o afpd-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-main.Tpo $(DEPDIR)/afpd-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='afpd-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c afpd-main.obj: main.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-main.obj -MD -MP -MF $(DEPDIR)/afpd-main.Tpo -c -o afpd-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-main.Tpo $(DEPDIR)/afpd-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='afpd-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` afpd-mangle.o: mangle.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-mangle.o -MD -MP -MF $(DEPDIR)/afpd-mangle.Tpo -c -o afpd-mangle.o `test -f 'mangle.c' || echo '$(srcdir)/'`mangle.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-mangle.Tpo $(DEPDIR)/afpd-mangle.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mangle.c' object='afpd-mangle.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-mangle.o `test -f 'mangle.c' || echo '$(srcdir)/'`mangle.c afpd-mangle.obj: mangle.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-mangle.obj -MD -MP -MF $(DEPDIR)/afpd-mangle.Tpo -c -o afpd-mangle.obj `if test -f 'mangle.c'; then $(CYGPATH_W) 'mangle.c'; else $(CYGPATH_W) '$(srcdir)/mangle.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-mangle.Tpo $(DEPDIR)/afpd-mangle.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mangle.c' object='afpd-mangle.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-mangle.obj `if test -f 'mangle.c'; then $(CYGPATH_W) 'mangle.c'; else $(CYGPATH_W) '$(srcdir)/mangle.c'; fi` afpd-messages.o: messages.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-messages.o -MD -MP -MF $(DEPDIR)/afpd-messages.Tpo -c -o afpd-messages.o `test -f 'messages.c' || echo '$(srcdir)/'`messages.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-messages.Tpo $(DEPDIR)/afpd-messages.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='messages.c' object='afpd-messages.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-messages.o `test -f 'messages.c' || echo '$(srcdir)/'`messages.c afpd-messages.obj: messages.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-messages.obj -MD -MP -MF $(DEPDIR)/afpd-messages.Tpo -c -o afpd-messages.obj `if test -f 'messages.c'; then $(CYGPATH_W) 'messages.c'; else $(CYGPATH_W) '$(srcdir)/messages.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-messages.Tpo $(DEPDIR)/afpd-messages.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='messages.c' object='afpd-messages.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-messages.obj `if test -f 'messages.c'; then $(CYGPATH_W) 'messages.c'; else $(CYGPATH_W) '$(srcdir)/messages.c'; fi` afpd-nfsquota.o: nfsquota.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-nfsquota.o -MD -MP -MF $(DEPDIR)/afpd-nfsquota.Tpo -c -o afpd-nfsquota.o `test -f 'nfsquota.c' || echo '$(srcdir)/'`nfsquota.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-nfsquota.Tpo $(DEPDIR)/afpd-nfsquota.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nfsquota.c' object='afpd-nfsquota.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-nfsquota.o `test -f 'nfsquota.c' || echo '$(srcdir)/'`nfsquota.c afpd-nfsquota.obj: nfsquota.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-nfsquota.obj -MD -MP -MF $(DEPDIR)/afpd-nfsquota.Tpo -c -o afpd-nfsquota.obj `if test -f 'nfsquota.c'; then $(CYGPATH_W) 'nfsquota.c'; else $(CYGPATH_W) '$(srcdir)/nfsquota.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-nfsquota.Tpo $(DEPDIR)/afpd-nfsquota.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nfsquota.c' object='afpd-nfsquota.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-nfsquota.obj `if test -f 'nfsquota.c'; then $(CYGPATH_W) 'nfsquota.c'; else $(CYGPATH_W) '$(srcdir)/nfsquota.c'; fi` afpd-ofork.o: ofork.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-ofork.o -MD -MP -MF $(DEPDIR)/afpd-ofork.Tpo -c -o afpd-ofork.o `test -f 'ofork.c' || echo '$(srcdir)/'`ofork.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-ofork.Tpo $(DEPDIR)/afpd-ofork.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofork.c' object='afpd-ofork.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-ofork.o `test -f 'ofork.c' || echo '$(srcdir)/'`ofork.c afpd-ofork.obj: ofork.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-ofork.obj -MD -MP -MF $(DEPDIR)/afpd-ofork.Tpo -c -o afpd-ofork.obj `if test -f 'ofork.c'; then $(CYGPATH_W) 'ofork.c'; else $(CYGPATH_W) '$(srcdir)/ofork.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-ofork.Tpo $(DEPDIR)/afpd-ofork.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofork.c' object='afpd-ofork.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-ofork.obj `if test -f 'ofork.c'; then $(CYGPATH_W) 'ofork.c'; else $(CYGPATH_W) '$(srcdir)/ofork.c'; fi` afpd-quota.o: quota.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-quota.o -MD -MP -MF $(DEPDIR)/afpd-quota.Tpo -c -o afpd-quota.o `test -f 'quota.c' || echo '$(srcdir)/'`quota.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-quota.Tpo $(DEPDIR)/afpd-quota.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='quota.c' object='afpd-quota.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-quota.o `test -f 'quota.c' || echo '$(srcdir)/'`quota.c afpd-quota.obj: quota.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-quota.obj -MD -MP -MF $(DEPDIR)/afpd-quota.Tpo -c -o afpd-quota.obj `if test -f 'quota.c'; then $(CYGPATH_W) 'quota.c'; else $(CYGPATH_W) '$(srcdir)/quota.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-quota.Tpo $(DEPDIR)/afpd-quota.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='quota.c' object='afpd-quota.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-quota.obj `if test -f 'quota.c'; then $(CYGPATH_W) 'quota.c'; else $(CYGPATH_W) '$(srcdir)/quota.c'; fi` afpd-status.o: status.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-status.o -MD -MP -MF $(DEPDIR)/afpd-status.Tpo -c -o afpd-status.o `test -f 'status.c' || echo '$(srcdir)/'`status.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-status.Tpo $(DEPDIR)/afpd-status.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='status.c' object='afpd-status.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-status.o `test -f 'status.c' || echo '$(srcdir)/'`status.c afpd-status.obj: status.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-status.obj -MD -MP -MF $(DEPDIR)/afpd-status.Tpo -c -o afpd-status.obj `if test -f 'status.c'; then $(CYGPATH_W) 'status.c'; else $(CYGPATH_W) '$(srcdir)/status.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-status.Tpo $(DEPDIR)/afpd-status.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='status.c' object='afpd-status.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-status.obj `if test -f 'status.c'; then $(CYGPATH_W) 'status.c'; else $(CYGPATH_W) '$(srcdir)/status.c'; fi` afpd-switch.o: switch.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-switch.o -MD -MP -MF $(DEPDIR)/afpd-switch.Tpo -c -o afpd-switch.o `test -f 'switch.c' || echo '$(srcdir)/'`switch.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-switch.Tpo $(DEPDIR)/afpd-switch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='switch.c' object='afpd-switch.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-switch.o `test -f 'switch.c' || echo '$(srcdir)/'`switch.c afpd-switch.obj: switch.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-switch.obj -MD -MP -MF $(DEPDIR)/afpd-switch.Tpo -c -o afpd-switch.obj `if test -f 'switch.c'; then $(CYGPATH_W) 'switch.c'; else $(CYGPATH_W) '$(srcdir)/switch.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-switch.Tpo $(DEPDIR)/afpd-switch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='switch.c' object='afpd-switch.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-switch.obj `if test -f 'switch.c'; then $(CYGPATH_W) 'switch.c'; else $(CYGPATH_W) '$(srcdir)/switch.c'; fi` afpd-uam.o: uam.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-uam.o -MD -MP -MF $(DEPDIR)/afpd-uam.Tpo -c -o afpd-uam.o `test -f 'uam.c' || echo '$(srcdir)/'`uam.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-uam.Tpo $(DEPDIR)/afpd-uam.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uam.c' object='afpd-uam.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-uam.o `test -f 'uam.c' || echo '$(srcdir)/'`uam.c afpd-uam.obj: uam.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-uam.obj -MD -MP -MF $(DEPDIR)/afpd-uam.Tpo -c -o afpd-uam.obj `if test -f 'uam.c'; then $(CYGPATH_W) 'uam.c'; else $(CYGPATH_W) '$(srcdir)/uam.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-uam.Tpo $(DEPDIR)/afpd-uam.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uam.c' object='afpd-uam.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-uam.obj `if test -f 'uam.c'; then $(CYGPATH_W) 'uam.c'; else $(CYGPATH_W) '$(srcdir)/uam.c'; fi` afpd-uid.o: uid.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-uid.o -MD -MP -MF $(DEPDIR)/afpd-uid.Tpo -c -o afpd-uid.o `test -f 'uid.c' || echo '$(srcdir)/'`uid.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-uid.Tpo $(DEPDIR)/afpd-uid.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uid.c' object='afpd-uid.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-uid.o `test -f 'uid.c' || echo '$(srcdir)/'`uid.c afpd-uid.obj: uid.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-uid.obj -MD -MP -MF $(DEPDIR)/afpd-uid.Tpo -c -o afpd-uid.obj `if test -f 'uid.c'; then $(CYGPATH_W) 'uid.c'; else $(CYGPATH_W) '$(srcdir)/uid.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-uid.Tpo $(DEPDIR)/afpd-uid.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uid.c' object='afpd-uid.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-uid.obj `if test -f 'uid.c'; then $(CYGPATH_W) 'uid.c'; else $(CYGPATH_W) '$(srcdir)/uid.c'; fi` afpd-unix.o: unix.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-unix.o -MD -MP -MF $(DEPDIR)/afpd-unix.Tpo -c -o afpd-unix.o `test -f 'unix.c' || echo '$(srcdir)/'`unix.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-unix.Tpo $(DEPDIR)/afpd-unix.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='unix.c' object='afpd-unix.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-unix.o `test -f 'unix.c' || echo '$(srcdir)/'`unix.c afpd-unix.obj: unix.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-unix.obj -MD -MP -MF $(DEPDIR)/afpd-unix.Tpo -c -o afpd-unix.obj `if test -f 'unix.c'; then $(CYGPATH_W) 'unix.c'; else $(CYGPATH_W) '$(srcdir)/unix.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-unix.Tpo $(DEPDIR)/afpd-unix.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='unix.c' object='afpd-unix.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-unix.obj `if test -f 'unix.c'; then $(CYGPATH_W) 'unix.c'; else $(CYGPATH_W) '$(srcdir)/unix.c'; fi` afpd-volume.o: volume.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-volume.o -MD -MP -MF $(DEPDIR)/afpd-volume.Tpo -c -o afpd-volume.o `test -f 'volume.c' || echo '$(srcdir)/'`volume.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-volume.Tpo $(DEPDIR)/afpd-volume.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='volume.c' object='afpd-volume.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-volume.o `test -f 'volume.c' || echo '$(srcdir)/'`volume.c afpd-volume.obj: volume.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-volume.obj -MD -MP -MF $(DEPDIR)/afpd-volume.Tpo -c -o afpd-volume.obj `if test -f 'volume.c'; then $(CYGPATH_W) 'volume.c'; else $(CYGPATH_W) '$(srcdir)/volume.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-volume.Tpo $(DEPDIR)/afpd-volume.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='volume.c' object='afpd-volume.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-volume.obj `if test -f 'volume.c'; then $(CYGPATH_W) 'volume.c'; else $(CYGPATH_W) '$(srcdir)/volume.c'; fi` afpd-acls.o: acls.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-acls.o -MD -MP -MF $(DEPDIR)/afpd-acls.Tpo -c -o afpd-acls.o `test -f 'acls.c' || echo '$(srcdir)/'`acls.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-acls.Tpo $(DEPDIR)/afpd-acls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='acls.c' object='afpd-acls.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-acls.o `test -f 'acls.c' || echo '$(srcdir)/'`acls.c afpd-acls.obj: acls.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -MT afpd-acls.obj -MD -MP -MF $(DEPDIR)/afpd-acls.Tpo -c -o afpd-acls.obj `if test -f 'acls.c'; then $(CYGPATH_W) 'acls.c'; else $(CYGPATH_W) '$(srcdir)/acls.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpd-acls.Tpo $(DEPDIR)/afpd-acls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='acls.c' object='afpd-acls.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpd_CFLAGS) $(CFLAGS) -c -o afpd-acls.obj `if test -f 'acls.c'; then $(CYGPATH_W) 'acls.c'; else $(CYGPATH_W) '$(srcdir)/acls.c'; fi` fce-fce_api.o: fce_api.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fce_CFLAGS) $(CFLAGS) -MT fce-fce_api.o -MD -MP -MF $(DEPDIR)/fce-fce_api.Tpo -c -o fce-fce_api.o `test -f 'fce_api.c' || echo '$(srcdir)/'`fce_api.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/fce-fce_api.Tpo $(DEPDIR)/fce-fce_api.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fce_api.c' object='fce-fce_api.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fce_CFLAGS) $(CFLAGS) -c -o fce-fce_api.o `test -f 'fce_api.c' || echo '$(srcdir)/'`fce_api.c fce-fce_api.obj: fce_api.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fce_CFLAGS) $(CFLAGS) -MT fce-fce_api.obj -MD -MP -MF $(DEPDIR)/fce-fce_api.Tpo -c -o fce-fce_api.obj `if test -f 'fce_api.c'; then $(CYGPATH_W) 'fce_api.c'; else $(CYGPATH_W) '$(srcdir)/fce_api.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/fce-fce_api.Tpo $(DEPDIR)/fce-fce_api.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fce_api.c' object='fce-fce_api.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fce_CFLAGS) $(CFLAGS) -c -o fce-fce_api.obj `if test -f 'fce_api.c'; then $(CYGPATH_W) 'fce_api.c'; else $(CYGPATH_W) '$(srcdir)/fce_api.c'; fi` fce-fce_util.o: fce_util.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fce_CFLAGS) $(CFLAGS) -MT fce-fce_util.o -MD -MP -MF $(DEPDIR)/fce-fce_util.Tpo -c -o fce-fce_util.o `test -f 'fce_util.c' || echo '$(srcdir)/'`fce_util.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/fce-fce_util.Tpo $(DEPDIR)/fce-fce_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fce_util.c' object='fce-fce_util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fce_CFLAGS) $(CFLAGS) -c -o fce-fce_util.o `test -f 'fce_util.c' || echo '$(srcdir)/'`fce_util.c fce-fce_util.obj: fce_util.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fce_CFLAGS) $(CFLAGS) -MT fce-fce_util.obj -MD -MP -MF $(DEPDIR)/fce-fce_util.Tpo -c -o fce-fce_util.obj `if test -f 'fce_util.c'; then $(CYGPATH_W) 'fce_util.c'; else $(CYGPATH_W) '$(srcdir)/fce_util.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/fce-fce_util.Tpo $(DEPDIR)/fce-fce_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fce_util.c' object='fce-fce_util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fce_CFLAGS) $(CFLAGS) -c -o fce-fce_util.obj `if test -f 'fce_util.c'; then $(CYGPATH_W) 'fce_util.c'; else $(CYGPATH_W) '$(srcdir)/fce_util.c'; fi` hash-hash.o: hash.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hash_CFLAGS) $(CFLAGS) -MT hash-hash.o -MD -MP -MF $(DEPDIR)/hash-hash.Tpo -c -o hash-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/hash-hash.Tpo $(DEPDIR)/hash-hash.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hash.c' object='hash-hash.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hash_CFLAGS) $(CFLAGS) -c -o hash-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c hash-hash.obj: hash.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hash_CFLAGS) $(CFLAGS) -MT hash-hash.obj -MD -MP -MF $(DEPDIR)/hash-hash.Tpo -c -o hash-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/hash-hash.Tpo $(DEPDIR)/hash-hash.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hash.c' object='hash-hash.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hash_CFLAGS) $(CFLAGS) -c -o hash-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-sbinPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-sbinPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS clean-sbinPROGRAMS ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-sbinPROGRAMS install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-sbinPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/etc/afpd/fce_util.c0000644000175200017500000001322311667370513013700 00000000000000/* * Copyright (c) 2010 Mark Williams * * File change event API for netatalk * * for every detected filesystem change a UDP packet is sent to an arbitrary list * of listeners. Each packet contains unix path of modified filesystem element, * event reason, and a consecutive event id (32 bit). Technically we are UDP client and are sending * out packets synchronuosly as they are created by the afp functions. This should not affect * performance measurably. The only delaying calls occur during initialization, if we have to * resolve non-IP hostnames to IP. All numeric data inside the packet is network byte order, so use * ntohs / ntohl to resolve length and event id. Ideally a listener receives every packet with * no gaps in event ids, starting with event id 1 and mode FCE_CONN_START followed by * data events from id 2 up to 0xFFFFFFFF, followed by 0 to 0xFFFFFFFF and so on. * * A gap or not starting with 1 mode FCE_CONN_START or receiving mode FCE_CONN_BROKEN means that * the listener has lost at least one filesystem event * * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "fork.h" #include "file.h" #include "directory.h" #include "desktop.h" #include "volume.h" // ONLY USED IN THIS FILE #include "fce_api_internal.h" #define FCE_TRUE 1 #define FCE_FALSE 0 /* We store our connection data here */ static uint32_t coalesce = 0; static struct fce_history fce_history_list[FCE_HISTORY_LEN]; /**** * With coalesce we try to reduce the events over UDP, the eventlistener would throw these * events away anyway. * This works only, if the connected listener uses the events on a "per directory" base * It is a very simple aproach, but saves a lot of events sent to listeners. * Every "child element" event is ignored as long as its parent event is not older * than MAX_COALESCE_TIME_MS ms. If large directory trees or large files are created or deleted, * this probably will not work recursive, because the time to copy data will exceed this * event timeout. * ****/ static long get_ms_difftime ( struct timeval *tv1, struct timeval *tv2 ) { unsigned long s = tv2->tv_sec - tv1->tv_sec; long us = tv2->tv_usec - tv1->tv_usec; return s * 1000 + us/1000; } /****************************************************************************** * Public functions follow ******************************************************************************/ void fce_initialize_history() { for (int i = 0; i < FCE_HISTORY_LEN; i++) { memset( &fce_history_list[i], 0, sizeof(fce_history_list[i]) ); } } bool fce_handle_coalescation( char *path, int is_dir, int mode ) { /* These two are used to eval our next index in history */ /* the history is unsorted, speed should not be a problem, length is 10 */ unsigned long oldest_entry = (unsigned long )((long)-1); int oldest_entry_idx = -1; struct timeval tv; if (coalesce == 0) return false; /* After a file creation *ALWAYS* a file modification is produced */ if ((mode == FCE_FILE_CREATE) && (coalesce & FCE_COALESCE_CREATE)) return true; /* get timestamp */ gettimeofday(&tv, 0); /* Now detect events in the very near history */ for (int i = 0; i < FCE_HISTORY_LEN; i++) { struct fce_history *fh = &fce_history_list[i]; /* Not inited ? */ if (fh->tv.tv_sec == 0) { /* we can use it for new elements */ oldest_entry = 0; oldest_entry_idx = i; continue; } /* Too old ? */ if (get_ms_difftime( &fh->tv, &tv ) > MAX_COALESCE_TIME_MS) { /* Invalidate entry */ fh->tv.tv_sec = 0; oldest_entry = 0; oldest_entry_idx = i; continue; } /* If we find a parent dir wich was created we are done */ if ((coalesce & FCE_COALESCE_CREATE) && (fh->mode == FCE_DIR_CREATE)) { /* Parent dir ? */ if (!strncmp(fh->path, path, strlen(fh->path))) return true; } /* If we find a parent dir we should be DELETED we are done */ if ((coalesce & FCE_COALESCE_DELETE) && fh->is_dir && (mode == FCE_FILE_DELETE || mode == FCE_DIR_DELETE)) { /* Parent dir ? */ if (!strncmp(fh->path, path, strlen(fh->path))) return true; } /* Detect oldest entry for next new entry */ if (oldest_entry_idx == -1 || fh->tv.tv_sec < oldest_entry) { oldest_entry = fh->tv.tv_sec; oldest_entry_idx = i; } } /* We have a new entry for the history, register it */ fce_history_list[oldest_entry_idx].tv = tv; fce_history_list[oldest_entry_idx].mode = mode; fce_history_list[oldest_entry_idx].is_dir = is_dir; strncpy( fce_history_list[oldest_entry_idx].path, path, MAXPATHLEN); /* we have to handle this event */ return false; } /* * Set event coalescation to reduce number of events sent over UDP * all|delete|create */ int fce_set_coalesce(char *opt) { char *e; char *p; if (opt == NULL) return AFPERR_PARAM; e = strdup(opt); for (p = strtok(e, ","); p; p = strtok(NULL, ",")) { if (strcmp(p, "all") == 0) { coalesce = FCE_COALESCE_ALL; } else if (strcmp(p, "delete") == 0) { coalesce = FCE_COALESCE_DELETE; } else if (strcmp(p, "create") == 0) { coalesce = FCE_COALESCE_CREATE; } } free(e); return AFP_OK; } netatalk-2.2.2/etc/afpd/afp_zeroconf.h0000644000175200017500000000122111655731126014557 00000000000000/* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */ /* * Author: Daniel S. Haischt * Purpose: Zeroconf facade, that abstracts access to a * particular Zeroconf implementation * Doc: http://www.dns-sd.org/ * */ #ifndef AFPD_ZEROCONF_H #define AFPD_ZEROCONF_H #include "afp_config.h" /* * Prototype Definitions */ /* * registers service with a particular Zerconf implemenation. */ void zeroconf_register(const AFPConfig *configs); /* * de-registers the ntpd service with a particular Zerconf implemenation. */ void zeroconf_deregister(void); #endif /* AFPD_ZEROCONF_H */ netatalk-2.2.2/etc/afpd/file.h0000644000175200017500000001247511655731126013040 00000000000000/* * $Id: file.h,v 1.26 2010/03/12 15:16:49 franklahm Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef AFPD_FILE_H #define AFPD_FILE_H 1 /*#include */ /* including it here causes some confusion */ #include #include #include #include #include #include "volume.h" #include "directory.h" extern const u_char ufinderi[]; #define FILPBIT_ATTR 0 #define FILPBIT_PDID 1 #define FILPBIT_CDATE 2 #define FILPBIT_MDATE 3 #define FILPBIT_BDATE 4 #define FILPBIT_FINFO 5 #define FILPBIT_LNAME 6 #define FILPBIT_SNAME 7 #define FILPBIT_FNUM 8 #define FILPBIT_DFLEN 9 #define FILPBIT_RFLEN 10 #define FILPBIT_EXTDFLEN 11 #define FILPBIT_PDINFO 13 /* ProDOS Info/ UTF8 name */ #define FILPBIT_EXTRFLEN 14 #define FILPBIT_UNIXPR 15 struct extmap { char *em_ext; char em_creator[ 4 ]; char em_type[ 4 ]; }; #define kTextEncodingUTF8 0x08000103 typedef enum { /* Mac OS encodings*/ kTextEncodingMacRoman = 0L, kTextEncodingMacJapanese = 1, kTextEncodingMacChineseTrad = 2, kTextEncodingMacKorean = 3, kTextEncodingMacArabic = 4, kTextEncodingMacHebrew = 5, kTextEncodingMacGreek = 6, kTextEncodingMacCyrillic = 7, kTextEncodingMacDevanagari = 9, kTextEncodingMacGurmukhi = 10, kTextEncodingMacGujarati = 11, kTextEncodingMacOriya = 12, kTextEncodingMacBengali = 13, kTextEncodingMacTamil = 14, kTextEncodingMacTelugu = 15, kTextEncodingMacKannada = 16, kTextEncodingMacMalayalam = 17, kTextEncodingMacSinhalese = 18, kTextEncodingMacBurmese = 19, kTextEncodingMacKhmer = 20, kTextEncodingMacThai = 21, kTextEncodingMacLaotian = 22, kTextEncodingMacGeorgian = 23, kTextEncodingMacArmenian = 24, kTextEncodingMacChineseSimp = 25, kTextEncodingMacTibetan = 26, kTextEncodingMacMongolian = 27, kTextEncodingMacEthiopic = 28, kTextEncodingMacCentralEurRoman = 29, kTextEncodingMacVietnamese = 30, kTextEncodingMacExtArabic = 31, /* The following use script code 0, smRoman*/ kTextEncodingMacSymbol = 33, kTextEncodingMacDingbats = 34, kTextEncodingMacTurkish = 35, kTextEncodingMacCroatian = 36, kTextEncodingMacIcelandic = 37, kTextEncodingMacRomanian = 38, kTextEncodingMacCeltic = 39, kTextEncodingMacGaelic = 40, kTextEncodingMacKeyboardGlyphs = 41, } kTextEncoding_t; extern char *set_name (const struct vol *, char *, cnid_t, char *, cnid_t, u_int32_t ); extern struct extmap *getextmap (const char *); extern struct extmap *getdefextmap (void); extern int getfilparams (struct vol *, u_int16_t, struct path *, struct dir *, char *buf, size_t *); extern int setfilparams (struct vol *, struct path *, u_int16_t, char *); extern int renamefile (const struct vol *, int, char *, char *, char *, struct adouble *); extern int copyfile (const struct vol *, const struct vol *, int, char *, char *, char *, struct adouble *); extern int deletefile (const struct vol *, int, char *, int); extern int getmetadata (struct vol *vol, u_int16_t bitmap, struct path *path, struct dir *dir, char *buf, size_t *buflen, struct adouble *adp); extern void *get_finderinfo (const struct vol *, const char *, struct adouble *, void *, int); extern size_t mtoUTF8 (const struct vol *, const char *, size_t , char *, size_t ); extern int copy_path_name (const struct vol *, char *, char *i); extern uint32_t get_id (struct vol *, struct adouble *, const struct stat *, cnid_t , const char *, int ); /* FP functions */ int afp_exchangefiles (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_setfilparams (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_copyfile (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_createfile (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_createid (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_resolveid (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_deleteid (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); #endif netatalk-2.2.2/etc/afpd/afp_config.h0000644000175200017500000000137711655731126014213 00000000000000/* * $Id: afp_config.h,v 1.5 2009-10-13 22:55:36 didg Exp $ */ #ifndef AFPD_CONFIG_H #define AFPD_CONFIG_H 1 #ifdef HAVE_SYS_CDEFS_H #include #endif /* HAVE_SYS_CDEFS_H */ #include #include #include typedef struct AFPConfig { AFPObj obj; int fd, statuslen; unsigned char *optcount; char status[1400]; const void *defoptions, *signature; afp_child_t *(*server_start) (struct AFPConfig *, struct AFPConfig *, server_child *); void (*server_cleanup) (const struct AFPConfig *); struct AFPConfig *next; } AFPConfig; extern AFPConfig *configinit (struct afp_options *); extern void configfree (AFPConfig *, const AFPConfig *); #endif netatalk-2.2.2/etc/afpd/uid.c0000644000175200017500000000712711655731126012673 00000000000000/* * $Id: uid.c,v 1.14 2005-04-28 20:49:45 bfernhomberg Exp $ * code: jeff@univrel.pr.uconn.edu * * These functions are abstracted here, so that all calls for resolving * user/group names can be centrally changed (good for OS dependant calls * across the package). */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ /* don't compile this file at all unless FORCE_UIDGID is set */ #ifdef FORCE_UIDGID #include #include #include #include /* functions for username and group */ #include #include #include "uid.h" #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ extern uid_t uuid; void save_uidgid ( pair ) uidgidset *pair; { pair->uid = geteuid (); pair->gid = getegid (); } void restore_uidgid ( pair ) uidgidset *pair; { uid_t uid gid_t gid; uid = geteuid (); gid = getegid (); if (uid == pair->uid && gid == pair->gid) return; if (seteuid(0) < 0) { LOG(log_error, logtype_afpd, "set_uidgid: Could not switch back to root: %s", strerror(errno)); } if ( setegid ( pair->gid ) < 0 ) LOG(log_error, logtype_afpd, "restore_uidgid: unable to setegid '%s': %s", pair->gid, strerror(errno) ); if ( seteuid ( pair->uid ) < 0 ) LOG(log_error, logtype_afpd, "restore_uidgid: unable to seteuid '%s': %s", pair->uid, strerror(errno) ); else uuid = pair->uid; /* ugly hack for utommode */ } void set_uidgid ( this_volume ) const struct vol *this_volume; { int uid, gid; /* derived ones go in here */ /* check to see if we have to switch users */ uid = user_to_uid ( (this_volume)->v_forceuid); gid = group_to_gid ( (this_volume)->v_forcegid); if ((!uid || uid == geteuid()) && (!gid || gid == getegid())) return; if ( seteuid(0) < 0) { LOG(log_error, logtype_afpd, "set_uidgid: Could not switch back to root: %s", strerror(errno)); return; } /* check to see if we have to switch groups */ if ( gid ) { if ( setegid ( gid ) < 0 ) LOG(log_error, logtype_afpd, "set_uidgid: unable to setegid '%s': %s", (this_volume)->v_forcegid, strerror(errno) ); } /* end of checking for (this_volume)->v_forcegid */ if ( uid) { if ( seteuid ( uid ) < 0 ) LOG(log_error, logtype_afpd, "set_uidgid: unable to seteuid '%s': %s", (this_volume)->v_forceuid, strerror(errno) ); else uuid = uid; /* ugly hack for utommode */ } /* end of checking for (this_volume)->v_forceuid */ } /* end function void set_uidgid ( username, group ) */ int user_to_uid ( username ) char *username; { struct passwd *this_passwd; /* check for anything */ if ( !username || strlen ( username ) < 1 ) return 0; /* grab the /etc/passwd record relating to username */ this_passwd = getpwnam ( username ); /* return false if there is no structure returned */ if (this_passwd == NULL) return 0; /* return proper uid */ return this_passwd->pw_uid; } /* end function int user_to_uid ( username ) */ int group_to_gid ( group ) char *group; { struct group *this_group; /* check for anything */ if ( !group || strlen ( group ) < 1 ) return 0; /* grab the /etc/groups record relating to group */ this_group = getgrnam ( group ); /* return false if there is no structure returned */ if (this_group == NULL) return 0; /* return proper gid */ return this_group->gr_gid; } /* end function int group_to_gid ( group ) */ #endif /* FORCE_UIDGID */ netatalk-2.2.2/etc/afpd/afp_zeroconf.c0000644000175200017500000000153511655731244014563 00000000000000/* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */ /* * Author: Daniel S. Haischt * Purpose: Zeroconf facade, that abstracts access to a * particular Zeroconf implementation * Doc: http://www.dns-sd.org/ * */ #ifdef HAVE_CONFIG_H #include #endif #include "afp_zeroconf.h" #include "afp_config.h" #ifdef HAVE_AVAHI #include "afp_avahi.h" #endif /* * Functions (actually they are just facades) */ void zeroconf_register(const AFPConfig *configs) { #if defined (HAVE_AVAHI) LOG(log_debug, logtype_afpd, "Attempting to register with mDNS using Avahi"); av_zeroconf_register(configs); #endif } void zeroconf_deregister(void) { #if defined (HAVE_AVAHI) LOG(log_debug, logtype_afpd, "Attempting to de-register mDNS using Avahi"); av_zeroconf_unregister(); #endif } netatalk-2.2.2/etc/afpd/filedir.h0000644000175200017500000000214611655731126013531 00000000000000/* * $Id: filedir.h,v 1.11 2009-10-15 10:43:13 didg Exp $ */ #ifndef AFPD_FILEDIR_H #define AFPD_FILEDIR_H 1 #include #include #include #include "volume.h" extern struct afp_options default_options; extern char *ctoupath (const struct vol *, struct dir *, char *); extern char *absupath (const struct vol *, struct dir *, char *); extern int veto_file (const char *veto_str, const char *path); extern int check_name (const struct vol *vol, char *name); extern int matchfile2dirperms (char *, struct vol *, int); /* FP functions */ int afp_moveandrename (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_rename (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_delete (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_getfildirparams (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_setfildirparams (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); #endif netatalk-2.2.2/etc/afpd/afp_config.c0000644000175200017500000004254011655731126014203 00000000000000/* * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #ifdef USE_SRVLOC #include #endif /* USE_SRVLOC */ #include #include #include #include #include #include #include #include #include #ifdef HAVE_LDAP #include #endif #include #include "afp_config.h" #include "uam_auth.h" #include "status.h" #include "volume.h" #include "afp_zeroconf.h" #define LINESIZE 1024 /* get rid of unneeded configurations. i use reference counts to deal * w/ multiple configs sharing the same afp_options. oh, to dream of * garbage collection ... */ void configfree(AFPConfig *configs, const AFPConfig *config) { AFPConfig *p, *q; for (p = configs; p; p = q) { q = p->next; if (p == config) continue; /* do a little reference counting */ if (--(*p->optcount) < 1) { afp_options_free(&p->obj.options, p->defoptions); free(p->optcount); } switch (p->obj.proto) { #ifndef NO_DDP case AFPPROTO_ASP: free(p->obj.Obj); free(p->obj.Type); free(p->obj.Zone); atp_close(((ASP) p->obj.handle)->asp_atp); free(p->obj.handle); break; #endif /* no afp/asp */ case AFPPROTO_DSI: close(p->fd); free(p->obj.handle); break; } free(p); } /* the master loaded the volumes for zeroconf, get rid of that */ unload_volumes_and_extmap(); } #ifdef USE_SRVLOC static void SRVLOC_callback(SLPHandle hslp _U_, SLPError errcode, void *cookie) { *(SLPError*)cookie = errcode; } static char hex[17] = "0123456789abcdef"; static char * srvloc_encode(const struct afp_options *options, const char *name) { static char buf[512]; char *conv_name; unsigned char *p; unsigned int i = 0; #ifndef NO_DDP char *Obj, *Type = "", *Zone = ""; #endif /* Convert name to maccharset */ if ((size_t)-1 ==(convert_string_allocate( options->unixcharset, options->maccharset, name, -1, &conv_name)) ) return (char*)name; /* Escape characters */ p = conv_name; while (*p && i<(sizeof(buf)-4)) { if (*p == '@') break; else if (isspace(*p)) { buf[i++] = '%'; buf[i++] = '2'; buf[i++] = '0'; p++; } else if ((!isascii(*p)) || *p <= 0x2f || *p == 0x3f ) { buf[i++] = '%'; buf[i++] = hex[*p >> 4]; buf[i++] = hex[*p++ & 15]; } else { buf[i++] = *p++; } } buf[i] = '\0'; #ifndef NO_DDP /* Add ZONE, */ if (nbp_name(options->server, &Obj, &Type, &Zone )) { LOG(log_error, logtype_afpd, "srvloc_encode: can't parse %s", options->server ); } else { snprintf( buf+i, sizeof(buf)-i-1 ,"&ZONE=%s", Zone); } #endif free (conv_name); return buf; } #endif /* USE_SRVLOC */ static void dsi_cleanup(const AFPConfig *config) { #ifdef USE_SRVLOC SLPError err; SLPError callbackerr; SLPHandle hslp; DSI *dsi = (DSI *)config->obj.handle; /* Do nothing if we didn't register. */ if (!dsi || dsi->srvloc_url[0] == '\0') return; err = SLPOpen("en", SLP_FALSE, &hslp); if (err != SLP_OK) { LOG(log_error, logtype_afpd, "dsi_cleanup: Error opening SRVLOC handle"); goto srvloc_dereg_err; } err = SLPDereg(hslp, dsi->srvloc_url, SRVLOC_callback, &callbackerr); if (err != SLP_OK) { LOG(log_error, logtype_afpd, "dsi_cleanup: Error unregistering %s from SRVLOC", dsi->srvloc_url); goto srvloc_dereg_err; } if (callbackerr != SLP_OK) { LOG(log_error, logtype_afpd, "dsi_cleanup: Error in callback while trying to unregister %s from SRVLOC (%d)", dsi->srvloc_url, callbackerr); goto srvloc_dereg_err; } srvloc_dereg_err: dsi->srvloc_url[0] = '\0'; SLPClose(hslp); #endif /* USE_SRVLOC */ } #ifndef NO_DDP static void asp_cleanup(const AFPConfig *config) { /* we need to stop tickle handler */ asp_stop_tickle(); nbp_unrgstr(config->obj.Obj, config->obj.Type, config->obj.Zone, &config->obj.options.ddpaddr); } /* these two are almost identical. it should be possible to collapse them * into one with minimal junk. */ static int asp_start(AFPConfig *config, AFPConfig *configs, server_child *server_children) { ASP asp; if (!(asp = asp_getsession(config->obj.handle, server_children, config->obj.options.tickleval))) { LOG(log_error, logtype_afpd, "main: asp_getsession: %s", strerror(errno) ); exit( EXITERR_CLNT ); } if (asp->child) { configfree(configs, config); /* free a bunch of stuff */ afp_over_asp(&config->obj); exit (0); } return 0; } #endif /* no afp/asp */ static afp_child_t *dsi_start(AFPConfig *config, AFPConfig *configs, server_child *server_children) { DSI *dsi = config->obj.handle; afp_child_t *child = NULL; if (!(child = dsi_getsession(dsi, server_children, config->obj.options.tickleval))) { LOG(log_error, logtype_afpd, "dsi_start: session error: %s", strerror(errno)); return NULL; } /* we've forked. */ if (parent_or_child == 1) { configfree(configs, config); config->obj.ipc_fd = child->ipc_fds[1]; close(child->ipc_fds[0]); /* Close parent IPC fd */ free(child); afp_over_dsi(&config->obj); /* start a session */ exit (0); } return child; } #ifndef NO_DDP static AFPConfig *ASPConfigInit(const struct afp_options *options, unsigned char *refcount) { AFPConfig *config; ATP atp; ASP asp; char *Obj, *Type = "AFPServer", *Zone = "*"; char *convname = NULL; if ((config = (AFPConfig *) calloc(1, sizeof(AFPConfig))) == NULL) return NULL; if ((atp = atp_open(ATADDR_ANYPORT, &options->ddpaddr)) == NULL) { LOG(log_error, logtype_afpd, "main: atp_open: %s", strerror(errno) ); free(config); return NULL; } if ((asp = asp_init( atp )) == NULL) { LOG(log_error, logtype_afpd, "main: asp_init: %s", strerror(errno) ); atp_close(atp); free(config); return NULL; } /* register asp server */ Obj = (char *) options->hostname; if (options->server && (size_t)-1 ==(convert_string_allocate( options->unixcharset, options->maccharset, options->server, strlen(options->server), &convname)) ) { if ((convname = strdup(options->server)) == NULL ) { LOG(log_error, logtype_afpd, "malloc: %s", strerror(errno) ); goto serv_free_return; } } if (nbp_name(convname, &Obj, &Type, &Zone )) { LOG(log_error, logtype_afpd, "main: can't parse %s", options->server ); goto serv_free_return; } if (convname) free (convname); /* dup Obj, Type and Zone as they get assigned to a single internal * buffer by nbp_name */ if ((config->obj.Obj = strdup(Obj)) == NULL) goto serv_free_return; if ((config->obj.Type = strdup(Type)) == NULL) { free(config->obj.Obj); goto serv_free_return; } if ((config->obj.Zone = strdup(Zone)) == NULL) { free(config->obj.Obj); free(config->obj.Type); goto serv_free_return; } /* make sure we're not registered */ nbp_unrgstr(Obj, Type, Zone, &options->ddpaddr); if (nbp_rgstr( atp_sockaddr( atp ), Obj, Type, Zone ) < 0 ) { LOG(log_error, logtype_afpd, "Can't register %s:%s@%s", Obj, Type, Zone ); free(config->obj.Obj); free(config->obj.Type); free(config->obj.Zone); goto serv_free_return; } LOG(log_info, logtype_afpd, "%s:%s@%s started on %u.%u:%u (%s)", Obj, Type, Zone, ntohs( atp_sockaddr( atp )->sat_addr.s_net ), atp_sockaddr( atp )->sat_addr.s_node, atp_sockaddr( atp )->sat_port, VERSION ); config->fd = atp_fileno(atp); config->obj.handle = asp; config->obj.config = config; config->obj.proto = AFPPROTO_ASP; memcpy(&config->obj.options, options, sizeof(struct afp_options)); config->optcount = refcount; (*refcount)++; config->server_start = asp_start; config->server_cleanup = asp_cleanup; return config; serv_free_return: asp_close(asp); free(config); return NULL; } #endif /* no afp/asp */ static AFPConfig *DSIConfigInit(const struct afp_options *options, unsigned char *refcount, const dsi_proto protocol) { AFPConfig *config; DSI *dsi; char *p, *q; if ((config = (AFPConfig *) calloc(1, sizeof(AFPConfig))) == NULL) { LOG(log_error, logtype_afpd, "DSIConfigInit: malloc(config): %s", strerror(errno) ); return NULL; } LOG(log_debug, logtype_afpd, "DSIConfigInit: hostname: %s, ip/port: %s/%s, ", options->hostname, options->ipaddr ? options->ipaddr : "default", options->port ? options->port : "548"); if ((dsi = dsi_init(protocol, "afpd", options->hostname, options->ipaddr, options->port, options->flags & OPTION_PROXY, options->server_quantum)) == NULL) { LOG(log_error, logtype_afpd, "main: dsi_init: %s", strerror(errno) ); free(config); return NULL; } dsi->dsireadbuf = options->dsireadbuf; if (options->flags & OPTION_PROXY) { LOG(log_note, logtype_afpd, "AFP/TCP proxy initialized for %s:%d (%s)", getip_string((struct sockaddr *)&dsi->server), getip_port((struct sockaddr *)&dsi->server), VERSION); } else { LOG(log_note, logtype_afpd, "AFP/TCP started, advertising %s:%d (%s)", getip_string((struct sockaddr *)&dsi->server), getip_port((struct sockaddr *)&dsi->server), VERSION); } #ifdef USE_SRVLOC dsi->srvloc_url[0] = '\0'; /* Mark that we haven't registered. */ if (!(options->flags & OPTION_NOSLP)) { SLPError err; SLPError callbackerr; SLPHandle hslp; unsigned int afp_port; int l; char *srvloc_hostname; const char *hostname; err = SLPOpen("en", SLP_FALSE, &hslp); if (err != SLP_OK) { LOG(log_error, logtype_afpd, "DSIConfigInit: Error opening SRVLOC handle"); goto srvloc_reg_err; } /* XXX We don't want to tack on the port number if we don't have to. * Why? * Well, this seems to break MacOS < 10. If the user _really_ wants to * use a non-default port, they can, but be aware, this server might * not show up int the Network Browser. */ afp_port = getip_port((struct sockaddr *)&dsi->server); /* If specified use the FQDN to register with srvloc, otherwise use IP. */ p = NULL; if (options->fqdn) { hostname = options->fqdn; p = strchr(hostname, ':'); } else hostname = getip_string((struct sockaddr *)&dsi->server); srvloc_hostname = srvloc_encode(options, (options->server ? options->server : options->hostname)); if ((p) || afp_port == 548) { l = snprintf(dsi->srvloc_url, sizeof(dsi->srvloc_url), "afp://%s/?NAME=%s", hostname, srvloc_hostname); } else { l = snprintf(dsi->srvloc_url, sizeof(dsi->srvloc_url), "afp://%s:%d/?NAME=%s", hostname, afp_port, srvloc_hostname); } if (l == -1 || l >= (int)sizeof(dsi->srvloc_url)) { LOG(log_error, logtype_afpd, "DSIConfigInit: Hostname is too long for SRVLOC"); dsi->srvloc_url[0] = '\0'; goto srvloc_reg_err; } err = SLPReg(hslp, dsi->srvloc_url, SLP_LIFETIME_MAXIMUM, "afp", "", SLP_TRUE, SRVLOC_callback, &callbackerr); if (err != SLP_OK) { LOG(log_error, logtype_afpd, "DSIConfigInit: Error registering %s with SRVLOC", dsi->srvloc_url); dsi->srvloc_url[0] = '\0'; goto srvloc_reg_err; } if (callbackerr != SLP_OK) { LOG(log_error, logtype_afpd, "DSIConfigInit: Error in callback trying to register %s with SRVLOC", dsi->srvloc_url); dsi->srvloc_url[0] = '\0'; goto srvloc_reg_err; } LOG(log_info, logtype_afpd, "Sucessfully registered %s with SRVLOC", dsi->srvloc_url); config->server_cleanup = dsi_cleanup; srvloc_reg_err: SLPClose(hslp); } #endif /* USE_SRVLOC */ config->fd = dsi->serversock; config->obj.handle = dsi; config->obj.config = config; config->obj.proto = AFPPROTO_DSI; memcpy(&config->obj.options, options, sizeof(struct afp_options)); /* get rid of any appletalk info. we use the fact that the DSI * stuff is done after the ASP stuff. */ p = config->obj.options.server; if (p && (q = strchr(p, ':'))) *q = '\0'; config->optcount = refcount; (*refcount)++; config->server_start = dsi_start; return config; } /* allocate server configurations. this should really store the last * entry in config->last or something like that. that would make * supporting multiple dsi transports easier. */ static AFPConfig *AFPConfigInit(struct afp_options *options, const struct afp_options *defoptions) { AFPConfig *config = NULL, *next = NULL; unsigned char *refcount; if ((refcount = (unsigned char *) calloc(1, sizeof(unsigned char))) == NULL) { LOG(log_error, logtype_afpd, "AFPConfigInit: calloc(refcount): %s", strerror(errno) ); return NULL; } #ifndef NO_DDP /* handle asp transports */ if ((options->transports & AFPTRANS_DDP) && (config = ASPConfigInit(options, refcount))) config->defoptions = defoptions; #endif /* NO_DDP */ /* set signature */ set_signature(options); /* handle dsi transports and dsi proxies. we only proxy * for DSI connections. */ /* this should have something like the following: * for (i=mindsi; i < maxdsi; i++) * if (options->transports & (1 << i) && * (next = DSIConfigInit(options, refcount, i))) * next->defoptions = defoptions; */ if ((options->transports & AFPTRANS_TCP) && (((options->flags & OPTION_PROXY) == 0) || ((options->flags & OPTION_PROXY) && config)) && (next = DSIConfigInit(options, refcount, DSI_TCPIP))) next->defoptions = defoptions; /* load in all the authentication modules. we can load the same things multiple times if necessary. however, loading different things with the same names will cause complaints. by not loading in any uams with proxies, we prevent ddp connections from succeeding. */ auth_load(options->uampath, options->uamlist); /* this should be able to accept multiple dsi transports. i think * the only thing that gets affected is the net addresses. */ status_init(config, next, options); /* attach dsi config to tail of asp config */ if (config) { config->next = next; return config; } return next; } /* fill in the appropriate bits for each interface */ AFPConfig *configinit(struct afp_options *cmdline) { FILE *fp; char buf[LINESIZE + 1], *p, have_option = 0; size_t len; struct afp_options options; AFPConfig *config=NULL, *first = NULL; /* if config file doesn't exist, load defaults */ if ((fp = fopen(cmdline->configfile, "r")) == NULL) { LOG(log_debug, logtype_afpd, "ConfigFile %s not found, assuming defaults", cmdline->configfile); return AFPConfigInit(cmdline, cmdline); } /* scan in the configuration file */ len = 0; while (!feof(fp)) { if (!fgets(&buf[len], LINESIZE - len, fp) || buf[len] == '#') continue; len = strlen(buf); if ( len >= 2 && buf[len-2] == '\\' ) { len -= 2; continue; } else len = 0; /* a little pre-processing to get rid of spaces and end-of-lines */ p = buf; while (p && isspace(*p)) p++; if (!p || (*p == '\0')) continue; have_option = 1; memcpy(&options, cmdline, sizeof(options)); if (!afp_options_parseline(p, &options)) continue; /* AFPConfigInit can return two linked configs due to DSI and ASP */ if (!first) { if ((first = AFPConfigInit(&options, cmdline))) config = first->next ? first->next : first; } else if ((config->next = AFPConfigInit(&options, cmdline))) { config = config->next->next ? config->next->next : config->next; } } #ifdef HAVE_LDAP /* Parse afp_ldap.conf */ acl_ldap_readconfig(_PATH_ACL_LDAPCONF); #endif /* HAVE_LDAP */ LOG(log_debug, logtype_afpd, "Finished parsing Config File"); fclose(fp); if (!have_option) first = AFPConfigInit(cmdline, cmdline); /* Now register with zeroconf, we also need the volumes for that */ if (! (first->obj.options.flags & OPTION_NOZEROCONF)) { load_volumes(&first->obj); zeroconf_register(first); } return first; } netatalk-2.2.2/etc/afpd/acl_mappings.h0000644000175200017500000000672711655731126014561 00000000000000/* Copyright (c) 2008,2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef ACL_MAPPINGS #define ACL_MAPPINGS #ifdef HAVE_SOLARIS_ACLS #include #endif #include "acls.h" /* * Stuff for mapping between ACL implementations */ /* Solaris 10u8 still hasn't got ACE_INHERITED_ACE */ #ifndef ACE_INHERITED_ACE #define ACE_INHERITED_ACE 0x0080 #endif struct ace_rights_map { u_int32_t from; u_int32_t to; }; #ifdef HAVE_SOLARIS_ACLS struct ace_rights_map nfsv4_to_darwin_rights[] = { {ACE_READ_DATA, DARWIN_ACE_READ_DATA}, {ACE_WRITE_DATA, DARWIN_ACE_WRITE_DATA}, {ACE_APPEND_DATA, DARWIN_ACE_APPEND_DATA}, {ACE_READ_NAMED_ATTRS, DARWIN_ACE_READ_EXTATTRIBUTES}, {ACE_WRITE_NAMED_ATTRS, DARWIN_ACE_WRITE_EXTATTRIBUTES}, {ACE_EXECUTE, DARWIN_ACE_EXECUTE}, {ACE_DELETE_CHILD, DARWIN_ACE_DELETE_CHILD}, {ACE_READ_ATTRIBUTES, DARWIN_ACE_READ_ATTRIBUTES}, {ACE_WRITE_ATTRIBUTES, DARWIN_ACE_WRITE_ATTRIBUTES}, {ACE_DELETE, DARWIN_ACE_DELETE}, {ACE_READ_ACL, DARWIN_ACE_READ_SECURITY}, {ACE_WRITE_ACL, DARWIN_ACE_WRITE_SECURITY}, {ACE_WRITE_OWNER, DARWIN_ACE_TAKE_OWNERSHIP}, {0,0} }; struct ace_rights_map darwin_to_nfsv4_rights[] = { {DARWIN_ACE_READ_DATA, ACE_READ_DATA}, {DARWIN_ACE_WRITE_DATA, ACE_WRITE_DATA}, {DARWIN_ACE_APPEND_DATA, ACE_APPEND_DATA}, {DARWIN_ACE_READ_EXTATTRIBUTES, ACE_READ_NAMED_ATTRS}, {DARWIN_ACE_WRITE_EXTATTRIBUTES, ACE_WRITE_NAMED_ATTRS}, {DARWIN_ACE_EXECUTE, ACE_EXECUTE}, {DARWIN_ACE_DELETE_CHILD, ACE_DELETE_CHILD}, {DARWIN_ACE_READ_ATTRIBUTES, ACE_READ_ATTRIBUTES}, {DARWIN_ACE_WRITE_ATTRIBUTES, ACE_WRITE_ATTRIBUTES}, {DARWIN_ACE_DELETE, ACE_DELETE}, {DARWIN_ACE_READ_SECURITY, ACE_READ_ACL}, {DARWIN_ACE_WRITE_SECURITY, ACE_WRITE_ACL}, {DARWIN_ACE_TAKE_OWNERSHIP, ACE_WRITE_OWNER}, {0,0} }; struct nfsv4_to_darwin_flags_map { u_int16_t from; u_int32_t to; }; struct nfsv4_to_darwin_flags_map nfsv4_to_darwin_flags[] = { {ACE_FILE_INHERIT_ACE, DARWIN_ACE_FLAGS_FILE_INHERIT}, {ACE_DIRECTORY_INHERIT_ACE, DARWIN_ACE_FLAGS_DIRECTORY_INHERIT}, {ACE_NO_PROPAGATE_INHERIT_ACE, DARWIN_ACE_FLAGS_LIMIT_INHERIT}, {ACE_INHERIT_ONLY_ACE, DARWIN_ACE_FLAGS_ONLY_INHERIT}, {ACE_INHERITED_ACE, DARWIN_ACE_FLAGS_INHERITED}, {0,0} }; struct darwin_to_nfsv4_flags_map { u_int32_t from; u_int16_t to; }; struct darwin_to_nfsv4_flags_map darwin_to_nfsv4_flags[] = { {DARWIN_ACE_FLAGS_FILE_INHERIT, ACE_FILE_INHERIT_ACE}, {DARWIN_ACE_FLAGS_DIRECTORY_INHERIT, ACE_DIRECTORY_INHERIT_ACE}, {DARWIN_ACE_FLAGS_LIMIT_INHERIT, ACE_NO_PROPAGATE_INHERIT_ACE}, {DARWIN_ACE_FLAGS_ONLY_INHERIT, ACE_INHERIT_ONLY_ACE}, {DARWIN_ACE_FLAGS_INHERITED, ACE_INHERITED_ACE}, {0,0} }; #endif /* HAVE_SOLARIS_ACLS */ #endif /* ACL_MAPPINGS */ netatalk-2.2.2/etc/afpd/directory.c0000644000175200017500000024404111661233023014102 00000000000000/* * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "directory.h" #include "dircache.h" #include "desktop.h" #include "volume.h" #include "fork.h" #include "file.h" #include "filedir.h" #include "unix.h" #include "mangle.h" #include "hash.h" /* * FIXMEs, loose ends after the dircache rewrite: * o merge dircache_search_by_name and dir_add ?? * o case-insensitivity is gone from cname */ /******************************************************************************************* * Globals ******************************************************************************************/ int afp_errno; /* As long as directory.c hasn't got its own init call, this get initialized in dircache_init */ struct dir rootParent = { NULL, NULL, NULL, NULL, /* path, d_m_name, d_u_name, d_m_name_ucs2 */ NULL, 0, 0, /* qidx_node, ctime, d_flags */ 0, 0, 0, 0 /* pdid, did, offcnt, d_vid */ }; struct dir *curdir = &rootParent; struct path Cur_Path = { 0, "", /* mac name */ ".", /* unix name */ 0, /* id */ NULL,/* struct dir * */ 0, /* stat is not set */ 0, /* errno */ {0} /* struct stat */ }; /* * dir_remove queues struct dirs to be freed here. We can't just delete them immeidately * eg in dircache_search_by_id, because a caller somewhere up the stack might be * referencing it. * So instead: * - we mark it as invalid by setting d_did to CNID_INVALID (ie 0) * - queue it in "invalid_dircache_entries" queue * - which is finally freed at the end of every AFP func in afp_dsi.c. */ q_t *invalid_dircache_entries; /******************************************************************************************* * Locals ******************************************************************************************/ /* ------------------------- appledouble mkdir afp error code. */ static int netatalk_mkdir(const struct vol *vol, const char *name) { int ret; struct stat st; if (vol->v_flags & AFPVOL_UNIX_PRIV) { if (lstat(".", &st) < 0) return AFPERR_MISC; int mode = (DIRBITS & (~S_ISGID & st.st_mode)) | (0777 & ~vol->v_umask); LOG(log_maxdebug, logtype_afpd, "netatalk_mkdir(\"%s\") {parent mode: %04o, vol umask: %04o}", name, st.st_mode, vol->v_umask); ret = mkdir(name, mode); } else { ret = ad_mkdir(name, DIRBITS | 0777); } if (ret < 0) { switch ( errno ) { case ENOENT : return( AFPERR_NOOBJ ); case EROFS : return( AFPERR_VLOCK ); case EPERM: case EACCES : return( AFPERR_ACCESS ); case EEXIST : return( AFPERR_EXIST ); case ENOSPC : case EDQUOT : return( AFPERR_DFULL ); default : return( AFPERR_PARAM ); } } return AFP_OK; } /* ------------------- */ static int deletedir(int dirfd, char *dir) { char path[MAXPATHLEN + 1]; DIR *dp; struct dirent *de; struct stat st; size_t len; int err = AFP_OK; size_t remain; if ((len = strlen(dir)) +2 > sizeof(path)) return AFPERR_PARAM; /* already gone */ if ((dp = opendirat(dirfd, dir)) == NULL) return AFP_OK; strcpy(path, dir); strcat(path, "/"); len++; remain = sizeof(path) -len -1; while ((de = readdir(dp)) && err == AFP_OK) { /* skip this and previous directory */ if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, "..")) continue; if (strlen(de->d_name) > remain) { err = AFPERR_PARAM; break; } strcpy(path + len, de->d_name); if (lstatat(dirfd, path, &st)) { continue; } if (S_ISDIR(st.st_mode)) { err = deletedir(dirfd, path); } else { err = netatalk_unlinkat(dirfd, path); } } closedir(dp); /* okay. the directory is empty. delete it. note: we already got rid of .AppleDouble. */ if (err == AFP_OK) { err = netatalk_rmdir(dirfd, dir); } return err; } /* do a recursive copy. */ static int copydir(const struct vol *vol, int dirfd, char *src, char *dst) { char spath[MAXPATHLEN + 1], dpath[MAXPATHLEN + 1]; DIR *dp; struct dirent *de; struct stat st; struct utimbuf ut; size_t slen, dlen; size_t srem, drem; int err; /* doesn't exist or the path is too long. */ if (((slen = strlen(src)) > sizeof(spath) - 2) || ((dlen = strlen(dst)) > sizeof(dpath) - 2) || ((dp = opendirat(dirfd, src)) == NULL)) return AFPERR_PARAM; /* try to create the destination directory */ if (AFP_OK != (err = netatalk_mkdir(vol, dst)) ) { closedir(dp); return err; } /* set things up to copy */ strcpy(spath, src); strcat(spath, "/"); slen++; srem = sizeof(spath) - slen -1; strcpy(dpath, dst); strcat(dpath, "/"); dlen++; drem = sizeof(dpath) - dlen -1; err = AFP_OK; while ((de = readdir(dp))) { /* skip this and previous directory */ if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, "..")) continue; if (strlen(de->d_name) > srem) { err = AFPERR_PARAM; break; } strcpy(spath + slen, de->d_name); if (lstatat(dirfd, spath, &st) == 0) { if (strlen(de->d_name) > drem) { err = AFPERR_PARAM; break; } strcpy(dpath + dlen, de->d_name); if (S_ISDIR(st.st_mode)) { if (AFP_OK != (err = copydir(vol, dirfd, spath, dpath))) goto copydir_done; } else if (AFP_OK != (err = copyfile(vol, vol, dirfd, spath, dpath, NULL, NULL))) { goto copydir_done; } else { /* keep the same time stamp. */ ut.actime = ut.modtime = st.st_mtime; utime(dpath, &ut); } } } /* keep the same time stamp. */ if (lstatat(dirfd, src, &st) == 0) { ut.actime = ut.modtime = st.st_mtime; utime(dst, &ut); } copydir_done: closedir(dp); return err; } /* --------------------- * is our cached offspring count valid? */ static int diroffcnt(struct dir *dir, struct stat *st) { return st->st_ctime == dir->d_ctime; } /* --------------------- */ static int invisible_dots(const struct vol *vol, const char *name) { return vol_inv_dots(vol) && *name == '.' && strcmp(name, ".") && strcmp(name, ".."); } /* ------------------ */ static int set_dir_errors(struct path *path, const char *where, int err) { switch ( err ) { case EPERM : case EACCES : return AFPERR_ACCESS; case EROFS : return AFPERR_VLOCK; } LOG(log_error, logtype_afpd, "setdirparam(%s): %s: %s", fullpathname(path->u_name), where, strerror(err) ); return AFPERR_PARAM; } /*! * @brief Convert name in client encoding to server encoding * * Convert ret->m_name to ret->u_name from client encoding to server encoding. * This only gets called from cname(). * * @returns 0 on success, -1 on error * * @note If the passed ret->m_name is mangled, we'll demangle it */ static int cname_mtouname(const struct vol *vol, const struct dir *dir, struct path *ret, int toUTF8) { static char temp[ MAXPATHLEN + 1]; char *t; cnid_t fileid = 0; if (afp_version >= 30) { if (toUTF8) { if (dir->d_did == DIRDID_ROOT_PARENT) { /* * With uft8 volume name is utf8-mac, but requested path may be a mangled longname. See #2611981. * So we compare it with the longname from the current volume and if they match * we overwrite the requested path with the utf8 volume name so that the following * strcmp can match. */ ucs2_to_charset(vol->v_maccharset, vol->v_macname, temp, AFPVOL_MACNAMELEN + 1); if (strcasecmp(ret->m_name, temp) == 0) ucs2_to_charset(CH_UTF8_MAC, vol->v_u8mname, ret->m_name, AFPVOL_U8MNAMELEN); } else { /* toUTF8 */ if (mtoUTF8(vol, ret->m_name, strlen(ret->m_name), temp, MAXPATHLEN) == (size_t)-1) { afp_errno = AFPERR_PARAM; return -1; } strcpy(ret->m_name, temp); } } /* check for OS X mangled filename :( */ t = demangle_osx(vol, ret->m_name, dir->d_did, &fileid); LOG(log_maxdebug, logtype_afpd, "cname_mtouname('%s',did:%u) {demangled:'%s', fileid:%u}", ret->m_name, ntohl(dir->d_did), t, ntohl(fileid)); if (t != ret->m_name) { ret->u_name = t; /* duplicate work but we can't reuse all convert_char we did in demangle_osx * flags weren't the same */ if ( (t = utompath(vol, ret->u_name, fileid, utf8_encoding())) ) { /* at last got our view of mac name */ strcpy(ret->m_name, t); } } } /* afp_version >= 30 */ /* If we haven't got it by now, get it */ if (ret->u_name == NULL) { if ((ret->u_name = mtoupath(vol, ret->m_name, dir->d_did, utf8_encoding())) == NULL) { afp_errno = AFPERR_PARAM; return -1; } } return 0; } /*! * @brief Build struct path from struct dir * * The final movecwd in cname failed, possibly with EPERM or ENOENT. We: * 1. move cwd into parent dir (we're often already there, but not always) * 2. set struct path to the dirname * 3. in case of * AFPERR_ACCESS: the dir is there, we just cant chdir into it * AFPERR_NOOBJ: the dir was there when we stated it in cname, so we have a race * 4. indicate there's no dir for this path * 5. remove the dir */ static struct path *path_from_dir(struct vol *vol, struct dir *dir, struct path *ret) { if (dir->d_did == DIRDID_ROOT_PARENT || dir->d_did == DIRDID_ROOT) return NULL; switch (afp_errno) { case AFPERR_ACCESS: if (movecwd( vol, dirlookup(vol, dir->d_pdid)) < 0 ) /* 1 */ return NULL; memcpy(ret->m_name, cfrombstr(dir->d_m_name), blength(dir->d_m_name) + 1); /* 3 */ if (dir->d_m_name == dir->d_u_name) { ret->u_name = ret->m_name; } else { ret->u_name = ret->m_name + blength(dir->d_m_name) + 1; memcpy(ret->u_name, cfrombstr(dir->d_u_name), blength(dir->d_u_name) + 1); } ret->d_dir = dir; LOG(log_debug, logtype_afpd, "cname('%s') {path-from-dir: AFPERR_ACCESS. curdir:'%s', path:'%s'}", cfrombstr(dir->d_fullpath), cfrombstr(curdir->d_fullpath), ret->u_name); return ret; case AFPERR_NOOBJ: if (movecwd(vol, dirlookup(vol, dir->d_pdid)) < 0 ) /* 1 */ return NULL; memcpy(ret->m_name, cfrombstr(dir->d_m_name), blength(dir->d_m_name) + 1); if (dir->d_m_name == dir->d_u_name) { ret->u_name = ret->m_name; } else { ret->u_name = ret->m_name + blength(dir->d_m_name) + 1; memcpy(ret->u_name, cfrombstr(dir->d_u_name), blength(dir->d_u_name) + 1); } ret->d_dir = NULL; /* 4 */ dir_remove(vol, dir); /* 5 */ return ret; default: return NULL; } /* DEADC0DE: never get here */ return NULL; } /********************************************************************************************* * Interface ********************************************************************************************/ int get_afp_errno(const int param) { if (afp_errno != AFPERR_DID1) return afp_errno; return param; } /*! * Resolve struct dir for an absolute path * * Given a path like "/Volumes/volume/dir/subdir" in a volume "/Volumes/volume" return * a pointer to struct dir of "subdir". * 1. Remove volue path from absolute path * 2. start path * 3. loop through all elements of the remaining path from 1. * 4. we only allow dirs * 5. search dircache * 6. if not found in the dircache query the CNID database for the DID * 7. and use dirlookup to resolve the DID to a it's struct dir * * * @param vol (r) volume the path is in, must be known * @param path (r) absoule path * * @returns pointer to struct dir or NULL on error */ struct dir *dirlookup_bypath(const struct vol *vol, const char *path) { EC_INIT; struct dir *dir = NULL; cnid_t cnid, did; bstring rpath = NULL; bstring statpath = NULL; struct bstrList *l = NULL; struct stat st; cnid = htonl(2); dir = vol->v_root; LOG(log_debug, logtype_afpd, "dirlookup_bypath(\"%s\")", path); if (strcmp(vol->v_path, path) == 0) return dir; EC_NULL(rpath = rel_path_in_vol(path, vol->v_path)); /* 1. */ LOG(log_debug, logtype_afpd, "dirlookup_bypath: rpath: \"%s\"", cfrombstr(rpath)); EC_NULL(statpath = bfromcstr(vol->v_path)); /* 2. */ l = bsplit(rpath, '/'); for (int i = 0; i < l->qty ; i++) { /* 3. */ did = cnid; EC_ZERO(bcatcstr(statpath, "/")); EC_ZERO(bconcat(statpath, l->entry[i])); LOG(log_debug, logtype_afpd, "dirlookup_bypath: statpath: \"%s\"", cfrombstr(statpath)); EC_ZERO_LOGSTR(lstat(cfrombstr(statpath), &st), "lstat(rpath: %s, elem: %s): %s: %s", cfrombstr(rpath), cfrombstr(l->entry[i]), cfrombstr(statpath), strerror(errno)); if (!(S_ISDIR(st.st_mode))) /* 4. */ EC_FAIL; if ((dir = dircache_search_by_name(vol, /* 5. */ dir, cfrombstr(l->entry[i]), blength(l->entry[i]))) == NULL) { if ((cnid = cnid_add(vol->v_cdb, /* 6. */ &st, did, cfrombstr(l->entry[i]), blength(l->entry[i]), 0)) == CNID_INVALID) EC_FAIL; if ((dir = dirlookup(vol, cnid)) == NULL) /* 7. */ EC_FAIL; } } EC_CLEANUP: bdestroy(rpath); bstrListDestroy(l); bdestroy(statpath); if (ret != 0) return NULL; LOG(log_debug, logtype_afpd, "dirlookup_bypath: result: \"%s\"", cfrombstr(dir->d_fullpath)); return dir; } /*! * @brief Resolve a DID * * Resolve a DID, allocate a struct dir for it * 1. Check for special CNIDs 0 (invalid), 1 and 2. * 2a. Check if the DID is in the cache. * 2b. Check if it's really a dir because we cache files too. * 3. If it's not in the cache resolve it via the database. * 4. Build complete server-side path to the dir. * 5. Check if it exists and is a directory. * 6. Create the struct dir and populate it. * 7. Add it to the cache. * * @param vol (r) pointer to struct vol * @param did (r) DID to resolve * * @returns pointer to struct dir */ struct dir *dirlookup(const struct vol *vol, cnid_t did) { static char buffer[12 + MAXPATHLEN + 1]; struct stat st; struct dir *ret = NULL, *pdir; bstring fullpath = NULL; char *upath = NULL, *mpath; cnid_t cnid, pdid; size_t maxpath; int buflen = 12 + MAXPATHLEN + 1; int utf8; int err = 0; LOG(log_debug, logtype_afpd, "dirlookup(did: %u): START", ntohl(did)); /* check for did 0, 1 and 2 */ if (did == 0 || vol == NULL) { /* 1 */ afp_errno = AFPERR_PARAM; ret = NULL; goto exit; } else if (did == DIRDID_ROOT_PARENT) { rootParent.d_vid = vol->v_vid; ret = &rootParent; goto exit; } else if (did == DIRDID_ROOT) { ret = vol->v_root; goto exit; } /* Search the cache */ if ((ret = dircache_search_by_did(vol, did)) != NULL) { /* 2a */ if (ret->d_flags & DIRF_ISFILE) { /* 2b */ afp_errno = AFPERR_BADTYPE; ret = NULL; goto exit; } if (lstat(cfrombstr(ret->d_fullpath), &st) != 0) { LOG(log_debug, logtype_afpd, "dirlookup(did: %u, path: \"%s\"): lstat: %s", ntohl(did), cfrombstr(ret->d_fullpath), strerror(errno)); switch (errno) { case ENOENT: case ENOTDIR: /* It's not there anymore, so remove it */ LOG(log_debug, logtype_afpd, "dirlookup(did: %u): calling dir_remove", ntohl(did)); dir_remove(vol, ret); afp_errno = AFPERR_NOOBJ; ret = NULL; goto exit; default: ret = ret; goto exit; } /* DEADC0DE */ ret = NULL; goto exit; } ret = ret; goto exit; } utf8 = utf8_encoding(); maxpath = (utf8) ? MAXPATHLEN - 7 : 255; /* Get it from the database */ cnid = did; LOG(log_debug, logtype_afpd, "dirlookup(did: %u): querying CNID database", ntohl(did)); if ((upath = cnid_resolve(vol->v_cdb, &cnid, buffer, buflen)) == NULL) { afp_errno = AFPERR_NOOBJ; err = 1; goto exit; } if ((upath = strdup(upath)) == NULL) { /* 3 */ afp_errno = AFPERR_NOOBJ; err = 1; goto exit; } pdid = cnid; /* * Recurse up the tree, terminates in dirlookup when either * - DIRDID_ROOT is hit * - a cached entry is found */ LOG(log_debug, logtype_afpd, "dirlookup(did: %u): recursion for did: %u", ntohl(did), ntohl(pdid)); if ((pdir = dirlookup(vol, pdid)) == NULL) { err = 1; goto exit; } /* build the fullpath */ if ((fullpath = bstrcpy(pdir->d_fullpath)) == NULL || bconchar(fullpath, '/') != BSTR_OK || bcatcstr(fullpath, upath) != BSTR_OK) { err = 1; goto exit; } /* stat it and check if it's a dir */ LOG(log_debug, logtype_afpd, "dirlookup(did: %u): stating \"%s\"", ntohl(did), cfrombstr(fullpath)); if (lstat(cfrombstr(fullpath), &st) != 0) { /* 5a */ switch (errno) { case ENOENT: afp_errno = AFPERR_NOOBJ; err = 1; goto exit; case EPERM: afp_errno = AFPERR_ACCESS; err = 1; goto exit; default: afp_errno = AFPERR_MISC; err = 1; goto exit; } } else { if ( ! S_ISDIR(st.st_mode)) { /* 5b */ afp_errno = AFPERR_BADTYPE; err = 1; goto exit; } } /* Get macname from unix name */ if ( (mpath = utompath(vol, upath, did, utf8)) == NULL ) { afp_errno = AFPERR_NOOBJ; err = 1; goto exit; } /* Create struct dir */ if ((ret = dir_new(mpath, upath, vol, pdid, did, fullpath, &st)) == NULL) { /* 6 */ LOG(log_error, logtype_afpd, "dirlookup(did: %u) {%s, %s}: %s", ntohl(did), mpath, upath, strerror(errno)); err = 1; goto exit; } /* Add it to the cache only if it's a dir */ if (dircache_add(vol, ret) != 0) { /* 7 */ err = 1; goto exit; } exit: if (upath) free(upath); if (err) { LOG(log_debug, logtype_afpd, "dirlookup(did: %u) {exit_error: %s}", ntohl(did), AfpErr2name(afp_errno)); if (fullpath) bdestroy(fullpath); if (ret) { dir_free(ret); ret = NULL; } } if (ret) LOG(log_debug, logtype_afpd, "dirlookup(did: %u): RESULT: pdid: %u, path: \"%s\"", ntohl(ret->d_did), ntohl(ret->d_pdid), cfrombstr(ret->d_fullpath)); return ret; } #define ENUMVETO "./../Network Trash Folder/TheVolumeSettingsFolder/TheFindByContentFolder/:2eDS_Store/Contents/Desktop Folder/Trash/Benutzer/" int caseenumerate(const struct vol *vol, struct path *path, struct dir *dir) { DIR *dp; struct dirent *de; int ret; static u_int32_t did = 0; static char cname[MAXPATHLEN]; static char lname[MAXPATHLEN]; ucs2_t u2_path[MAXPATHLEN]; ucs2_t u2_dename[MAXPATHLEN]; char *tmp, *savepath; if (!(vol->v_flags & AFPVOL_CASEINSEN)) return -1; if (veto_file(ENUMVETO, path->u_name)) return -1; savepath = path->u_name; /* very simple cache */ if ( dir->d_did == did && strcmp(lname, path->u_name) == 0) { path->u_name = cname; path->d_dir = NULL; if (of_stat( path ) == 0 ) { return 0; } /* something changed, we cannot stat ... */ did = 0; } if (NULL == ( dp = opendir( "." )) ) { LOG(log_debug, logtype_afpd, "caseenumerate: opendir failed: %s", dir->d_u_name); return -1; } /* LOG(log_debug, logtype_afpd, "caseenumerate: for %s", path->u_name); */ if ((size_t) -1 == convert_string(vol->v_volcharset, CH_UCS2, path->u_name, -1, u2_path, sizeof(u2_path)) ) LOG(log_debug, logtype_afpd, "caseenumerate: conversion failed for %s", path->u_name); /*LOG(log_debug, logtype_afpd, "caseenumerate: dir: %s, path: %s", dir->d_u_name, path->u_name); */ ret = -1; for ( de = readdir( dp ); de != NULL; de = readdir( dp )) { if (NULL == check_dirent(vol, de->d_name)) continue; if ((size_t) -1 == convert_string(vol->v_volcharset, CH_UCS2, de->d_name, -1, u2_dename, sizeof(u2_dename)) ) continue; if (strcasecmp_w( u2_path, u2_dename) == 0) { tmp = path->u_name; strlcpy(cname, de->d_name, sizeof(cname)); path->u_name = cname; path->d_dir = NULL; if (of_stat( path ) == 0 ) { LOG(log_debug, logtype_afpd, "caseenumerate: using dir: %s, path: %s", de->d_name, path->u_name); strlcpy(lname, tmp, sizeof(lname)); did = dir->d_did; ret = 0; break; } else path->u_name = tmp; } } closedir(dp); if (ret) { /* invalidate cache */ cname[0] = 0; did = 0; path->u_name = savepath; } /* LOG(log_debug, logtype_afpd, "caseenumerate: path on ret: %s", path->u_name); */ return ret; } /*! * @brief Construct struct dir * * Construct struct dir from parameters. * * @param m_name (r) directory name in UTF8-dec * @param u_name (r) directory name in server side encoding * @param vol (r) pointer to struct vol * @param pdid (r) Parent CNID * @param did (r) CNID * @param path (r) Full unix path to object * @param st (r) struct stat of object * * @returns pointer to new struct dir or NULL on error * * @note Most of the time mac name and unix name are the same. */ struct dir *dir_new(const char *m_name, const char *u_name, const struct vol *vol, cnid_t pdid, cnid_t did, bstring path, struct stat *st) { struct dir *dir; dir = (struct dir *) calloc(1, sizeof( struct dir )); if (!dir) return NULL; if ((dir->d_m_name = bfromcstr(m_name)) == NULL) { free(dir); return NULL; } if (convert_string_allocate( (utf8_encoding()) ? CH_UTF8_MAC : vol->v_maccharset, CH_UCS2, m_name, -1, (char **)&dir->d_m_name_ucs2) == (size_t)-1 ) { LOG(log_error, logtype_afpd, "dir_new(did: %u) {%s, %s}: couldn't set UCS2 name", ntohl(did), m_name, u_name); dir->d_m_name_ucs2 = NULL; } if (m_name == u_name || !strcmp(m_name, u_name)) { dir->d_u_name = dir->d_m_name; } else if ((dir->d_u_name = bfromcstr(u_name)) == NULL) { bdestroy(dir->d_m_name); free(dir); return NULL; } dir->d_did = did; dir->d_pdid = pdid; dir->d_vid = vol->v_vid; dir->d_fullpath = path; dir->dcache_ctime = st->st_ctime; dir->dcache_ino = st->st_ino; if (!S_ISDIR(st->st_mode)) dir->d_flags = DIRF_ISFILE; dir->d_rights_cache = 0xffffffff; return dir; } /*! * @brief Free a struct dir and all its members * * @param (rw) pointer to struct dir */ void dir_free(struct dir *dir) { if (dir->d_u_name != dir->d_m_name) { bdestroy(dir->d_u_name); } if (dir->d_m_name_ucs2) free(dir->d_m_name_ucs2); bdestroy(dir->d_m_name); bdestroy(dir->d_fullpath); free(dir); } /*! * @brief Create struct dir from struct path * * Create a new struct dir from struct path. Then add it to the cache. * * 1. Open adouble file, get CNID from it. * 2. Search the database, hinting with the CNID from (1). * 3. Build fullpath and create struct dir. * 4. Add it to the cache. * * @param vol (r) pointer to struct vol, possibly modified in callee * @param dir (r) pointer to parrent directory * @param path (rw) pointer to struct path with valid path->u_name * @param len (r) strlen of path->u_name * * @returns Pointer to new struct dir or NULL on error. * * @note Function also assigns path->m_name from path->u_name. */ struct dir *dir_add(struct vol *vol, const struct dir *dir, struct path *path, int len) { int err = 0; struct dir *cdir = NULL; cnid_t id; struct adouble ad; struct adouble *adp = NULL; bstring fullpath; AFP_ASSERT(vol); AFP_ASSERT(dir); AFP_ASSERT(path); AFP_ASSERT(len > 0); if ((cdir = dircache_search_by_name(vol, dir, path->u_name, strlen(path->u_name))) != NULL) { /* there's a stray entry in the dircache */ LOG(log_debug, logtype_afpd, "dir_add(did:%u,'%s/%s'): {stray cache entry: did:%u,'%s', removing}", ntohl(dir->d_did), cfrombstr(dir->d_fullpath), path->u_name, ntohl(cdir->d_did), cfrombstr(dir->d_fullpath)); if (dir_remove(vol, cdir) != 0) { dircache_dump(); AFP_PANIC("dir_add"); } } /* get_id needs adp for reading CNID from adouble file */ ad_init(&ad, vol->v_adouble, vol->v_ad_options); if ((ad_open_metadata(path->u_name, ADFLAGS_DIR, 0, &ad)) == 0) /* 1 */ adp = &ad; /* Get CNID */ if ((id = get_id(vol, adp, &path->st, dir->d_did, path->u_name, len)) == 0) { /* 2 */ err = 1; goto exit; } if (adp) ad_close_metadata(adp); /* Get macname from unixname */ if (path->m_name == NULL) { if ((path->m_name = utompath(vol, path->u_name, id, utf8_encoding())) == NULL) { LOG(log_error, logtype_afpd, "dir_add(\"%s\"): can't assign macname", path->u_name); err = 2; goto exit; } } /* Build fullpath */ if ( ((fullpath = bstrcpy(dir->d_fullpath)) == NULL) /* 3 */ || (bconchar(fullpath, '/') != BSTR_OK) || (bcatcstr(fullpath, path->u_name)) != BSTR_OK) { LOG(log_error, logtype_afpd, "dir_add: fullpath: %s", strerror(errno) ); err = 3; goto exit; } /* Allocate and initialize struct dir */ if ((cdir = dir_new(path->m_name, path->u_name, vol, dir->d_did, id, fullpath, &path->st)) == NULL) { /* 3 */ err = 4; goto exit; } if ((dircache_add(vol, cdir)) != 0) { /* 4 */ LOG(log_error, logtype_afpd, "dir_add: fatal dircache error: %s", cfrombstr(fullpath)); exit(EXITERR_SYS); } exit: if (err != 0) { LOG(log_debug, logtype_afpd, "dir_add('%s/%s'): error: %u", cfrombstr(dir->d_u_name), path->u_name, err); if (adp) ad_close_metadata(adp); if (!cdir && fullpath) bdestroy(fullpath); if (cdir) dir_free(cdir); cdir = NULL; } else { /* no error */ LOG(log_debug, logtype_afpd, "dir_add(did:%u,'%s/%s'): {cached: %u,'%s'}", ntohl(dir->d_did), cfrombstr(dir->d_fullpath), path->u_name, ntohl(cdir->d_did), cfrombstr(cdir->d_fullpath)); } return(cdir); } /*! * Free the queue with invalid struct dirs * * This gets called at the end of every AFP func. */ void dir_free_invalid_q(void) { struct dir *dir; while (dir = (struct dir *)dequeue(invalid_dircache_entries)) dir_free(dir); } /*! * @brief Remove a dir from a cache and queue it for freeing * * 1. Check if the dir is locked or has opened forks * 2. Remove it from the cache * 3. Queue it for removal * 4. If it's a request to remove curdir, mark curdir as invalid * 5. Mark it as invalid * * @param (r) pointer to struct vol * @param (rw) pointer to struct dir */ int dir_remove(const struct vol *vol, struct dir *dir) { AFP_ASSERT(vol); AFP_ASSERT(dir); if (dir->d_did == DIRDID_ROOT_PARENT || dir->d_did == DIRDID_ROOT) return 0; LOG(log_debug, logtype_afpd, "dir_remove(did:%u,'%s'): {removing}", ntohl(dir->d_did), cfrombstr(dir->d_u_name)); dircache_remove(vol, dir, DIRCACHE | DIDNAME_INDEX | QUEUE_INDEX); /* 2 */ enqueue(invalid_dircache_entries, dir); /* 3 */ if (curdir == dir) /* 4 */ curdir = NULL; dir->d_did = CNID_INVALID; /* 5 */ return 0; } #if 0 /* unused */ /*! * @brief Modify a struct dir, adjust cache * * Any value that is 0 or NULL is not changed. If new_uname is NULL it is set to new_mname. * If given new_uname == new_mname, new_uname will point to new_mname. * * @param vol (r) pointer to struct vol * @param dir (rw) pointer to struct dir * @param pdid (r) new parent DID * @param did (r) new DID * @param new_mname (r) new mac-name * @param new_uname (r) new unix-name * @param pdir_fullpath (r) new fullpath of parent dir */ int dir_modify(const struct vol *vol, struct dir *dir, cnid_t pdid, cnid_t did, const char *new_mname, const char *new_uname, bstring pdir_fullpath) { int ret = 0; /* Remove it from the cache */ dircache_remove(vol, dir, DIRCACHE | DIDNAME_INDEX | QUEUE_INDEX); if (pdid) dir->d_pdid = pdid; if (did) dir->d_did = did; if (new_mname) { /* free uname if it's not the same as mname */ if (dir->d_m_name != dir->d_u_name) bdestroy(dir->d_u_name); if (new_uname == NULL) new_uname = new_mname; /* assign new name */ if ((bassigncstr(dir->d_m_name, new_mname)) != BSTR_OK) { LOG(log_error, logtype_afpd, "dir_modify: bassigncstr: %s", strerror(errno) ); return -1; } if (new_mname == new_uname || (strcmp(new_mname, new_uname) == 0)) { dir->d_u_name = dir->d_m_name; } else { if ((dir->d_u_name = bfromcstr(new_uname)) == NULL) { LOG(log_error, logtype_afpd, "dir_modify: bassigncstr: %s", strerror(errno) ); return -1; } } } if (pdir_fullpath) { if (bassign(dir->d_fullpath, pdir_fullpath) != BSTR_OK) return -1; if (bcatcstr(dir->d_fullpath, "/") != BSTR_OK) return -1; if (bcatcstr(dir->d_fullpath, new_uname) != BSTR_OK) return -1; } if (dir->d_m_name_ucs2) free(dir->d_m_name_ucs2); if ((size_t)-1 == convert_string_allocate((utf8_encoding())?CH_UTF8_MAC:vol->v_maccharset, CH_UCS2, dir->d_m_name, -1, (char**)&dir->d_m_name_ucs2)) dir->d_m_name_ucs2 = NULL; /* Re-add it to the cache */ if ((dircache_add(vol, dir)) != 0) { dircache_dump(); AFP_PANIC("dir_modify"); } return ret; } #endif /*! * @brief Resolve a catalog node name path * * 1. Evaluate path type * 2. Move to start dir, if we cant, it might eg because of EACCES, build * path from dirname, so eg getdirparams has sth it can chew on. curdir * is dir parent then. All this is done in path_from_dir(). * 3. Parse next cnode name in path, cases: * 4. single "\0" -> do nothing * 5. two or more consecutive "\0" -> chdir("..") one or more times * 6. cnode name -> copy it to path.m_name * 7. Get unix name from mac name * 8. Special handling of request with did 1 * 9. stat the cnode name * 10. If it's not there, it's probably an afp_createfile|dir, * return with curdir = dir parent, struct path = dirname * 11. If it's there and it's a file, it must should be the last element of the requested * path. Return with curdir = cnode name parent dir, struct path = filename * 12. Treat symlinks like files, dont follow them * 13. If it's a dir: * 14. Search the dircache for it * 15. If it's not in the cache, create a struct dir for it and add it to the cache * 16. chdir into the dir and * 17. set m_name to the mac equivalent of "." * 18. goto 3 */ struct path *cname(struct vol *vol, struct dir *dir, char **cpath) { static char path[ MAXPATHLEN + 1]; static struct path ret; struct dir *cdir; char *data, *p; int len; u_int32_t hint; u_int16_t len16; int size = 0; int toUTF8 = 0; LOG(log_maxdebug, logtype_afpd, "came('%s'): {start}", cfrombstr(dir->d_fullpath)); data = *cpath; afp_errno = AFPERR_NOOBJ; memset(&ret, 0, sizeof(ret)); switch (ret.m_type = *data) { /* 1 */ case 2: data++; len = (unsigned char) *data++; size = 2; if (afp_version >= 30) { ret.m_type = 3; toUTF8 = 1; } break; case 3: if (afp_version >= 30) { data++; memcpy(&hint, data, sizeof(hint)); hint = ntohl(hint); data += sizeof(hint); memcpy(&len16, data, sizeof(len16)); len = ntohs(len16); data += 2; size = 7; break; } /* else it's an error */ default: afp_errno = AFPERR_PARAM; return( NULL ); } *cpath += len + size; path[0] = 0; ret.m_name = path; if (movecwd(vol, dir) < 0 ) { LOG(log_debug, logtype_afpd, "cname(did:%u): failed to chdir to '%s'", ntohl(dir->d_did), cfrombstr(dir->d_fullpath)); if (len == 0) return path_from_dir(vol, dir, &ret); else return NULL; } while (len) { /* 3 */ if (*data == 0) { /* 4 or 5 */ data++; len--; while (len > 0 && *data == 0) { /* 5 */ /* chdir to parrent dir */ if ((dir = dirlookup(vol, dir->d_pdid)) == NULL) return NULL; if (movecwd( vol, dir ) < 0 ) { dir_remove(vol, dir); return NULL; } data++; len--; } continue; } /* 6*/ for ( p = path; *data != 0 && len > 0; len-- ) { *p++ = *data++; if (p > &path[UTF8FILELEN_EARLY]) { /* FIXME safeguard, limit of early Mac OS X */ afp_errno = AFPERR_PARAM; return NULL; } } *p = 0; /* Terminate string */ ret.u_name = NULL; if (cname_mtouname(vol, dir, &ret, toUTF8) != 0) { /* 7 */ LOG(log_error, logtype_afpd, "cname('%s'): error from cname_mtouname", path); return NULL; } LOG(log_maxdebug, logtype_afpd, "came('%s'): {node: '%s}", cfrombstr(dir->d_fullpath), ret.u_name); /* Prevent access to our special folders like .AppleDouble */ if (check_name(vol, ret.u_name)) { /* the name is illegal */ LOG(log_info, logtype_afpd, "cname: illegal path: '%s'", ret.u_name); afp_errno = AFPERR_PARAM; return NULL; } if (dir->d_did == DIRDID_ROOT_PARENT) { /* 8 */ /* * Special case: CNID 1 * root parent (did 1) has one child: the volume. Requests for did=1 with * some must check against the volume name. */ if ((strcmp(cfrombstr(vol->v_root->d_m_name), ret.m_name)) == 0) cdir = vol->v_root; else return NULL; } else { /* * CNID != 1, eg. most of the times we take this way. * Now check if current path-part is a file or dir: * o if it's dir we have to step into it * o if it's a file we expect it to be the last part of the requested path * and thus call continue which should terminate the while loop because * len = 0. Ok? */ if (of_stat(&ret) != 0) { /* 9 */ /* * ret.u_name doesn't exist, might be afp_createfile|dir * that means it should have been the last part */ if (len > 0) { /* it wasn't the last part, so we have a bogus path request */ afp_errno = AFPERR_NOOBJ; return NULL; } /* * this will terminate clean in while (1) because len == 0, * probably afp_createfile|dir */ LOG(log_maxdebug, logtype_afpd, "came('%s'): {leave-cnode ENOENT (possile create request): '%s'}", cfrombstr(dir->d_fullpath), ret.u_name); continue; /* 10 */ } switch (ret.st.st_mode & S_IFMT) { case S_IFREG: /* 11 */ LOG(log_debug, logtype_afpd, "came('%s'): {file: '%s'}", cfrombstr(dir->d_fullpath), ret.u_name); if (len > 0) { /* it wasn't the last part, so we have a bogus path request */ afp_errno = AFPERR_PARAM; return NULL; } continue; /* continues while loop */ case S_IFLNK: /* 12 */ LOG(log_debug, logtype_afpd, "came('%s'): {link: '%s'}", cfrombstr(dir->d_fullpath), ret.u_name); if (len > 0) { LOG(log_warning, logtype_afpd, "came('%s'): {symlinked dir: '%s'}", cfrombstr(dir->d_fullpath), ret.u_name); afp_errno = AFPERR_PARAM; return NULL; } continue; /* continues while loop */ case S_IFDIR: /* 13 */ break; default: LOG(log_info, logtype_afpd, "cname: special file: '%s'", ret.u_name); afp_errno = AFPERR_NODIR; return NULL; } /* Search the cache */ int unamelen = strlen(ret.u_name); cdir = dircache_search_by_name(vol, dir, ret.u_name, unamelen); /* 14 */ if (cdir == NULL) { /* Not in cache, create one */ if ((cdir = dir_add(vol, dir, &ret, unamelen)) == NULL) { /* 15 */ LOG(log_error, logtype_afpd, "cname(did:%u, name:'%s', cwd:'%s'): failed to add dir", ntohl(dir->d_did), ret.u_name, getcwdpath()); return NULL; } } } /* if/else cnid==1 */ /* Now chdir to the evaluated dir */ if (movecwd( vol, cdir ) < 0 ) { /* 16 */ LOG(log_debug, logtype_afpd, "cname(cwd:'%s'): failed to chdir to new subdir '%s': %s", cfrombstr(curdir->d_fullpath), cfrombstr(cdir->d_fullpath), strerror(errno)); if (len == 0) return path_from_dir(vol, cdir, &ret); else return NULL; } dir = cdir; ret.m_name[0] = 0; /* 17, so we later know last token was a dir */ } /* while (len) */ if (curdir->d_did == DIRDID_ROOT_PARENT) { afp_errno = AFPERR_DID1; return NULL; } if (ret.m_name[0] == 0) { /* Last part was a dir */ ret.u_name = mtoupath(vol, ret.m_name, 0, 1); /* Force "." into a useable static buffer */ ret.d_dir = dir; } LOG(log_debug, logtype_afpd, "came('%s') {end: curdir:'%s', path:'%s'}", cfrombstr(dir->d_fullpath), cfrombstr(curdir->d_fullpath), ret.u_name); return &ret; } /* * @brief chdir() to dir * * @param vol (r) pointer to struct vol * @param dir (r) pointer to struct dir * * @returns 0 on success, -1 on error with afp_errno set appropiately */ int movecwd(const struct vol *vol, struct dir *dir) { int ret; AFP_ASSERT(vol); AFP_ASSERT(dir); LOG(log_maxdebug, logtype_afpd, "movecwd: from: curdir:\"%s\", cwd:\"%s\"", curdir ? cfrombstr(curdir->d_fullpath) : "INVALID", getcwdpath()); if (dir->d_did == DIRDID_ROOT_PARENT) { curdir = &rootParent; return 0; } LOG(log_debug, logtype_afpd, "movecwd(to: did: %u, \"%s\")", ntohl(dir->d_did), cfrombstr(dir->d_fullpath)); if ((ret = lchdir(cfrombstr(dir->d_fullpath))) != 0 ) { LOG(log_debug, logtype_afpd, "movecwd(\"%s\"): %s", cfrombstr(dir->d_fullpath), strerror(errno)); if (ret == 1) { /* p is a symlink or getcwd failed */ afp_errno = AFPERR_BADTYPE; if (chdir(vol->v_path ) < 0) { LOG(log_error, logtype_afpd, "can't chdir back'%s': %s", vol->v_path, strerror(errno)); /* XXX what do we do here? */ } curdir = vol->v_root; return -1; } switch (errno) { case EACCES: case EPERM: afp_errno = AFPERR_ACCESS; break; default: afp_errno = AFPERR_NOOBJ; } return( -1 ); } curdir = dir; return( 0 ); } /* * We can't use unix file's perm to support Apple's inherited protection modes. * If we aren't the file's owner we can't change its perms when moving it and smb * nfs,... don't even try. */ #define AFP_CHECK_ACCESS int check_access(char *path, int mode) { #ifdef AFP_CHECK_ACCESS struct maccess ma; char *p; p = ad_dir(path); if (!p) return -1; accessmode(current_vol, p, &ma, curdir, NULL); if ((mode & OPENACC_WR) && !(ma.ma_user & AR_UWRITE)) return -1; if ((mode & OPENACC_RD) && !(ma.ma_user & AR_UREAD)) return -1; #endif return 0; } /* --------------------- */ int file_access(struct path *path, int mode) { struct maccess ma; accessmode(current_vol, path->u_name, &ma, curdir, &path->st); LOG(log_debug, logtype_afpd, "file_access(\"%s\"): mapped user mode: 0x%02x", path->u_name, ma.ma_user); if ((mode & OPENACC_WR) && !(ma.ma_user & AR_UWRITE)) { LOG(log_debug, logtype_afpd, "file_access(\"%s\"): write access denied", path->u_name); return -1; } if ((mode & OPENACC_RD) && !(ma.ma_user & AR_UREAD)) { LOG(log_debug, logtype_afpd, "file_access(\"%s\"): read access denied", path->u_name); return -1; } return 0; } /* --------------------- */ void setdiroffcnt(struct dir *dir, struct stat *st, u_int32_t count) { dir->d_offcnt = count; dir->d_ctime = st->st_ctime; dir->d_flags &= ~DIRF_CNID; } /* --------------------- * is our cached also for reenumerate id? */ int dirreenumerate(struct dir *dir, struct stat *st) { return st->st_ctime == dir->d_ctime && (dir->d_flags & DIRF_CNID); } /* ------------------------------ (".", curdir) (name, dir) with curdir:name == dir, from afp_enumerate */ int getdirparams(const struct vol *vol, u_int16_t bitmap, struct path *s_path, struct dir *dir, char *buf, size_t *buflen ) { struct maccess ma; struct adouble ad; char *data, *l_nameoff = NULL, *utf_nameoff = NULL; int bit = 0, isad = 0; u_int32_t aint; u_int16_t ashort; int ret; u_int32_t utf8 = 0; cnid_t pdid; struct stat *st = &s_path->st; char *upath = s_path->u_name; if ((bitmap & ((1 << DIRPBIT_ATTR) | (1 << DIRPBIT_CDATE) | (1 << DIRPBIT_MDATE) | (1 << DIRPBIT_BDATE) | (1 << DIRPBIT_FINFO)))) { ad_init(&ad, vol->v_adouble, vol->v_ad_options); if ( !ad_metadata( upath, ADFLAGS_CREATE|ADFLAGS_DIR, &ad) ) { isad = 1; if (ad.ad_md->adf_flags & O_CREAT) { /* We just created it */ if (s_path->m_name == NULL) { if ((s_path->m_name = utompath(vol, upath, dir->d_did, utf8_encoding())) == NULL) { LOG(log_error, logtype_afpd, "getdirparams(\"%s\"): can't assign macname", cfrombstr(dir->d_fullpath)); return AFPERR_MISC; } } ad_setname(&ad, s_path->m_name); ad_setid( &ad, s_path->st.st_dev, s_path->st.st_ino, dir->d_did, dir->d_pdid, vol->v_stamp); ad_flush( &ad); } } } pdid = dir->d_pdid; data = buf; while ( bitmap != 0 ) { while (( bitmap & 1 ) == 0 ) { bitmap = bitmap>>1; bit++; } switch ( bit ) { case DIRPBIT_ATTR : if ( isad ) { ad_getattr(&ad, &ashort); } else if (invisible_dots(vol, cfrombstr(dir->d_u_name))) { ashort = htons(ATTRBIT_INVISIBLE); } else ashort = 0; memcpy( data, &ashort, sizeof( ashort )); data += sizeof( ashort ); break; case DIRPBIT_PDID : memcpy( data, &pdid, sizeof( pdid )); data += sizeof( pdid ); LOG(log_debug, logtype_afpd, "metadata('%s'): Parent DID: %u", s_path->u_name, ntohl(pdid)); break; case DIRPBIT_CDATE : if (!isad || (ad_getdate(&ad, AD_DATE_CREATE, &aint) < 0)) aint = AD_DATE_FROM_UNIX(st->st_mtime); memcpy( data, &aint, sizeof( aint )); data += sizeof( aint ); break; case DIRPBIT_MDATE : aint = AD_DATE_FROM_UNIX(st->st_mtime); memcpy( data, &aint, sizeof( aint )); data += sizeof( aint ); break; case DIRPBIT_BDATE : if (!isad || (ad_getdate(&ad, AD_DATE_BACKUP, &aint) < 0)) aint = AD_DATE_START; memcpy( data, &aint, sizeof( aint )); data += sizeof( aint ); break; case DIRPBIT_FINFO : if ( isad ) { memcpy( data, ad_entry( &ad, ADEID_FINDERI ), 32 ); } else { /* no appledouble */ memset( data, 0, 32 ); /* set default view -- this also gets done in ad_open() */ ashort = htons(FINDERINFO_CLOSEDVIEW); memcpy(data + FINDERINFO_FRVIEWOFF, &ashort, sizeof(ashort)); /* dot files are by default visible */ if (invisible_dots(vol, cfrombstr(dir->d_u_name))) { ashort = htons(FINDERINFO_INVISIBLE); memcpy(data + FINDERINFO_FRFLAGOFF, &ashort, sizeof(ashort)); } } data += 32; break; case DIRPBIT_LNAME : if (dir->d_m_name) /* root of parent can have a null name */ l_nameoff = data; else memset(data, 0, sizeof(u_int16_t)); data += sizeof( u_int16_t ); break; case DIRPBIT_SNAME : memset(data, 0, sizeof(u_int16_t)); data += sizeof( u_int16_t ); break; case DIRPBIT_DID : memcpy( data, &dir->d_did, sizeof( aint )); data += sizeof( aint ); LOG(log_debug, logtype_afpd, "metadata('%s'): DID: %u", s_path->u_name, ntohl(dir->d_did)); break; case DIRPBIT_OFFCNT : ashort = 0; /* this needs to handle current directory access rights */ if (diroffcnt(dir, st)) { ashort = (dir->d_offcnt > 0xffff)?0xffff:dir->d_offcnt; } else if ((ret = for_each_dirent(vol, upath, NULL,NULL)) >= 0) { setdiroffcnt(dir, st, ret); ashort = (dir->d_offcnt > 0xffff)?0xffff:dir->d_offcnt; } ashort = htons( ashort ); memcpy( data, &ashort, sizeof( ashort )); data += sizeof( ashort ); break; case DIRPBIT_UID : aint = htonl(st->st_uid); memcpy( data, &aint, sizeof( aint )); data += sizeof( aint ); break; case DIRPBIT_GID : aint = htonl(st->st_gid); memcpy( data, &aint, sizeof( aint )); data += sizeof( aint ); break; case DIRPBIT_ACCESS : accessmode(vol, upath, &ma, dir , st); *data++ = ma.ma_user; *data++ = ma.ma_world; *data++ = ma.ma_group; *data++ = ma.ma_owner; break; /* Client has requested the ProDOS information block. Just pass back the same basic block for all directories. */ case DIRPBIT_PDINFO : if (afp_version >= 30) { /* UTF8 name */ utf8 = kTextEncodingUTF8; if (dir->d_m_name) /* root of parent can have a null name */ utf_nameoff = data; else memset(data, 0, sizeof(u_int16_t)); data += sizeof( u_int16_t ); aint = 0; memcpy(data, &aint, sizeof( aint )); data += sizeof( aint ); } else { /* ProDOS Info Block */ *data++ = 0x0f; *data++ = 0; ashort = htons( 0x0200 ); memcpy( data, &ashort, sizeof( ashort )); data += sizeof( ashort ); memset( data, 0, sizeof( ashort )); data += sizeof( ashort ); } break; case DIRPBIT_UNIXPR : /* accessmode may change st_mode with ACLs */ accessmode(vol, upath, &ma, dir, st); aint = htonl(st->st_uid); memcpy( data, &aint, sizeof( aint )); data += sizeof( aint ); aint = htonl(st->st_gid); memcpy( data, &aint, sizeof( aint )); data += sizeof( aint ); aint = st->st_mode; aint = htonl ( aint & ~S_ISGID ); /* Remove SGID, OSX doesn't like it ... */ memcpy( data, &aint, sizeof( aint )); data += sizeof( aint ); *data++ = ma.ma_user; *data++ = ma.ma_world; *data++ = ma.ma_group; *data++ = ma.ma_owner; break; default : if ( isad ) { ad_close_metadata( &ad ); } return( AFPERR_BITMAP ); } bitmap = bitmap>>1; bit++; } if ( l_nameoff ) { ashort = htons( data - buf ); memcpy( l_nameoff, &ashort, sizeof( ashort )); data = set_name(vol, data, pdid, cfrombstr(dir->d_m_name), dir->d_did, 0); } if ( utf_nameoff ) { ashort = htons( data - buf ); memcpy( utf_nameoff, &ashort, sizeof( ashort )); data = set_name(vol, data, pdid, cfrombstr(dir->d_m_name), dir->d_did, utf8); } if ( isad ) { ad_close_metadata( &ad ); } *buflen = data - buf; return( AFP_OK ); } /* ----------------------------- */ int path_error(struct path *path, int error) { /* - a dir with access error * - no error it's a file * - file not found */ if (path_isadir(path)) return afp_errno; if (path->st_valid && path->st_errno) return error; return AFPERR_BADTYPE ; } /* ----------------------------- */ int afp_setdirparams(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *vol; struct dir *dir; struct path *path; u_int16_t vid, bitmap; u_int32_t did; int rc; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } if (vol->v_flags & AFPVOL_RO) return AFPERR_VLOCK; memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( int ); if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; } memcpy( &bitmap, ibuf, sizeof( bitmap )); bitmap = ntohs( bitmap ); ibuf += sizeof( bitmap ); if (NULL == ( path = cname( vol, dir, &ibuf )) ) { return get_afp_errno(AFPERR_NOOBJ); } if ( *path->m_name != '\0' ) { rc = path_error(path, AFPERR_NOOBJ); /* maybe we are trying to set perms back */ if (rc != AFPERR_ACCESS) return rc; } /* * If ibuf is odd, make it even. */ if ((u_long)ibuf & 1 ) { ibuf++; } if (AFP_OK == ( rc = setdirparams(vol, path, bitmap, ibuf )) ) { setvoltime(obj, vol ); } return( rc ); } /* * cf AFP3.0.pdf page 244 for change_mdate and change_parent_mdate logic * * assume path == '\0' eg. it's a directory in canonical form */ int setdirparams(struct vol *vol, struct path *path, u_int16_t d_bitmap, char *buf ) { struct maccess ma; struct adouble ad; struct utimbuf ut; struct timeval tv; char *upath; struct dir *dir; int bit, isad = 1; int cdate, bdate; int owner, group; u_int16_t ashort, bshort, oshort; int err = AFP_OK; int change_mdate = 0; int change_parent_mdate = 0; int newdate = 0; u_int16_t bitmap = d_bitmap; u_char finder_buf[32]; u_int32_t upriv; mode_t mpriv = 0; u_int16_t upriv_bit = 0; bit = 0; upath = path->u_name; dir = path->d_dir; while ( bitmap != 0 ) { while (( bitmap & 1 ) == 0 ) { bitmap = bitmap>>1; bit++; } switch( bit ) { case DIRPBIT_ATTR : change_mdate = 1; memcpy( &ashort, buf, sizeof( ashort )); buf += sizeof( ashort ); break; case DIRPBIT_CDATE : change_mdate = 1; memcpy(&cdate, buf, sizeof(cdate)); buf += sizeof( cdate ); break; case DIRPBIT_MDATE : memcpy(&newdate, buf, sizeof(newdate)); buf += sizeof( newdate ); break; case DIRPBIT_BDATE : change_mdate = 1; memcpy(&bdate, buf, sizeof(bdate)); buf += sizeof( bdate ); break; case DIRPBIT_FINFO : change_mdate = 1; memcpy( finder_buf, buf, 32 ); buf += 32; break; case DIRPBIT_UID : /* What kind of loser mounts as root? */ change_parent_mdate = 1; memcpy( &owner, buf, sizeof(owner)); buf += sizeof( owner ); break; case DIRPBIT_GID : change_parent_mdate = 1; memcpy( &group, buf, sizeof( group )); buf += sizeof( group ); break; case DIRPBIT_ACCESS : change_mdate = 1; change_parent_mdate = 1; ma.ma_user = *buf++; ma.ma_world = *buf++; ma.ma_group = *buf++; ma.ma_owner = *buf++; mpriv = mtoumode( &ma ) | vol->v_dperm; if (dir_rx_set(mpriv) && setdirmode( vol, upath, mpriv) < 0 ) { err = set_dir_errors(path, "setdirmode", errno); bitmap = 0; } break; /* Ignore what the client thinks we should do to the ProDOS information block. Skip over the data and report nothing amiss. */ case DIRPBIT_PDINFO : if (afp_version < 30) { buf += 6; } else { err = AFPERR_BITMAP; bitmap = 0; } break; case DIRPBIT_UNIXPR : if (vol_unix_priv(vol)) { memcpy( &owner, buf, sizeof(owner)); /* FIXME need to change owner too? */ buf += sizeof( owner ); memcpy( &group, buf, sizeof( group )); buf += sizeof( group ); change_mdate = 1; change_parent_mdate = 1; memcpy( &upriv, buf, sizeof( upriv )); buf += sizeof( upriv ); upriv = ntohl (upriv) | vol->v_dperm; if (dir_rx_set(upriv)) { /* maybe we are trying to set perms back */ if ( setdirunixmode(vol, upath, upriv) < 0 ) { bitmap = 0; err = set_dir_errors(path, "setdirunixmode", errno); } } else { /* do it later */ upriv_bit = 1; } break; } /* fall through */ default : err = AFPERR_BITMAP; bitmap = 0; break; } bitmap = bitmap>>1; bit++; } ad_init(&ad, vol->v_adouble, vol->v_ad_options); if (ad_open_metadata( upath, ADFLAGS_DIR, O_CREAT, &ad) < 0) { /* * Check to see what we're trying to set. If it's anything * but ACCESS, UID, or GID, give an error. If it's any of those * three, we don't need the ad to be open, so just continue. * * note: we also don't need to worry about mdate. also, be quiet * if we're using the noadouble option. */ if (!vol_noadouble(vol) && (d_bitmap & ~((1<d_m_name)); } } bit = 0; bitmap = d_bitmap; while ( bitmap != 0 ) { while (( bitmap & 1 ) == 0 ) { bitmap = bitmap>>1; bit++; } switch( bit ) { case DIRPBIT_ATTR : if (isad) { ad_getattr(&ad, &bshort); oshort = bshort; if ( ntohs( ashort ) & ATTRBIT_SETCLR ) { bshort |= htons( ntohs( ashort ) & ~ATTRBIT_SETCLR ); } else { bshort &= ~ashort; } if ((bshort & htons(ATTRBIT_INVISIBLE)) != (oshort & htons(ATTRBIT_INVISIBLE))) change_parent_mdate = 1; ad_setattr(&ad, bshort); } break; case DIRPBIT_CDATE : if (isad) { ad_setdate(&ad, AD_DATE_CREATE, cdate); } break; case DIRPBIT_MDATE : break; case DIRPBIT_BDATE : if (isad) { ad_setdate(&ad, AD_DATE_BACKUP, bdate); } break; case DIRPBIT_FINFO : if (isad) { /* Fixes #2802236 */ u_int16_t *fflags = (u_int16_t *)(finder_buf + FINDERINFO_FRFLAGOFF); *fflags &= htons(~FINDERINFO_ISHARED); /* #2802236 end */ if ( dir->d_did == DIRDID_ROOT ) { /* * Alright, we admit it, this is *really* sick! * The 4 bytes that we don't copy, when we're dealing * with the root of a volume, are the directory's * location information. This eliminates that annoying * behavior one sees when mounting above another mount * point. */ memcpy( ad_entry( &ad, ADEID_FINDERI ), finder_buf, 10 ); memcpy( ad_entry( &ad, ADEID_FINDERI ) + 14, finder_buf + 14, 18 ); } else { memcpy( ad_entry( &ad, ADEID_FINDERI ), finder_buf, 32 ); } } break; case DIRPBIT_UID : /* What kind of loser mounts as root? */ if ( (dir->d_did == DIRDID_ROOT) && (setdeskowner( ntohl(owner), -1 ) < 0)) { err = set_dir_errors(path, "setdeskowner", errno); if (isad && err == AFPERR_PARAM) { err = AFP_OK; /* ???*/ } else { goto setdirparam_done; } } if ( setdirowner(vol, upath, ntohl(owner), -1 ) < 0 ) { err = set_dir_errors(path, "setdirowner", errno); goto setdirparam_done; } break; case DIRPBIT_GID : if (dir->d_did == DIRDID_ROOT) setdeskowner( -1, ntohl(group) ); if ( setdirowner(vol, upath, -1, ntohl(group) ) < 0 ) { err = set_dir_errors(path, "setdirowner", errno); goto setdirparam_done; } break; case DIRPBIT_ACCESS : if (dir->d_did == DIRDID_ROOT) { setdeskmode(mpriv); if (!dir_rx_set(mpriv)) { /* we can't remove read and search for owner on volume root */ err = AFPERR_ACCESS; goto setdirparam_done; } } if (!dir_rx_set(mpriv) && setdirmode( vol, upath, mpriv) < 0 ) { err = set_dir_errors(path, "setdirmode", errno); goto setdirparam_done; } break; case DIRPBIT_PDINFO : if (afp_version >= 30) { err = AFPERR_BITMAP; goto setdirparam_done; } break; case DIRPBIT_UNIXPR : if (vol_unix_priv(vol)) { if (dir->d_did == DIRDID_ROOT) { if (!dir_rx_set(upriv)) { /* we can't remove read and search for owner on volume root */ err = AFPERR_ACCESS; goto setdirparam_done; } setdeskowner( -1, ntohl(group) ); setdeskmode( upriv ); } if ( setdirowner(vol, upath, -1, ntohl(group) ) < 0 ) { err = set_dir_errors(path, "setdirowner", errno); goto setdirparam_done; } if ( upriv_bit && setdirunixmode(vol, upath, upriv) < 0 ) { err = set_dir_errors(path, "setdirunixmode", errno); goto setdirparam_done; } } else { err = AFPERR_BITMAP; goto setdirparam_done; } break; default : err = AFPERR_BITMAP; goto setdirparam_done; break; } bitmap = bitmap>>1; bit++; } setdirparam_done: if (change_mdate && newdate == 0 && gettimeofday(&tv, NULL) == 0) { newdate = AD_DATE_FROM_UNIX(tv.tv_sec); } if (newdate) { if (isad) ad_setdate(&ad, AD_DATE_MODIFY, newdate); ut.actime = ut.modtime = AD_DATE_TO_UNIX(newdate); utime(upath, &ut); } if ( isad ) { if (path->st_valid && !path->st_errno) { struct stat *st = &path->st; if (dir && dir->d_pdid) { ad_setid(&ad, st->st_dev, st->st_ino, dir->d_did, dir->d_pdid, vol->v_stamp); } } ad_flush( &ad); ad_close_metadata( &ad); } if (change_parent_mdate && dir->d_did != DIRDID_ROOT && gettimeofday(&tv, NULL) == 0) { if (movecwd(vol, dirlookup(vol, dir->d_pdid)) == 0) { newdate = AD_DATE_FROM_UNIX(tv.tv_sec); /* be careful with bitmap because now dir is null */ bitmap = 1<d_u_name); dfd = dirfd( dp ); if ( fsync ( dfd ) < 0 ) LOG(log_error, logtype_afpd, "afp_syncdir(%s): %s", dir->d_u_name, strerror(errno) ); closedir(dp); /* closes dfd too */ #endif if ( -1 == (dfd = open(vol->ad_path(".", ADFLAGS_DIR), O_RDWR))) { switch( errno ) { case ENOENT: return( AFPERR_NOOBJ ); case EACCES: return( AFPERR_ACCESS ); default: return( AFPERR_PARAM ); } } LOG(log_debug, logtype_afpd, "afp_syncdir: ad-file: '%s'", vol->ad_path(".", ADFLAGS_DIR) ); if ( fsync(dfd) < 0 ) LOG(log_error, logtype_afpd, "afp_syncdir(%s): %s", vol->ad_path(cfrombstr(dir->d_u_name), ADFLAGS_DIR), strerror(errno) ); close(dfd); } return ( AFP_OK ); } int afp_createdir(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct adouble ad; struct vol *vol; struct dir *dir; char *upath; struct path *s_path; u_int32_t did; u_int16_t vid; int err; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } if (vol->v_flags & AFPVOL_RO) return AFPERR_VLOCK; memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; /* was AFPERR_NOOBJ */ } /* for concurrent access we need to be sure we are not in the * folder we want to create... */ movecwd(vol, dir); if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) { return get_afp_errno(AFPERR_PARAM); } /* cname was able to move curdir to it! */ if (*s_path->m_name == '\0') return AFPERR_EXIST; upath = s_path->u_name; if (AFP_OK != (err = netatalk_mkdir(vol, upath))) { return err; } if (of_stat(s_path) < 0) { return AFPERR_MISC; } curdir->d_offcnt++; if ((dir = dir_add(vol, curdir, s_path, strlen(s_path->u_name))) == NULL) { return AFPERR_MISC; } if ( movecwd( vol, dir ) < 0 ) { return( AFPERR_PARAM ); } ad_init(&ad, vol->v_adouble, vol->v_ad_options); if (ad_open_metadata( ".", ADFLAGS_DIR, O_CREAT, &ad ) < 0) { if (vol_noadouble(vol)) goto createdir_done; return( AFPERR_ACCESS ); } ad_setname(&ad, s_path->m_name); ad_setid( &ad, s_path->st.st_dev, s_path->st.st_ino, dir->d_did, did, vol->v_stamp); fce_register_new_dir(s_path); ad_flush( &ad); ad_close_metadata( &ad); createdir_done: memcpy( rbuf, &dir->d_did, sizeof( u_int32_t )); *rbuflen = sizeof( u_int32_t ); setvoltime(obj, vol ); return( AFP_OK ); } /* * dst new unix filename (not a pathname) * newname new mac name * newparent curdir * dirfd -1 means ignore dirfd (or use AT_FDCWD), otherwise src is relative to dirfd */ int renamedir(const struct vol *vol, int dirfd, char *src, char *dst, struct dir *dir, struct dir *newparent, char *newname) { struct adouble ad; int err; /* existence check moved to afp_moveandrename */ if ( unix_rename(dirfd, src, -1, dst ) < 0 ) { switch ( errno ) { case ENOENT : return( AFPERR_NOOBJ ); case EACCES : return( AFPERR_ACCESS ); case EROFS: return AFPERR_VLOCK; case EINVAL: /* tried to move directory into a subdirectory of itself */ return AFPERR_CANTMOVE; case EXDEV: /* this needs to copy and delete. bleah. that means we have * to deal with entire directory hierarchies. */ if ((err = copydir(vol, dirfd, src, dst)) < 0) { deletedir(-1, dst); return err; } if ((err = deletedir(dirfd, src)) < 0) return err; break; default : return( AFPERR_PARAM ); } } vol->vfs->vfs_renamedir(vol, dirfd, src, dst); ad_init(&ad, vol->v_adouble, vol->v_ad_options); if (!ad_open_metadata( dst, ADFLAGS_DIR, 0, &ad)) { ad_setname(&ad, newname); ad_flush( &ad); ad_close_metadata( &ad); } return( AFP_OK ); } /* delete an empty directory */ int deletecurdir(struct vol *vol) { struct dirent *de; struct stat st; struct dir *fdir, *pdir; DIR *dp; struct adouble ad; u_int16_t ashort; int err; if ((pdir = dirlookup(vol, curdir->d_pdid)) == NULL) { return( AFPERR_ACCESS ); } fdir = curdir; ad_init(&ad, vol->v_adouble, vol->v_ad_options); /* we never want to create a resource fork here, we are going to delete it */ if ( ad_metadata( ".", ADFLAGS_DIR, &ad) == 0 ) { ad_getattr(&ad, &ashort); ad_close_metadata(&ad); if ((ashort & htons(ATTRBIT_NODELETE))) { return AFPERR_OLOCK; } } err = vol->vfs->vfs_deletecurdir(vol); if (err) { LOG(log_error, logtype_afpd, "deletecurdir: error deleting .AppleDouble in \"%s\"", curdir->d_fullpath); return err; } /* now get rid of dangling symlinks */ if ((dp = opendir("."))) { while ((de = readdir(dp))) { /* skip this and previous directory */ if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, "..")) continue; /* bail if it's not a symlink */ if ((lstat(de->d_name, &st) == 0) && !S_ISLNK(st.st_mode)) { LOG(log_error, logtype_afpd, "deletecurdir(\"%s\"): not empty", curdir->d_fullpath); closedir(dp); return AFPERR_DIRNEMPT; } if ((err = netatalk_unlink(de->d_name))) { closedir(dp); return err; } } } if (movecwd(vol, pdir) < 0) { err = afp_errno; goto delete_done; } LOG(log_debug, logtype_afpd, "deletecurdir: moved to \"%s\"", cfrombstr(curdir->d_fullpath)); err = netatalk_rmdir_all_errors(-1, cfrombstr(fdir->d_u_name)); if ( err == AFP_OK || err == AFPERR_NOOBJ) { cnid_delete(vol->v_cdb, fdir->d_did); dir_remove( vol, fdir ); } else { LOG(log_error, logtype_afpd, "deletecurdir(\"%s\"): netatalk_rmdir_all_errors error", cfrombstr(curdir->d_fullpath)); } delete_done: if (dp) { /* inode is used as key for cnid. * Close the descriptor only after cnid_delete * has been called. */ closedir(dp); } return err; } int afp_mapid(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct passwd *pw; struct group *gr; char *name; u_int32_t id; int len, sfunc; int utf8 = 0; ibuf++; sfunc = (unsigned char) *ibuf++; *rbuflen = 0; if (sfunc >= 3 && sfunc <= 6) { if (afp_version < 30) { return( AFPERR_PARAM ); } utf8 = 1; } switch ( sfunc ) { case 1 : case 3 :/* unicode */ memcpy( &id, ibuf, sizeof( id )); id = ntohl(id); if ( id != 0 ) { if (( pw = getpwuid( id )) == NULL ) { return( AFPERR_NOITEM ); } len = convert_string_allocate( obj->options.unixcharset, ((!utf8)?obj->options.maccharset:CH_UTF8_MAC), pw->pw_name, -1, &name); } else { len = 0; name = NULL; } break; case 2 : case 4 : /* unicode */ memcpy( &id, ibuf, sizeof( id )); id = ntohl(id); if ( id != 0 ) { if (NULL == ( gr = (struct group *)getgrgid( id ))) { return( AFPERR_NOITEM ); } len = convert_string_allocate( obj->options.unixcharset, (!utf8)?obj->options.maccharset:CH_UTF8_MAC, gr->gr_name, -1, &name); } else { len = 0; name = NULL; } break; case 5 : /* UUID -> username */ case 6 : /* UUID -> groupname */ if ((afp_version < 32) || !(obj->options.flags & OPTION_UUID )) return AFPERR_PARAM; LOG(log_debug, logtype_afpd, "afp_mapid: valid UUID request"); uuidtype_t type; len = getnamefromuuid((unsigned char*) ibuf, &name, &type); if (len != 0) /* its a error code, not len */ return AFPERR_NOITEM; switch (type) { case UUID_USER: if (( pw = getpwnam( name )) == NULL ) return( AFPERR_NOITEM ); LOG(log_debug, logtype_afpd, "afp_mapid: name:%s -> uid:%d", name, pw->pw_uid); id = htonl(UUID_USER); memcpy( rbuf, &id, sizeof( id )); id = htonl( pw->pw_uid); rbuf += sizeof( id ); memcpy( rbuf, &id, sizeof( id )); rbuf += sizeof( id ); *rbuflen = 2 * sizeof( id ); break; case UUID_GROUP: if (( gr = getgrnam( name )) == NULL ) return( AFPERR_NOITEM ); LOG(log_debug, logtype_afpd, "afp_mapid: group:%s -> gid:%d", name, gr->gr_gid); id = htonl(UUID_GROUP); memcpy( rbuf, &id, sizeof( id )); rbuf += sizeof( id ); id = htonl( gr->gr_gid); memcpy( rbuf, &id, sizeof( id )); rbuf += sizeof( id ); *rbuflen = 2 * sizeof( id ); break; default: return AFPERR_MISC; } break; default : return( AFPERR_PARAM ); } if (name) len = strlen( name ); if (utf8) { u_int16_t tp = htons(len); memcpy(rbuf, &tp, sizeof(tp)); rbuf += sizeof(tp); *rbuflen += 2; } else { *rbuf++ = len; *rbuflen += 1; } if ( len > 0 ) { memcpy( rbuf, name, len ); } *rbuflen += len; if (name) free(name); return( AFP_OK ); } int afp_mapname(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct passwd *pw; struct group *gr; int len, sfunc; u_int32_t id; u_int16_t ulen; ibuf++; sfunc = (unsigned char) *ibuf++; *rbuflen = 0; LOG(log_debug, logtype_afpd, "afp_mapname: sfunc: %d, afp_version: %d", sfunc, afp_version); switch ( sfunc ) { case 1 : case 2 : /* unicode */ if (afp_version < 30) { return( AFPERR_PARAM ); } memcpy(&ulen, ibuf, sizeof(ulen)); len = ntohs(ulen); ibuf += 2; LOG(log_debug, logtype_afpd, "afp_mapname: alive"); break; case 3 : case 4 : len = (unsigned char) *ibuf++; break; case 5 : /* username -> UUID */ case 6 : /* groupname -> UUID */ if ((afp_version < 32) || !(obj->options.flags & OPTION_UUID )) return AFPERR_PARAM; memcpy(&ulen, ibuf, sizeof(ulen)); len = ntohs(ulen); ibuf += 2; break; default : return( AFPERR_PARAM ); } ibuf[ len ] = '\0'; if ( len == 0 ) return AFPERR_PARAM; else { switch ( sfunc ) { case 1 : /* unicode */ case 3 : if (NULL == ( pw = (struct passwd *)getpwnam( ibuf )) ) { return( AFPERR_NOITEM ); } id = pw->pw_uid; id = htonl(id); memcpy( rbuf, &id, sizeof( id )); *rbuflen = sizeof( id ); break; case 2 : /* unicode */ case 4 : LOG(log_debug, logtype_afpd, "afp_mapname: getgrnam for name: %s",ibuf); if (NULL == ( gr = (struct group *)getgrnam( ibuf ))) { return( AFPERR_NOITEM ); } id = gr->gr_gid; LOG(log_debug, logtype_afpd, "afp_mapname: getgrnam for name: %s -> id: %d",ibuf, id); id = htonl(id); memcpy( rbuf, &id, sizeof( id )); *rbuflen = sizeof( id ); break; case 5 : /* username -> UUID */ LOG(log_debug, logtype_afpd, "afp_mapname: name: %s",ibuf); if (0 != getuuidfromname(ibuf, UUID_USER, (unsigned char *)rbuf)) return AFPERR_NOITEM; *rbuflen = UUID_BINSIZE; break; case 6 : /* groupname -> UUID */ LOG(log_debug, logtype_afpd, "afp_mapname: name: %s",ibuf); if (0 != getuuidfromname(ibuf, UUID_GROUP, (unsigned char *)rbuf)) return AFPERR_NOITEM; *rbuflen = UUID_BINSIZE; break; } } return( AFP_OK ); } /* ------------------------------------ variable DID support */ int afp_closedir(AFPObj *obj _U_, char *ibuf _U_, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { #if 0 struct vol *vol; struct dir *dir; u_int16_t vid; u_int32_t did; #endif /* 0 */ *rbuflen = 0; /* do nothing as dids are static for the life of the process. */ #if 0 ibuf += 2; memcpy(&vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (( vol = getvolbyvid( vid )) == NULL ) { return( AFPERR_PARAM ); } memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); if (( dir = dirlookup( vol, did )) == NULL ) { return( AFPERR_PARAM ); } /* dir_remove -- deletedid */ #endif /* 0 */ return AFP_OK; } /* did creation gets done automatically * there's a pb again with case but move it to cname */ int afp_opendir(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct vol *vol; struct dir *parentdir; struct path *path; u_int32_t did; u_int16_t vid; *rbuflen = 0; ibuf += 2; memcpy(&vid, ibuf, sizeof(vid)); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } memcpy(&did, ibuf, sizeof(did)); ibuf += sizeof(did); if (NULL == ( parentdir = dirlookup( vol, did )) ) { return afp_errno; } if (NULL == ( path = cname( vol, parentdir, &ibuf )) ) { return get_afp_errno(AFPERR_PARAM); } if ( *path->m_name != '\0' ) { return path_error(path, AFPERR_NOOBJ); } if ( !path->st_valid && of_stat(path ) < 0 ) { return( AFPERR_NOOBJ ); } if ( path->st_errno ) { return( AFPERR_NOOBJ ); } memcpy(rbuf, &curdir->d_did, sizeof(curdir->d_did)); *rbuflen = sizeof(curdir->d_did); return AFP_OK; } netatalk-2.2.2/etc/afpd/dircache.h0000644000175200017500000000275111655731126013657 00000000000000/* Copyright (c) 2010 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef DIRCACHE_H #define DIRCACHE_H #include #include #include /* Maximum size of the dircache hashtable */ #define DEFAULT_MAX_DIRCACHE_SIZE 8192 #define MAX_POSSIBLE_DIRCACHE_SIZE 131072 #define DIRCACHE_FREE_QUANTUM 256 /* flags for dircache_remove */ #define DIRCACHE (1 << 0) #define DIDNAME_INDEX (1 << 1) #define QUEUE_INDEX (1 << 2) #define DIRCACHE_ALL (DIRCACHE|DIDNAME_INDEX|QUEUE_INDEX) extern int dircache_init(int reqsize); extern int dircache_add(const struct vol *, struct dir *); extern void dircache_remove(const struct vol *, struct dir *, int flag); extern struct dir *dircache_search_by_did(const struct vol *vol, cnid_t did); extern struct dir *dircache_search_by_name(const struct vol *, const struct dir *dir, char *name, int len); extern void dircache_dump(void); extern void log_dircache_stat(void); #endif /* DIRCACHE_H */ netatalk-2.2.2/etc/afpd/extattrs.h0000644000175200017500000000207611655731126013773 00000000000000/* $Id: extattrs.h,v 1.3 2009-10-15 10:43:13 didg Exp $ Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef AFPD_EXT_ATTRS_H #define AFPD_EXT_ATTRS_H /* AFP funcs */ int afp_listextattr (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_getextattr (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_setextattr(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_remextattr(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); #endif /* AFPD_EXT_ATTRS_H */ netatalk-2.2.2/etc/afpd/hash.h0000644000175200017500000000523611655731126013041 00000000000000/* * Hash Table Data Type * Copyright (C) 1997 Kaz Kylheku * * Free Software License: * * All rights are reserved by the author, with the following exceptions: * Permission is granted to freely reproduce and distribute this software, * possibly in exchange for a fee, provided that this copyright notice appears * intact. Permission is also granted to adapt this software to produce * derivative works, as long as the modified versions carry this copyright * notice and additional notices stating that the work has been modified. * This source code may be translated into executable form and incorporated * into proprietary software; there is no requirement for such software to * contain a copyright notice related to this source. * * $Id: hash.h,v 1.2 2009-10-02 09:32:40 franklahm Exp $ * $Name: $ */ #ifndef HASH_H #define HASH_H #include #include extern hash_t *hash_create(hashcount_t, hash_comp_t, hash_fun_t); extern void hash_set_allocator(hash_t *, hnode_alloc_t, hnode_free_t, void *); extern void hash_destroy(hash_t *); extern void hash_free_nodes(hash_t *); extern void hash_free(hash_t *); extern hash_t *hash_init(hash_t *, hashcount_t, hash_comp_t, hash_fun_t, hnode_t **, hashcount_t); extern void hash_insert(hash_t *, hnode_t *, const void *); extern hnode_t *hash_lookup(hash_t *, const void *); extern hnode_t *hash_delete(hash_t *, hnode_t *); extern int hash_alloc_insert(hash_t *, const void *, void *); extern void hash_delete_free(hash_t *, hnode_t *); extern void hnode_put(hnode_t *, void *); extern void *hnode_get(hnode_t *); extern const void *hnode_getkey(hnode_t *); extern hashcount_t hash_count(hash_t *); extern hashcount_t hash_size(hash_t *); extern int hash_isfull(hash_t *); extern int hash_isempty(hash_t *); extern void hash_scan_begin(hscan_t *, hash_t *); extern hnode_t *hash_scan_next(hscan_t *); extern hnode_t *hash_scan_delete(hash_t *, hnode_t *); extern void hash_scan_delfree(hash_t *, hnode_t *); extern int hash_verify(hash_t *); extern hnode_t *hnode_create(void *); extern hnode_t *hnode_init(hnode_t *, void *); extern void hnode_destroy(hnode_t *); #if defined(HASH_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG) #ifdef KAZLIB_SIDEEFFECT_DEBUG #define hash_isfull(H) (SFX_CHECK(H)->hash_nodecount == (H)->hash_maxcount) #else #define hash_isfull(H) ((H)->hash_nodecount == (H)->hash_maxcount) #endif #define hash_isempty(H) ((H)->hash_nodecount == 0) #define hash_count(H) ((H)->hash_nodecount) #define hash_size(H) ((H)->hash_nchains) #define hnode_get(N) ((N)->hash_data) #define hnode_getkey(N) ((N)->hash_key) #define hnode_put(N, V) ((N)->hash_data = (V)) #endif #endif netatalk-2.2.2/etc/afpd/uid.h0000644000175200017500000000111211655731126012664 00000000000000/* * $Id: uid.h,v 1.6 2002-08-30 19:32:41 didg Exp $ * code: jeff@univrel.pr.uconn.edu */ #ifndef AFPD_UID_H #define AFPD_UID_H 1 #ifdef FORCE_UIDGID /* have to make sure struct vol is defined */ #include "volume.h" /* functions to save and restore uid/gid pairs */ extern void save_uidgid ( uidgidset * ); extern void restore_uidgid ( uidgidset * ); extern void set_uidgid ( const struct vol * ); /* internal functions to convert user and group names to ids */ extern int user_to_uid ( char * ); extern int group_to_gid ( char * ); #endif /* FORCE_UIDGID */ #endif netatalk-2.2.2/etc/afpd/acls.c0000644000175200017500000016164411656215256013043 00000000000000/* Copyright (c) 2008, 2009, 2010 Frank Lahm Copyright (c) 2011 Laura Mueller This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #ifdef HAVE_SOLARIS_ACLS #include #endif #ifdef HAVE_POSIX_ACLS #include #endif #ifdef HAVE_ACL_LIBACL_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include "directory.h" #include "desktop.h" #include "volume.h" #include "fork.h" #include "unix.h" #include "acls.h" #include "acl_mappings.h" #include "auth.h" /* for map_acl() */ #define SOLARIS_2_DARWIN 1 #define DARWIN_2_SOLARIS 2 #define POSIX_DEFAULT_2_DARWIN 3 #define POSIX_ACCESS_2_DARWIN 4 #define DARWIN_2_POSIX_DEFAULT 5 #define DARWIN_2_POSIX_ACCESS 6 #define MAP_MASK 31 #define IS_DIR 32 /* bit flags for set_acl() and map_aces_darwin_to_posix() */ #define HAS_DEFAULT_ACL 0x01 #define HAS_EXT_DEFAULT_ACL 0x02 /******************************************************** * Solaris funcs ********************************************************/ #ifdef HAVE_SOLARIS_ACLS /*! * Compile access rights for a user to one file-system object * * This combines combines all access rights for a user to one fs-object and * returns the result as a Darwin allowed rights ACE. * This must honor trivial ACEs which are a mode_t mapping. * * @param path (r) path to filesystem object * @param sb (r) struct stat of path * @param result (w) resulting Darwin allow ACE * * @returns 0 or -1 on error */ static int solaris_acl_rights(const char *path, const struct stat *sb, uint32_t *result) { EC_INIT; int i, ace_count, checkgroup; ace_t *aces = NULL; uid_t who; uint16_t flags, type; uint32_t rights, allowed_rights = 0, denied_rights = 0, darwin_rights; /* Get ACL from file/dir */ EC_NEG1_LOG(ace_count = get_nfsv4_acl(path, &aces)); if (ace_count == 0) goto EC_CLEANUP; /* Now check requested rights */ i = 0; do { /* Loop through ACEs */ who = aces[i].a_who; flags = aces[i].a_flags; type = aces[i].a_type; rights = aces[i].a_access_mask; if (flags & ACE_INHERIT_ONLY_ACE) continue; /* Now the tricky part: decide if ACE effects our user. I'll explain: if its a dedicated (non trivial) ACE for the user OR if its a ACE for a group we're member of OR if its a trivial ACE_OWNER ACE and requested UUID is the owner OR if its a trivial ACE_GROUP ACE and requested UUID is group OR if its a trivial ACE_EVERYONE ACE THEN process ACE */ if (((who == uuid) && !(flags & (ACE_TRIVIAL|ACE_IDENTIFIER_GROUP))) || ((flags & ACE_IDENTIFIER_GROUP) && !(flags & ACE_GROUP) && gmem(who)) || ((flags & ACE_OWNER) && (uuid == sb->st_uid)) || ((flags & ACE_GROUP) && !(uuid == sb->st_uid) && gmem(sb->st_gid)) || (flags & ACE_EVERYONE && !(uuid == sb->st_uid) && !gmem(sb->st_gid)) ) { /* Found an applicable ACE */ if (type == ACE_ACCESS_ALLOWED_ACE_TYPE) allowed_rights |= rights; else if (type == ACE_ACCESS_DENIED_ACE_TYPE) /* Only or to denied rights if not previously allowed !! */ denied_rights |= ((!allowed_rights) & rights); } } while (++i < ace_count); /* Darwin likes to ask for "delete_child" on dir, "write_data" is actually the same, so we add that for dirs */ if (S_ISDIR(sb->st_mode) && (allowed_rights & ACE_WRITE_DATA)) allowed_rights |= ACE_DELETE_CHILD; /* Remove denied from allowed rights */ allowed_rights &= ~denied_rights; /* map rights */ darwin_rights = 0; for (i=0; nfsv4_to_darwin_rights[i].from != 0; i++) { if (allowed_rights & nfsv4_to_darwin_rights[i].from) darwin_rights |= nfsv4_to_darwin_rights[i].to; } *result |= darwin_rights; EC_CLEANUP: if (aces) free(aces); EC_EXIT; } /* Maps ACE array from Solaris to Darwin. Darwin ACEs are stored in network byte order. Return numer of mapped ACEs or -1 on error. All errors while mapping (e.g. getting UUIDs from LDAP) are fatal. */ static int map_aces_solaris_to_darwin(const ace_t *aces, darwin_ace_t *darwin_aces, int ace_count) { EC_INIT; int i, count = 0; uint32_t flags; uint32_t rights; struct passwd *pwd = NULL; struct group *grp = NULL; LOG(log_maxdebug, logtype_afpd, "map_aces_solaris_to_darwin: parsing %d ACES", ace_count); while(ace_count--) { LOG(log_maxdebug, logtype_afpd, "ACE No. %d", ace_count + 1); /* if its a ACE resulting from nfsv4 mode mapping, discard it */ if (aces->a_flags & (ACE_OWNER | ACE_GROUP | ACE_EVERYONE)) { LOG(log_debug, logtype_afpd, "trivial ACE"); aces++; continue; } if ( ! (aces->a_flags & ACE_IDENTIFIER_GROUP) ) { /* user ace */ LOG(log_debug, logtype_afpd, "uid: %d", aces->a_who); EC_NULL_LOG(pwd = getpwuid(aces->a_who)); LOG(log_debug, logtype_afpd, "uid: %d -> name: %s", aces->a_who, pwd->pw_name); EC_ZERO_LOG(getuuidfromname(pwd->pw_name, UUID_USER, darwin_aces->darwin_ace_uuid)); } else { /* group ace */ LOG(log_debug, logtype_afpd, "gid: %d", aces->a_who); EC_NULL_LOG(grp = getgrgid(aces->a_who)); LOG(log_debug, logtype_afpd, "gid: %d -> name: %s", aces->a_who, grp->gr_name); EC_ZERO_LOG(getuuidfromname(grp->gr_name, UUID_GROUP, darwin_aces->darwin_ace_uuid)); } /* map flags */ if (aces->a_type == ACE_ACCESS_ALLOWED_ACE_TYPE) flags = DARWIN_ACE_FLAGS_PERMIT; else if (aces->a_type == ACE_ACCESS_DENIED_ACE_TYPE) flags = DARWIN_ACE_FLAGS_DENY; else { /* unsupported type */ aces++; continue; } for(i=0; nfsv4_to_darwin_flags[i].from != 0; i++) { if (aces->a_flags & nfsv4_to_darwin_flags[i].from) flags |= nfsv4_to_darwin_flags[i].to; } darwin_aces->darwin_ace_flags = htonl(flags); /* map rights */ rights = 0; for (i=0; nfsv4_to_darwin_rights[i].from != 0; i++) { if (aces->a_access_mask & nfsv4_to_darwin_rights[i].from) rights |= nfsv4_to_darwin_rights[i].to; } darwin_aces->darwin_ace_rights = htonl(rights); count++; aces++; darwin_aces++; } return count; EC_CLEANUP: EC_EXIT; } /* Maps ACE array from Darwin to Solaris. Darwin ACEs are expected in network byte order. Return numer of mapped ACEs or -1 on error. All errors while mapping (e.g. getting UUIDs from LDAP) are fatal. */ static int map_aces_darwin_to_solaris(darwin_ace_t *darwin_aces, ace_t *nfsv4_aces, int ace_count) { EC_INIT; int i, mapped_aces = 0; uint32_t darwin_ace_flags; uint32_t darwin_ace_rights; uint16_t nfsv4_ace_flags; uint32_t nfsv4_ace_rights; char *name = NULL; uuidtype_t uuidtype; struct passwd *pwd; struct group *grp; while(ace_count--) { nfsv4_ace_flags = 0; nfsv4_ace_rights = 0; /* uid/gid first */ EC_ZERO(getnamefromuuid(darwin_aces->darwin_ace_uuid, &name, &uuidtype)); switch (uuidtype) { case UUID_USER: EC_NULL_LOG(pwd = getpwnam(name)); nfsv4_aces->a_who = pwd->pw_uid; break; case UUID_GROUP: EC_NULL_LOG(grp = getgrnam(name)); nfsv4_aces->a_who = (uid_t)(grp->gr_gid); nfsv4_ace_flags |= ACE_IDENTIFIER_GROUP; break; default: LOG(log_error, logtype_afpd, "map_aces_darwin_to_solaris: unkown uuidtype"); EC_FAIL; } free(name); name = NULL; /* now type: allow/deny */ darwin_ace_flags = ntohl(darwin_aces->darwin_ace_flags); if (darwin_ace_flags & DARWIN_ACE_FLAGS_PERMIT) nfsv4_aces->a_type = ACE_ACCESS_ALLOWED_ACE_TYPE; else if (darwin_ace_flags & DARWIN_ACE_FLAGS_DENY) nfsv4_aces->a_type = ACE_ACCESS_DENIED_ACE_TYPE; else { /* unsupported type */ darwin_aces++; continue; } /* map flags */ for(i=0; darwin_to_nfsv4_flags[i].from != 0; i++) { if (darwin_ace_flags & darwin_to_nfsv4_flags[i].from) nfsv4_ace_flags |= darwin_to_nfsv4_flags[i].to; } /* map rights */ darwin_ace_rights = ntohl(darwin_aces->darwin_ace_rights); for (i=0; darwin_to_nfsv4_rights[i].from != 0; i++) { if (darwin_ace_rights & darwin_to_nfsv4_rights[i].from) nfsv4_ace_rights |= darwin_to_nfsv4_rights[i].to; } LOG(log_debug9, logtype_afpd, "map_aces_darwin_to_solaris: ACE flags: Darwin:%08x -> NFSv4:%04x", darwin_ace_flags, nfsv4_ace_flags); LOG(log_debug9, logtype_afpd, "map_aces_darwin_to_solaris: ACE rights: Darwin:%08x -> NFSv4:%08x", darwin_ace_rights, nfsv4_ace_rights); nfsv4_aces->a_flags = nfsv4_ace_flags; nfsv4_aces->a_access_mask = nfsv4_ace_rights; mapped_aces++; darwin_aces++; nfsv4_aces++; } return mapped_aces; EC_CLEANUP: if (name) free(name); EC_EXIT; } #endif /* HAVE_SOLARIS_ACLS */ /******************************************************** * POSIX 1e funcs ********************************************************/ #ifdef HAVE_POSIX_ACLS static uint32_t posix_permset_to_darwin_rights(acl_entry_t e, int is_dir) { EC_INIT; uint32_t rights = 0; acl_permset_t permset; EC_ZERO_LOG(acl_get_permset(e, &permset)); #ifdef HAVE_ACL_GET_PERM_NP if (acl_get_perm_np(permset, ACL_READ)) #else if (acl_get_perm(permset, ACL_READ)) #endif rights = DARWIN_ACE_READ_DATA | DARWIN_ACE_READ_EXTATTRIBUTES | DARWIN_ACE_READ_ATTRIBUTES | DARWIN_ACE_READ_SECURITY; #ifdef HAVE_ACL_GET_PERM_NP if (acl_get_perm_np(permset, ACL_WRITE)) { #else if (acl_get_perm(permset, ACL_WRITE)) { #endif rights |= DARWIN_ACE_WRITE_DATA | DARWIN_ACE_APPEND_DATA | DARWIN_ACE_WRITE_EXTATTRIBUTES | DARWIN_ACE_WRITE_ATTRIBUTES; if (is_dir) rights |= DARWIN_ACE_DELETE_CHILD; } #ifdef HAVE_ACL_GET_PERM_NP if (acl_get_perm_np(permset, ACL_EXECUTE)) #else if (acl_get_perm(permset, ACL_EXECUTE)) #endif rights |= DARWIN_ACE_EXECUTE; EC_CLEANUP: LOG(log_maxdebug, logtype_afpd, "mapped rights: 0x%08x", rights); return rights; } /*! * Compile access rights for a user to one file-system object * * This combines combines all access rights for a user to one fs-object and * returns the result as a Darwin allowed rights ACE. * This must honor trivial ACEs which are a mode_t mapping. * * @param path (r) path to filesystem object * @param sb (r) struct stat of path * @param result (rw) resulting Darwin allow ACE * * @returns 0 or -1 on error */ static int posix_acl_rights(const char *path, const struct stat *sb, uint32_t *result) { EC_INIT; int entry_id = ACL_FIRST_ENTRY; uint32_t rights = 0; /* rights which do not depend on ACL_MASK */ uint32_t acl_rights = 0; /* rights which are subject to limitations imposed by ACL_MASK */ uint32_t mask_rights = 0xffffffff; uid_t *uid = NULL; gid_t *gid = NULL; acl_t acl = NULL; acl_entry_t e; acl_tag_t tag; EC_NULL_LOGSTR(acl = acl_get_file(path, ACL_TYPE_ACCESS), "acl_get_file(\"%s\"): %s", fullpathname(path), strerror(errno)); /* Iterate through all ACEs. If we apply mask_rights later there is no need to iterate twice. */ while (acl_get_entry(acl, entry_id, &e) == 1) { entry_id = ACL_NEXT_ENTRY; EC_ZERO_LOG(acl_get_tag_type(e, &tag)); switch (tag) { case ACL_USER_OBJ: if (sb->st_uid == uuid) { LOG(log_maxdebug, logtype_afpd, "ACL_USER_OBJ: %u", sb->st_uid); rights |= posix_permset_to_darwin_rights(e, S_ISDIR(sb->st_mode)); } break; case ACL_USER: EC_NULL_LOG(uid = (uid_t *)acl_get_qualifier(e)); if (*uid == uuid) { LOG(log_maxdebug, logtype_afpd, "ACL_USER: %u", *uid); acl_rights |= posix_permset_to_darwin_rights(e, S_ISDIR(sb->st_mode)); } acl_free(uid); uid = NULL; break; case ACL_GROUP_OBJ: if (!(sb->st_uid == uuid) && gmem(sb->st_gid)) { LOG(log_maxdebug, logtype_afpd, "ACL_GROUP_OBJ: %u", sb->st_gid); acl_rights |= posix_permset_to_darwin_rights(e, S_ISDIR(sb->st_mode)); } break; case ACL_GROUP: EC_NULL_LOG(gid = (gid_t *)acl_get_qualifier(e)); if (gmem(*gid)) { LOG(log_maxdebug, logtype_afpd, "ACL_GROUP: %u", *gid); acl_rights |= posix_permset_to_darwin_rights(e, S_ISDIR(sb->st_mode)); } acl_free(gid); gid = NULL; break; case ACL_MASK: mask_rights = posix_permset_to_darwin_rights(e, S_ISDIR(sb->st_mode)); LOG(log_maxdebug, logtype_afpd, "maskrights: 0x%08x", mask_rights); break; case ACL_OTHER: if (!(sb->st_uid == uuid) && !gmem(sb->st_gid)) { LOG(log_maxdebug, logtype_afpd, "ACL_OTHER"); rights |= posix_permset_to_darwin_rights(e, S_ISDIR(sb->st_mode)); } break; default: continue; } } /* while */ /* apply the mask and collect the rights */ rights |= (acl_rights & mask_rights); *result |= rights; EC_CLEANUP: if (acl) acl_free(acl); if (uid) acl_free(uid); if (gid) acl_free(gid); EC_EXIT; } /*! * Helper function for posix_acls_to_uaperms() to convert Posix ACL permissions * into access rights needed to fill ua_permissions of a FPUnixPrivs structure. * * @param entry (r) Posix ACL entry * * @returns access rights */ static u_char acl_permset_to_uarights(acl_entry_t entry) { acl_permset_t permset; u_char rights = 0; if (acl_get_permset(entry, &permset) == -1) return rights; #ifdef HAVE_ACL_GET_PERM_NP if (acl_get_perm_np(permset, ACL_READ)) #else if (acl_get_perm(permset, ACL_READ)) #endif rights |= AR_UREAD; #ifdef HAVE_ACL_GET_PERM_NP if (acl_get_perm_np(permset, ACL_WRITE)) #else if (acl_get_perm(permset, ACL_WRITE)) #endif rights |= AR_UWRITE; #ifdef HAVE_ACL_GET_PERM_NP if (acl_get_perm_np(permset, ACL_EXECUTE)) #else if (acl_get_perm(permset, ACL_EXECUTE)) #endif rights |= AR_USEARCH; return rights; } /*! * Update FPUnixPrivs for a file-system object on a volume supporting ACLs * * Checks permissions granted by ACLS for a user to one fs-object and * updates user and group permissions in given struct maccess. As OS X * doesn't conform to Posix 1003.1e Draft 17 it expects proper group * permissions in st_mode of struct stat even if the fs-object has an * ACL_MASK entry, st_mode gets modified to properly reflect group * permissions. * * @param path (r) path to filesystem object * @param sb (rw) struct stat of path * @param maccess (rw) struct maccess of path * * @returns 0 or -1 on error */ static int posix_acls_to_uaperms(const char *path, struct stat *sb, struct maccess *ma) { EC_INIT; int entry_id = ACL_FIRST_ENTRY; acl_entry_t entry; acl_tag_t tag; acl_t acl = NULL; uid_t *uid; gid_t *gid; uid_t whoami = geteuid(); u_char group_rights = 0x00; u_char acl_rights = 0x00; u_char mask = 0xff; EC_NULL_LOG(acl = acl_get_file(path, ACL_TYPE_ACCESS)); /* iterate through all ACEs */ while (acl_get_entry(acl, entry_id, &entry) == 1) { entry_id = ACL_NEXT_ENTRY; EC_ZERO_LOG(acl_get_tag_type(entry, &tag)); switch (tag) { case ACL_USER: EC_NULL_LOG(uid = (uid_t *)acl_get_qualifier(entry)); if (*uid == uuid && !(whoami == sb->st_uid)) { LOG(log_maxdebug, logtype_afpd, "ACL_USER: %u", *uid); acl_rights |= acl_permset_to_uarights(entry); } acl_free(uid); break; case ACL_GROUP_OBJ: group_rights = acl_permset_to_uarights(entry); LOG(log_maxdebug, logtype_afpd, "ACL_GROUP_OBJ: %u", sb->st_gid); if (gmem(sb->st_gid) && !(whoami == sb->st_uid)) acl_rights |= group_rights; break; case ACL_GROUP: EC_NULL_LOG(gid = (gid_t *)acl_get_qualifier(entry)); if (gmem(*gid) && !(whoami == sb->st_uid)) { LOG(log_maxdebug, logtype_afpd, "ACL_GROUP: %u", *gid); acl_rights |= acl_permset_to_uarights(entry); } acl_free(gid); break; case ACL_MASK: mask = acl_permset_to_uarights(entry); LOG(log_maxdebug, logtype_afpd, "ACL_MASK: 0x%02x", mask); break; default: break; } } /* apply the mask and adjust user and group permissions */ ma->ma_user |= (acl_rights & mask); ma->ma_group = (group_rights & mask); /* update st_mode to properly reflect group permissions */ sb->st_mode &= ~S_IRWXG; if (ma->ma_group & AR_USEARCH) sb->st_mode |= S_IXGRP; if (ma->ma_group & AR_UWRITE) sb->st_mode |= S_IWGRP; if (ma->ma_group & AR_UREAD) sb->st_mode |= S_IRGRP; EC_CLEANUP: if (acl) acl_free(acl); EC_EXIT; } /*! * Add entries of one acl to another acl * * @param aclp (rw) destination acl where new aces will be added * @param acl (r) source acl where aces will be copied from * * @returns 0 on success, -1 on error */ static int acl_add_acl(acl_t *aclp, const acl_t acl) { EC_INIT; int id; acl_entry_t se, de; for (id = ACL_FIRST_ENTRY; acl_get_entry(acl, id, &se) == 1; id = ACL_NEXT_ENTRY) { EC_ZERO_LOG_ERR(acl_create_entry(aclp, &de), AFPERR_MISC); EC_ZERO_LOG_ERR(acl_copy_entry(de, se), AFPERR_MISC); } EC_CLEANUP: EC_EXIT; } /*! * Map Darwin ACE rights to POSIX 1e perm * * We can only map few rights: * DARWIN_ACE_READ_DATA -> ACL_READ * DARWIN_ACE_WRITE_DATA -> ACL_WRITE * DARWIN_ACE_DELETE_CHILD & (is_dir == 1) -> ACL_WRITE * DARWIN_ACE_EXECUTE -> ACL_EXECUTE * * @param entry (rw) result of the mapping * @param is_dir (r) 1 for dirs, 0 for files * * @returns mapping result as acl_perm_t, -1 on error */ static acl_perm_t map_darwin_right_to_posix_permset(uint32_t darwin_ace_rights, int is_dir) { acl_perm_t perm = 0; if (darwin_ace_rights & DARWIN_ACE_READ_DATA) perm |= ACL_READ; if (darwin_ace_rights & (DARWIN_ACE_WRITE_DATA | (is_dir ? DARWIN_ACE_DELETE_CHILD : 0))) perm |= ACL_WRITE; if (darwin_ace_rights & DARWIN_ACE_EXECUTE) perm |= ACL_EXECUTE; return perm; } /*! * Add a ACL_USER or ACL_GROUP permission to an ACL, extending existing ACEs * * Add a permission of "type" for user or group "id" to an ACL. Scan the ACL * for existing permissions for this type/id, if there is one add the perm, * otherwise create a new ACL entry. * perm can be or'ed ACL_READ, ACL_WRITE and ACL_EXECUTE. * * @param aclp (rw) pointer to ACL * @param type (r) acl_tag_t of ACL_USER or ACL_GROUP * @param id (r) uid_t uid for ACL_USER, or gid casted to uid_t for ACL_GROUP * @param perm (r) acl_perm_t permissions to add * * @returns 0 on success, -1 on failure */ static int posix_acl_add_perm(acl_t *aclp, acl_tag_t type, uid_t id, acl_perm_t perm) { EC_INIT; uid_t *eid = NULL; acl_entry_t e; acl_tag_t tag; int entry_id = ACL_FIRST_ENTRY; acl_permset_t permset; int found = 0; for ( ; (! found) && acl_get_entry(*aclp, entry_id, &e) == 1; entry_id = ACL_NEXT_ENTRY) { EC_ZERO_LOG(acl_get_tag_type(e, &tag)); if (tag != ACL_USER && tag != ACL_GROUP) continue; EC_NULL_LOG(eid = (uid_t *)acl_get_qualifier(e)); if ((*eid == id) && (type == tag)) { /* found an ACE for this type/id */ found = 1; EC_ZERO_LOG(acl_get_permset(e, &permset)); EC_ZERO_LOG(acl_add_perm(permset, perm)); } acl_free(eid); eid = NULL; } if ( ! found) { /* there was no existing ACE for this type/id */ EC_ZERO_LOG(acl_create_entry(aclp, &e)); EC_ZERO_LOG(acl_set_tag_type(e, type)); EC_ZERO_LOG(acl_set_qualifier(e, &id)); EC_ZERO_LOG(acl_get_permset(e, &permset)); EC_ZERO_LOG(acl_clear_perms(permset)); EC_ZERO_LOG(acl_add_perm(permset, perm)); EC_ZERO_LOG(acl_set_permset(e, permset)); } EC_CLEANUP: if (eid) acl_free(eid); EC_EXIT; } /*! * Map Darwin ACL to POSIX ACL. * * aclp must point to a acl_init'ed acl_t or an acl_t that can eg contain default ACEs. * Mapping pecularities: * - we create a default ace (which inherits to files and dirs) if either DARWIN_ACE_FLAGS_FILE_INHERIT or DARWIN_ACE_FLAGS_DIRECTORY_INHERIT is requested * - we throw away DARWIN_ACE_FLAGS_LIMIT_INHERIT (can't be mapped), thus the ACL will * not be limited * * @param darwin_aces (r) pointer to darwin_aces buffer * @param def_aclp (rw) directories: pointer to an initialized acl_t with the default acl files: *def_aclp will be NULL * @param acc_aclp (rw) pointer to an initialized acl_t with the access acl * @param ace_count (r) number of ACEs in darwin_aces buffer * @param default_acl_flags (rw) flags to indicate if the object has a basic default * acl or an extended default acl. * * @returns 0 on success storing the result in aclp, -1 on error. default_acl_flags * is set to HAS_DEFAULT_ACL|HAS_EXT_DEFAULT_ACL in case there is at least one * extended default ace. Otherwise default_acl_flags is left unchanged. */ static int map_aces_darwin_to_posix(const darwin_ace_t *darwin_aces, acl_t *def_aclp, acl_t *acc_aclp, int ace_count, uint32_t *default_acl_flags) { EC_INIT; char *name = NULL; uuidtype_t uuidtype; struct passwd *pwd; struct group *grp; uid_t id; uint32_t darwin_ace_flags, darwin_ace_rights; acl_tag_t tag; acl_perm_t perm; for ( ; ace_count != 0; ace_count--, darwin_aces++) { /* type: allow/deny, posix only has allow */ darwin_ace_flags = ntohl(darwin_aces->darwin_ace_flags); if ( ! (darwin_ace_flags & DARWIN_ACE_FLAGS_PERMIT)) continue; darwin_ace_rights = ntohl(darwin_aces->darwin_ace_rights); perm = map_darwin_right_to_posix_permset(darwin_ace_rights, (*def_aclp != NULL)); if (perm == 0) continue; /* dont add empty perm */ LOG(log_debug, logtype_afpd, "map_ace: no: %u, flags: %08x, darwin: %08x, posix: %02x", ace_count, darwin_ace_flags, darwin_ace_rights, perm); /* uid/gid */ EC_ZERO_LOG(getnamefromuuid(darwin_aces->darwin_ace_uuid, &name, &uuidtype)); switch (uuidtype) { case UUID_USER: EC_NULL_LOG(pwd = getpwnam(name)); tag = ACL_USER; id = pwd->pw_uid; LOG(log_debug, logtype_afpd, "map_ace: name: %s, uid: %u", name, id); break; case UUID_GROUP: EC_NULL_LOG(grp = getgrnam(name)); tag = ACL_GROUP; id = (uid_t)(grp->gr_gid); LOG(log_debug, logtype_afpd, "map_ace: name: %s, gid: %u", name, id); break; default: continue; } free(name); name = NULL; if (darwin_ace_flags & DARWIN_ACE_INHERIT_CONTROL_FLAGS) { if (*def_aclp == NULL) { /* ace request inheritane but we haven't got a default acl pointer */ LOG(log_warning, logtype_afpd, "map_acl: unexpected ACE, flags: 0x%04x", darwin_ace_flags); EC_FAIL; } /* add it as default ace */ EC_ZERO_LOG(posix_acl_add_perm(def_aclp, tag, id, perm)); *default_acl_flags = (HAS_DEFAULT_ACL|HAS_EXT_DEFAULT_ACL); if (! (darwin_ace_flags & DARWIN_ACE_FLAGS_ONLY_INHERIT)) /* if it not a "inherit only" ace, it must be added as access aces too */ EC_ZERO_LOG(posix_acl_add_perm(acc_aclp, tag, id, perm)); } else { EC_ZERO_LOG(posix_acl_add_perm(acc_aclp, tag, id, perm)); } } EC_CLEANUP: if (name) free(name); EC_EXIT; } /* * Map ACEs from POSIX to Darwin. * type is either POSIX_DEFAULT_2_DARWIN or POSIX_ACCESS_2_DARWIN, cf. acl_get_file. * Return number of mapped ACES, -1 on error. */ static int map_acl_posix_to_darwin(int type, const acl_t acl, darwin_ace_t *darwin_aces) { EC_INIT; int mapped_aces = 0; int entry_id = ACL_FIRST_ENTRY; acl_entry_t e; acl_tag_t tag; uid_t *uid = NULL; gid_t *gid = NULL; struct passwd *pwd = NULL; struct group *grp = NULL; uint32_t flags; uint32_t rights, maskrights = 0; darwin_ace_t *saved_darwin_aces = darwin_aces; LOG(log_maxdebug, logtype_afpd, "map_aces_posix_to_darwin(%s)", (type & MAP_MASK) == POSIX_DEFAULT_2_DARWIN ? "POSIX_DEFAULT_2_DARWIN" : "POSIX_ACCESS_2_DARWIN"); /* itereate through all ACEs */ while (acl_get_entry(acl, entry_id, &e) == 1) { entry_id = ACL_NEXT_ENTRY; /* get ACE type */ EC_ZERO_LOG(acl_get_tag_type(e, &tag)); /* we return user and group ACE */ switch (tag) { case ACL_USER: EC_NULL_LOG(uid = (uid_t *)acl_get_qualifier(e)); EC_NULL_LOG(pwd = getpwuid(*uid)); LOG(log_debug, logtype_afpd, "map_aces_posix_to_darwin: uid: %d -> name: %s", *uid, pwd->pw_name); EC_ZERO_LOG(getuuidfromname(pwd->pw_name, UUID_USER, darwin_aces->darwin_ace_uuid)); acl_free(uid); uid = NULL; break; case ACL_GROUP: EC_NULL_LOG(gid = (gid_t *)acl_get_qualifier(e)); EC_NULL_LOG(grp = getgrgid(*gid)); LOG(log_debug, logtype_afpd, "map_aces_posix_to_darwin: gid: %d -> name: %s", *gid, grp->gr_name); EC_ZERO_LOG(getuuidfromname(grp->gr_name, UUID_GROUP, darwin_aces->darwin_ace_uuid)); acl_free(gid); gid = NULL; break; case ACL_MASK: maskrights = posix_permset_to_darwin_rights(e, type & IS_DIR); continue; default: continue; } /* flags */ flags = DARWIN_ACE_FLAGS_PERMIT; if ((type & MAP_MASK) == POSIX_DEFAULT_2_DARWIN) flags |= DARWIN_ACE_FLAGS_FILE_INHERIT | DARWIN_ACE_FLAGS_DIRECTORY_INHERIT | DARWIN_ACE_FLAGS_ONLY_INHERIT; darwin_aces->darwin_ace_flags = htonl(flags); /* rights */ rights = posix_permset_to_darwin_rights(e, type & IS_DIR); darwin_aces->darwin_ace_rights = htonl(rights); darwin_aces++; mapped_aces++; } /* while */ /* Loop through the mapped ACE buffer once again, applying the mask */ for (int i = mapped_aces; i > 0; i--) { saved_darwin_aces->darwin_ace_rights &= htonl(maskrights); saved_darwin_aces++; } EC_STATUS(mapped_aces); EC_CLEANUP: if (uid) acl_free(uid); if (gid) acl_free(gid); EC_EXIT; } #endif /* * Multiplex ACL mapping (SOLARIS_2_DARWIN, DARWIN_2_SOLARIS, POSIX_2_DARWIN, DARWIN_2_POSIX). * Reads from 'aces' buffer, writes to 'rbuf' buffer. * Caller must provide buffer. * Darwin ACEs are read and written in network byte order. * Needs to know how many ACEs are in the ACL (ace_count) for Solaris ACLs. * Ignores trivial ACEs. * Return no of mapped ACEs or -1 on error. */ static int map_acl(int type, void *acl, darwin_ace_t *buf, int ace_count) { int mapped_aces; LOG(log_debug9, logtype_afpd, "map_acl: BEGIN"); switch (type & MAP_MASK) { #ifdef HAVE_SOLARIS_ACLS case SOLARIS_2_DARWIN: mapped_aces = map_aces_solaris_to_darwin( acl, buf, ace_count); break; case DARWIN_2_SOLARIS: mapped_aces = map_aces_darwin_to_solaris( buf, acl, ace_count); break; #endif /* HAVE_SOLARIS_ACLS */ #ifdef HAVE_POSIX_ACLS case POSIX_DEFAULT_2_DARWIN: mapped_aces = map_acl_posix_to_darwin(type, (const acl_t)acl, buf); break; case POSIX_ACCESS_2_DARWIN: mapped_aces = map_acl_posix_to_darwin(type, (const acl_t)acl, buf); break; case DARWIN_2_POSIX_DEFAULT: break; case DARWIN_2_POSIX_ACCESS: break; #endif /* HAVE_POSIX_ACLS */ default: mapped_aces = -1; break; } LOG(log_debug9, logtype_afpd, "map_acl: END"); return mapped_aces; } /* Get ACL from object omitting trivial ACEs. Map to Darwin ACL style and store Darwin ACL at rbuf. Add length of ACL written to rbuf to *rbuflen. Returns 0 on success, -1 on error. */ static int get_and_map_acl(char *name, char *rbuf, size_t *rbuflen) { EC_INIT; int mapped_aces = 0; int dirflag; uint32_t *darwin_ace_count = (u_int32_t *)rbuf; #ifdef HAVE_SOLARIS_ACLS int ace_count = 0; ace_t *aces = NULL; #endif #ifdef HAVE_POSIX_ACLS struct stat st; #endif LOG(log_debug9, logtype_afpd, "get_and_map_acl: BEGIN"); /* Skip length and flags */ rbuf += 4; *rbuf = 0; rbuf += 4; #ifdef HAVE_SOLARIS_ACLS EC_NEG1(ace_count = get_nfsv4_acl(name, &aces)); EC_NEG1(mapped_aces = map_acl(SOLARIS_2_DARWIN, aces, (darwin_ace_t *)rbuf, ace_count)); #endif /* HAVE_SOLARIS_ACLS */ #ifdef HAVE_POSIX_ACLS acl_t defacl = NULL , accacl = NULL; /* stat to check if its a dir */ EC_ZERO_LOG(lstat(name, &st)); /* if its a dir, check for default acl too */ dirflag = 0; if (S_ISDIR(st.st_mode)) { dirflag = IS_DIR; EC_NULL_LOG(defacl = acl_get_file(name, ACL_TYPE_DEFAULT)); EC_NEG1(mapped_aces = map_acl(POSIX_DEFAULT_2_DARWIN | dirflag, defacl, (darwin_ace_t *)rbuf, 0)); } EC_NULL_LOG(accacl = acl_get_file(name, ACL_TYPE_ACCESS)); int tmp; EC_NEG1(tmp = map_acl(POSIX_ACCESS_2_DARWIN | dirflag, accacl, (darwin_ace_t *)(rbuf + mapped_aces * sizeof(darwin_ace_t)), 0)); mapped_aces += tmp; #endif /* HAVE_POSIX_ACLS */ LOG(log_debug, logtype_afpd, "get_and_map_acl: mapped %d ACEs", mapped_aces); *darwin_ace_count = htonl(mapped_aces); *rbuflen += sizeof(darwin_acl_header_t) + (mapped_aces * sizeof(darwin_ace_t)); EC_STATUS(0); EC_CLEANUP: #ifdef HAVE_SOLARIS_ACLS if (aces) free(aces); #endif #ifdef HAVE_POSIX_ACLS if (defacl) acl_free(defacl); if (accacl) acl_free(accacl); #endif /* HAVE_POSIX_ACLS */ LOG(log_debug9, logtype_afpd, "get_and_map_acl: END"); EC_EXIT; } /* Removes all non-trivial ACLs from object. Returns full AFPERR code. */ static int remove_acl(const struct vol *vol,const char *path, int dir) { int ret = AFP_OK; #if (defined HAVE_SOLARIS_ACLS || defined HAVE_POSIX_ACLS) /* Ressource etc. first */ if ((ret = vol->vfs->vfs_remove_acl(vol, path, dir)) != AFP_OK) return ret; /* now the data fork or dir */ ret = remove_acl_vfs(path); #endif return ret; } /* Set ACL. Subtleties: - the client sends a complete list of ACEs, not only new ones. So we dont need to do any combination business (one exception being 'kFileSec_Inherit': see next) - client might request that we add inherited ACEs via 'kFileSec_Inherit'. We will store inherited ACEs first, which is Darwins canonical order. - returns AFPerror code */ #ifdef HAVE_SOLARIS_ACLS static int set_acl(const struct vol *vol, char *name, int inherit, darwin_ace_t *daces, uint32_t ace_count) { EC_INIT; int i, nfsv4_ace_count; int tocopy_aces_count = 0, new_aces_count = 0, trivial_ace_count = 0; ace_t *old_aces, *new_aces = NULL; uint16_t flags; LOG(log_debug9, logtype_afpd, "set_acl: BEGIN"); if (inherit) /* inherited + trivial ACEs */ flags = ACE_INHERITED_ACE | ACE_OWNER | ACE_GROUP | ACE_EVERYONE; else /* only trivial ACEs */ flags = ACE_OWNER | ACE_GROUP | ACE_EVERYONE; /* Get existing ACL and count ACEs which have to be copied */ if ((nfsv4_ace_count = get_nfsv4_acl(name, &old_aces)) == -1) return AFPERR_MISC; for ( i=0; i < nfsv4_ace_count; i++) { if (old_aces[i].a_flags & flags) tocopy_aces_count++; } /* Now malloc buffer exactly sized to fit all new ACEs */ if ((new_aces = malloc((ace_count + tocopy_aces_count) * sizeof(ace_t))) == NULL) { LOG(log_error, logtype_afpd, "set_acl: malloc %s", strerror(errno)); EC_STATUS(AFPERR_MISC); goto EC_CLEANUP; } /* Start building new ACL */ /* Copy local inherited ACEs. Therefore we have 'Darwin canonical order' (see chmod there): inherited ACEs first. */ if (inherit) { for (i=0; i < nfsv4_ace_count; i++) { if (old_aces[i].a_flags & ACE_INHERITED_ACE) { memcpy(&new_aces[new_aces_count], &old_aces[i], sizeof(ace_t)); new_aces_count++; } } } LOG(log_debug7, logtype_afpd, "set_acl: copied %d inherited ACEs", new_aces_count); /* Now the ACEs from the client */ if ((ret = (map_acl(DARWIN_2_SOLARIS, &new_aces[new_aces_count], daces, ace_count))) == -1) { EC_STATUS(AFPERR_PARAM); goto EC_CLEANUP; } new_aces_count += ret; LOG(log_debug7, logtype_afpd, "set_acl: mapped %d ACEs from client", ret); /* Now copy the trivial ACEs */ for (i=0; i < nfsv4_ace_count; i++) { if (old_aces[i].a_flags & (ACE_OWNER | ACE_GROUP | ACE_EVERYONE)) { memcpy(&new_aces[new_aces_count], &old_aces[i], sizeof(ace_t)); new_aces_count++; trivial_ace_count++; } } LOG(log_debug7, logtype_afpd, "set_acl: copied %d trivial ACEs", trivial_ace_count); /* Ressourcefork first. Note: for dirs we set the same ACL on the .AppleDouble/.Parent _file_. This might be strange for ACE_DELETE_CHILD and for inheritance flags. */ if ((ret = (vol->vfs->vfs_acl(vol, name, ACE_SETACL, new_aces_count, new_aces))) != 0) { LOG(log_error, logtype_afpd, "set_acl: error setting acl: %s", strerror(errno)); if (errno == (EACCES | EPERM)) EC_STATUS(AFPERR_ACCESS); else if (errno == ENOENT) EC_STATUS(AFPERR_NOITEM); else EC_STATUS(AFPERR_MISC); goto EC_CLEANUP; } if ((ret = (acl(name, ACE_SETACL, new_aces_count, new_aces))) != 0) { LOG(log_error, logtype_afpd, "set_acl: error setting acl: %s", strerror(errno)); if (errno == (EACCES | EPERM)) EC_STATUS(AFPERR_ACCESS); else if (errno == ENOENT) EC_STATUS(AFPERR_NOITEM); else EC_STATUS(AFPERR_MISC); goto EC_CLEANUP; } EC_STATUS(AFP_OK); EC_CLEANUP: if (old_aces) free(old_aces); if (new_aces) free(new_aces); LOG(log_debug9, logtype_afpd, "set_acl: END"); EC_EXIT; } #endif /* HAVE_SOLARIS_ACLS */ #ifdef HAVE_POSIX_ACLS #ifndef HAVE_ACL_FROM_MODE static acl_t acl_from_mode(mode_t mode) { acl_t acl; acl_entry_t entry; acl_permset_t permset; if (!(acl = acl_init(3))) return NULL; if (acl_create_entry(&acl, &entry) != 0) goto error; acl_set_tag_type(entry, ACL_USER_OBJ); acl_get_permset(entry, &permset); acl_clear_perms(permset); if (mode & S_IRUSR) acl_add_perm(permset, ACL_READ); if (mode & S_IWUSR) acl_add_perm(permset, ACL_WRITE); if (mode & S_IXUSR) acl_add_perm(permset, ACL_EXECUTE); acl_set_permset(entry, permset); if (acl_create_entry(&acl, &entry) != 0) goto error; acl_set_tag_type(entry, ACL_GROUP_OBJ); acl_get_permset(entry, &permset); acl_clear_perms(permset); if (mode & S_IRGRP) acl_add_perm(permset, ACL_READ); if (mode & S_IWGRP) acl_add_perm(permset, ACL_WRITE); if (mode & S_IXGRP) acl_add_perm(permset, ACL_EXECUTE); acl_set_permset(entry, permset); if (acl_create_entry(&acl, &entry) != 0) goto error; acl_set_tag_type(entry, ACL_OTHER); acl_get_permset(entry, &permset); acl_clear_perms(permset); if (mode & S_IROTH) acl_add_perm(permset, ACL_READ); if (mode & S_IWOTH) acl_add_perm(permset, ACL_WRITE); if (mode & S_IXOTH) acl_add_perm(permset, ACL_EXECUTE); acl_set_permset(entry, permset); return acl; error: acl_free(acl); return NULL; } #endif static int set_acl(const struct vol *vol, const char *name, int inherit _U_, darwin_ace_t *daces, uint32_t ace_count) { EC_INIT; struct stat st; acl_t default_acl = NULL; acl_t access_acl = NULL; acl_entry_t entry; acl_tag_t tag; int entry_id = ACL_FIRST_ENTRY; int has_def_acl = 0; /* flags to indicate if the object has a minimal default acl and/or an extended * default acl. */ uint32_t default_acl_flags = 0; LOG(log_maxdebug, logtype_afpd, "set_acl: BEGIN"); EC_NULL_LOG_ERR(access_acl = acl_get_file(name, ACL_TYPE_ACCESS), AFPERR_MISC); /* Iterate through acl and remove all extended acl entries. */ while (acl_get_entry(access_acl, entry_id, &entry) == 1) { entry_id = ACL_NEXT_ENTRY; EC_ZERO_LOG(acl_get_tag_type(entry, &tag)); if ((tag == ACL_USER) || (tag == ACL_GROUP) || (tag == ACL_MASK)) { EC_ZERO_LOG_ERR(acl_delete_entry(access_acl, entry), AFPERR_MISC); } } /* while */ /* In case we are acting on a directory prepare a default acl. For files default_acl will be NULL. * If the directory already has a default acl it will be preserved. */ EC_ZERO_LOG_ERR(lstat(name, &st), AFPERR_NOOBJ); if (S_ISDIR(st.st_mode)) { default_acl = acl_get_file(name, ACL_TYPE_DEFAULT); if (default_acl) { /* If default_acl is not empty then the dir has a default acl. */ if (acl_get_entry(default_acl, ACL_FIRST_ENTRY, &entry) == 1) default_acl_flags = HAS_DEFAULT_ACL; acl_free(default_acl); } default_acl = acl_dup(access_acl); } /* adds the clients aces */ EC_ZERO_ERR(map_aces_darwin_to_posix(daces, &default_acl, &access_acl, ace_count, &default_acl_flags), AFPERR_MISC); /* calcuate ACL mask */ EC_ZERO_LOG_ERR(acl_calc_mask(&access_acl), AFPERR_MISC); /* is it ok? */ EC_ZERO_LOG_ERR(acl_valid(access_acl), AFPERR_MISC); /* set it */ EC_ZERO_LOG_ERR(acl_set_file(name, ACL_TYPE_ACCESS, access_acl), AFPERR_MISC); EC_ZERO_LOG_ERR(vol->vfs->vfs_acl(vol, name, ACL_TYPE_ACCESS, 0, access_acl), AFPERR_MISC); if (default_acl) { /* If the dir has an extended default acl it's ACL_MASK must be updated.*/ if (default_acl_flags & HAS_EXT_DEFAULT_ACL) EC_ZERO_LOG_ERR(acl_calc_mask(&default_acl), AFPERR_MISC); if (default_acl_flags) { EC_ZERO_LOG_ERR(acl_valid(default_acl), AFPERR_MISC); EC_ZERO_LOG_ERR(acl_set_file(name, ACL_TYPE_DEFAULT, default_acl), AFPERR_MISC); EC_ZERO_LOG_ERR(vol->vfs->vfs_acl(vol, name, ACL_TYPE_DEFAULT, 0, default_acl), AFPERR_MISC); } } EC_CLEANUP: if (access_acl) acl_free(access_acl); if (default_acl) acl_free(default_acl); LOG(log_maxdebug, logtype_afpd, "set_acl: END"); EC_EXIT; } #endif /* HAVE_POSIX_ACLS */ /*! * Checks if a given UUID has requested_rights(type darwin_ace_rights) for path. * * Note: this gets called frequently and is a good place for optimizations ! * * @param vol (r) volume * @param dir (rw) directory * @param path (r) path to filesystem object * @param uuid (r) UUID of user * @param requested_rights (r) requested Darwin ACE * * @returns AFP result code */ static int check_acl_access(const struct vol *vol, struct dir *dir, const char *path, const uuidp_t uuid, uint32_t requested_rights) { int ret; uint32_t allowed_rights = 0; char *username = NULL; uuidtype_t uuidtype; struct stat st; bstring parent = NULL; int is_dir; LOG(log_maxdebug, logtype_afpd, "check_acl_access(dir: \"%s\", path: \"%s\", curdir: \"%s\", 0x%08x)", cfrombstr(dir->d_fullpath), path, getcwdpath(), requested_rights); /* This check is not used anymore, as OS X Server seems to be ignoring too */ #if 0 /* Get uid or gid from UUID */ EC_ZERO_ERR(getnamefromuuid(uuid, &username, &uuidtype), AFPERR_PARAM); switch (uuidtype) { case UUID_USER: break; case UUID_GROUP: LOG(log_warning, logtype_afpd, "check_acl_access: afp_access not supported for groups"); EC_STATUS(AFPERR_MISC); goto EC_CLEANUP; default: EC_STATUS(AFPERR_MISC); goto EC_CLEANUP; } #endif EC_ZERO_LOG_ERR(lstat(path, &st), AFPERR_PARAM); is_dir = !strcmp(path, "."); if (is_dir && (curdir->d_rights_cache != 0xffffffff)) { /* its a dir and the cache value is valid */ allowed_rights = curdir->d_rights_cache; LOG(log_debug, logtype_afpd, "check_access: allowed rights from dircache: 0x%08x", allowed_rights); } else { #ifdef HAVE_SOLARIS_ACLS EC_ZERO_LOG(solaris_acl_rights(path, &st, &allowed_rights)); #endif #ifdef HAVE_POSIX_ACLS EC_ZERO_LOG(posix_acl_rights(path, &st, &allowed_rights)); #endif /* * The DARWIN_ACE_DELETE right might implicitly result from write acces to the parent * directory. As it seems the 10.6 AFP client is puzzled when this right is not * allowed where a delete would succeed because the parent dir gives write perms. * So we check the parent dir for write access and set the right accordingly. * Currentyl acl2ownermode calls us with dir = NULL, because it doesn't make sense * there to do this extra check -- afaict. */ if (vol && dir && (requested_rights & DARWIN_ACE_DELETE)) { int i; uint32_t parent_rights = 0; if (curdir->d_did == DIRDID_ROOT_PARENT) { /* use volume path */ EC_NULL_LOG_ERR(parent = bfromcstr(vol->v_path), AFPERR_MISC); } else { /* build path for parent */ EC_NULL_LOG_ERR(parent = bstrcpy(curdir->d_fullpath), AFPERR_MISC); EC_ZERO_LOG_ERR(bconchar(parent, '/'), AFPERR_MISC); EC_ZERO_LOG_ERR(bcatcstr(parent, path), AFPERR_MISC); EC_NEG1_LOG_ERR(i = bstrrchr(parent, '/'), AFPERR_MISC); EC_ZERO_LOG_ERR(binsertch(parent, i, 1, 0), AFPERR_MISC); } LOG(log_debug, logtype_afpd,"parent: %s", cfrombstr(parent)); EC_ZERO_LOG_ERR(lstat(cfrombstr(parent), &st), AFPERR_MISC); #ifdef HAVE_SOLARIS_ACLS EC_ZERO_LOG(solaris_acl_rights(cfrombstr(parent), &st, &parent_rights)); #endif #ifdef HAVE_POSIX_ACLS EC_ZERO_LOG(posix_acl_rights(path, &st, &parent_rights)); #endif if (parent_rights & (DARWIN_ACE_WRITE_DATA | DARWIN_ACE_DELETE_CHILD)) allowed_rights |= DARWIN_ACE_DELETE; /* man, that was a lot of work! */ } if (is_dir) { /* Without DARWIN_ACE_DELETE set OS X 10.6 refuses to rename subdirectories in a * directory. */ if (allowed_rights & DARWIN_ACE_ADD_SUBDIRECTORY) allowed_rights |= DARWIN_ACE_DELETE; curdir->d_rights_cache = allowed_rights; } LOG(log_debug, logtype_afpd, "allowed rights: 0x%08x", allowed_rights); } if ((requested_rights & allowed_rights) != requested_rights) { LOG(log_debug, logtype_afpd, "some requested right wasn't allowed: 0x%08x / 0x%08x", requested_rights, allowed_rights); EC_STATUS(AFPERR_ACCESS); } else { LOG(log_debug, logtype_afpd, "all requested rights are allowed: 0x%08x", requested_rights); EC_STATUS(AFP_OK); } EC_CLEANUP: if (username) free(username); if (parent) bdestroy(parent); EC_EXIT; } /******************************************************** * Interface ********************************************************/ int afp_access(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { int ret; struct vol *vol; struct dir *dir; uint32_t did, darwin_ace_rights; uint16_t vid; struct path *s_path; uuidp_t uuid; *rbuflen = 0; ibuf += 2; memcpy(&vid, ibuf, sizeof( vid )); ibuf += sizeof(vid); if (NULL == ( vol = getvolbyvid( vid ))) { LOG(log_error, logtype_afpd, "afp_access: error getting volid:%d", vid); return AFPERR_NOOBJ; } memcpy(&did, ibuf, sizeof( did )); ibuf += sizeof( did ); if (NULL == ( dir = dirlookup( vol, did ))) { LOG(log_error, logtype_afpd, "afp_access: error getting did:%d", did); return afp_errno; } /* Skip bitmap */ ibuf += 2; /* Store UUID address */ uuid = (uuidp_t)ibuf; ibuf += UUID_BINSIZE; /* Store ACE rights */ memcpy(&darwin_ace_rights, ibuf, 4); darwin_ace_rights = ntohl(darwin_ace_rights); ibuf += 4; /* get full path and handle file/dir subtleties in netatalk code*/ if (NULL == ( s_path = cname( vol, dir, &ibuf ))) { LOG(log_error, logtype_afpd, "afp_getacl: cname got an error!"); return AFPERR_NOOBJ; } if (!s_path->st_valid) of_statdir(vol, s_path); if ( s_path->st_errno != 0 ) { LOG(log_error, logtype_afpd, "afp_getacl: cant stat"); return AFPERR_NOOBJ; } ret = check_acl_access(vol, dir, s_path->u_name, uuid, darwin_ace_rights); return ret; } int afp_getacl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *vol; struct dir *dir; int ret; uint32_t did; uint16_t vid, bitmap; struct path *s_path; struct passwd *pw; struct group *gr; LOG(log_debug9, logtype_afpd, "afp_getacl: BEGIN"); *rbuflen = 0; ibuf += 2; memcpy(&vid, ibuf, sizeof( vid )); ibuf += sizeof(vid); if (NULL == ( vol = getvolbyvid( vid ))) { LOG(log_error, logtype_afpd, "afp_getacl: error getting volid:%d", vid); return AFPERR_NOOBJ; } memcpy(&did, ibuf, sizeof( did )); ibuf += sizeof( did ); if (NULL == ( dir = dirlookup( vol, did ))) { LOG(log_error, logtype_afpd, "afp_getacl: error getting did:%d", did); return afp_errno; } memcpy(&bitmap, ibuf, sizeof( bitmap )); memcpy(rbuf, ibuf, sizeof( bitmap )); bitmap = ntohs( bitmap ); ibuf += sizeof( bitmap ); rbuf += sizeof( bitmap ); *rbuflen += sizeof( bitmap ); /* skip maxreplysize */ ibuf += 4; /* get full path and handle file/dir subtleties in netatalk code*/ if (NULL == ( s_path = cname( vol, dir, &ibuf ))) { LOG(log_error, logtype_afpd, "afp_getacl: cname got an error!"); return AFPERR_NOOBJ; } if (!s_path->st_valid) of_statdir(vol, s_path); if ( s_path->st_errno != 0 ) { LOG(log_error, logtype_afpd, "afp_getacl: cant stat"); return AFPERR_NOOBJ; } /* Shall we return owner UUID ? */ if (bitmap & kFileSec_UUID) { LOG(log_debug, logtype_afpd, "afp_getacl: client requested files owner user UUID"); if (NULL == (pw = getpwuid(s_path->st.st_uid))) { LOG(log_debug, logtype_afpd, "afp_getacl: local uid: %u", s_path->st.st_uid); localuuid_from_id(rbuf, UUID_USER, s_path->st.st_uid); } else { LOG(log_debug, logtype_afpd, "afp_getacl: got uid: %d, name: %s", s_path->st.st_uid, pw->pw_name); if ((ret = getuuidfromname(pw->pw_name, UUID_USER, rbuf)) != 0) return AFPERR_MISC; } rbuf += UUID_BINSIZE; *rbuflen += UUID_BINSIZE; } /* Shall we return group UUID ? */ if (bitmap & kFileSec_GRPUUID) { LOG(log_debug, logtype_afpd, "afp_getacl: client requested files owner group UUID"); if (NULL == (gr = getgrgid(s_path->st.st_gid))) { LOG(log_debug, logtype_afpd, "afp_getacl: local gid: %u", s_path->st.st_gid); localuuid_from_id(rbuf, UUID_GROUP, s_path->st.st_gid); } else { LOG(log_debug, logtype_afpd, "afp_getacl: got gid: %d, name: %s", s_path->st.st_gid, gr->gr_name); if ((ret = getuuidfromname(gr->gr_name, UUID_GROUP, rbuf)) != 0) return AFPERR_MISC; } rbuf += UUID_BINSIZE; *rbuflen += UUID_BINSIZE; } /* Shall we return ACL ? */ if (bitmap & kFileSec_ACL) { LOG(log_debug, logtype_afpd, "afp_getacl: client requested files ACL"); if (get_and_map_acl(s_path->u_name, rbuf, rbuflen) != 0) { LOG(log_error, logtype_afpd, "afp_getacl(\"%s/%s\"): mapping error", getcwdpath(), s_path->u_name); return AFPERR_MISC; } } LOG(log_debug9, logtype_afpd, "afp_getacl: END"); return AFP_OK; } int afp_setacl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *vol; struct dir *dir; int ret; uint32_t did; uint16_t vid, bitmap; struct path *s_path; LOG(log_debug9, logtype_afpd, "afp_setacl: BEGIN"); *rbuflen = 0; ibuf += 2; memcpy(&vid, ibuf, sizeof( vid )); ibuf += sizeof(vid); if (NULL == ( vol = getvolbyvid( vid ))) { LOG(log_error, logtype_afpd, "afp_setacl: error getting volid:%d", vid); return AFPERR_NOOBJ; } memcpy(&did, ibuf, sizeof( did )); ibuf += sizeof( did ); if (NULL == ( dir = dirlookup( vol, did ))) { LOG(log_error, logtype_afpd, "afp_setacl: error getting did:%d", did); return afp_errno; } memcpy(&bitmap, ibuf, sizeof( bitmap )); bitmap = ntohs( bitmap ); ibuf += sizeof( bitmap ); /* get full path and handle file/dir subtleties in netatalk code*/ if (NULL == ( s_path = cname( vol, dir, &ibuf ))) { LOG(log_error, logtype_afpd, "afp_setacl: cname got an error!"); return AFPERR_NOOBJ; } if (!s_path->st_valid) of_statdir(vol, s_path); if ( s_path->st_errno != 0 ) { LOG(log_error, logtype_afpd, "afp_setacl: cant stat"); return AFPERR_NOOBJ; } LOG(log_debug, logtype_afpd, "afp_setacl: unixname: %s", s_path->u_name); /* Padding? */ if ((unsigned long)ibuf & 1) ibuf++; /* Start processing request */ /* Change owner: dont even try */ if (bitmap & kFileSec_UUID) { LOG(log_note, logtype_afpd, "afp_setacl: change owner request, discarded"); ret = AFPERR_ACCESS; ibuf += UUID_BINSIZE; } /* Change group: certain changes might be allowed, so try it. FIXME: not implemented yet. */ if (bitmap & kFileSec_UUID) { LOG(log_note, logtype_afpd, "afp_setacl: change group request, not supported"); ret = AFPERR_PARAM; ibuf += UUID_BINSIZE; } /* Remove ACL ? */ if (bitmap & kFileSec_REMOVEACL) { LOG(log_debug, logtype_afpd, "afp_setacl: Remove ACL request."); if ((ret = remove_acl(vol, s_path->u_name, S_ISDIR(s_path->st.st_mode))) != AFP_OK) LOG(log_error, logtype_afpd, "afp_setacl: error from remove_acl"); } /* Change ACL ? */ if (bitmap & kFileSec_ACL) { LOG(log_debug, logtype_afpd, "afp_setacl: Change ACL request."); /* Get no of ACEs the client put on the wire */ uint32_t ace_count; memcpy(&ace_count, ibuf, sizeof(uint32_t)); ace_count = htonl(ace_count); ibuf += 8; /* skip ACL flags (see acls.h) */ ret = set_acl(vol, s_path->u_name, (bitmap & kFileSec_Inherit), (darwin_ace_t *)ibuf, ace_count); if (ret == 0) ret = AFP_OK; else { LOG(log_warning, logtype_afpd, "afp_setacl(\"%s/%s\"): error", getcwdpath(), s_path->u_name); ret = AFPERR_MISC; } } LOG(log_debug9, logtype_afpd, "afp_setacl: END"); return ret; } /******************************************************************** * ACL funcs interfacing with other parts ********************************************************************/ /*! * map ACL to user maccess * * This is the magic function that makes ACLs usable by calculating * the access granted by ACEs to the logged in user. */ int acltoownermode(const struct vol *vol, char *path, struct stat *st, struct maccess *ma) { EC_INIT; uint32_t rights = 0; if ( ! (AFPobj->options.flags & OPTION_ACL2MACCESS) || ! (vol->v_flags & AFPVOL_ACLS)) return 0; LOG(log_maxdebug, logtype_afpd, "acltoownermode(\"%s/%s\", 0x%02x)", getcwdpath(), path, ma->ma_user); #ifdef HAVE_SOLARIS_ACLS EC_ZERO_LOG(solaris_acl_rights(path, st, &rights)); LOG(log_maxdebug, logtype_afpd, "rights: 0x%08x", rights); if (rights & DARWIN_ACE_READ_DATA) ma->ma_user |= AR_UREAD; if (rights & DARWIN_ACE_WRITE_DATA) ma->ma_user |= AR_UWRITE; if (rights & (DARWIN_ACE_EXECUTE | DARWIN_ACE_SEARCH)) ma->ma_user |= AR_USEARCH; #endif #ifdef HAVE_POSIX_ACLS EC_ZERO_LOG(posix_acls_to_uaperms(path, st, ma)); #endif LOG(log_maxdebug, logtype_afpd, "resulting user maccess: 0x%02x group maccess: 0x%02x", ma->ma_user, ma->ma_group); EC_CLEANUP: EC_EXIT; } /*! * Check whether a volume supports ACLs * * @param vol (r) volume * * @returns 0 if not, 1 if yes */ int check_vol_acl_support(const struct vol *vol) { int ret = 0; #ifdef HAVE_SOLARIS_ACLS ace_t *aces = NULL; ret = 1; if (get_nfsv4_acl(vol->v_path, &aces) == -1) ret = 0; #endif #ifdef HAVE_POSIX_ACLS acl_t acl = NULL; ret = 1; if ((acl = acl_get_file(vol->v_path, ACL_TYPE_ACCESS)) == NULL) ret = 0; #endif #ifdef HAVE_SOLARIS_ACLS if (aces) free(aces); #endif #ifdef HAVE_POSIX_ACLS if (acl) acl_free(acl); #endif /* HAVE_POSIX_ACLS */ LOG(log_debug, logtype_afpd, "Volume \"%s\" ACL support: %s", vol->v_path, ret ? "yes" : "no"); return ret; } netatalk-2.2.2/etc/afpd/catsearch.c0000644000175200017500000007547111655742264014063 00000000000000/* * Netatalk 2002 (c) * Copyright (C) 1990, 1993 Regents of The University of Michigan * Copyright (C) 2010 Frank Lahm * All Rights Reserved. See COPYRIGHT */ /* * This file contains FPCatSearch implementation. FPCatSearch performs * file/directory search based on specified criteria. It is used by client * to perform fast searches on (propably) big volumes. So, it has to be * pretty fast. * * This implementation bypasses most of adouble/libatalk stuff as long as * possible and does a standard filesystem search. It calls higher-level * libatalk/afpd functions only when it is really needed, mainly while * returning some non-UNIX information or filtering by non-UNIX criteria. * * Initial version written by Rafal Lewczuk * * Starting with Netatalk 2.2 searching by name criteria utilizes the * CNID database in conjunction with an enhanced cnid_dbd. This requires * the use of cnidscheme:dbd for the searched volume, the new functionality * is not built into cnidscheme:cdb. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "desktop.h" #include "directory.h" #include "dircache.h" #include "file.h" #include "volume.h" #include "filedir.h" #include "fork.h" struct finderinfo { u_int32_t f_type; u_int32_t creator; u_int16_t attrs; /* File attributes (high 8 bits)*/ u_int16_t label; /* Label (low 8 bits )*/ char reserved[22]; /* Unknown (at least for now...) */ }; typedef char packed_finder[ADEDLEN_FINDERI]; /* Known attributes: * 0x04 - has a custom icon * 0x20 - name/icon is locked * 0x40 - is invisible * 0x80 - is alias * * Known labels: * 0x02 - project 2 * 0x04 - project 1 * 0x06 - personal * 0x08 - cool * 0x0a - in progress * 0x0c - hot * 0x0e - essential */ /* This is our search-criteria structure. */ struct scrit { u_int32_t rbitmap; /* Request bitmap - which values should we check ? */ u_int16_t fbitmap, dbitmap; /* file & directory bitmap - which values should we return ? */ u_int16_t attr; /* File attributes */ time_t cdate; /* Creation date */ time_t mdate; /* Last modification date */ time_t bdate; /* Last backup date */ u_int32_t pdid; /* Parent DID */ u_int16_t offcnt; /* Offspring count */ struct finderinfo finfo; /* Finder info */ char lname[64]; /* Long name */ char utf8name[514]; /* UTF8 or UCS2 name */ /* for convert_charset dest_len parameter +2 */ }; /* * Directory tree search is recursive by its nature. But AFP specification * requires FPCatSearch to pause after returning n results and be able to * resume the search later. So we have to do recursive search using flat * (iterative) algorithm and remember all directories to look into in an * stack-like structure. The structure below is one item of directory stack. * */ struct dsitem { // struct dir *dir; /* Structure describing this directory */ // cnid_t did; /* CNID of this directory */ int pidx; /* Parent's dsitem structure index. */ int checked; /* Have we checked this directory ? */ int path_len; char *path; /* absolute UNIX path to this directory */ }; #define DS_BSIZE 128 static int save_cidx = -1; /* Saved index of currently scanned directory. */ static struct dsitem *dstack = NULL; /* Directory stack data... */ static int dssize = 0; /* Directory stack (allocated) size... */ static int dsidx = 0; /* First free item index... */ static struct scrit c1, c2; /* search criteria */ /* Puts new item onto directory stack. */ static int addstack(char *uname, struct dir *dir, int pidx) { struct dsitem *ds; size_t l, u; /* check if we have some space on stack... */ if (dsidx >= dssize) { dssize += DS_BSIZE; dstack = realloc(dstack, dssize * sizeof(struct dsitem)); if (dstack == NULL) return -1; } /* Put new element. Allocate and copy lname and path. */ ds = dstack + dsidx++; // ds->did = dir->d_did; ds->pidx = pidx; ds->checked = 0; if (pidx >= 0) { l = dstack[pidx].path_len; u = strlen(uname) +1; if (!(ds->path = malloc(l + u + 1) )) return -1; memcpy(ds->path, dstack[pidx].path, l); ds->path[l] = '/'; memcpy(&ds->path[l+1], uname, u); ds->path_len = l +u; } else { ds->path = strdup(uname); ds->path_len = strlen(uname); } return 0; } /* Removes checked items from top of directory stack. Returns index of the first unchecked elements or -1. */ static int reducestack(void) { int r; if (save_cidx != -1) { r = save_cidx; save_cidx = -1; return r; } while (dsidx > 0) { if (dstack[dsidx-1].checked) { dsidx--; free(dstack[dsidx].path); } else return dsidx - 1; } return -1; } /* Clears directory stack. */ static void clearstack(void) { save_cidx = -1; while (dsidx > 0) { dsidx--; free(dstack[dsidx].path); } } /* Looks up for an opened adouble structure, opens resource fork of selected file. * FIXME What about noadouble? */ static struct adouble *adl_lkup(struct vol *vol, struct path *path, struct adouble *adp) { static struct adouble ad; struct ofork *of; int isdir; if (adp) return adp; isdir = S_ISDIR(path->st.st_mode); if (!isdir && (of = of_findname(path))) { adp = of->of_ad; } else { ad_init(&ad, vol->v_adouble, vol->v_ad_options); adp = &ad; } if ( ad_metadata( path->u_name, ((isdir) ? ADFLAGS_DIR : 0), adp) < 0 ) { adp = NULL; /* FIXME without resource fork adl_lkup will be call again */ } return adp; } /* -------------------- */ static struct finderinfo *unpack_buffer(struct finderinfo *finfo, char *buffer) { memcpy(&finfo->f_type, buffer +FINDERINFO_FRTYPEOFF, sizeof(finfo->f_type)); memcpy(&finfo->creator, buffer +FINDERINFO_FRCREATOFF, sizeof(finfo->creator)); memcpy(&finfo->attrs, buffer +FINDERINFO_FRFLAGOFF, sizeof(finfo->attrs)); memcpy(&finfo->label, buffer +FINDERINFO_FRFLAGOFF, sizeof(finfo->label)); finfo->attrs &= 0xff00; /* high 8 bits */ finfo->label &= 0xff; /* low 8 bits */ return finfo; } /* -------------------- */ static struct finderinfo * unpack_finderinfo(struct vol *vol, struct path *path, struct adouble **adp, struct finderinfo *finfo, int islnk) { packed_finder buf; void *ptr; *adp = adl_lkup(vol, path, *adp); ptr = get_finderinfo(vol, path->u_name, *adp, &buf,islnk); return unpack_buffer(finfo, ptr); } /* -------------------- */ #define CATPBIT_PARTIAL 31 /* Criteria checker. This function returns a 2-bit value. */ /* bit 0 means if checked file meets given criteria. */ /* bit 1 means if it is a directory and we should descent into it. */ /* uname - UNIX name * fname - our fname (translated to UNIX) * cidx - index in directory stack */ static int crit_check(struct vol *vol, struct path *path) { int result = 0; u_int16_t attr, flags = CONV_PRECOMPOSE; struct finderinfo *finfo = NULL, finderinfo; struct adouble *adp = NULL; time_t c_date, b_date; u_int32_t ac_date, ab_date; static char convbuf[514]; /* for convert_charset dest_len parameter +2 */ size_t len; int islnk; islnk=S_ISLNK(path->st.st_mode); if (S_ISDIR(path->st.st_mode)) { if (!c1.dbitmap) return 0; } else { if (!c1.fbitmap) return 0; /* compute the Mac name * first try without id (it's slow to find it) * An other option would be to call get_id in utompath but * we need to pass parent dir */ if (!(path->m_name = utompath(vol, path->u_name, 0 , utf8_encoding()) )) { /*retry with the right id */ cnid_t id; adp = adl_lkup(vol, path, adp); id = get_id(vol, adp, &path->st, path->d_dir->d_did, path->u_name, strlen(path->u_name)); if (!id) { /* FIXME */ return 0; } /* save the id for getfilparm */ path->id = id; if (!(path->m_name = utompath(vol, path->u_name, id , utf8_encoding()))) { return 0; } } } /* Kind of optimization: * -- first check things we've already have - filename * -- last check things we get from ad_open() * FIXME strmcp strstr (icase) */ /* Check for filename */ if ((c1.rbitmap & (1<v_maccharset, CH_UCS2, path->m_name, -1, convbuf, 512)) ) goto crit_check_ret; if ((c1.rbitmap & (1<m_name, strlen(path->m_name), convbuf, 512, &flags))) { goto crit_check_ret; } if (c1.rbitmap & (1< 0x7fffffff) c2.mdate = 0x7fffffff; if ((unsigned)c2.cdate > 0x7fffffff) c2.cdate = 0x7fffffff; if ((unsigned)c2.bdate > 0x7fffffff) c2.bdate = 0x7fffffff; /* Check for modification date */ if ((c1.rbitmap & (1<st.st_mtime < c1.mdate || path->st.st_mtime > c2.mdate) goto crit_check_ret; } /* Check for creation date... */ if ((c1.rbitmap & (1<st.st_mtime; adp = adl_lkup(vol, path, adp); if (adp && ad_getdate(adp, AD_DATE_CREATE, &ac_date) >= 0) c_date = AD_DATE_TO_UNIX(ac_date); if (c_date < c1.cdate || c_date > c2.cdate) goto crit_check_ret; } /* Check for backup date... */ if ((c1.rbitmap & (1<st.st_mtime; adp = adl_lkup(vol, path, adp); if (adp && ad_getdate(adp, AD_DATE_BACKUP, &ab_date) >= 0) b_date = AD_DATE_TO_UNIX(ab_date); if (b_date < c1.bdate || b_date > c2.bdate) goto crit_check_ret; } /* Check attributes */ if ((c1.rbitmap & (1<f_type != c1.finfo.f_type) goto crit_check_ret; } /* Check creator ID */ if ((c1.rbitmap & (1<creator != c1.finfo.creator) goto crit_check_ret; } /* Check finder info attributes */ if ((c1.rbitmap & (1<attrs & c2.finfo.attrs) != c1.finfo.attrs) goto crit_check_ret; } /* Check label */ if ((c1.rbitmap & (1<label & c2.finfo.label) != c1.finfo.label) goto crit_check_ret; } /* FIXME: Attributes check ! */ /* All criteria are met. */ result |= 1; crit_check_ret: if (adp != NULL) ad_close_metadata(adp); return result; } /* ------------------------------ */ static int rslt_add ( struct vol *vol, struct path *path, char **buf, int ext) { char *p = *buf; int ret; size_t tbuf =0; u_int16_t resultsize; int isdir = S_ISDIR(path->st.st_mode); /* Skip resultsize */ if (ext) { p += sizeof(resultsize); } else { p++; } *p++ = isdir ? FILDIRBIT_ISDIR : FILDIRBIT_ISFILE; /* IsDir ? */ if (ext) { *p++ = 0; /* Pad */ } if ( isdir ) { ret = getdirparams(vol, c1.dbitmap, path, path->d_dir, p , &tbuf ); } else { /* FIXME slow if we need the file ID, we already know it, done ? */ ret = getfilparams ( vol, c1.fbitmap, path, path->d_dir, p, &tbuf); } if ( ret != AFP_OK ) return 0; /* Make sure entry length is even */ if ((tbuf & 1)) { *p++ = 0; tbuf++; } if (ext) { resultsize = htons(tbuf); memcpy ( *buf, &resultsize, sizeof(resultsize) ); *buf += tbuf + 4; } else { **buf = tbuf; *buf += tbuf + 2; } return 1; } #define VETO_STR \ "./../.AppleDouble/.AppleDB/Network Trash Folder/TheVolumeSettingsFolder/TheFindByContentFolder/.AppleDesktop/.Parent/" /*! * This function performs a filesystem search * * Uses globals c1, c2, the search criteria * * @param vol (r) volume we are searching on ... * @param dir (rw) directory we are starting from ... * @param rmatches (r) maximum number of matches we can return * @param pos (r) position we've stopped recently * @param rbuf (w) output buffer * @param nrecs (w) number of matches * @param rsize (w) length of data written to output buffer * @param ext (r) extended search flag */ #define NUM_ROUNDS 200 static int catsearch(struct vol *vol, struct dir *dir, int rmatches, uint32_t *pos, char *rbuf, uint32_t *nrecs, int *rsize, int ext) { static u_int32_t cur_pos; /* Saved position index (ID) - used to remember "position" across FPCatSearch calls */ static DIR *dirpos; /* UNIX structure describing currently opened directory. */ struct dir *currentdir; /* struct dir of current directory */ int cidx, r; struct dirent *entry; int result = AFP_OK; int ccr; struct path path; char *vpath = vol->v_path; char *rrbuf = rbuf; time_t start_time; int num_rounds = NUM_ROUNDS; int cwd = -1; int error; if (*pos != 0 && *pos != cur_pos) { result = AFPERR_CATCHNG; goto catsearch_end; } /* FIXME: Category "offspring count ! */ /* We need to initialize all mandatory structures/variables and change working directory appropriate... */ if (*pos == 0) { clearstack(); if (dirpos != NULL) { closedir(dirpos); dirpos = NULL; } if (addstack(vpath, dir, -1) == -1) { result = AFPERR_MISC; goto catsearch_end; } /* FIXME: Sometimes DID is given by client ! (correct this one above !) */ } /* Save current path */ if ((cwd = open(".", O_RDONLY)) < 0) { result = AFPERR_MISC; goto catsearch_end; } /* So we are beginning... */ start_time = time(NULL); while ((cidx = reducestack()) != -1) { LOG(log_debug, logtype_afpd, "catsearch: dir: \"%s\"", dstack[cidx].path); error = lchdir(dstack[cidx].path); if (!error && dirpos == NULL) dirpos = opendir("."); if (dirpos == NULL) dirpos = opendir(dstack[cidx].path); if (error || dirpos == NULL) { switch (errno) { case EACCES: dstack[cidx].checked = 1; continue; case EMFILE: case ENFILE: case ENOENT: result = AFPERR_NFILE; break; case ENOMEM: case ENOTDIR: default: result = AFPERR_MISC; } /* switch (errno) */ goto catsearch_end; } if ((currentdir = dirlookup_bypath(vol, dstack[cidx].path)) == NULL) { result = AFPERR_MISC; goto catsearch_end; } LOG(log_debug, logtype_afpd, "catsearch: current struct dir: \"%s\"", cfrombstr(currentdir->d_fullpath)); while ((entry = readdir(dirpos)) != NULL) { (*pos)++; if (!check_dirent(vol, entry->d_name)) continue; LOG(log_debug, logtype_afpd, "catsearch(\"%s\"): dirent: \"%s\"", cfrombstr(currentdir->d_fullpath), entry->d_name); memset(&path, 0, sizeof(path)); path.u_name = entry->d_name; if (of_stat(&path) != 0) { switch (errno) { case EACCES: case ELOOP: case ENOENT: continue; case ENOTDIR: case EFAULT: case ENOMEM: case ENAMETOOLONG: default: result = AFPERR_MISC; goto catsearch_end; } } if (S_ISDIR(path.st.st_mode)) { /* here we can short cut ie if in the same loop the parent dir wasn't in the cache ALL dirsearch_byname will fail. */ int unlen = strlen(path.u_name); path.d_dir = dircache_search_by_name(vol, currentdir, path.u_name, unlen); if (path.d_dir == NULL) { /* path.m_name is set by adddir */ if ((path.d_dir = dir_add(vol, currentdir, &path, unlen)) == NULL) { result = AFPERR_MISC; goto catsearch_end; } } path.m_name = cfrombstr(path.d_dir->d_m_name); if (addstack(path.u_name, path.d_dir, cidx) == -1) { result = AFPERR_MISC; goto catsearch_end; } } else { path.d_dir = currentdir; } ccr = crit_check(vol, &path); /* bit 0 means that criteria has been met */ if ((ccr & 1)) { r = rslt_add ( vol, &path, &rrbuf, ext); if (r == 0) { result = AFPERR_MISC; goto catsearch_end; } *nrecs += r; /* Number of matches limit */ if (--rmatches == 0) goto catsearch_pause; /* Block size limit */ if (rrbuf - rbuf >= 448) goto catsearch_pause; } /* MacOS 9 doesn't like servers executing commands longer than few seconds */ if (--num_rounds <= 0) { if (start_time != time(NULL)) { result=AFP_OK; goto catsearch_pause; } num_rounds = NUM_ROUNDS; } } /* while ((entry=readdir(dirpos)) != NULL) */ closedir(dirpos); dirpos = NULL; dstack[cidx].checked = 1; } /* while (current_idx = reducestack()) != -1) */ /* We have finished traversing our tree. Return EOF here. */ result = AFPERR_EOF; goto catsearch_end; catsearch_pause: cur_pos = *pos; save_cidx = cidx; catsearch_end: /* Exiting catsearch: error condition */ *rsize = rrbuf - rbuf; if (cwd != -1) { if ((fchdir(cwd)) != 0) { LOG(log_debug, logtype_afpd, "error chdiring back: %s", strerror(errno)); } close(cwd); } return result; } /* catsearch() */ /*! * This function performs a CNID db search * * Uses globals c1, c2, the search criteria * * @param vol (r) volume we are searching on ... * @param dir (rw) directory we are starting from ... * @param uname (r) UNIX name of object to search * @param rmatches (r) maximum number of matches we can return * @param pos (r) position we've stopped recently * @param rbuf (w) output buffer * @param nrecs (w) number of matches * @param rsize (w) length of data written to output buffer * @param ext (r) extended search flag */ static int catsearch_db(struct vol *vol, struct dir *dir, const char *uname, int rmatches, uint32_t *pos, char *rbuf, uint32_t *nrecs, int *rsize, int ext) { static char resbuf[DBD_MAX_SRCH_RSLTS * sizeof(cnid_t)]; static uint32_t cur_pos; static int num_matches; int ccr ,r; int result = AFP_OK; struct path path; char *rrbuf = rbuf; char buffer[MAXPATHLEN +2]; uint16_t flags = CONV_TOLOWER; LOG(log_debug, logtype_afpd, "catsearch_db(req pos: %u): {pos: %u, name: %s}", *pos, cur_pos, uname); if (*pos != 0 && *pos != cur_pos) { result = AFPERR_CATCHNG; goto catsearch_end; } if (cur_pos == 0 || *pos == 0) { if (convert_charset(vol->v_volcharset, vol->v_volcharset, vol->v_maccharset, uname, strlen(uname), buffer, MAXPATHLEN, &flags) == (size_t)-1) { LOG(log_error, logtype_afpd, "catsearch_db: conversion error"); result = AFPERR_MISC; goto catsearch_end; } LOG(log_debug, logtype_afpd, "catsearch_db: %s", buffer); if ((num_matches = cnid_find(vol->v_cdb, buffer, strlen(uname), resbuf, sizeof(resbuf))) == -1) { result = AFPERR_MISC; goto catsearch_end; } } while (cur_pos < num_matches) { char *name; cnid_t cnid, did; char resolvebuf[12 + MAXPATHLEN + 1]; struct dir *dir; /* Next CNID to process from buffer */ memcpy(&cnid, resbuf + cur_pos * sizeof(cnid_t), sizeof(cnid_t)); did = cnid; if ((name = cnid_resolve(vol->v_cdb, &did, resolvebuf, 12 + MAXPATHLEN + 1)) == NULL) goto next; LOG(log_debug, logtype_afpd, "catsearch_db: {pos: %u, name:%s, cnid: %u}", cur_pos, name, ntohl(cnid)); if ((dir = dirlookup(vol, did)) == NULL) goto next; if (movecwd(vol, dir) < 0 ) goto next; memset(&path, 0, sizeof(path)); path.u_name = name; path.m_name = utompath(vol, name, cnid, utf8_encoding()); if (of_stat(&path) != 0) { switch (errno) { case EACCES: case ELOOP: goto next; case ENOENT: default: result = AFPERR_MISC; goto catsearch_end; } } /* For files path.d_dir is the parent dir, for dirs its the dir itself */ if (S_ISDIR(path.st.st_mode)) if ((dir = dirlookup(vol, cnid)) == NULL) goto next; path.d_dir = dir; LOG(log_maxdebug, logtype_afpd,"catsearch_db: dir: %s, cwd: %s, name: %s", cfrombstr(dir->d_fullpath), getcwdpath(), path.u_name); /* At last we can check the search criteria */ ccr = crit_check(vol, &path); if ((ccr & 1)) { LOG(log_debug, logtype_afpd,"catsearch_db: match: %s/%s", getcwdpath(), path.u_name); /* bit 1 means that criteria has been met */ r = rslt_add(vol, &path, &rrbuf, ext); if (r == 0) { result = AFPERR_MISC; goto catsearch_end; } *nrecs += r; /* Number of matches limit */ if (--rmatches == 0) goto catsearch_pause; /* Block size limit */ if (rrbuf - rbuf >= 448) goto catsearch_pause; } next: cur_pos++; } /* while */ /* finished */ result = AFPERR_EOF; cur_pos = 0; goto catsearch_end; catsearch_pause: *pos = cur_pos; catsearch_end: /* Exiting catsearch: error condition */ *rsize = rrbuf - rbuf; LOG(log_debug, logtype_afpd, "catsearch_db(req pos: %u): {pos: %u}", *pos, cur_pos); return result; } /* -------------------------- */ static int catsearch_afp(AFPObj *obj _U_, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen, int ext) { struct vol *vol; u_int16_t vid; u_int16_t spec_len; u_int32_t rmatches, reserved; u_int32_t catpos[4]; u_int32_t pdid = 0; int ret, rsize; u_int32_t nrecs = 0; unsigned char *spec1, *spec2, *bspec1, *bspec2; size_t len; u_int16_t namelen; u_int16_t flags; char tmppath[256]; char *uname; *rbuflen = 0; /* min header size */ if (ibuflen < 32) { return AFPERR_PARAM; } memset(&c1, 0, sizeof(c1)); memset(&c2, 0, sizeof(c2)); ibuf += 2; memcpy(&vid, ibuf, sizeof(vid)); ibuf += sizeof(vid); if ((vol = getvolbyvid(vid)) == NULL) { return AFPERR_PARAM; } memcpy(&rmatches, ibuf, sizeof(rmatches)); rmatches = ntohl(rmatches); ibuf += sizeof(rmatches); /* FIXME: (rl) should we check if reserved == 0 ? */ ibuf += sizeof(reserved); memcpy(catpos, ibuf, sizeof(catpos)); ibuf += sizeof(catpos); memcpy(&c1.fbitmap, ibuf, sizeof(c1.fbitmap)); c1.fbitmap = c2.fbitmap = ntohs(c1.fbitmap); ibuf += sizeof(c1.fbitmap); memcpy(&c1.dbitmap, ibuf, sizeof(c1.dbitmap)); c1.dbitmap = c2.dbitmap = ntohs(c1.dbitmap); ibuf += sizeof(c1.dbitmap); memcpy(&c1.rbitmap, ibuf, sizeof(c1.rbitmap)); c1.rbitmap = c2.rbitmap = ntohl(c1.rbitmap); ibuf += sizeof(c1.rbitmap); if (! (c1.fbitmap || c1.dbitmap)) { return AFPERR_BITMAP; } if ( ext) { memcpy(&spec_len, ibuf, sizeof(spec_len)); spec_len = ntohs(spec_len); } else { /* with catsearch only name and parent id are allowed */ c1.fbitmap &= (1<v_maccharset, CH_UCS2, tmppath, -1, c1.lname, sizeof(c1.lname)); if (len == (size_t)(-1)) return AFPERR_PARAM; #if 0 /* FIXME: do we need it ? It's always null ! */ memcpy(c2.lname, bspec2 + spec2[1] + 1, (bspec2 + spec2[1])[0]); c2.lname[(bspec2 + spec2[1])[0]]= 0; #endif } /* UTF8 Name */ if (c1.rbitmap & (1 << FILPBIT_PDINFO)) { /* offset */ memcpy(&namelen, spec1, sizeof(namelen)); namelen = ntohs (namelen); spec1 = bspec1+namelen+4; /* Skip Unicode Hint */ /* length */ memcpy(&namelen, spec1, sizeof(namelen)); namelen = ntohs (namelen); if (namelen > UTF8FILELEN_EARLY) /* Safeguard */ namelen = UTF8FILELEN_EARLY; memcpy (c1.utf8name, spec1+2, namelen); c1.utf8name[namelen] = 0; if ((uname = mtoupath(vol, c1.utf8name, 0, utf8_encoding())) == NULL) return AFPERR_PARAM; /* convert charset */ flags = CONV_PRECOMPOSE; len = convert_charset(CH_UTF8_MAC, CH_UCS2, CH_UTF8, c1.utf8name, namelen, c1.utf8name, 512, &flags); if (len == (size_t)(-1)) return AFPERR_PARAM; } /* Call search */ *rbuflen = 24; if ((c1.rbitmap & (1 << FILPBIT_PDINFO)) && (strcmp(vol->v_cnidscheme, "dbd") == 0) && (vol->v_flags & AFPVOL_SEARCHDB)) /* we've got a name and it's a dbd volume, so search CNID database */ ret = catsearch_db(vol, vol->v_root, uname, rmatches, &catpos[0], rbuf+24, &nrecs, &rsize, ext); else /* perform a slow filesystem tree search */ ret = catsearch(vol, vol->v_root, rmatches, &catpos[0], rbuf+24, &nrecs, &rsize, ext); memcpy(rbuf, catpos, sizeof(catpos)); rbuf += sizeof(catpos); c1.fbitmap = htons(c1.fbitmap); memcpy(rbuf, &c1.fbitmap, sizeof(c1.fbitmap)); rbuf += sizeof(c1.fbitmap); c1.dbitmap = htons(c1.dbitmap); memcpy(rbuf, &c1.dbitmap, sizeof(c1.dbitmap)); rbuf += sizeof(c1.dbitmap); nrecs = htonl(nrecs); memcpy(rbuf, &nrecs, sizeof(nrecs)); rbuf += sizeof(nrecs); *rbuflen += rsize; return ret; } /* catsearch_afp */ /* -------------------------- */ int afp_catsearch (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { return catsearch_afp( obj, ibuf, ibuflen, rbuf, rbuflen, 0); } int afp_catsearch_ext (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { return catsearch_afp( obj, ibuf, ibuflen, rbuf, rbuflen, 1); } /* FIXME: we need a clean separation between afp stubs and 'real' implementation */ /* (so, all buffer packing/unpacking should be done in stub, everything else should be done in other functions) */ netatalk-2.2.2/etc/afpd/afp_util.c0000644000175200017500000001632511655731126013715 00000000000000/* * $Id: afp_util.c,v 1.10 2010-01-23 14:44:42 franklahm Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * * Copyright (c) 2002 netatalk * * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include const char *AfpNum2name(int num) { switch(num) { case AFP_BYTELOCK : return "AFP_BYTELOCK"; /* 1 */ case AFP_CLOSEVOL : return "AFP_CLOSEVOL"; /* 2 */ case AFP_CLOSEDIR : return "AFP_CLOSEDIR"; /* 3 */ case AFP_CLOSEFORK : return "AFP_CLOSEFORK"; /* 4 */ case AFP_COPYFILE : return "AFP_COPYFILE"; /* 5 */ case AFP_CREATEDIR : return "AFP_CREATEDIR"; /* 6 */ case AFP_CREATEFILE : return "AFP_CREATEFILE"; /* 7 */ case AFP_DELETE : return "AFP_DELETE"; /* 8 */ case AFP_ENUMERATE : return "AFP_ENUMERATE"; /* 9 */ case AFP_FLUSH : return "AFP_FLUSH"; /* 10 */ case AFP_FLUSHFORK : return "AFP_FLUSHFORK"; /* 11 */ case AFP_GETFORKPARAM : return "AFP_GETFORKPARAM"; /* 14 */ case AFP_GETSRVINFO : return "AFP_GETSRVINFO"; /* 15 */ case AFP_GETSRVPARAM : return "AFP_GETSRVPARAM"; /* 16 */ case AFP_GETVOLPARAM : return "AFP_GETVOLPARAM"; /* 17 */ case AFP_LOGIN : return "AFP_LOGIN"; /* 18 */ case AFP_LOGINCONT : return "AFP_LOGINCONT"; /* 19 */ case AFP_LOGOUT : return "AFP_LOGOUT"; /* 20 */ case AFP_MAPID : return "AFP_MAPID"; /* 21 */ case AFP_MAPNAME : return "AFP_MAPNAME"; /* 22 */ case AFP_MOVE : return "AFP_MOVE"; /* 23 */ case AFP_OPENVOL : return "AFP_OPENVOL"; /* 24 */ case AFP_OPENDIR : return "AFP_OPENDIR"; /* 25 */ case AFP_OPENFORK : return "AFP_OPENFORK"; /* 26 */ case AFP_READ : return "AFP_READ"; /* 27 */ case AFP_RENAME : return "AFP_RENAME"; /* 28 */ case AFP_SETDIRPARAM : return "AFP_SETDIRPARAM"; /* 29 */ case AFP_SETFILEPARAM : return "AFP_SETFILEPARAM"; /* 30 */ case AFP_SETFORKPARAM : return "AFP_SETFORKPARAM"; /* 31 */ case AFP_SETVOLPARAM : return "AFP_SETVOLPARAM "; /* 32 */ case AFP_WRITE : return "AFP_WRITE"; /* 33 */ case AFP_GETFLDRPARAM : return "AFP_GETFLDRPARAM"; /* 34 */ case AFP_SETFLDRPARAM : return "AFP_SETFLDRPARAM"; /* 35 */ case AFP_CHANGEPW : return "AFP_CHANGEPW"; /* 36 */ case AFP_GETUSERINFO : return "AFP_GETUSERINFO"; /* 37 */ case AFP_GETSRVRMSG : return "AFP_GETSRVRMSG"; /* 38 */ case AFP_CREATEID : return "AFP_CREATEID"; /* 39 */ case AFP_DELETEID : return "AFP_DELETEID"; /* 40 */ case AFP_RESOLVEID : return "AFP_RESOLVEID"; /* 41 */ case AFP_EXCHANGEFILE : return "AFP_EXCHANGEFILE"; /* 42 */ case AFP_CATSEARCH : return "AFP_CATSEARCH"; /* 43 */ case AFP_OPENDT : return "AFP_OPENDT"; /* 48 */ case AFP_CLOSEDT : return "AFP_CLOSEDT"; /* 49 */ case AFP_GETICON : return "AFP_GETICON"; /* 51 */ case AFP_GTICNINFO : return "AFP_GTICNINFO"; /* 52 */ case AFP_ADDAPPL : return "AFP_ADDAPPL"; /* 53 */ case AFP_RMVAPPL : return "AFP_RMVAPPL"; /* 54 */ case AFP_GETAPPL : return "AFP_GETAPPL"; /* 55 */ case AFP_ADDCMT : return "AFP_ADDCMT"; /* 56 */ case AFP_RMVCMT : return "AFP_RMVCMT"; /* 57 */ case AFP_GETCMT : return "AFP_GETCMT"; /* 58 */ case AFP_ADDICON : return "AFP_ADDICON"; /* 192 */ /* version 3.0 */ case AFP_BYTELOCK_EXT : return "AFP_BYTELOCK_EXT"; /* 59 */ case AFP_READ_EXT : return "AFP_READ_EXT"; /* 60 */ case AFP_WRITE_EXT : return "AFP_WRITE_EXT"; /* 61 */ case AFP_GETSESSTOKEN : return "AFP_GETSESSTOKEN"; /* 64 */ case AFP_LOGIN_EXT : return "AFP_LOGIN_EXT"; /* 63 */ case AFP_DISCTOLDSESS : return "AFP_DISCTOLDSESS"; /* 65 */ case AFP_ENUMERATE_EXT : return "AFP_ENUMERATE_EXT"; /* 66 */ case AFP_CATSEARCH_EXT : return "AFP_CATSEARCH_EXT"; /* 67 */ /* version 3.1 */ case AFP_ENUMERATE_EXT2: return "AFP_ENUMERATE_EXT2"; /* 68 */ case AFP_ZZZ : return "AFP_ZZZ"; /* 122 */ /* version 3.2 */ case AFP_GETEXTATTR : return "AFP_GETEXTATTR"; /* 69 */ case AFP_SETEXTATTR : return "AFP_SETEXTATTR"; /* 70 */ case AFP_REMOVEATTR : return "AFP_REMOVEATTR"; /* 71 */ case AFP_LISTEXTATTR : return "AFP_LISTEXTATTR"; /* 72 */ case AFP_GETACL : return "AFP_GETACL"; /* 73 */ case AFP_SETACL : return "AFP_SETACL"; /* 74 */ case AFP_ACCESS : return "AFP_ACCESS"; /* 75 */ case AFP_SPOTLIGHT_PRIVATE : return "AFP_SPOTLIGHT_PRIVATE"; /* 76 */ case AFP_SYNCDIR : return "AFP_SYNCDIR"; /* 78 */ case AFP_SYNCFORK : return "AFP_SYNCFORK"; /* 79 */ } return "not yet defined"; } #define AFPERR2NAME(err) case err : return #err const char *AfpErr2name(int err) { switch (err) { AFPERR2NAME(AFP_OK); AFPERR2NAME(AFPERR_DID1); AFPERR2NAME(AFPERR_ACCESS); AFPERR2NAME(AFPERR_AUTHCONT); AFPERR2NAME(AFPERR_BADUAM); AFPERR2NAME(AFPERR_BADVERS); AFPERR2NAME(AFPERR_BITMAP); AFPERR2NAME(AFPERR_CANTMOVE); AFPERR2NAME(AFPERR_DENYCONF); AFPERR2NAME(AFPERR_DIRNEMPT); AFPERR2NAME(AFPERR_DFULL); AFPERR2NAME(AFPERR_EOF); AFPERR2NAME(AFPERR_BUSY); AFPERR2NAME(AFPERR_FLATVOL); AFPERR2NAME(AFPERR_NOITEM); AFPERR2NAME(AFPERR_LOCK); AFPERR2NAME(AFPERR_MISC); AFPERR2NAME(AFPERR_NLOCK); AFPERR2NAME(AFPERR_NOSRVR); AFPERR2NAME(AFPERR_EXIST); AFPERR2NAME(AFPERR_NOOBJ); AFPERR2NAME(AFPERR_PARAM); AFPERR2NAME(AFPERR_NORANGE); AFPERR2NAME(AFPERR_RANGEOVR); AFPERR2NAME(AFPERR_SESSCLOS); AFPERR2NAME(AFPERR_NOTAUTH); AFPERR2NAME(AFPERR_NOOP); AFPERR2NAME(AFPERR_BADTYPE); AFPERR2NAME(AFPERR_NFILE); AFPERR2NAME(AFPERR_SHUTDOWN); AFPERR2NAME(AFPERR_NORENAME); AFPERR2NAME(AFPERR_NODIR); AFPERR2NAME(AFPERR_ITYPE); AFPERR2NAME(AFPERR_VLOCK); AFPERR2NAME(AFPERR_OLOCK); AFPERR2NAME(AFPERR_CTNSHRD); AFPERR2NAME(AFPERR_NOID); AFPERR2NAME(AFPERR_EXISTID); AFPERR2NAME(AFPERR_DIFFVOL); AFPERR2NAME(AFPERR_CATCHNG); AFPERR2NAME(AFPERR_SAMEOBJ); AFPERR2NAME(AFPERR_BADID); AFPERR2NAME(AFPERR_PWDSAME); AFPERR2NAME(AFPERR_PWDSHORT); AFPERR2NAME(AFPERR_PWDEXPR); AFPERR2NAME(AFPERR_INSHRD); AFPERR2NAME(AFPERR_INTRASH); AFPERR2NAME(AFPERR_PWDCHNG); AFPERR2NAME(AFPERR_PWDPOLCY); AFPERR2NAME(AFPERR_USRLOGIN); } return "not yet defined"; } netatalk-2.2.2/etc/afpd/unix.c0000644000175200017500000004147711665651044013104 00000000000000/* * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include /* STDC check */ #ifdef STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #include #include #include #include #include #include #include #include #include #include #include "auth.h" #include "directory.h" #include "volume.h" #include "unix.h" #include "fork.h" #ifdef HAVE_ACLS #include "acls.h" #endif /* * Get the free space on a partition. */ int ustatfs_getvolspace(const struct vol *vol, VolSpace *bfree, VolSpace *btotal, u_int32_t *bsize) { VolSpace maxVolSpace = UINT64_MAX; #ifdef ultrix struct fs_data sfs; #else /*ultrix*/ struct statfs sfs; #endif /*ultrix*/ if ( statfs( vol->v_path, &sfs ) < 0 ) { LOG(log_error, logtype_afpd, "ustatfs_getvolspace unable to stat %s", vol->v_path); return( AFPERR_PARAM ); } #ifdef ultrix *bfree = (VolSpace) sfs.fd_req.bfreen; *bsize = 1024; #else /* !ultrix */ *bfree = (VolSpace) sfs.f_bavail; *bsize = sfs.f_frsize; #endif /* ultrix */ if ( *bfree > maxVolSpace / *bsize ) { *bfree = maxVolSpace; } else { *bfree *= *bsize; } #ifdef ultrix *btotal = (VolSpace) ( sfs.fd_req.btot - ( sfs.fd_req.bfree - sfs.fd_req.bfreen )); #else /* !ultrix */ *btotal = (VolSpace) ( sfs.f_blocks - ( sfs.f_bfree - sfs.f_bavail )); #endif /* ultrix */ /* see similar block above comments */ if ( *btotal > maxVolSpace / *bsize ) { *btotal = maxVolSpace; } else { *btotal *= *bsize; } return( AFP_OK ); } static int utombits(mode_t bits) { int mbits; mbits = 0; mbits |= ( bits & ( S_IREAD >> 6 )) ? AR_UREAD : 0; mbits |= ( bits & ( S_IWRITE >> 6 )) ? AR_UWRITE : 0; /* Do we really need this? */ mbits |= ( bits & ( S_IEXEC >> 6) ) ? AR_USEARCH : 0; return( mbits ); } /* -------------------------------- cf AFP 3.0 page 63 */ void utommode(struct stat *stat, struct maccess *ma) { mode_t mode; mode = stat->st_mode; ma->ma_world = utombits( mode ); mode = mode >> 3; ma->ma_group = utombits( mode ); mode = mode >> 3; ma->ma_owner = utombits( mode ); /* ma_user is a union of all permissions but we must follow * unix perm */ if ( (uuid == stat->st_uid) || (uuid == 0)) { ma->ma_user = ma->ma_owner | AR_UOWN; } else if ( gmem( stat->st_gid )) { ma->ma_user = ma->ma_group; } else { ma->ma_user = ma->ma_world; } /* * There are certain things the mac won't try if you don't have * the "owner" bit set, even tho you can do these things on unix wiht * only write permission. What were the things? * * FIXME * ditto seems to care if st_uid is 0 ? * was ma->ma_user & AR_UWRITE * but 0 as owner is a can of worms. */ if ( !stat->st_uid ) { ma->ma_user |= AR_UOWN; } } #ifdef accessmode #undef accessmode #endif /* * Calculate the mode for a directory using a stat() call to * estimate permission. * * Note: the previous method, using access(), does not work correctly * over NFS. * * dir parameter is used by AFS */ void accessmode(const struct vol *vol, char *path, struct maccess *ma, struct dir *dir _U_, struct stat *st) { struct stat sb; ma->ma_user = ma->ma_owner = ma->ma_world = ma->ma_group = 0; if (!st) { if (lstat(path, &sb) != 0) return; st = &sb; } utommode( st, ma ); #ifdef HAVE_ACLS acltoownermode(vol, path, st, ma); #endif } int gmem(const gid_t gid) { int i; for ( i = 0; i < ngroups; i++ ) { if ( groups[ i ] == gid ) { return( 1 ); } } return( 0 ); } static mode_t mtoubits(u_char bits) { mode_t mode; mode = 0; mode |= ( bits & AR_UREAD ) ? ( (S_IREAD | S_IEXEC) >> 6 ) : 0; mode |= ( bits & AR_UWRITE ) ? ( (S_IWRITE | S_IEXEC) >> 6 ) : 0; /* I don't think there's a way to set the SEARCH bit by itself on a Mac mode |= ( bits & AR_USEARCH ) ? ( S_IEXEC >> 6 ) : 0; */ return( mode ); } /* ---------------------------------- from the finder's share windows (menu--> File--> sharing...) and from AFP 3.0 spec page 63 the mac mode should be save somewhere */ mode_t mtoumode(struct maccess *ma) { mode_t mode; mode = 0; mode |= mtoubits( ma->ma_owner |ma->ma_world); mode = mode << 3; mode |= mtoubits( ma->ma_group |ma->ma_world); mode = mode << 3; mode |= mtoubits( ma->ma_world ); return( mode ); } #define EXEC_MODE (S_IXGRP | S_IXUSR | S_IXOTH) int setdeskmode(const mode_t mode) { char wd[ MAXPATHLEN + 1]; struct stat st; char modbuf[ 12 + 1], *m; struct dirent *deskp, *subp; DIR *desk, *sub; if (!dir_rx_set(mode)) { /* want to remove read and search access to owner it will screw the volume */ return -1 ; } if ( getcwd( wd , MAXPATHLEN) == NULL ) { return( -1 ); } if ( chdir( ".AppleDesktop" ) < 0 ) { return( -1 ); } if (( desk = opendir( "." )) == NULL ) { if ( chdir( wd ) < 0 ) { LOG(log_error, logtype_afpd, "setdeskmode: chdir %s: %s", wd, strerror(errno) ); } return( -1 ); } for ( deskp = readdir( desk ); deskp != NULL; deskp = readdir( desk )) { if ( strcmp( deskp->d_name, "." ) == 0 || strcmp( deskp->d_name, ".." ) == 0 || strlen( deskp->d_name ) > 2 ) { continue; } strcpy( modbuf, deskp->d_name ); strcat( modbuf, "/" ); m = strchr( modbuf, '\0' ); if (( sub = opendir( deskp->d_name )) == NULL ) { continue; } for ( subp = readdir( sub ); subp != NULL; subp = readdir( sub )) { if ( strcmp( subp->d_name, "." ) == 0 || strcmp( subp->d_name, ".." ) == 0 ) { continue; } *m = '\0'; strcat( modbuf, subp->d_name ); /* XXX: need to preserve special modes */ if (lstat(modbuf, &st) < 0) { LOG(log_error, logtype_afpd, "setdeskmode: stat %s: %s",fullpathname(modbuf), strerror(errno) ); continue; } if (S_ISDIR(st.st_mode)) { if ( chmod_acl( modbuf, (DIRBITS | mode) & ~default_options.umask ) < 0 && errno != EPERM ) { LOG(log_error, logtype_afpd, "setdeskmode: chmod %s: %s",fullpathname(modbuf), strerror(errno) ); } } else if ( chmod_acl( modbuf, mode & ~(default_options.umask | EXEC_MODE) ) < 0 && errno != EPERM ) { LOG(log_error, logtype_afpd, "setdeskmode: chmod %s: %s",fullpathname(modbuf), strerror(errno) ); } } closedir( sub ); /* XXX: need to preserve special modes */ if ( chmod_acl( deskp->d_name, (DIRBITS | mode) & ~default_options.umask ) < 0 && errno != EPERM ) { LOG(log_error, logtype_afpd, "setdeskmode: chmod %s: %s",fullpathname(deskp->d_name), strerror(errno) ); } } closedir( desk ); if ( chdir( wd ) < 0 ) { LOG(log_error, logtype_afpd, "setdeskmode: chdir %s: %s", wd, strerror(errno) ); return -1; } /* XXX: need to preserve special modes */ if ( chmod_acl( ".AppleDesktop", (DIRBITS | mode) & ~default_options.umask ) < 0 && errno != EPERM ) { LOG(log_error, logtype_afpd, "setdeskmode: chmod %s: %s", fullpathname(".AppleDesktop"),strerror(errno) ); } return( 0 ); } /* --------------------- */ int setfilunixmode (const struct vol *vol, struct path* path, mode_t mode) { if (!path->st_valid) { of_stat(path); } if (path->st_errno) { return -1; } mode |= vol->v_fperm; if (setfilmode( path->u_name, mode, &path->st, vol->v_umask) < 0) return -1; /* we need to set write perm if read set for resource fork */ return vol->vfs->vfs_setfilmode(vol, path->u_name, mode, &path->st); } /* --------------------- */ int setdirunixmode(const struct vol *vol, const char *name, mode_t mode) { int dropbox = (vol->v_flags & AFPVOL_DROPBOX); LOG(log_debug, logtype_afpd, "setdirunixmode('%s', mode:%04o) {v_dperm:%04o}", fullpathname(name), mode, vol->v_dperm); mode |= vol->v_dperm; if (dir_rx_set(mode)) { /* extending right? dir first then .AppleDouble in rf_setdirmode */ if ( stickydirmode(name, DIRBITS | mode, dropbox, vol->v_umask) < 0 ) return -1; } if (vol->vfs->vfs_setdirunixmode(vol, name, mode, NULL) < 0 && !vol_noadouble(vol)) { return -1 ; } if (!dir_rx_set(mode)) { if ( stickydirmode(name, DIRBITS | mode, dropbox, vol->v_umask) < 0 ) return -1; } return 0; } /* --------------------- */ int setdirmode(const struct vol *vol, const char *name, mode_t mode) { struct stat st; struct dirent *dirp; DIR *dir; mode_t hf_mode; int osx = vol->v_adouble == AD_VERSION2_OSX; int dropbox = (vol->v_flags & AFPVOL_DROPBOX); mode |= vol->v_dperm; hf_mode = ad_hf_mode(mode); if (dir_rx_set(mode)) { /* extending right? dir first */ if ( stickydirmode(name, DIRBITS | mode, dropbox, vol->v_umask) < 0 ) return -1; } if (( dir = opendir( name )) == NULL ) { LOG(log_error, logtype_afpd, "setdirmode: opendir: %s", fullpathname(name), strerror(errno) ); return( -1 ); } for ( dirp = readdir( dir ); dirp != NULL; dirp = readdir( dir )) { /* FIXME */ if ( *dirp->d_name == '.' && (!osx || dirp->d_name[1] != '_')) { continue; } if ( lstat( dirp->d_name, &st ) < 0 ) { LOG(log_error, logtype_afpd, "setdirmode: stat %s: %s",dirp->d_name, strerror(errno) ); continue; } if (!S_ISDIR(st.st_mode)) { int setmode = (osx && *dirp->d_name == '.')?hf_mode:mode; if (setfilmode(dirp->d_name, setmode, &st, vol->v_umask) < 0) { closedir( dir ); LOG(log_error, logtype_afpd, "setdirmode: chmod %s: %s",dirp->d_name, strerror(errno) ); return -1; } } } closedir( dir ); if (vol->vfs->vfs_setdirmode(vol, name, mode, NULL) < 0 && !vol_noadouble(vol)) { return -1 ; } if (!dir_rx_set(mode)) { if ( stickydirmode(name, DIRBITS | mode, dropbox, vol->v_umask) < 0 ) return -1; } return( 0 ); } /* ----------------------------- */ int setdeskowner(const uid_t uid, const gid_t gid) { char wd[ MAXPATHLEN + 1]; char modbuf[12 + 1], *m; struct dirent *deskp, *subp; DIR *desk, *sub; if ( getcwd( wd, MAXPATHLEN ) == NULL ) { return( -1 ); } if ( chdir( ".AppleDesktop" ) < 0 ) { return( -1 ); } if (( desk = opendir( "." )) == NULL ) { if ( chdir( wd ) < 0 ) { LOG(log_error, logtype_afpd, "setdeskowner: chdir %s: %s", wd, strerror(errno) ); } return( -1 ); } for ( deskp = readdir( desk ); deskp != NULL; deskp = readdir( desk )) { if ( strcmp( deskp->d_name, "." ) == 0 || strcmp( deskp->d_name, ".." ) == 0 || strlen( deskp->d_name ) > 2 ) { continue; } strcpy( modbuf, deskp->d_name ); strcat( modbuf, "/" ); m = strchr( modbuf, '\0' ); if (( sub = opendir( deskp->d_name )) == NULL ) { continue; } for ( subp = readdir( sub ); subp != NULL; subp = readdir( sub )) { if ( strcmp( subp->d_name, "." ) == 0 || strcmp( subp->d_name, ".." ) == 0 ) { continue; } *m = '\0'; strcat( modbuf, subp->d_name ); /* XXX: add special any uid, ignore group bits */ if ( chown( modbuf, uid, gid ) < 0 && errno != EPERM ) { LOG(log_error, logtype_afpd, "setdeskown: chown %s: %s", fullpathname(modbuf), strerror(errno) ); } } closedir( sub ); /* XXX: add special any uid, ignore group bits */ if ( chown( deskp->d_name, uid, gid ) < 0 && errno != EPERM ) { LOG(log_error, logtype_afpd, "setdeskowner: chown %s: %s", deskp->d_name, strerror(errno) ); } } closedir( desk ); if ( chdir( wd ) < 0 ) { LOG(log_error, logtype_afpd, "setdeskowner: chdir %s: %s", wd, strerror(errno) ); return -1; } if ( chown( ".AppleDesktop", uid, gid ) < 0 && errno != EPERM ) { LOG(log_error, logtype_afpd, "setdeskowner: chown %s: %s", fullpathname(".AppleDouble"), strerror(errno) ); } return( 0 ); } /* ----------------------------- */ int setfilowner(const struct vol *vol, const uid_t uid, const gid_t gid, struct path* path) { if (!path->st_valid) { of_stat(path); } if (path->st_errno) { return -1; } if ( lchown( path->u_name, uid, gid ) < 0 && errno != EPERM ) { LOG(log_debug, logtype_afpd, "setfilowner: chown %d/%d %s: %s", uid, gid, path->u_name, strerror(errno) ); return -1; } if (vol->vfs->vfs_chown(vol, path->u_name, uid, gid ) < 0 && errno != EPERM) { LOG(log_debug, logtype_afpd, "setfilowner: rf_chown %d/%d %s: %s", uid, gid, path->u_name, strerror(errno) ); return -1; } return 0; } /* --------------------------------- * uid/gid == 0 need to be handled as special cases. they really mean * that user/group should inherit from other, but that doesn't fit * into the unix permission scheme. we can get around this by * co-opting some bits. */ int setdirowner(const struct vol *vol, const char *name, const uid_t uid, const gid_t gid) { struct stat st; struct dirent *dirp; DIR *dir; int osx = vol->v_adouble == AD_VERSION2_OSX; if (( dir = opendir( name )) == NULL ) { return( -1 ); } for ( dirp = readdir( dir ); dirp != NULL; dirp = readdir( dir )) { if ( *dirp->d_name == '.' && (!osx || dirp->d_name[1] != '_')) { continue; } if ( lstat( dirp->d_name, &st ) < 0 ) { LOG(log_error, logtype_afpd, "setdirowner: stat %s: %s", fullpathname(dirp->d_name), strerror(errno) ); continue; } if (( st.st_mode & S_IFMT ) == S_IFREG ) { if ( lchown( dirp->d_name, uid, gid ) < 0 && errno != EPERM ) { LOG(log_debug, logtype_afpd, "setdirowner: chown %s: %s", fullpathname(dirp->d_name), strerror(errno) ); /* return ( -1 ); Sometimes this is okay */ } } } closedir( dir ); if (vol->vfs->vfs_setdirowner(vol, name, uid, gid) < 0) { return -1; } if ( lstat( ".", &st ) < 0 ) { return( -1 ); } if ( gid && gid != st.st_gid && lchown( ".", uid, gid ) < 0 && errno != EPERM ) { LOG(log_debug, logtype_afpd, "setdirowner: chown %d/%d %s: %s", uid, gid, fullpathname("."), strerror(errno) ); } return( 0 ); } #if 0 /* recursive chown()ing of a directory */ static int recursive_chown(const char *path, uid_t uid, gid_t gid) { struct stat sbuf; DIR *odir = NULL; struct dirent *entry; char *name; int ret = 0; char newpath[PATH_MAX+1]; newpath[PATH_MAX] = '\0'; if (chown(path, uid, gid) < 0) { LOG(log_error, logtype_afpd, "cannot chown() file [%s] (uid = %d): %s", path, uid, strerror(errno)); return -1; } if (lstat(path, &sbuf) < 0) { LOG(log_error, logtype_afpd, "cannot chown() file [%s] (uid = %d): %s", path, uid, strerror(errno)); return -1; } if (S_ISDIR(sbuf.st_mode)) { odir = opendir(path); if (odir == NULL) { LOG(log_error, logtype_afpd, "cannot opendir() [%s] (uid = %d): %s", path, uid, strerror(errno)); goto recursive_chown_end; } while (NULL != (entry=readdir(odir)) ) { name = entry->d_name; if (name[0] == '.' && name[1] == '\0') continue; if (name[0] == '.' && name[1] == '.' && name[2] == '\0') continue; sprintf(newpath, "%s/%s", path, name); if (recursive_chown(newpath, uid, gid) < 0) ret = -1; } /* while */ } /* if */ recursive_chown_end: if (odir != NULL) { closedir(odir); } return ret; } #endif netatalk-2.2.2/etc/afpd/status.c0000644000175200017500000006356511655731244013446 00000000000000/* * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #if 0 #ifdef BSD4_4 #include #ifndef HAVE_GETHOSTID #include #endif /* HAVE_GETHOSTID */ #endif /* BSD4_4 */ #endif #include #include #include #include #include #include #include #include #include #include "status.h" #include "afp_config.h" #include "icon.h" static size_t maxstatuslen = 0; static void status_flags(char *data, const int notif, const int ipok, const unsigned char passwdbits, const int dirsrvcs _U_, int flags) { uint16_t status; status = AFPSRVRINFO_COPY | AFPSRVRINFO_SRVSIGNATURE | AFPSRVRINFO_SRVMSGS | AFPSRVRINFO_FASTBOZO | AFPSRVRINFO_SRVRDIR | AFPSRVRINFO_SRVUTF8 | AFPSRVRINFO_EXTSLEEP; if (passwdbits & PASSWD_SET) /* some uams may not allow this. */ status |= AFPSRVRINFO_PASSWD; if (passwdbits & PASSWD_NOSAVE) status |= AFPSRVRINFO_NOSAVEPASSWD; if (ipok) /* only advertise tcp/ip if we have a valid address */ status |= AFPSRVRINFO_TCPIP; if (notif) /* Default is yes */ status |= AFPSRVRINFO_SRVNOTIFY; if (flags & OPTION_UUID) status |= AFPSRVRINFO_UUID; status = htons(status); memcpy(data + AFPSTATUS_FLAGOFF, &status, sizeof(status)); } static int status_server(char *data, const char *server, const struct afp_options *options) { char *start = data; char *Obj, *Type, *Zone; char buf[32]; u_int16_t status; size_t len; /* make room for all offsets before server name */ data += AFPSTATUS_PRELEN; /* extract the obj part of the server */ Obj = (char *) server; #ifndef NO_DDP nbp_name(server, &Obj, &Type, &Zone); #endif if ((size_t)-1 == (len = convert_string( options->unixcharset, options->maccharset, Obj, -1, buf, sizeof(buf))) ) { len = MIN(strlen(Obj), 31); *data++ = len; memcpy( data, Obj, len ); LOG ( log_error, logtype_afpd, "Could not set servername, using fallback"); } else { *data++ = len; memcpy( data, buf, len ); } if ((len + 1) & 1) /* pad server name and length byte to even boundary */ len++; data += len; /* make room for signature and net address offset. save location of * signature offset. we're also making room for directory names offset * and the utf-8 server name offset. * * NOTE: technically, we don't need to reserve space for the * signature and net address offsets if they're not going to be * used. as there are no offsets after them, it doesn't hurt to * have them specified though. so, we just do that to simplify * things. * * NOTE2: AFP3.1 Documentation states that the directory names offset * is a required feature, even though it can be set to zero. */ len = data - start; status = htons(len + AFPSTATUS_POSTLEN); memcpy(start + AFPSTATUS_MACHOFF, &status, sizeof(status)); return len; /* return the offset to beginning of signature offset */ } static void status_machine(char *data) { char *start = data; u_int16_t status; int len; #ifdef AFS const char *machine = "afs"; #else /* !AFS */ const char *machine = "Netatalk%s"; #endif /* AFS */ char buf[AFPSTATUS_MACHLEN+1]; memcpy(&status, start + AFPSTATUS_MACHOFF, sizeof(status)); data += ntohs( status ); if ((strlen(machine) + strlen(VERSION)) <= AFPSTATUS_MACHLEN) { len = snprintf(buf, AFPSTATUS_MACHLEN + 1, machine, VERSION); } else { if (strlen(VERSION) > AFPSTATUS_MACHLEN) { len = snprintf(buf, AFPSTATUS_MACHLEN + 1, VERSION); } else { (void)snprintf(buf, AFPSTATUS_MACHLEN + 1, machine, ""); (void)snprintf(buf + AFPSTATUS_MACHLEN - strlen(VERSION), strlen(VERSION) + 1, VERSION); len = AFPSTATUS_MACHLEN; } } *data++ = len; memcpy( data, buf, len ); data += len; status = htons(data - start); memcpy(start + AFPSTATUS_VERSOFF, &status, sizeof(status)); } /* server signature is a 16-byte quantity */ static u_int16_t status_signature(char *data, int *servoffset, const struct afp_options *options) { char *status; u_int16_t offset, sigoff; status = data; /* get server signature offset */ memcpy(&offset, data + *servoffset, sizeof(offset)); sigoff = offset = ntohs(offset); /* jump to server signature offset */ data += offset; memset(data, 0, 16); memcpy(data, options->signature, 16); data += 16; /* calculate net address offset */ *servoffset += sizeof(offset); offset = htons(data - status); memcpy(status + *servoffset, &offset, sizeof(offset)); return sigoff; } static size_t status_netaddress(char *data, int *servoffset, #ifndef NO_DDP const ASP asp, #endif const DSI *dsi, const struct afp_options *options) { char *begin; u_int16_t offset; size_t addresses_len = 0; begin = data; /* get net address offset */ memcpy(&offset, data + *servoffset, sizeof(offset)); data += ntohs(offset); /* format: Address count (byte) len (byte = sizeof(length + address type + address) address type (byte, ip address = 0x01, ip + port = 0x02, ddp address = 0x03, fqdn = 0x04) address (up to 254 bytes, ip = 4, ip + port = 6, ddp = 4) */ /* number of addresses. this currently screws up if we have a dsi connection, but we don't have the ip address. to get around this, we turn off the status flag for tcp/ip. */ *data++ = ((options->fqdn && dsi)? 1 : 0) + (dsi ? 1 : 0) + #ifndef NO_DDP (asp ? 1 : 0) + #endif (((options->flags & OPTION_ANNOUNCESSH) && options->fqdn && dsi)? 1 : 0); /* ip address */ if (dsi) { if (dsi->server.ss_family == AF_INET) { /* IPv4 */ const struct sockaddr_in *inaddr = (struct sockaddr_in *)&dsi->server; if (inaddr->sin_port == htons(DSI_AFPOVERTCP_PORT)) { *data++ = 6; /* length */ *data++ = 0x01; /* basic ip address */ memcpy(data, &inaddr->sin_addr.s_addr, sizeof(inaddr->sin_addr.s_addr)); data += sizeof(inaddr->sin_addr.s_addr); addresses_len += 7; } else { /* ip address + port */ *data++ = 8; *data++ = 0x02; /* ip address with port */ memcpy(data, &inaddr->sin_addr.s_addr, sizeof(inaddr->sin_addr.s_addr)); data += sizeof(inaddr->sin_addr.s_addr); memcpy(data, &inaddr->sin_port, sizeof(inaddr->sin_port)); data += sizeof(inaddr->sin_port); addresses_len += 9; } } else { /* IPv6 */ const struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)&dsi->server; if (sa6->sin6_port == htons(DSI_AFPOVERTCP_PORT)) { *data++ = 18; /* length */ *data++ = 6; /* type */ memcpy(data, &sa6->sin6_addr.s6_addr, sizeof(sa6->sin6_addr.s6_addr)); data += sizeof(sa6->sin6_addr.s6_addr); addresses_len += 19; } else { /* ip address + port */ *data++ = 20; /* length */ *data++ = 7; /* type*/ memcpy(data, &sa6->sin6_addr.s6_addr, sizeof(sa6->sin6_addr.s6_addr)); data += sizeof(sa6->sin6_addr.s6_addr); memcpy(data, &sa6->sin6_port, sizeof(sa6->sin6_port)); data += sizeof(sa6->sin6_port); addresses_len += 21; } } } /* handle DNS names */ if (options->fqdn && dsi) { size_t len = strlen(options->fqdn); if ( len + 2 + addresses_len < maxstatuslen - offset) { *data++ = len +2; *data++ = 0x04; memcpy(data, options->fqdn, len); data += len; addresses_len += len+2; } /* Annouce support for SSH tunneled AFP session, * this feature is available since 10.3.2. * According to the specs (AFP 3.1 p.225) this should * be an IP+Port style value, but it only works with * a FQDN. OSX Server uses FQDN as well. */ if ( len + 2 + addresses_len < maxstatuslen - offset) { if (options->flags & OPTION_ANNOUNCESSH) { *data++ = len +2; *data++ = 0x05; memcpy(data, options->fqdn, len); data += len; } } } #ifndef NO_DDP if (asp) { const struct sockaddr_at *ddpaddr = atp_sockaddr(asp->asp_atp); /* ddp address */ *data++ = 6; *data++ = 0x03; /* ddp address */ memcpy(data, &ddpaddr->sat_addr.s_net, sizeof(ddpaddr->sat_addr.s_net)); data += sizeof(ddpaddr->sat_addr.s_net); memcpy(data, &ddpaddr->sat_addr.s_node, sizeof(ddpaddr->sat_addr.s_node)); data += sizeof(ddpaddr->sat_addr.s_node); memcpy(data, &ddpaddr->sat_port, sizeof(ddpaddr->sat_port)); data += sizeof(ddpaddr->sat_port); } #endif /* ! NO_DDP */ /* calculate/store Directory Services Names offset */ offset = htons(data - begin); *servoffset += sizeof(offset); memcpy(begin + *servoffset, &offset, sizeof(offset)); /* return length of buffer */ return (data - begin); } static size_t status_directorynames(char *data, int *diroffset, const DSI *dsi _U_, const struct afp_options *options) { char *begin = data; u_int16_t offset; memcpy(&offset, data + *diroffset, sizeof(offset)); offset = ntohs(offset); data += offset; /* I can not find documentation of any other purpose for the * DirectoryNames field. */ /* * Try to synthesize a principal: * service '/' fqdn '@' realm */ if (options->k5service && options->k5realm && options->fqdn) { /* should k5princ be utf8 encoded? */ size_t len; char *p = strchr( options->fqdn, ':' ); if (p) *p = '\0'; len = strlen( options->k5service ) + strlen( options->fqdn ) + strlen( options->k5realm ); len+=2; /* '/' and '@' */ if ( len > 255 || len+2 > maxstatuslen - offset) { *data++ = 0; LOG ( log_error, logtype_afpd, "status: could not set directory service list, no more room"); } else { *data++ = 1; /* DirectoryNamesCount */ *data++ = len; snprintf( data, len + 1, "%s/%s@%s", options->k5service, options->fqdn, options->k5realm ); data += len; if (p) *p = ':'; } } else { *data++ = 0; } /* Calculate and store offset for UTF8ServerName */ *diroffset += sizeof(u_int16_t); offset = htons(data - begin); memcpy(begin + *diroffset, &offset, sizeof(u_int16_t)); /* return length of buffer */ return (data - begin); } static size_t status_utf8servername(char *data, int *nameoffset, const DSI *dsi _U_, const struct afp_options *options) { char *Obj, *Type, *Zone; u_int16_t namelen; size_t len; char *begin = data; u_int16_t offset, status; memcpy(&offset, data + *nameoffset, sizeof(offset)); offset = ntohs(offset); data += offset; /* FIXME: * What is the valid character range for an nbpname? * * Apple's server likes to use the non-qualified hostname * This obviously won't work very well if multiple servers are running * on the box. */ /* extract the obj part of the server */ Obj = (char *) (options->server ? options->server : options->hostname); #ifndef NO_DDP nbp_name(options->server ? options->server : options->hostname, &Obj, &Type, &Zone); #endif if ((size_t) -1 == (len = convert_string ( options->unixcharset, CH_UTF8_MAC, Obj, -1, data+sizeof(namelen), maxstatuslen-offset )) ) { LOG ( log_error, logtype_afpd, "Could not set utf8 servername"); /* set offset to 0 */ memset(begin + *nameoffset, 0, sizeof(offset)); data = begin + offset; } else { namelen = htons(len); memcpy( data, &namelen, sizeof(namelen)); data += sizeof(namelen); data += len; offset = htons(offset); memcpy(begin + *nameoffset, &offset, sizeof(u_int16_t)); } /* return length of buffer */ return (data - begin); } /* returns actual offset to signature */ static void status_icon(char *data, const unsigned char *icondata, const int iconlen, const int sigoffset) { char *start = data; char *sigdata = data + sigoffset; u_int16_t ret, status; memcpy(&status, start + AFPSTATUS_ICONOFF, sizeof(status)); if ( icondata == NULL ) { ret = status; memset(start + AFPSTATUS_ICONOFF, 0, sizeof(status)); } else { data += ntohs( status ); memcpy( data, icondata, iconlen); data += iconlen; ret = htons(data - start); } /* put in signature offset */ if (sigoffset) memcpy(sigdata, &ret, sizeof(ret)); } /* --------------------- */ void status_init(AFPConfig *aspconfig, AFPConfig *dsiconfig, const struct afp_options *options) { #ifndef NO_DDP ASP asp; #endif DSI *dsi; char *status = NULL; size_t statuslen; int c, sigoff, ipok; if (!(aspconfig || dsiconfig) || !options) return; #ifndef NO_DDP if (aspconfig) { status = aspconfig->status; maxstatuslen=sizeof(aspconfig->status); asp = aspconfig->obj.handle; } else asp = NULL; #endif ipok = 0; if (dsiconfig) { status = dsiconfig->status; maxstatuslen=sizeof(dsiconfig->status); dsi = dsiconfig->obj.handle; if (dsi->server.ss_family == AF_INET) { /* IPv4 */ const struct sockaddr_in *sa4 = (struct sockaddr_in *)&dsi->server; ipok = sa4->sin_addr.s_addr ? 1 : 0; } else { /* IPv6 */ const struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)&dsi->server; for (int i=0; i<16; i++) { if (sa6->sin6_addr.s6_addr[i]) { ipok = 1; break; } } } } else dsi = NULL; /* * These routines must be called in order -- earlier calls * set the offsets for later calls. * * using structs is a bad idea, but that's what the original code * does. solaris, in fact, will segfault with them. so, now * we just use the powers of #defines and memcpy. * * reply block layout (offsets are 16-bit quantities): * machine type offset -> AFP version count offset -> * UAM count offset -> vol icon/mask offset -> flags -> * * server name [padded to even boundary] -> signature offset -> * network address offset -> * * at the appropriate offsets: * machine type, afp versions, uams, server signature * (16-bytes), network addresses, volume icon/mask */ status_flags(status, options->server_notif, (options->fqdn || ipok), options->passwdbits, (options->k5service && options->k5realm && options->fqdn), options->flags); /* returns offset to signature offset */ c = status_server(status, options->server ? options->server : options->hostname, options); status_machine(status); status_versions(status, #ifndef NO_DDP asp, #endif dsi); status_uams(status, options->uamlist); if (options->flags & OPTION_CUSTOMICON) status_icon(status, icon, sizeof(icon), c); else status_icon(status, apple_atalk_icon, sizeof(apple_atalk_icon), c); sigoff = status_signature(status, &c, options); /* c now contains the offset where the netaddress offset lives */ status_netaddress(status, &c, #ifndef NO_DDP asp, #endif dsi, options); /* c now contains the offset where the Directory Names Count offset lives */ statuslen = status_directorynames(status, &c, dsi, options); /* c now contains the offset where the UTF-8 ServerName offset lives */ if ( statuslen < maxstatuslen) statuslen = status_utf8servername(status, &c, dsi, options); #ifndef NO_DDP if (aspconfig) { if (dsiconfig) /* status is dsiconfig->status */ memcpy(aspconfig->status, status, statuslen); asp_setstatus(asp, status, statuslen); aspconfig->signature = status + sigoff; aspconfig->statuslen = statuslen; } #endif /* ! NO_DDP */ if (dsiconfig) { if ((options->flags & OPTION_CUSTOMICON) == 0) { status_icon(status, apple_tcp_icon, sizeof(apple_tcp_icon), 0); } dsi_setstatus(dsi, status, statuslen); dsiconfig->signature = status + sigoff; dsiconfig->statuslen = statuslen; } } /* set_signature() */ /* */ /* If found in conf file, use it. */ /* If not found in conf file, genarate and append in conf file. */ /* If conf file don't exist, create and genarate. */ /* If cannot open conf file, use one-time signature. */ /* If -signature user:xxxxx, use it. */ void set_signature(struct afp_options *options) { char *usersign; int fd, i; struct stat tmpstat; char *servername_conf; int header = 0; char buf[1024], *p; FILE *fp = NULL, *randomp; size_t len; char *server_tmp; server_tmp = (options->server ? options->server : options->hostname); if (strcmp(options->signatureopt, "auto") == 0) { goto server_signature_auto; /* default */ } else if (strcmp(options->signatureopt, "host") == 0) { LOG(log_warning, logtype_afpd, "WARNING: option \"-signature host\" is obsoleted. Switching back to auto.", options->signatureopt); goto server_signature_auto; /* same as auto */ } else if (strncmp(options->signatureopt, "user", 4) == 0) { goto server_signature_user; /* user string */ } else { LOG(log_error, logtype_afpd, "ERROR: option \"-signature %s\" is not valid. Switching back to auto.", options->signatureopt); goto server_signature_auto; /* switch back to auto*/ } server_signature_user: /* Signature type is user string */ len = strlen(options->signatureopt); if (len <= 5) { LOG(log_warning, logtype_afpd, "WARNING: option \"-signature %s\" is not valid. Switching back to auto.", options->signatureopt); goto server_signature_auto; } usersign = options->signatureopt + 5; len = len - 5; if (len > 16) { LOG(log_warning, logtype_afpd, "WARNING: signature user string %s is very long !", usersign); len = 16; } else if (len >= 3) { LOG(log_info, logtype_afpd, "signature user string is %s.", usersign); } else { LOG(log_warning, logtype_afpd, "WARNING: signature user string %s is very short !", usersign); } memset(options->signature, 0, 16); memcpy(options->signature, usersign, len); goto server_signature_done; server_signature_auto: /* Signature type is auto, using afp_signature.conf */ if (!stat(options->sigconffile, &tmpstat)) { /* conf file exists? */ if ((fp = fopen(options->sigconffile, "r")) != NULL) { /* read open? */ /* scan in the conf file */ while (fgets(buf, sizeof(buf), fp) != NULL) { p = buf; while (p && isblank(*p)) p++; if (!p || (*p == '#') || (*p == '\n')) continue; /* invalid line */ if (*p == '"') { p++; if ((servername_conf = strtok( p, "\"" )) == NULL) continue; /* syntax error: invalid quoted servername */ } else { if ((servername_conf = strtok( p, " \t" )) == NULL) continue; /* syntax error: invalid servername */ } p = strchr(p, '\0'); p++; if (*p == '\0') continue; /* syntax error: missing signature */ if (strcmp(server_tmp, servername_conf)) continue; /* another servername */ while (p && isblank(*p)) p++; if ( 16 == sscanf(p, "%2hhX%2hhX%2hhX%2hhX%2hhX%2hhX%2hhX%2hhX%2hhX%2hhX%2hhX%2hhX%2hhX%2hhX%2hhX%2hhX", &options->signature[ 0], &options->signature[ 1], &options->signature[ 2], &options->signature[ 3], &options->signature[ 4], &options->signature[ 5], &options->signature[ 6], &options->signature[ 7], &options->signature[ 8], &options->signature[ 9], &options->signature[10], &options->signature[11], &options->signature[12], &options->signature[13], &options->signature[14], &options->signature[15] )) { fclose(fp); goto server_signature_done; /* found in conf file */ } } if ((fp = freopen(options->sigconffile, "a+", fp)) != NULL) { /* append because not found */ fseek(fp, 0L, SEEK_END); if(ftell(fp) == 0) { /* size = 0 */ header = 1; goto server_signature_random; } else { fseek(fp, -1L, SEEK_END); if(fgetc(fp) != '\n') fputc('\n', fp); /* last char is \n? */ goto server_signature_random; } } else { LOG(log_error, logtype_afpd, "ERROR: Cannot write in %s (%s). Using one-time signature.", options->sigconffile, strerror(errno)); goto server_signature_random; } } else { LOG(log_error, logtype_afpd, "ERROR: Cannot read %s (%s). Using one-time signature.", options->sigconffile, strerror(errno)); goto server_signature_random; } } else { /* conf file don't exist */ if (( fd = creat(options->sigconffile, 0644 )) < 0 ) { LOG(log_error, logtype_afpd, "ERROR: Cannot create %s (%s). Using one-time signature.", options->sigconffile, strerror(errno)); goto server_signature_random; } if (( fp = fdopen( fd, "w" )) == NULL ) { LOG(log_error, logtype_afpd, "ERROR: Cannot fdopen %s (%s). Using one-time signature.", options->sigconffile, strerror(errno)); close(fd); goto server_signature_random; } header = 1; goto server_signature_random; } server_signature_random: /* generate signature from random number */ randombytes(options->signature, 16); if (fp && header) { /* conf file is created or size=0 */ fprintf(fp, "# DON'T TOUCH NOR COPY THOUGHTLESSLY!\n"); fprintf(fp, "# This file is auto-generated by afpd.\n"); fprintf(fp, "# \n"); fprintf(fp, "# ServerSignature is unique identifier used to prevent logging on to\n"); fprintf(fp, "# the same server twice.\n"); fprintf(fp, "# \n"); fprintf(fp, "# If setting \"-signature user:xxxxx\" in afpd.conf, this file is not used.\n\n"); } if (fp) { fprintf(fp, "\"%s\"\t", server_tmp); for (i=0 ; i<16 ; i++) { fprintf(fp, "%02X", (options->signature)[i]); } fprintf(fp, "%s", "\n"); fclose(fp); } server_signature_done: /* retrun */ LOG(log_info, logtype_afpd, " \"%s\"'s signature is %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", server_tmp, (options->signature)[ 0], (options->signature)[ 1], (options->signature)[ 2], (options->signature)[ 3], (options->signature)[ 4], (options->signature)[ 5], (options->signature)[ 6], (options->signature)[ 7], (options->signature)[ 8], (options->signature)[ 9], (options->signature)[10], (options->signature)[11], (options->signature)[12], (options->signature)[13], (options->signature)[14], (options->signature)[15]); return; } /* this is the same as asp/dsi_getstatus */ int afp_getsrvrinfo(AFPObj *obj, char *ibuf _U_, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { AFPConfig *config = obj->config; memcpy(rbuf, config->status, config->statuslen); *rbuflen = config->statuslen; return AFP_OK; } netatalk-2.2.2/etc/afpd/fork.c0000644000175200017500000012300211677047042013043 00000000000000/* * $Id: fork.c,v 1.73 2010-03-30 12:55:26 franklahm Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "fork.h" #include "file.h" #include "directory.h" #include "desktop.h" #include "volume.h" #ifdef DEBUG1 #define Debug(a) ((a)->options.flags & OPTION_DEBUG) #else #define Debug(a) (0) #endif #ifdef AFS struct ofork *writtenfork; #endif static int getforkparams(struct ofork *ofork, u_int16_t bitmap, char *buf, size_t *buflen) { struct path path; struct stat *st; struct adouble *adp; struct dir *dir; struct vol *vol; /* can only get the length of the opened fork */ if ( ( (bitmap & ((1<of_flags & AFPFORK_RSRC)) || ( (bitmap & ((1<of_flags & AFPFORK_DATA))) { return( AFPERR_BITMAP ); } if ( ad_reso_fileno( ofork->of_ad ) == -1 ) { /* META ? */ adp = NULL; } else { adp = ofork->of_ad; } vol = ofork->of_vol; dir = dirlookup(vol, ofork->of_did); if (NULL == (path.u_name = mtoupath(vol, of_name(ofork), dir->d_did, utf8_encoding()))) { return( AFPERR_MISC ); } path.m_name = of_name(ofork); path.id = 0; st = &path.st; if ( bitmap & ( (1<of_ad ) <= 0 ) { /* 0 is for symlink */ if (movecwd(vol, dir) < 0) return( AFPERR_NOOBJ ); if ( lstat( path.u_name, st ) < 0 ) return( AFPERR_NOOBJ ); } else { if ( fstat( ad_data_fileno( ofork->of_ad ), st ) < 0 ) { return( AFPERR_BITMAP ); } } } return getmetadata(vol, bitmap, &path, dir, buf, buflen, adp ); } /* ---------------------------- */ static off_t get_off_t(char **ibuf, int is64) { u_int32_t temp; off_t ret; ret = 0; memcpy(&temp, *ibuf, sizeof( temp )); ret = ntohl(temp); /* ntohl is unsigned */ *ibuf += sizeof(temp); if (is64) { memcpy(&temp, *ibuf, sizeof( temp )); *ibuf += sizeof(temp); ret = ntohl(temp)| (ret << 32); } else { ret = (int)ret; /* sign extend */ } return ret; } /* ---------------------- */ static int set_off_t(off_t offset, char *rbuf, int is64) { u_int32_t temp; int ret; ret = 0; if (is64) { temp = htonl(offset >> 32); memcpy(rbuf, &temp, sizeof( temp )); rbuf += sizeof(temp); ret = sizeof( temp ); offset &= 0xffffffff; } temp = htonl(offset); memcpy(rbuf, &temp, sizeof( temp )); ret += sizeof( temp ); return ret; } /* ------------------------ */ static int is_neg(int is64, off_t val) { if (val < 0 || (sizeof(off_t) == 8 && !is64 && (val & 0x80000000U))) return 1; return 0; } static int sum_neg(int is64, off_t offset, off_t reqcount) { if (is_neg(is64, offset +reqcount) ) return 1; return 0; } /* ------------------------- */ static int setforkmode(struct adouble *adp, int eid, int ofrefnum, off_t what) { return ad_lock(adp, eid, ADLOCK_RD | ADLOCK_FILELOCK, what, 1, ofrefnum); } /* ------------------------- */ int getforkmode(struct adouble *adp, int eid, off_t what) { return ad_testlock(adp, eid, what); } /* ------------------------- */ static int fork_setmode(struct adouble *adp, int eid, int access, int ofrefnum) { int ret; int readset; int writeset; int denyreadset; int denywriteset; if (! (access & (OPENACC_WR | OPENACC_RD | OPENACC_DWR | OPENACC_DRD))) { return setforkmode(adp, eid, ofrefnum, AD_FILELOCK_OPEN_NONE); } if ((access & (OPENACC_RD | OPENACC_DRD))) { if ((readset = getforkmode(adp, eid, AD_FILELOCK_OPEN_RD)) <0) return readset; if ((denyreadset = getforkmode(adp, eid, AD_FILELOCK_DENY_RD)) <0) return denyreadset; if ((access & OPENACC_RD) && denyreadset) { errno = EACCES; return -1; } if ((access & OPENACC_DRD) && readset) { errno = EACCES; return -1; } /* boolean logic is not enough, because getforkmode is not always telling the * true */ if ((access & OPENACC_RD)) { ret = setforkmode(adp, eid, ofrefnum, AD_FILELOCK_OPEN_RD); if (ret) return ret; } if ((access & OPENACC_DRD)) { ret = setforkmode(adp, eid, ofrefnum, AD_FILELOCK_DENY_RD); if (ret) return ret; } } /* ------------same for writing -------------- */ if ((access & (OPENACC_WR | OPENACC_DWR))) { if ((writeset = getforkmode(adp, eid, AD_FILELOCK_OPEN_WR)) <0) return writeset; if ((denywriteset = getforkmode(adp, eid, AD_FILELOCK_DENY_WR)) <0) return denywriteset; if ((access & OPENACC_WR) && denywriteset) { errno = EACCES; return -1; } if ((access & OPENACC_DWR) && writeset) { errno = EACCES; return -1; } if ((access & OPENACC_WR)) { ret = setforkmode(adp, eid, ofrefnum, AD_FILELOCK_OPEN_WR); if (ret) return ret; } if ((access & OPENACC_DWR)) { ret = setforkmode(adp, eid, ofrefnum, AD_FILELOCK_DENY_WR); if (ret) return ret; } } if ( access == (OPENACC_WR | OPENACC_RD | OPENACC_DWR | OPENACC_DRD)) { return ad_excl_lock(adp, eid); } return 0; } /* ----------------------- */ int afp_openfork(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct vol *vol; struct dir *dir; struct ofork *ofork, *opened; struct adouble *adsame = NULL; size_t buflen; int ret, adflags, eid; u_int32_t did; u_int16_t vid, bitmap, access, ofrefnum; char fork, *path, *upath; struct stat *st; u_int16_t bshort; struct path *s_path; ibuf++; fork = *ibuf++; memcpy(&vid, ibuf, sizeof( vid )); ibuf += sizeof(vid); *rbuflen = 0; if (NULL == ( vol = getvolbyvid( vid ))) { return( AFPERR_PARAM ); } memcpy(&did, ibuf, sizeof( did )); ibuf += sizeof( int ); if (NULL == ( dir = dirlookup( vol, did ))) { return afp_errno; } memcpy(&bitmap, ibuf, sizeof( bitmap )); bitmap = ntohs( bitmap ); ibuf += sizeof( bitmap ); memcpy(&access, ibuf, sizeof( access )); access = ntohs( access ); ibuf += sizeof( access ); if ((vol->v_flags & AFPVOL_RO) && (access & OPENACC_WR)) { return AFPERR_VLOCK; } if (NULL == ( s_path = cname( vol, dir, &ibuf ))) { return get_afp_errno(AFPERR_PARAM); } if (*s_path->m_name == '\0') { /* it's a dir ! */ return AFPERR_BADTYPE; } /* stat() data fork st is set because it's not a dir */ switch ( s_path->st_errno ) { case 0: break; case ENOENT: return AFPERR_NOOBJ; case EACCES: return (access & OPENACC_WR) ? AFPERR_LOCK : AFPERR_ACCESS; default: LOG(log_error, logtype_afpd, "afp_openfork(%s): ad_open: %s", s_path->m_name, strerror(errno) ); return AFPERR_PARAM; } /* FIXME should we check it first ? */ upath = s_path->u_name; if (!vol_unix_priv(vol)) { if (check_access(upath, access ) < 0) { return AFPERR_ACCESS; } } else { if (file_access(s_path, access ) < 0) { return AFPERR_ACCESS; } } st = &s_path->st; /* XXX: this probably isn't the best way to do this. the already open bits should really be set if the fork is opened by any program, not just this one. however, that's problematic to do if we can't write lock files somewhere. opened is also passed to ad_open so that we can keep file locks together. FIXME: add the fork we are opening? */ if ((opened = of_findname(s_path))) { adsame = opened->of_ad; } if ( fork == OPENFORK_DATA ) { eid = ADEID_DFORK; adflags = ADFLAGS_DF|ADFLAGS_HF; } else { eid = ADEID_RFORK; adflags = ADFLAGS_HF; } path = s_path->m_name; if (( ofork = of_alloc(vol, curdir, path, &ofrefnum, eid, adsame, st)) == NULL ) { return( AFPERR_NFILE ); } ret = AFPERR_NOOBJ; if (access & OPENACC_WR) { /* try opening in read-write mode */ if (ad_open(upath, adflags, O_RDWR, 0, ofork->of_ad) < 0) { switch ( errno ) { case EROFS: ret = AFPERR_VLOCK; case EACCES: goto openfork_err; break; case ENOENT: if (fork == OPENFORK_DATA) { /* try to open only the data fork */ if (ad_open(upath, ADFLAGS_DF, O_RDWR, 0, ofork->of_ad) < 0) { goto openfork_err; } adflags = ADFLAGS_DF; } else { /* here's the deal. we only try to create the resource * fork if the user wants to open it for write acess. */ if (ad_open(upath, adflags, O_RDWR | O_CREAT, 0666, ofork->of_ad) < 0) goto openfork_err; ofork->of_flags |= AFPFORK_OPEN; } break; case EMFILE : case ENFILE : ret = AFPERR_NFILE; goto openfork_err; break; case EISDIR : ret = AFPERR_BADTYPE; goto openfork_err; break; default: LOG(log_error, logtype_afpd, "afp_openfork(%s): ad_open: %s", s_path->m_name, strerror(errno) ); ret = AFPERR_PARAM; goto openfork_err; break; } } else { /* the ressource fork is open too */ ofork->of_flags |= AFPFORK_OPEN; } } else { /* try opening in read-only mode */ ret = AFPERR_NOOBJ; if (ad_open(upath, adflags, O_RDONLY, 0, ofork->of_ad) < 0) { switch ( errno ) { case EROFS: ret = AFPERR_VLOCK; case EACCES: goto openfork_err; break; case ENOENT: /* see if client asked for a read only data fork */ if (fork == OPENFORK_DATA) { if (ad_open(upath, ADFLAGS_DF, O_RDONLY, 0, ofork->of_ad) < 0) { goto openfork_err; } adflags = ADFLAGS_DF; } /* else we don't set AFPFORK_OPEN because there's no ressource fork file * We need to check AFPFORK_OPEN in afp_closefork(). eg fork open read-only * then create in open read-write. * FIXME , it doesn't play well with byte locking example: * ressource fork open read only * locking set on it (no effect, there's no file!) * ressource fork open read write now */ break; case EMFILE : case ENFILE : ret = AFPERR_NFILE; goto openfork_err; break; case EISDIR : ret = AFPERR_BADTYPE; goto openfork_err; break; default: LOG(log_error, logtype_afpd, "afp_openfork('%s/%s'): ad_open: errno: %i (%s)", getcwdpath, s_path->m_name, errno, strerror(errno) ); goto openfork_err; break; } } else { /* the ressource fork is open too */ ofork->of_flags |= AFPFORK_OPEN; } } if ((adflags & ADFLAGS_HF) && (ad_get_HF_flags( ofork->of_ad) & O_CREAT)) { if (ad_setname(ofork->of_ad, path)) { ad_flush( ofork->of_ad ); } } if (( ret = getforkparams(ofork, bitmap, rbuf + 2 * sizeof( u_int16_t ), &buflen )) != AFP_OK ) { ad_close( ofork->of_ad, adflags ); goto openfork_err; } *rbuflen = buflen + 2 * sizeof( u_int16_t ); bitmap = htons( bitmap ); memcpy(rbuf, &bitmap, sizeof( u_int16_t )); rbuf += sizeof( u_int16_t ); /* check WriteInhibit bit if we have a ressource fork * the test is done here, after some Mac trafic capture */ if (ad_meta_fileno(ofork->of_ad) != -1) { /* META */ ad_getattr(ofork->of_ad, &bshort); if ((bshort & htons(ATTRBIT_NOWRITE)) && (access & OPENACC_WR)) { ad_close( ofork->of_ad, adflags ); of_dealloc( ofork ); ofrefnum = 0; memcpy(rbuf, &ofrefnum, sizeof(ofrefnum)); return(AFPERR_OLOCK); } } /* * synchronization locks: */ /* don't try to lock non-existent rforks. */ if ((eid == ADEID_DFORK) || (ad_meta_fileno(ofork->of_ad) != -1)) { /* META */ ret = fork_setmode(ofork->of_ad, eid, access, ofrefnum); /* can we access the fork? */ if (ret < 0) { ret = errno; ad_close( ofork->of_ad, adflags ); of_dealloc( ofork ); switch (ret) { case EAGAIN: /* return data anyway */ case EACCES: case EINVAL: ofrefnum = 0; memcpy(rbuf, &ofrefnum, sizeof(ofrefnum)); return( AFPERR_DENYCONF ); break; default: *rbuflen = 0; LOG(log_error, logtype_afpd, "afp_openfork(%s): ad_lock: %s", s_path->m_name, strerror(ret) ); return( AFPERR_PARAM ); } } if ((access & OPENACC_WR)) ofork->of_flags |= AFPFORK_ACCWR; } /* the file may be open read only without ressource fork */ if ((access & OPENACC_RD)) ofork->of_flags |= AFPFORK_ACCRD; memcpy(rbuf, &ofrefnum, sizeof(ofrefnum)); return( AFP_OK ); openfork_err: of_dealloc( ofork ); if (errno == EACCES) return (access & OPENACC_WR) ? AFPERR_LOCK : AFPERR_ACCESS; return ret; } int afp_setforkparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen, char *rbuf _U_, size_t *rbuflen) { struct ofork *ofork; off_t size; u_int16_t ofrefnum, bitmap; int err; int is64; int eid; off_t st_size; ibuf += 2; memcpy(&ofrefnum, ibuf, sizeof( ofrefnum )); ibuf += sizeof( ofrefnum ); memcpy(&bitmap, ibuf, sizeof(bitmap)); bitmap = ntohs(bitmap); ibuf += sizeof( bitmap ); *rbuflen = 0; if (NULL == ( ofork = of_find( ofrefnum )) ) { LOG(log_error, logtype_afpd, "afp_setforkparams: of_find(%d) could not locate fork", ofrefnum ); return( AFPERR_PARAM ); } if (ofork->of_vol->v_flags & AFPVOL_RO) return AFPERR_VLOCK; if ((ofork->of_flags & AFPFORK_ACCWR) == 0) return AFPERR_ACCESS; if ( ofork->of_flags & AFPFORK_DATA) { eid = ADEID_DFORK; } else if (ofork->of_flags & AFPFORK_RSRC) { eid = ADEID_RFORK; } else return AFPERR_PARAM; if ( ( (bitmap & ( (1<= 30) { is64 = 4; } else return AFPERR_BITMAP; } if (ibuflen < 2+ sizeof(ofrefnum) + sizeof(bitmap) + is64 +4) return AFPERR_PARAM ; size = get_off_t(&ibuf, is64); if (size < 0) return AFPERR_PARAM; /* Some MacOS don't return an error they just don't change the size! */ if (bitmap == (1<of_ad, eid); err = -2; if (st_size > size && ad_tmplock(ofork->of_ad, eid, ADLOCK_WR, size, st_size -size, ofork->of_refnum) < 0) goto afp_setfork_err; err = ad_dtruncate( ofork->of_ad, size ); if (st_size > size) ad_tmplock(ofork->of_ad, eid, ADLOCK_CLR, size, st_size -size, ofork->of_refnum); if (err < 0) goto afp_setfork_err; } else if (bitmap == (1<of_ad ); st_size = ad_size(ofork->of_ad, eid); err = -2; if (st_size > size && ad_tmplock(ofork->of_ad, eid, ADLOCK_WR, size, st_size -size, ofork->of_refnum) < 0) { goto afp_setfork_err; } err = ad_rtruncate(ofork->of_ad, size); if (st_size > size) ad_tmplock(ofork->of_ad, eid, ADLOCK_CLR, size, st_size -size, ofork->of_refnum); if (err < 0) goto afp_setfork_err; if (ad_flush( ofork->of_ad ) < 0) { LOG(log_error, logtype_afpd, "afp_setforkparams(%s): ad_flush: %s", of_name(ofork), strerror(errno) ); return AFPERR_PARAM; } } else return AFPERR_BITMAP; #ifdef AFS if ( flushfork( ofork ) < 0 ) { LOG(log_error, logtype_afpd, "afp_setforkparams(%s): flushfork: %s", of_name(ofork), strerror(errno) ); } #endif /* AFS */ return( AFP_OK ); afp_setfork_err: if (err == -2) return AFPERR_LOCK; else { switch (errno) { case EROFS: return AFPERR_VLOCK; case EPERM: case EACCES: return AFPERR_ACCESS; case EDQUOT: case EFBIG: case ENOSPC: return AFPERR_DFULL; default: return AFPERR_PARAM; } } } /* for this to work correctly, we need to check for locks before each * read and write. that's most easily handled by always doing an * appropriate check before each ad_read/ad_write. other things * that can change files like truncate are handled internally to those * functions. */ #define ENDBIT(a) ((a) & 0x80) #define UNLOCKBIT(a) ((a) & 0x01) /* ---------------------- */ static int byte_lock(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen, int is64) { struct ofork *ofork; off_t offset, length; int eid; u_int16_t ofrefnum; u_int8_t flags; int lockop; *rbuflen = 0; /* figure out parameters */ ibuf++; flags = *ibuf; /* first bit = endflag, lastbit = lockflag */ ibuf++; memcpy(&ofrefnum, ibuf, sizeof(ofrefnum)); ibuf += sizeof(ofrefnum); if (NULL == ( ofork = of_find( ofrefnum )) ) { LOG(log_error, logtype_afpd, "afp_bytelock: of_find(%d) could not locate fork", ofrefnum ); return( AFPERR_PARAM ); } if ( ofork->of_flags & AFPFORK_DATA) { eid = ADEID_DFORK; } else if (ofork->of_flags & AFPFORK_RSRC) { eid = ADEID_RFORK; } else return AFPERR_PARAM; offset = get_off_t(&ibuf, is64); length = get_off_t(&ibuf, is64); /* FIXME AD_FILELOCK test is surely wrong */ if (length == -1) length = BYTELOCK_MAX; else if (!length || is_neg(is64, length)) { return AFPERR_PARAM; } else if ((length >= AD_FILELOCK_BASE) && -1 == (ad_reso_fileno(ofork->of_ad))) { /* HF ?*/ return AFPERR_LOCK; } if (ENDBIT(flags)) { offset += ad_size(ofork->of_ad, eid); /* FIXME what do we do if file size > 2 GB and it's not byte_lock_ext? */ } if (offset < 0) /* error if we have a negative offset */ return AFPERR_PARAM; /* if the file is a read-only file, we use read locks instead of * write locks. that way, we can prevent anyone from initiating * a write lock. */ lockop = UNLOCKBIT(flags) ? ADLOCK_CLR : ADLOCK_WR; if (ad_lock(ofork->of_ad, eid, lockop, offset, length, ofork->of_refnum) < 0) { switch (errno) { case EACCES: case EAGAIN: return UNLOCKBIT(flags) ? AFPERR_NORANGE : AFPERR_LOCK; break; case ENOLCK: return AFPERR_NLOCK; break; case EINVAL: return UNLOCKBIT(flags) ? AFPERR_NORANGE : AFPERR_RANGEOVR; break; case EBADF: default: return AFPERR_PARAM; break; } } *rbuflen = set_off_t (offset, rbuf, is64); return( AFP_OK ); } /* --------------------------- */ int afp_bytelock(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { return byte_lock ( obj, ibuf, ibuflen, rbuf, rbuflen , 0); } /* --------------------------- */ int afp_bytelock_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { return byte_lock ( obj, ibuf, ibuflen, rbuf, rbuflen , 1); } #undef UNLOCKBIT /* --------------------------- */ static int crlf(struct ofork *of) { struct extmap *em; if ( ad_meta_fileno( of->of_ad ) == -1 || !memcmp( ufinderi, ad_entry( of->of_ad, ADEID_FINDERI),8)) { /* META */ /* no resource fork or no finderinfo, use our files extension mapping */ if (!( em = getextmap( of_name(of) )) || memcmp( "TEXT", em->em_type, sizeof( em->em_type ))) { return 0; } /* file type is TEXT */ return 1; } else if ( !memcmp( "TEXT", ad_entry( of->of_ad, ADEID_FINDERI ), 4 )) { return 1; } return 0; } static ssize_t read_file(struct ofork *ofork, int eid, off_t offset, u_char nlmask, u_char nlchar, char *rbuf, size_t *rbuflen, const int xlate) { ssize_t cc; int eof = 0; char *p, *q; cc = ad_read(ofork->of_ad, eid, offset, rbuf, *rbuflen); if ( cc < 0 ) { LOG(log_error, logtype_afpd, "afp_read(%s): ad_read: %s", of_name(ofork), strerror(errno) ); *rbuflen = 0; return( AFPERR_PARAM ); } if ( (size_t)cc < *rbuflen ) { eof = 1; } /* * Do Newline check. */ if ( nlmask != 0 ) { for ( p = rbuf, q = p + cc; p < q; ) { if (( *p++ & nlmask ) == nlchar ) { break; } } if ( p != q ) { cc = p - rbuf; eof = 0; } } /* * If this file is of type TEXT, then swap \012 to \015. */ if (xlate) { for ( p = rbuf, q = p + cc; p < q; p++ ) { if ( *p == '\012' ) { *p = '\015'; } else if ( *p == '\015' ) { *p = '\012'; } } } *rbuflen = cc; if ( eof ) { return( AFPERR_EOF ); } return AFP_OK; } /* ----------------------------- * with ddp, afp_read can return fewer bytes than in reqcount * so return EOF only if read actually past end of file not * if offset +reqcount > size of file * e.g.: * getfork size ==> 10430 * read fork offset 0 size 10752 ???? ==> 4264 bytes (without EOF) * read fork offset 4264 size 6128 ==> 4264 (without EOF) * read fork offset 9248 size 1508 ==> 1182 (EOF) * 10752 is a bug in Mac 7.5.x finder * * with dsi, should we check that reqcount < server quantum? */ static int read_fork(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen, int is64) { struct ofork *ofork; off_t offset, saveoff, reqcount, savereqcount; ssize_t cc, err; int eid, xlate = 0; u_int16_t ofrefnum; u_char nlmask, nlchar; ibuf += 2; memcpy(&ofrefnum, ibuf, sizeof( ofrefnum )); ibuf += sizeof( u_short ); if (NULL == ( ofork = of_find( ofrefnum )) ) { LOG(log_error, logtype_afpd, "afp_read: of_find(%d) could not locate fork", ofrefnum ); err = AFPERR_PARAM; goto afp_read_err; } if ((ofork->of_flags & AFPFORK_ACCRD) == 0) { err = AFPERR_ACCESS; goto afp_read_err; } offset = get_off_t(&ibuf, is64); reqcount = get_off_t(&ibuf, is64); if (is64) { nlmask = nlchar = 0; } else { nlmask = *ibuf++; nlchar = *ibuf++; } /* if we wanted to be picky, we could add in the following * bit: if (afp_version == 11 && !(nlmask == 0xFF || !nlmask)) */ if (reqcount < 0 || offset < 0) { err = AFPERR_PARAM; goto afp_read_err; } if ( ofork->of_flags & AFPFORK_DATA) { eid = ADEID_DFORK; xlate = (ofork->of_vol->v_flags & AFPVOL_CRLF) ? crlf(ofork) : 0; } else if (ofork->of_flags & AFPFORK_RSRC) { eid = ADEID_RFORK; } else { /* fork wasn't opened. this should never really happen. */ err = AFPERR_ACCESS; goto afp_read_err; } /* zero request count */ err = AFP_OK; if (!reqcount) { goto afp_read_err; } LOG(log_debug, logtype_afpd, "afp_read(name: \"%s\", offset: %jd, reqcount: %jd)", of_name(ofork), (intmax_t)offset, (intmax_t)reqcount); savereqcount = reqcount; saveoff = offset; if (ad_tmplock(ofork->of_ad, eid, ADLOCK_RD, saveoff, savereqcount,ofork->of_refnum) < 0) { err = AFPERR_LOCK; goto afp_read_err; } *rbuflen = MIN(reqcount, *rbuflen); LOG(log_debug, logtype_afpd, "afp_read(name: \"%s\", offset: %jd, reqcount: %jd): reading %jd bytes from file", of_name(ofork), (intmax_t)offset, (intmax_t)reqcount, (intmax_t)*rbuflen); err = read_file(ofork, eid, offset, nlmask, nlchar, rbuf, rbuflen, xlate); if (err < 0) goto afp_read_done; LOG(log_debug, logtype_afpd, "afp_read(name: \"%s\", offset: %jd, reqcount: %jd): got %jd bytes from file", of_name(ofork), (intmax_t)offset, (intmax_t)reqcount, (intmax_t)*rbuflen); /* dsi can stream requests. we can only do this if we're not checking * for an end-of-line character. oh well. */ if ((obj->proto == AFPPROTO_DSI) && (*rbuflen < reqcount) && !nlmask) { DSI *dsi = obj->handle; off_t size; /* reqcount isn't always truthful. we need to deal with that. */ size = ad_size(ofork->of_ad, eid); /* subtract off the offset */ size -= offset; if (reqcount > size) { reqcount = size; err = AFPERR_EOF; } offset += *rbuflen; /* dsi_readinit() returns size of next read buffer. by this point, * we know that we're sending some data. if we fail, something * horrible happened. */ if ((cc = dsi_readinit(dsi, rbuf, *rbuflen, reqcount, err)) < 0) goto afp_read_exit; *rbuflen = cc; /* due to the nature of afp packets, we have to exit if we get an error. we can't do this with translation on. */ #ifdef WITH_SENDFILE if (!(xlate || Debug(obj) )) { int fd; fd = ad_readfile_init(ofork->of_ad, eid, &offset, 0); if (dsi_stream_read_file(dsi, fd, offset, dsi->datasize) < 0) { if (errno == EINVAL || errno == ENOSYS) goto afp_read_loop; else { LOG(log_error, logtype_afpd, "afp_read(%s): ad_readfile: %s", of_name(ofork), strerror(errno)); goto afp_read_exit; } } dsi_readdone(dsi); goto afp_read_done; } afp_read_loop: #endif /* fill up our buffer. */ while (*rbuflen > 0) { cc = read_file(ofork, eid, offset, nlmask, nlchar, rbuf,rbuflen, xlate); if (cc < 0) goto afp_read_exit; offset += *rbuflen; /* dsi_read() also returns buffer size of next allocation */ cc = dsi_read(dsi, rbuf, *rbuflen); /* send it off */ if (cc < 0) goto afp_read_exit; *rbuflen = cc; } dsi_readdone(dsi); goto afp_read_done; afp_read_exit: LOG(log_error, logtype_afpd, "afp_read(%s): %s", of_name(ofork), strerror(errno)); dsi_readdone(dsi); ad_tmplock(ofork->of_ad, eid, ADLOCK_CLR, saveoff, savereqcount,ofork->of_refnum); obj->exit(EXITERR_CLNT); } afp_read_done: ad_tmplock(ofork->of_ad, eid, ADLOCK_CLR, saveoff, savereqcount,ofork->of_refnum); return err; afp_read_err: *rbuflen = 0; return err; } /* ---------------------- */ int afp_read(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { return read_fork(obj, ibuf, ibuflen, rbuf, rbuflen, 0); } /* ---------------------- */ int afp_read_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { return read_fork(obj, ibuf, ibuflen, rbuf, rbuflen, 1); } /* ---------------------- */ int afp_flush(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *vol; u_int16_t vid; *rbuflen = 0; ibuf += 2; memcpy(&vid, ibuf, sizeof(vid)); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } of_flush(vol); return( AFP_OK ); } int afp_flushfork(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct ofork *ofork; u_int16_t ofrefnum; *rbuflen = 0; ibuf += 2; memcpy(&ofrefnum, ibuf, sizeof( ofrefnum )); if (NULL == ( ofork = of_find( ofrefnum )) ) { LOG(log_error, logtype_afpd, "afp_flushfork: of_find(%d) could not locate fork", ofrefnum ); return( AFPERR_PARAM ); } if ( flushfork( ofork ) < 0 ) { LOG(log_error, logtype_afpd, "afp_flushfork(%s): %s", of_name(ofork), strerror(errno) ); } return( AFP_OK ); } /* FIXME There is a lot to tell about fsync, fdatasync, F_FULLFSYNC. fsync(2) on OSX is implemented differently than on other platforms. see: http://mirror.linux.org.au/pub/linux.conf.au/2007/video/talks/278.pdf. */ int afp_syncfork(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct ofork *ofork; u_int16_t ofrefnum; *rbuflen = 0; ibuf += 2; memcpy(&ofrefnum, ibuf, sizeof(ofrefnum)); ibuf += sizeof( ofrefnum ); if (NULL == ( ofork = of_find( ofrefnum )) ) { LOG(log_error, logtype_afpd, "afpd_syncfork: of_find(%d) could not locate fork", ofrefnum ); return( AFPERR_PARAM ); } if ( flushfork( ofork ) < 0 ) { LOG(log_error, logtype_afpd, "flushfork(%s): %s", of_name(ofork), strerror(errno) ); return AFPERR_MISC; } return( AFP_OK ); } /* this is very similar to closefork */ int flushfork(struct ofork *ofork) { struct timeval tv; int err = 0, doflush = 0; if ( ad_data_fileno( ofork->of_ad ) != -1 && fsync( ad_data_fileno( ofork->of_ad )) < 0 ) { LOG(log_error, logtype_afpd, "flushfork(%s): dfile(%d) %s", of_name(ofork), ad_data_fileno(ofork->of_ad), strerror(errno) ); err = -1; } if ( ad_reso_fileno( ofork->of_ad ) != -1 && /* HF */ (ofork->of_flags & AFPFORK_RSRC)) { /* read in the rfork length */ ad_refresh(ofork->of_ad); /* set the date if we're dirty */ if ((ofork->of_flags & AFPFORK_DIRTY) && !gettimeofday(&tv, NULL)) { ad_setdate(ofork->of_ad, AD_DATE_MODIFY|AD_DATE_UNIX, tv.tv_sec); ofork->of_flags &= ~AFPFORK_DIRTY; doflush++; } /* flush the header */ if (doflush && ad_flush(ofork->of_ad) < 0) err = -1; if (fsync( ad_reso_fileno( ofork->of_ad )) < 0) err = -1; if (err < 0) LOG(log_error, logtype_afpd, "flushfork(%s): hfile(%d) %s", of_name(ofork), ad_reso_fileno(ofork->of_ad), strerror(errno) ); } return( err ); } int afp_closefork(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct ofork *ofork; u_int16_t ofrefnum; *rbuflen = 0; ibuf += 2; memcpy(&ofrefnum, ibuf, sizeof( ofrefnum )); if (NULL == ( ofork = of_find( ofrefnum )) ) { LOG(log_error, logtype_afpd, "afp_closefork: of_find(%d) could not locate fork", ofrefnum ); return( AFPERR_PARAM ); } if ( of_closefork( ofork ) < 0 ) { LOG(log_error, logtype_afpd, "afp_closefork(%s): of_closefork: %s", of_name(ofork), strerror(errno) ); return( AFPERR_PARAM ); } return( AFP_OK ); } static ssize_t write_file(struct ofork *ofork, int eid, off_t offset, char *rbuf, size_t rbuflen, const int xlate) { char *p, *q; ssize_t cc; /* * If this file is of type TEXT, swap \015 to \012. */ if (xlate) { for ( p = rbuf, q = p + rbuflen; p < q; p++ ) { if ( *p == '\015' ) { *p = '\012'; } else if ( *p == '\012' ) { *p = '\015'; } } } if (( cc = ad_write(ofork->of_ad, eid, offset, 0, rbuf, rbuflen)) < 0 ) { switch ( errno ) { case EDQUOT : case EFBIG : case ENOSPC : return( AFPERR_DFULL ); case EACCES: return AFPERR_ACCESS; default : LOG(log_error, logtype_afpd, "afp_write(%s): ad_write: %s", of_name(ofork), strerror(errno) ); return( AFPERR_PARAM ); } } return cc; } /* FPWrite. NOTE: on an error, we always use afp_write_err as * the client may have sent us a bunch of data that's not reflected * in reqcount et al. */ static int write_fork(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen, int is64) { struct ofork *ofork; off_t offset, saveoff, reqcount, oldsize, newsize; int endflag, eid, xlate = 0, err = AFP_OK; u_int16_t ofrefnum; ssize_t cc; /* figure out parameters */ ibuf++; endflag = ENDBIT(*ibuf); ibuf++; memcpy(&ofrefnum, ibuf, sizeof( ofrefnum )); ibuf += sizeof( ofrefnum ); offset = get_off_t(&ibuf, is64); reqcount = get_off_t(&ibuf, is64); if (NULL == ( ofork = of_find( ofrefnum )) ) { LOG(log_error, logtype_afpd, "afp_write: of_find(%d) could not locate fork", ofrefnum ); err = AFPERR_PARAM; goto afp_write_err; } if ((ofork->of_flags & AFPFORK_ACCWR) == 0) { err = AFPERR_ACCESS; goto afp_write_err; } #ifdef AFS writtenfork = ofork; #endif /* AFS */ if ( ofork->of_flags & AFPFORK_DATA) { eid = ADEID_DFORK; xlate = (ofork->of_vol->v_flags & AFPVOL_CRLF) ? crlf(ofork) : 0; } else if (ofork->of_flags & AFPFORK_RSRC) { eid = ADEID_RFORK; } else { err = AFPERR_ACCESS; /* should never happen */ goto afp_write_err; } oldsize = ad_size(ofork->of_ad, eid); if (endflag) offset += oldsize; /* handle bogus parameters */ if (reqcount < 0 || offset < 0) { err = AFPERR_PARAM; goto afp_write_err; } newsize = ((offset + reqcount) > oldsize) ? (offset + reqcount) : oldsize; /* offset can overflow on 64-bit capable filesystems. * report disk full if that's going to happen. */ if (sum_neg(is64, offset, reqcount)) { err = AFPERR_DFULL; goto afp_write_err; } if (!reqcount) { /* handle request counts of 0 */ err = AFP_OK; *rbuflen = set_off_t (offset, rbuf, is64); goto afp_write_err; } saveoff = offset; if (ad_tmplock(ofork->of_ad, eid, ADLOCK_WR, saveoff, reqcount, ofork->of_refnum) < 0) { err = AFPERR_LOCK; goto afp_write_err; } /* this is yucky, but dsi can stream i/o and asp can't */ switch (obj->proto) { #ifndef NO_DDP case AFPPROTO_ASP: if (asp_wrtcont(obj->handle, rbuf, rbuflen) < 0) { *rbuflen = 0; LOG(log_error, logtype_afpd, "afp_write: asp_wrtcont: %s", strerror(errno) ); return( AFPERR_PARAM ); } #ifdef DEBUG1 if (obj->options.flags & OPTION_DEBUG) { printf("(write) len: %d\n", *rbuflen); bprint(rbuf, *rbuflen); } #endif if ((cc = write_file(ofork, eid, offset, rbuf, *rbuflen, xlate)) < 0) { *rbuflen = 0; ad_tmplock(ofork->of_ad, eid, ADLOCK_CLR, saveoff, reqcount, ofork->of_refnum); return cc; } offset += cc; break; #endif /* no afp/asp */ case AFPPROTO_DSI: { DSI *dsi = obj->handle; /* find out what we have already and write it out. */ cc = dsi_writeinit(dsi, rbuf, *rbuflen); if (!cc || (cc = write_file(ofork, eid, offset, rbuf, cc, xlate)) < 0) { dsi_writeflush(dsi); *rbuflen = 0; ad_tmplock(ofork->of_ad, eid, ADLOCK_CLR, saveoff, reqcount, ofork->of_refnum); return cc; } offset += cc; #if 0 /*def HAVE_SENDFILE_WRITE*/ if (!(xlate || obj->options.flags & OPTION_DEBUG)) { if ((cc = ad_writefile(ofork->of_ad, eid, dsi->socket, offset, dsi->datasize)) < 0) { switch (errno) { case EDQUOT : case EFBIG : case ENOSPC : cc = AFPERR_DFULL; break; default : LOG(log_error, logtype_afpd, "afp_write: ad_writefile: %s", strerror(errno) ); goto afp_write_loop; } dsi_writeflush(dsi); *rbuflen = 0; ad_tmplock(ofork->of_ad, eid, ADLOCK_CLR, saveoff, reqcount, ofork->of_refnum); return cc; } offset += cc; goto afp_write_done; } #endif /* 0, was HAVE_SENDFILE_WRITE */ /* loop until everything gets written. currently * dsi_write handles the end case by itself. */ while ((cc = dsi_write(dsi, rbuf, *rbuflen))) { if ((cc = write_file(ofork, eid, offset, rbuf, cc, xlate)) < 0) { dsi_writeflush(dsi); *rbuflen = 0; ad_tmplock(ofork->of_ad, eid, ADLOCK_CLR, saveoff, reqcount, ofork->of_refnum); return cc; } offset += cc; } } break; } ad_tmplock(ofork->of_ad, eid, ADLOCK_CLR, saveoff, reqcount, ofork->of_refnum); if ( ad_meta_fileno( ofork->of_ad ) != -1 ) /* META */ ofork->of_flags |= AFPFORK_DIRTY; /* we have modified any fork, remember until close_fork */ ofork->of_flags |= AFPFORK_MODIFIED; /* update write count */ ofork->of_vol->v_appended += (newsize > oldsize) ? (newsize - oldsize) : 0; *rbuflen = set_off_t (offset, rbuf, is64); return( AFP_OK ); afp_write_err: if (obj->proto == AFPPROTO_DSI) { dsi_writeinit(obj->handle, rbuf, *rbuflen); dsi_writeflush(obj->handle); } if (err != AFP_OK) { *rbuflen = 0; } return err; } /* ---------------------------- */ int afp_write(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { return write_fork(obj, ibuf, ibuflen, rbuf, rbuflen, 0); } /* ---------------------------- * FIXME need to deal with SIGXFSZ signal */ int afp_write_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { return write_fork(obj, ibuf, ibuflen, rbuf, rbuflen, 1); } /* ---------------------------- */ int afp_getforkparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct ofork *ofork; int ret; u_int16_t ofrefnum, bitmap; size_t buflen; ibuf += 2; memcpy(&ofrefnum, ibuf, sizeof( ofrefnum )); ibuf += sizeof( ofrefnum ); memcpy(&bitmap, ibuf, sizeof( bitmap )); bitmap = ntohs( bitmap ); ibuf += sizeof( bitmap ); *rbuflen = 0; if (NULL == ( ofork = of_find( ofrefnum )) ) { LOG(log_error, logtype_afpd, "afp_getforkparams: of_find(%d) could not locate fork", ofrefnum ); return( AFPERR_PARAM ); } if ( ad_meta_fileno( ofork->of_ad ) != -1 ) { /* META */ if ( ad_refresh( ofork->of_ad ) < 0 ) { LOG(log_error, logtype_afpd, "getforkparams(%s): ad_refresh: %s", of_name(ofork), strerror(errno) ); return( AFPERR_PARAM ); } } if (AFP_OK != ( ret = getforkparams( ofork, bitmap, rbuf + sizeof( u_short ), &buflen ))) { return( ret ); } *rbuflen = buflen + sizeof( u_short ); bitmap = htons( bitmap ); memcpy(rbuf, &bitmap, sizeof( bitmap )); return( AFP_OK ); } netatalk-2.2.2/etc/afpd/filedir.c0000644000175200017500000005715411655731244013536 00000000000000/* * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include /* STDC check */ #if STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #ifdef HAVE_STRINGS_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "directory.h" #include "dircache.h" #include "desktop.h" #include "volume.h" #include "fork.h" #include "file.h" #include "filedir.h" #include "unix.h" #ifdef DROPKLUDGE int matchfile2dirperms( /* Since it's kinda' big; I decided against an inline function */ char *upath, struct vol *vol, int did) /* The below code changes the way file ownership is determined in the name of fixing dropboxes. It has known security problem. See the netatalk FAQ for more information */ { struct stat st, sb; struct dir *dir; char *adpath; uid_t uid; int ret = AFP_OK; #ifdef DEBUG LOG(log_debug9, logtype_afpd, "begin matchfile2dirperms:"); #endif if (stat(upath, &st ) < 0) { LOG(log_error, logtype_afpd, "Could not stat %s: %s", upath, strerror(errno)); return AFPERR_NOOBJ ; } adpath = vol->vfs->ad_path( upath, ADFLAGS_HF ); /* FIXME dirsearch doesn't move cwd to did ! */ if (( dir = dirlookup( vol, did )) == NULL ) { LOG(log_error, logtype_afpd, "matchfile2dirperms: Unable to get directory info."); ret = AFPERR_NOOBJ; } else if (stat(".", &sb) < 0) { LOG(log_error, logtype_afpd, "matchfile2dirperms: Error checking directory \"%s\": %s", dir->d_m_name, strerror(errno)); ret = AFPERR_NOOBJ; } else { uid=geteuid(); if ( uid != sb.st_uid ) { seteuid(0); if (lchown(upath, sb.st_uid, sb.st_gid) < 0) { LOG(log_error, logtype_afpd, "matchfile2dirperms(%s): Error changing owner/gid: %s", upath, strerror(errno)); ret = AFPERR_ACCESS; } else if ((!S_ISLNK(st->st_mode)) && (chmod_acl(upath,(st.st_mode&~default_options.umask)| S_IRGRP| S_IROTH) < 0)) { LOG(log_error, logtype_afpd, "matchfile2dirperms(%s): Error adding file read permissions: %s", upath, strerror(errno)); ret = AFPERR_ACCESS; } else if (lchown(adpath, sb.st_uid, sb.st_gid) < 0) { LOG(log_error, logtype_afpd, "matchfile2dirperms(%s): Error changing AppleDouble owner/gid: %s", adpath, strerror(errno)); ret = AFPERR_ACCESS; } else if (chmod_acl(adpath, (st.st_mode&~default_options.umask)| S_IRGRP| S_IROTH) < 0) { LOG(log_error, logtype_afpd, "matchfile2dirperms(%s): Error adding AD file read permissions: %s", adpath, strerror(errno)); ret = AFPERR_ACCESS; } seteuid(uid); } } /* end else if stat success */ #ifdef DEBUG LOG(log_debug9, logtype_afpd, "end matchfile2dirperms:"); #endif return ret; } #endif int afp_getfildirparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct stat *st; struct vol *vol; struct dir *dir; u_int32_t did; int ret; size_t buflen; u_int16_t fbitmap, dbitmap, vid; struct path *s_path; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { /* was AFPERR_PARAM but it helps OS 10.3 when a volume has been removed * from the list. */ return( AFPERR_ACCESS ); } memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; } memcpy( &fbitmap, ibuf, sizeof( fbitmap )); fbitmap = ntohs( fbitmap ); ibuf += sizeof( fbitmap ); memcpy( &dbitmap, ibuf, sizeof( dbitmap )); dbitmap = ntohs( dbitmap ); ibuf += sizeof( dbitmap ); if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) { return get_afp_errno(AFPERR_NOOBJ); } LOG(log_debug, logtype_afpd, "getfildirparams(vid:%u, did:%u, f/d:%04x/%04x) {cwdid:%u, cwd: %s, name:'%s'}", ntohs(vid), ntohl(dir->d_did), fbitmap, dbitmap, ntohl(curdir->d_did), cfrombstr(curdir->d_fullpath), s_path->u_name); st = &s_path->st; if (!s_path->st_valid) { /* it's a dir and it should be there * because we chdir in it in cname or * it's curdir (maybe deleted, but then we can't know). * So we need to try harder. */ of_statdir(vol, s_path); } if ( s_path->st_errno != 0 ) { if (afp_errno != AFPERR_ACCESS) { return( AFPERR_NOOBJ ); } } buflen = 0; if (S_ISDIR(st->st_mode)) { if (dbitmap) { dir = s_path->d_dir; if (!dir) return AFPERR_NOOBJ; ret = getdirparams(vol, dbitmap, s_path, dir, rbuf + 3 * sizeof( u_int16_t ), &buflen ); if (ret != AFP_OK ) return( ret ); } /* this is a directory */ *(rbuf + 2 * sizeof( u_int16_t )) = (char) FILDIRBIT_ISDIR; } else { if (fbitmap && AFP_OK != (ret = getfilparams(vol, fbitmap, s_path, curdir, rbuf + 3 * sizeof( u_int16_t ), &buflen )) ) { return( ret ); } /* this is a file */ *(rbuf + 2 * sizeof( u_int16_t )) = FILDIRBIT_ISFILE; } *rbuflen = buflen + 3 * sizeof( u_int16_t ); fbitmap = htons( fbitmap ); memcpy( rbuf, &fbitmap, sizeof( fbitmap )); rbuf += sizeof( fbitmap ); dbitmap = htons( dbitmap ); memcpy( rbuf, &dbitmap, sizeof( dbitmap )); rbuf += sizeof( dbitmap ) + sizeof( u_char ); *rbuf = 0; return( AFP_OK ); } int afp_setfildirparams(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct stat *st; struct vol *vol; struct dir *dir; struct path *path; u_int16_t vid, bitmap; int did, rc; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof(vid)); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } if (vol->v_flags & AFPVOL_RO) return AFPERR_VLOCK; memcpy( &did, ibuf, sizeof( did)); ibuf += sizeof( did); if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; } memcpy( &bitmap, ibuf, sizeof( bitmap )); bitmap = ntohs( bitmap ); ibuf += sizeof( bitmap ); if (NULL == ( path = cname( vol, dir, &ibuf ))) { return get_afp_errno(AFPERR_NOOBJ); } st = &path->st; if (!path->st_valid) { /* it's a dir and it should be there * because we chdir in it in cname */ of_statdir(vol, path); } if ( path->st_errno != 0 ) { if (afp_errno != AFPERR_ACCESS) return( AFPERR_NOOBJ ); } /* * If ibuf is odd, make it even. */ if ((u_long)ibuf & 1 ) { ibuf++; } if (S_ISDIR(st->st_mode)) { rc = setdirparams(vol, path, bitmap, ibuf ); } else { rc = setfilparams(vol, path, bitmap, ibuf ); } if ( rc == AFP_OK ) { setvoltime(obj, vol ); } return( rc ); } /* -------------------------------------------- Factorise some checks on a pathname */ int check_name(const struct vol *vol, char *name) { /* check for illegal characters in the unix filename */ if (!wincheck(vol, name)) return AFPERR_PARAM; if ((vol->v_flags & AFPVOL_NOHEX) && strchr(name, '/')) return AFPERR_PARAM; if (!vol->vfs->vfs_validupath(vol, name)) { LOG(log_error, logtype_afpd, "check_name: illegal name: '%s'", name); return AFPERR_EXIST; } /* check for vetoed filenames */ if (veto_file(vol->v_veto, name)) return AFPERR_EXIST; return 0; } /* ------------------------- move and rename sdir:oldname to curdir:newname in volume vol special care is needed for lock */ static int moveandrename(const struct vol *vol, struct dir *sdir, int sdir_fd, char *oldname, char *newname, int isdir) { char *oldunixname = NULL; char *upath; int rc; struct stat *st, nst; int adflags; struct adouble ad; struct adouble *adp; struct ofork *opened = NULL; struct path path; cnid_t id; int cwd_fd = -1; LOG(log_debug, logtype_afpd, "moveandrename: [\"%s\"/\"%s\"] -> \"%s\"", cfrombstr(sdir->d_u_name), oldname, newname); ad_init(&ad, vol->v_adouble, vol->v_ad_options); adp = &ad; adflags = 0; if (!isdir) { if ((oldunixname = strdup(mtoupath(vol, oldname, sdir->d_did, utf8_encoding()))) == NULL) return AFPERR_PARAM; /* can't convert */ id = cnid_get(vol->v_cdb, sdir->d_did, oldunixname, strlen(oldunixname)); #ifndef HAVE_ATFUNCS /* Need full path */ free(oldunixname); if ((oldunixname = strdup(ctoupath(vol, sdir, oldname))) == NULL) return AFPERR_PARAM; /* pathname too long */ #endif /* HAVE_ATFUNCS */ path.st_valid = 0; path.u_name = oldunixname; #ifdef HAVE_ATFUNCS opened = of_findnameat(sdir_fd, &path); #else opened = of_findname(&path); #endif /* HAVE_ATFUNCS */ if (opened) { /* reuse struct adouble so it won't break locks */ adp = opened->of_ad; } } else { id = sdir->d_did; /* we already have the CNID */ if ((oldunixname = strdup(ctoupath( vol, dirlookup(vol, sdir->d_pdid), oldname))) == NULL) return AFPERR_PARAM; adflags = ADFLAGS_DIR; } /* * oldunixname now points to either * a) full pathname of the source fs object (if renameat is not available) * b) the oldname (renameat is available) * we are in the dest folder so we need to use * a) oldunixname for ad_open * b) fchdir sdir_fd before eg ad_open or use *at functions where appropiate */ if (sdir_fd != -1) { if ((cwd_fd = open(".", O_RDONLY)) == -1) return AFPERR_MISC; if (fchdir(sdir_fd) != 0) { rc = AFPERR_MISC; goto exit; } } if (!ad_metadata(oldunixname, adflags, adp)) { u_int16_t bshort; ad_getattr(adp, &bshort); ad_close_metadata( adp); if ((bshort & htons(ATTRBIT_NORENAME))) { rc = AFPERR_OLOCK; goto exit; } } if (sdir_fd != -1) { if (fchdir(cwd_fd) != 0) { LOG(log_error, logtype_afpd, "moveandrename: %s", strerror(errno) ); rc = AFPERR_MISC; goto exit; } } if (NULL == (upath = mtoupath(vol, newname, curdir->d_did, utf8_encoding()))){ rc = AFPERR_PARAM; goto exit; } path.u_name = upath; st = &path.st; if (0 != (rc = check_name(vol, upath))) { goto exit; } /* source == destination. we just silently accept this. */ if ((!isdir && curdir == sdir) || (isdir && curdir->d_did == sdir->d_pdid)) { if (strcmp(oldname, newname) == 0) { rc = AFP_OK; goto exit; } if (stat(upath, st) == 0 || caseenumerate(vol, &path, curdir) == 0) { if (!stat(oldunixname, &nst) && !(nst.st_dev == st->st_dev && nst.st_ino == st->st_ino) ) { /* not the same file */ rc = AFPERR_EXIST; goto exit; } errno = 0; } } else if (stat(upath, st ) == 0 || caseenumerate(vol, &path, curdir) == 0) { rc = AFPERR_EXIST; goto exit; } if ( !isdir ) { path.st_valid = 1; path.st_errno = errno; if (of_findname(&path)) { rc = AFPERR_EXIST; /* was AFPERR_BUSY; */ } else { rc = renamefile(vol, sdir_fd, oldunixname, upath, newname, adp ); if (rc == AFP_OK) of_rename(vol, opened, sdir, oldname, curdir, newname); } } else { rc = renamedir(vol, sdir_fd, oldunixname, upath, sdir, curdir, newname); } if ( rc == AFP_OK && id ) { /* renaming may have moved the file/dir across a filesystem */ if (stat(upath, st) < 0) { rc = AFPERR_MISC; goto exit; } /* Remove it from the cache */ struct dir *cacheddir = dircache_search_by_did(vol, id); if (cacheddir) { LOG(log_warning, logtype_afpd,"Still cached: \"%s/%s\"", getcwdpath(), upath); (void)dir_remove(vol, cacheddir); } /* Fixup adouble info */ if (!ad_metadata(upath, adflags, adp)) { ad_setid(adp, st->st_dev, st->st_ino, id, curdir->d_did, vol->v_stamp); ad_flush(adp); ad_close_metadata(adp); } /* fix up the catalog entry */ cnid_update(vol->v_cdb, id, st, curdir->d_did, upath, strlen(upath)); } exit: if (cwd_fd != -1) close(cwd_fd); if (oldunixname) free(oldunixname); return rc; } /* -------------------------------------------- */ int afp_rename(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *vol; struct dir *sdir; char *oldname, *newname; struct path *path; u_int32_t did; int plen; u_int16_t vid; int isdir = 0; int rc; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } if (vol->v_flags & AFPVOL_RO) return AFPERR_VLOCK; memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); if (NULL == ( sdir = dirlookup( vol, did )) ) { return afp_errno; } /* source pathname */ if (NULL == ( path = cname( vol, sdir, &ibuf )) ) { return get_afp_errno(AFPERR_NOOBJ); } sdir = curdir; newname = obj->newtmp; oldname = obj->oldtmp; isdir = path_isadir(path); if ( *path->m_name != '\0' ) { strcpy(oldname, path->m_name); /* an extra copy for of_rename */ if (isdir) { /* curdir parent dir, need to move sdir back */ sdir = path->d_dir; } } else { if ( sdir->d_did == DIRDID_ROOT ) { /* root directory */ return( AFPERR_NORENAME ); } /* move to destination dir */ if ( movecwd( vol, dirlookup(vol, sdir->d_pdid) ) < 0 ) { return afp_errno; } memcpy(oldname, cfrombstr(sdir->d_m_name), blength(sdir->d_m_name) +1); } /* another place where we know about the path type */ if ((plen = copy_path_name(vol, newname, ibuf)) < 0) { return( AFPERR_PARAM ); } if (!plen) { return AFP_OK; /* newname == oldname same dir */ } rc = moveandrename(vol, sdir, -1, oldname, newname, isdir); if ( rc == AFP_OK ) { setvoltime(obj, vol ); } return( rc ); } /* ------------------------------- */ int afp_delete(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *vol; struct dir *dir; struct path *s_path; char *upath; int did, rc; u_int16_t vid; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } if (vol->v_flags & AFPVOL_RO) return AFPERR_VLOCK; memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( int ); if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; } if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) { return get_afp_errno(AFPERR_NOOBJ); } upath = s_path->u_name; if ( path_isadir( s_path) ) { if (*s_path->m_name != '\0' || curdir->d_did == DIRDID_ROOT) { rc = AFPERR_ACCESS; } else { /* we have to cache this, the structs are lost in deletcurdir*/ /* but we need the positive returncode to send our event */ bstring dname; if ((dname = bstrcpy(curdir->d_u_name)) == NULL) return AFPERR_MISC; if ((rc = deletecurdir(vol)) == AFP_OK) fce_register_delete_dir(cfrombstr(dname)); bdestroy(dname); } } else if (of_findname(s_path)) { rc = AFPERR_BUSY; } else { /* it's a file st_valid should always be true * only test for ENOENT because EACCES needs * to read meta data in deletefile */ if (s_path->st_valid && s_path->st_errno == ENOENT) { rc = AFPERR_NOOBJ; } else { if ((rc = deletefile(vol, -1, upath, 1)) == AFP_OK) { fce_register_delete_file( s_path ); if (vol->v_tm_used < s_path->st.st_size) vol->v_tm_used = 0; else vol->v_tm_used -= s_path->st.st_size; } struct dir *cachedfile; if ((cachedfile = dircache_search_by_name(vol, dir, upath, strlen(upath)))) { dircache_remove(vol, cachedfile, DIRCACHE | DIDNAME_INDEX | QUEUE_INDEX); dir_free(cachedfile); } } } if ( rc == AFP_OK ) { curdir->d_offcnt--; setvoltime(obj, vol ); } return( rc ); } /* ------------------------ */ char *absupath(const struct vol *vol, struct dir *dir, char *u) { static char pathbuf[MAXPATHLEN + 1]; bstring path; if (u == NULL || dir == NULL || vol == NULL) return NULL; if ((path = bstrcpy(dir->d_fullpath)) == NULL) return NULL; if (bcatcstr(path, "/") != BSTR_OK) return NULL; if (bcatcstr(path, u) != BSTR_OK) return NULL; if (path->slen > MAXPATHLEN) return NULL; LOG(log_debug, logtype_afpd, "absupath: %s", cfrombstr(path)); strncpy(pathbuf, cfrombstr(path), blength(path) + 1); bdestroy(path); return(pathbuf); } char *ctoupath(const struct vol *vol, struct dir *dir, char *name) { if (vol == NULL || dir == NULL || name == NULL) return NULL; return absupath(vol, dir, mtoupath(vol, name, dir->d_did, utf8_encoding())); } /* ------------------------- */ int afp_moveandrename(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *vol; struct dir *sdir, *ddir; int isdir; char *oldname, *newname; struct path *path; int did; int pdid; int plen; u_int16_t vid; int rc; #ifdef DROPKLUDGE int retvalue; #endif /* DROPKLUDGE */ int sdir_fd = -1; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } if (vol->v_flags & AFPVOL_RO) return AFPERR_VLOCK; /* source did followed by dest did */ memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( int ); if (NULL == ( sdir = dirlookup( vol, did )) ) { return afp_errno; /* was AFPERR_PARAM */ } memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( int ); /* source pathname */ if (NULL == ( path = cname( vol, sdir, &ibuf )) ) { return get_afp_errno(AFPERR_NOOBJ); } sdir = curdir; newname = obj->newtmp; oldname = obj->oldtmp; isdir = path_isadir(path); if ( *path->m_name != '\0' ) { if (isdir) { sdir = path->d_dir; } strcpy(oldname, path->m_name); /* an extra copy for of_rename */ } else { memcpy(oldname, cfrombstr(sdir->d_m_name), blength(sdir->d_m_name) + 1); } #ifdef HAVE_ATFUNCS if ((sdir_fd = open(".", O_RDONLY)) == -1) return AFPERR_MISC; #endif /* get the destination directory */ if (NULL == ( ddir = dirlookup( vol, did )) ) { rc = afp_errno; /* was AFPERR_PARAM */ goto exit; } if (NULL == ( path = cname( vol, ddir, &ibuf ))) { rc = AFPERR_NOOBJ; goto exit; } pdid = curdir->d_did; if ( *path->m_name != '\0' ) { rc = path_error(path, AFPERR_NOOBJ); goto exit; } /* one more place where we know about path type */ if ((plen = copy_path_name(vol, newname, ibuf)) < 0) { rc = AFPERR_PARAM; goto exit; } if (!plen) { strcpy(newname, oldname); } /* This does the work */ LOG(log_debug, logtype_afpd, "afp_move(oldname:'%s', newname:'%s', isdir:%u)", oldname, newname, isdir); rc = moveandrename(vol, sdir, sdir_fd, oldname, newname, isdir); if ( rc == AFP_OK ) { char *upath = mtoupath(vol, newname, pdid, utf8_encoding()); if (NULL == upath) { rc = AFPERR_PARAM; goto exit; } curdir->d_offcnt++; sdir->d_offcnt--; #ifdef DROPKLUDGE if (vol->v_flags & AFPVOL_DROPBOX) { /* FIXME did is not always the source id */ if ((retvalue=matchfile2dirperms (upath, vol, did)) != AFP_OK) { rc = retvalue; goto exit; } } else #endif /* DROPKLUDGE */ /* if unix priv don't try to match perm with dest folder */ if (!isdir && !vol_unix_priv(vol)) { int admode = ad_mode("", 0777) | vol->v_fperm; setfilmode(upath, admode, NULL, vol->v_umask); vol->vfs->vfs_setfilmode(vol, upath, admode, NULL); } setvoltime(obj, vol ); } exit: #ifdef HAVE_ATFUNCS if (sdir_fd != -1) close(sdir_fd); #endif return( rc ); } int veto_file(const char*veto_str, const char*path) /* given a veto_str like "abc/zxc/" and path "abc", return 1 * veto_str should be '/' delimited * if path matches any one of the veto_str elements exactly, then 1 is returned * otherwise, 0 is returned. */ { int i; /* index to veto_str */ int j; /* index to path */ if ((veto_str == NULL) || (path == NULL)) return 0; for(i=0, j=0; veto_str[i] != '\0'; i++) { if (veto_str[i] == '/') { if ((j>0) && (path[j] == '\0')) { LOG(log_debug, logtype_afpd, "vetoed file:'%s'", path); return 1; } j = 0; } else { if (veto_str[i] != path[j]) { while ((veto_str[i] != '/') && (veto_str[i] != '\0')) i++; j = 0; continue; } j++; } } return 0; } netatalk-2.2.2/etc/afpd/afp_avahi.c0000644000175200017500000003046611667370644014041 00000000000000/* * Author: Daniel S. Haischt * Purpose: Avahi based Zeroconf support * Docs: http://avahi.org/download/doxygen/ * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_AVAHI #include #include #include #include #include #include #include #include "afp_avahi.h" #include "afp_config.h" #include "volume.h" /***************************************************************** * Global variables *****************************************************************/ struct context *ctx = NULL; /***************************************************************** * Private functions *****************************************************************/ static void publish_reply(AvahiEntryGroup *g, AvahiEntryGroupState state, void *userdata); /* * This function tries to register the AFP DNS * SRV service type. */ static void register_stuff(void) { uint port; const AFPConfig *config; const struct vol *volume; DSI *dsi; char name[MAXINSTANCENAMELEN+1]; AvahiStringList *strlist = NULL; AvahiStringList *strlist2 = NULL; char tmpname[256]; assert(ctx->client); if (!ctx->group) { if (!(ctx->group = avahi_entry_group_new(ctx->client, publish_reply, ctx))) { LOG(log_error, logtype_afpd, "Failed to create entry group: %s", avahi_strerror(avahi_client_errno(ctx->client))); goto fail; } } if (avahi_entry_group_is_empty(ctx->group)) { /* Register our service */ /* Build AFP volumes list */ int i = 0; strlist = avahi_string_list_add_printf(strlist, "sys=waMa=0,adVF=0x100"); for (volume = getvolumes(); volume; volume = volume->v_next) { if (convert_string(CH_UCS2, CH_UTF8_MAC, volume->v_name, -1, tmpname, 255) <= 0) { LOG ( log_error, logtype_afpd, "Could not set Zeroconf volume name for TimeMachine"); goto fail; } if (volume->v_flags & AFPVOL_TM) { if (volume->v_uuid) { LOG(log_info, logtype_afpd, "Registering volume '%s' with UUID: '%s' for TimeMachine", volume->v_localname, volume->v_uuid); strlist = avahi_string_list_add_printf(strlist, "dk%u=adVN=%s,adVF=0xa1,adVU=%s", i++, tmpname, volume->v_uuid); } else { LOG(log_warning, logtype_afpd, "Registering volume '%s' for TimeMachine. But UUID is invalid.", volume->v_localname); strlist = avahi_string_list_add_printf(strlist, "dk%u=adVN=%s,adVF=0xa1", i++, tmpname); } } } /* AFP server */ for (config = ctx->configs; config; config = config->next) { dsi = (DSI *)config->obj.handle; port = getip_port((struct sockaddr *)&dsi->server); if (convert_string(config->obj.options.unixcharset, CH_UTF8, config->obj.options.server ? config->obj.options.server : config->obj.options.hostname, -1, name, MAXINSTANCENAMELEN) <= 0) { LOG(log_error, logtype_afpd, "Could not set Zeroconf instance name"); goto fail; } if ((dsi->bonjourname = strdup(name)) == NULL) { LOG(log_error, logtype_afpd, "Could not set Zeroconf instance name"); goto fail; } LOG(log_info, logtype_afpd, "Registering server '%s' with Bonjour", dsi->bonjourname); if (avahi_entry_group_add_service(ctx->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, dsi->bonjourname, AFP_DNS_SERVICE_TYPE, NULL, NULL, port, NULL) < 0) { LOG(log_error, logtype_afpd, "Failed to add service: %s", avahi_strerror(avahi_client_errno(ctx->client))); goto fail; } if (i && avahi_entry_group_add_service_strlst(ctx->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, dsi->bonjourname, ADISK_SERVICE_TYPE, NULL, NULL, 9, /* discard */ strlist) < 0) { LOG(log_error, logtype_afpd, "Failed to add service: %s", avahi_strerror(avahi_client_errno(ctx->client))); goto fail; } /* if */ if (config->obj.options.mimicmodel) { strlist2 = avahi_string_list_add_printf(strlist2, "model=%s", config->obj.options.mimicmodel); if (avahi_entry_group_add_service_strlst(ctx->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, dsi->bonjourname, DEV_INFO_SERVICE_TYPE, NULL, NULL, 0, strlist2) < 0) { LOG(log_error, logtype_afpd, "Failed to add service: %s", avahi_strerror(avahi_client_errno(ctx->client))); goto fail; } } /* if (config->obj.options.mimicmodel) */ } /* for config*/ if (avahi_entry_group_commit(ctx->group) < 0) { LOG(log_error, logtype_afpd, "Failed to commit entry group: %s", avahi_strerror(avahi_client_errno(ctx->client))); goto fail; } } /* if avahi_entry_group_is_empty*/ return; fail: time(NULL); // avahi_threaded_poll_quit(ctx->threaded_poll); } /* Called when publishing of service data completes */ static void publish_reply(AvahiEntryGroup *g, AvahiEntryGroupState state, AVAHI_GCC_UNUSED void *userdata) { assert(ctx->group == NULL || g == ctx->group); switch (state) { case AVAHI_ENTRY_GROUP_ESTABLISHED : /* The entry group has been established successfully */ LOG(log_debug, logtype_afpd, "publish_reply: AVAHI_ENTRY_GROUP_ESTABLISHED"); break; case AVAHI_ENTRY_GROUP_COLLISION: /* With multiple names there's no way to know which one collided */ LOG(log_error, logtype_afpd, "publish_reply: AVAHI_ENTRY_GROUP_COLLISION", avahi_strerror(avahi_client_errno(ctx->client))); avahi_threaded_poll_quit(ctx->threaded_poll); break; case AVAHI_ENTRY_GROUP_FAILURE: LOG(log_error, logtype_afpd, "Failed to register service: %s", avahi_strerror(avahi_client_errno(ctx->client))); avahi_threaded_poll_quit(ctx->threaded_poll); break; case AVAHI_ENTRY_GROUP_UNCOMMITED: break; case AVAHI_ENTRY_GROUP_REGISTERING: break; } } static void client_callback(AvahiClient *client, AvahiClientState state, void *userdata) { ctx->client = client; switch (state) { case AVAHI_CLIENT_S_RUNNING: /* The server has startup successfully and registered its host * name on the network, so it's time to create our services */ if (!ctx->group) register_stuff(); break; case AVAHI_CLIENT_S_COLLISION: if (ctx->group) avahi_entry_group_reset(ctx->group); break; case AVAHI_CLIENT_FAILURE: { if (avahi_client_errno(client) == AVAHI_ERR_DISCONNECTED) { int error; avahi_client_free(ctx->client); ctx->client = NULL; ctx->group = NULL; /* Reconnect to the server */ if (!(ctx->client = avahi_client_new(avahi_threaded_poll_get(ctx->threaded_poll), AVAHI_CLIENT_NO_FAIL, client_callback, ctx, &error))) { LOG(log_error, logtype_afpd, "Failed to contact server: %s", avahi_strerror(error)); avahi_threaded_poll_quit(ctx->threaded_poll); } } else { LOG(log_error, logtype_afpd, "Client failure: %s", avahi_strerror(avahi_client_errno(client))); avahi_threaded_poll_quit(ctx->threaded_poll); } break; } case AVAHI_CLIENT_S_REGISTERING: break; case AVAHI_CLIENT_CONNECTING: break; } } /************************************************************************ * Public funcions ************************************************************************/ /* * Tries to setup the Zeroconf thread and any * neccessary config setting. */ void av_zeroconf_register(const AFPConfig *configs) { int error; /* initialize the struct that holds our config settings. */ if (ctx) { LOG(log_debug, logtype_afpd, "Resetting zeroconf records"); avahi_entry_group_reset(ctx->group); } else { ctx = calloc(1, sizeof(struct context)); ctx->configs = configs; assert(ctx); } /* first of all we need to initialize our threading env */ if (!(ctx->threaded_poll = avahi_threaded_poll_new())) { goto fail; } /* now we need to acquire a client */ if (!(ctx->client = avahi_client_new(avahi_threaded_poll_get(ctx->threaded_poll), AVAHI_CLIENT_NO_FAIL, client_callback, NULL, &error))) { LOG(log_error, logtype_afpd, "Failed to create client object: %s", avahi_strerror(error)); goto fail; } if (avahi_threaded_poll_start(ctx->threaded_poll) < 0) { LOG(log_error, logtype_afpd, "Failed to create thread: %s", avahi_strerror(avahi_client_errno(ctx->client))); goto fail; } else { LOG(log_info, logtype_afpd, "Successfully started avahi loop."); } ctx->thread_running = 1; return; fail: av_zeroconf_unregister(); return; } /* * Tries to shutdown this loop impl. * Call this function from inside this thread. */ int av_zeroconf_unregister() { LOG(log_error, logtype_afpd, "av_zeroconf_unregister"); if (ctx) { LOG(log_error, logtype_afpd, "av_zeroconf_unregister: avahi_threaded_poll_stop"); if (ctx->threaded_poll) avahi_threaded_poll_stop(ctx->threaded_poll); LOG(log_error, logtype_afpd, "av_zeroconf_unregister: avahi_client_free"); if (ctx->client) avahi_client_free(ctx->client); LOG(log_error, logtype_afpd, "av_zeroconf_unregister: avahi_threaded_poll_free"); if (ctx->threaded_poll) avahi_threaded_poll_free(ctx->threaded_poll); free(ctx); ctx = NULL; } return 0; } #endif /* USE_AVAHI */ netatalk-2.2.2/etc/afpd/afp_avahi.h0000644000175200017500000000216211655731244014030 00000000000000/* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */ /* * Author: Daniel S. Haischt * Purpose: Avahi based Zeroconf support * Docs: http://avahi.org/download/doxygen/ * */ #ifndef AFPD_AVAHI_H #define AFPD_AVAHI_H #include #include #include #include #include #include #include #include #include #include #include "afp_config.h" #define AFP_DNS_SERVICE_TYPE "_afpovertcp._tcp" #define ADISK_SERVICE_TYPE "_adisk._tcp" #define DEV_INFO_SERVICE_TYPE "_device-info._tcp" #define MAXINSTANCENAMELEN 63 struct context { /* Avahi stuff */ int thread_running; AvahiThreadedPoll *threaded_poll; AvahiClient *client; AvahiEntryGroup *group; /* Netatalk stuff */ const AFPConfig *configs; }; /* prototype definitions */ void av_zeroconf_register(const AFPConfig *configs); int av_zeroconf_unregister(void); #endif /* AFPD_AVAHI_H */ netatalk-2.2.2/etc/afpd/acls.h0000644000175200017500000001042411655731244013034 00000000000000/* Copyright (c) 2008,2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef AFPD_ACLS_H #define AFPD_ACLS_H #ifdef HAVE_SOLARIS_ACLS #include #endif #include /* for atalk_uuid_t */ /* * This is what Apple says about ACL flags in sys/kauth.h: * * The low 16 bits of the flags field are reserved for filesystem * internal use and must be preserved by all APIs. This includes * round-tripping flags through user-space interfaces. * The high 16 bits of the flags are used to store attributes and * to request specific handling of the ACL. * * The constants are included for reference. We DONT expect them on * the wire! We will ignore and spoil em. */ #ifdef HAVE_SOLARIS_ACLS /* Some stuff for the handling of NFSv4 ACLs */ #define ACE_TRIVIAL (ACE_OWNER | ACE_GROUP | ACE_EVERYONE) #endif /* HAVE_SOLARIS_ACLS */ /* FPGet|Set Bitmap */ enum { kFileSec_UUID = (1<<0), kFileSec_GRPUUID = (1<<1), kFileSec_ACL = (1<<2), kFileSec_REMOVEACL = (1<<3), kFileSec_Inherit = (1<<4) }; /* ACL Flags */ #define DARWIN_ACL_FLAGS_PRIVATE (0xffff) /* inheritance will be deferred until the first rename operation */ #define KAUTH_ACL_DEFER_INHERIT (1<<16) /* this ACL must not be overwritten as part of an inheritance operation */ #define KAUTH_ACL_NO_INHERIT (1<<17) /* ACE Flags */ #define DARWIN_ACE_FLAGS_KINDMASK 0xf #define DARWIN_ACE_FLAGS_PERMIT (1<<0) /* 0x00000001 */ #define DARWIN_ACE_FLAGS_DENY (1<<1) /* 0x00000002 */ #define DARWIN_ACE_FLAGS_INHERITED (1<<4) /* 0x00000010 */ #define DARWIN_ACE_FLAGS_FILE_INHERIT (1<<5) /* 0x00000020 */ #define DARWIN_ACE_FLAGS_DIRECTORY_INHERIT (1<<6) /* 0x00000040 */ #define DARWIN_ACE_FLAGS_LIMIT_INHERIT (1<<7) /* 0x00000080 */ #define DARWIN_ACE_FLAGS_ONLY_INHERIT (1<<8) /* 0x00000100 */ /* All flag bits controlling ACE inheritance */ #define DARWIN_ACE_INHERIT_CONTROL_FLAGS \ (DARWIN_ACE_FLAGS_FILE_INHERIT |\ DARWIN_ACE_FLAGS_DIRECTORY_INHERIT |\ DARWIN_ACE_FLAGS_LIMIT_INHERIT |\ DARWIN_ACE_FLAGS_ONLY_INHERIT) /* ACE Rights */ #define DARWIN_ACE_READ_DATA 0x00000002 #define DARWIN_ACE_LIST_DIRECTORY 0x00000002 #define DARWIN_ACE_WRITE_DATA 0x00000004 #define DARWIN_ACE_ADD_FILE 0x00000004 #define DARWIN_ACE_EXECUTE 0x00000008 #define DARWIN_ACE_SEARCH 0x00000008 #define DARWIN_ACE_DELETE 0x00000010 #define DARWIN_ACE_APPEND_DATA 0x00000020 #define DARWIN_ACE_ADD_SUBDIRECTORY 0x00000020 #define DARWIN_ACE_DELETE_CHILD 0x00000040 #define DARWIN_ACE_READ_ATTRIBUTES 0x00000080 #define DARWIN_ACE_WRITE_ATTRIBUTES 0x00000100 #define DARWIN_ACE_READ_EXTATTRIBUTES 0x00000200 #define DARWIN_ACE_WRITE_EXTATTRIBUTES 0x00000400 #define DARWIN_ACE_READ_SECURITY 0x00000800 #define DARWIN_ACE_WRITE_SECURITY 0x00001000 #define DARWIN_ACE_TAKE_OWNERSHIP 0x00002000 /* Access Control List Entry (ACE) */ typedef struct { atalk_uuid_t darwin_ace_uuid; uint32_t darwin_ace_flags; uint32_t darwin_ace_rights; } darwin_ace_t; /* Access Control List */ typedef struct { uint32_t darwin_acl_count; uint32_t darwin_acl_flags; } darwin_acl_header_t; /* FP functions */ int afp_access (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_getacl (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_setacl (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); /* Parse afp_ldap.conf */ extern int acl_ldap_readconfig(char *name); /* Misc funcs */ extern int acltoownermode(const struct vol *vol, char *path, struct stat *st, struct maccess *ma); extern int check_vol_acl_support(const struct vol *vol); #endif netatalk-2.2.2/etc/afpd/afp_asp.c0000644000175200017500000003070111665651044013516 00000000000000/* * $Id: afp_asp.c,v 1.29 2010-03-09 06:55:12 franklahm Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * * modified from main.c. this handles afp over asp. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifndef NO_DDP #include #include #include #include #include #include #ifdef HAVE_SYS_TIME_H #include #endif /* HAVE_SYS_TIME_H */ #ifdef HAVE_SYS_STAT_H #include #endif /* HAVE_SYS_STAT_H */ #include #include #include #include #include #include #include "switch.h" #include "auth.h" #include "fork.h" #ifdef FORCE_UIDGID #warning UIDGID #include "uid.h" #endif /* FORCE_UIDGID */ static AFPObj *child; static void afp_authprint_remove(AFPObj *); static void afp_asp_close(AFPObj *obj) { ASP asp = obj->handle; if (seteuid( obj->uid ) < 0) { LOG(log_error, logtype_afpd, "can't seteuid back %s", strerror(errno)); exit(EXITERR_SYS); } close_all_vol(); if (obj->options.authprintdir) afp_authprint_remove(obj); if (obj->logout) (*obj->logout)(); LOG(log_info, logtype_afpd, "%.2fKB read, %.2fKB written", asp->read_count / 1024.0, asp->write_count / 1024.0); asp_close( asp ); } /* removes the authprint trailing when appropriate */ static void afp_authprint_remove(AFPObj *obj) { ASP asp = obj->handle; char addr_filename[256]; char addr_filename_buff[256]; struct stat cap_st; sprintf(addr_filename, "%s/net%d.%dnode%d", obj->options.authprintdir, ntohs( asp->asp_sat.sat_addr.s_net )/256, ntohs( asp->asp_sat.sat_addr.s_net )%256, asp->asp_sat.sat_addr.s_node ); memset( addr_filename_buff, 0, 256 ); if(lstat(addr_filename, &cap_st) == 0) { if( S_ISREG(cap_st.st_mode) ) { int len; int capfd = open( addr_filename, O_RDONLY ); if ((len = read( capfd, addr_filename_buff, 256 )) > 0) { int file_pid; char *p_filepid; addr_filename_buff[len] = 0; if ( (p_filepid = strrchr(addr_filename_buff, ':')) != NULL) { *p_filepid = '\0'; p_filepid++; file_pid = atoi(p_filepid); if (file_pid == (int)getpid()) { if(unlink(addr_filename) == 0) { LOG(log_info, logtype_afpd, "removed %s", addr_filename); } else { LOG(log_info, logtype_afpd, "error removing %s: %s", addr_filename, strerror(errno)); } } else { LOG(log_info, logtype_afpd, "%s belongs to another pid %d", addr_filename, file_pid ); } } else { /* no pid info */ if (unlink(addr_filename) == 0) { LOG(log_info, logtype_afpd, "removed %s", addr_filename ); } else { LOG(log_info, logtype_afpd, "error removing %s: %s", addr_filename, strerror(errno)); } } } else { LOG(log_info, logtype_afpd, "couldn't read data from %s", addr_filename ); } if (capfd != -1) close(capfd); } else { LOG(log_info, logtype_afpd, "%s is not a regular file", addr_filename ); } } else { LOG(log_info, logtype_afpd, "error stat'ing %s: %s", addr_filename, strerror(errno)); } } /* ------------------------ * SIGTERM */ static void afp_asp_die(const int sig) { ASP asp = child->handle; asp_attention(asp, AFPATTN_SHUTDOWN); if ( asp_shutdown( asp ) < 0 ) { LOG(log_error, logtype_afpd, "afp_die: asp_shutdown: %s", strerror(errno) ); } afp_asp_close(child); if (sig == SIGTERM || sig == SIGALRM) exit( 0 ); else exit(sig); } /* ----------------------------- * SIGUSR1 */ static void afp_asp_timedown(int sig _U_) { struct sigaction sv; struct itimerval it; /* shutdown and don't reconnect. server going down in 5 minutes. */ asp_attention(child->handle, AFPATTN_SHUTDOWN | AFPATTN_NORECONNECT | AFPATTN_TIME(5)); it.it_interval.tv_sec = 0; it.it_interval.tv_usec = 0; it.it_value.tv_sec = 300; it.it_value.tv_usec = 0; if ( setitimer( ITIMER_REAL, &it, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "afp_timedown: setitimer: %s", strerror(errno) ); afp_asp_die(EXITERR_SYS); } memset(&sv, 0, sizeof(sv)); sv.sa_handler = afp_asp_die; sigemptyset( &sv.sa_mask ); sigaddset(&sv.sa_mask, SIGHUP); sigaddset(&sv.sa_mask, SIGTERM); sv.sa_flags = SA_RESTART; if ( sigaction( SIGALRM, &sv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "afp_timedown: sigaction: %s", strerror(errno) ); afp_asp_die(EXITERR_SYS); } /* ignore myself */ sv.sa_handler = SIG_IGN; sigemptyset( &sv.sa_mask ); sv.sa_flags = SA_RESTART; if ( sigaction( SIGUSR1, &sv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "afp_timedown: sigaction SIGUSR1: %s", strerror(errno) ); afp_asp_die(EXITERR_SYS); } } /* --------------------------------- * SIGHUP reload configuration file */ extern volatile int reload_request; static void afp_asp_reload(int sig _U_) { reload_request = 1; } /* ---------------------- */ #ifdef SERVERTEXT static void afp_asp_getmesg (int sig _U_) { readmessage(child); asp_attention(child->handle, AFPATTN_MESG | AFPATTN_TIME(5)); } #endif /* SERVERTEXT */ /* ---------------------- */ void afp_over_asp(AFPObj *obj) { ASP asp; struct sigaction action; int func, reply = 0; #ifdef DEBUG1 int ccnt = 0; #endif AFPobj = obj; obj->exit = afp_asp_die; obj->reply = (int (*)()) asp_cmdreply; obj->attention = (int (*)(void *, AFPUserBytes)) asp_attention; child = obj; asp = (ASP) obj->handle; /* install signal handlers * With ASP tickle handler is done in the parent process */ memset(&action, 0, sizeof(action)); /* install SIGHUP */ action.sa_handler = afp_asp_reload; sigemptyset( &action.sa_mask ); sigaddset(&action.sa_mask, SIGTERM); sigaddset(&action.sa_mask, SIGUSR1); #ifdef SERVERTEXT sigaddset(&action.sa_mask, SIGUSR2); #endif action.sa_flags = SA_RESTART; if ( sigaction( SIGHUP, &action, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "afp_over_asp: sigaction: %s", strerror(errno) ); afp_asp_die(EXITERR_SYS); } /* install SIGTERM */ action.sa_handler = afp_asp_die; sigemptyset( &action.sa_mask ); sigaddset(&action.sa_mask, SIGHUP); sigaddset(&action.sa_mask, SIGUSR1); #ifdef SERVERTEXT sigaddset(&action.sa_mask, SIGUSR2); #endif action.sa_flags = SA_RESTART; if ( sigaction( SIGTERM, &action, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "afp_over_asp: sigaction: %s", strerror(errno) ); afp_asp_die(EXITERR_SYS); } #ifdef SERVERTEXT /* Added for server message support */ action.sa_handler = afp_asp_getmesg; sigemptyset( &action.sa_mask ); sigaddset(&action.sa_mask, SIGTERM); sigaddset(&action.sa_mask, SIGUSR1); sigaddset(&action.sa_mask, SIGHUP); action.sa_flags = SA_RESTART; if ( sigaction( SIGUSR2, &action, NULL) < 0 ) { LOG(log_error, logtype_afpd, "afp_over_asp: sigaction: %s", strerror(errno) ); afp_asp_die(EXITERR_SYS); } #endif /* SERVERTEXT */ /* SIGUSR1 - set down in 5 minutes */ action.sa_handler = afp_asp_timedown; sigemptyset( &action.sa_mask ); sigaddset(&action.sa_mask, SIGHUP); sigaddset(&action.sa_mask, SIGTERM); #ifdef SERVERTEXT sigaddset(&action.sa_mask, SIGUSR2); #endif action.sa_flags = SA_RESTART; if ( sigaction( SIGUSR1, &action, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "afp_over_asp: sigaction: %s", strerror(errno) ); afp_asp_die(EXITERR_SYS); } if (dircache_init(obj->options.dircachesize) != 0) { LOG(log_error, logtype_afpd, "afp_over_asp: dircache_init error"); afp_asp_die(EXITERR_SYS); } LOG(log_info, logtype_afpd, "session from %u.%u:%u on %u.%u:%u", ntohs( asp->asp_sat.sat_addr.s_net ), asp->asp_sat.sat_addr.s_node, asp->asp_sat.sat_port, ntohs( atp_sockaddr( asp->asp_atp )->sat_addr.s_net ), atp_sockaddr( asp->asp_atp )->sat_addr.s_node, atp_sockaddr( asp->asp_atp )->sat_port ); while ((reply = asp_getrequest(asp))) { if (reload_request) { reload_request = 0; load_volumes(child); } switch (reply) { case ASPFUNC_CLOSE : afp_asp_close(obj); LOG(log_info, logtype_afpd, "done" ); #ifdef DEBUG1 if ( obj->options.flags & OPTION_DEBUG ) { printf( "done\n" ); } #endif return; break; case ASPFUNC_CMD : #ifdef AFS if ( writtenfork ) { if ( flushfork( writtenfork ) < 0 ) { LOG(log_error, logtype_afpd, "main flushfork: %s", strerror(errno)); } writtenfork = NULL; } #endif /* AFS */ func = (u_char) asp->commands[0]; #ifdef DEBUG1 if ( obj->options.flags & OPTION_DEBUG ) { printf("command: %d (%s)\n", func, AfpNum2name(func)); bprint( asp->commands, asp->cmdlen ); } #endif if ( afp_switch[ func ] != NULL ) { /* * The function called from afp_switch is expected to * read its parameters out of buf, put its * results in replybuf (updating rbuflen), and * return an error code. */ asp->datalen = ASP_DATASIZ; reply = (*afp_switch[ func ])(obj, asp->commands, asp->cmdlen, asp->data, &asp->datalen); #ifdef FORCE_UIDGID /* bring everything back to old euid, egid */ if (obj->force_uid) restore_uidgid ( &obj->uidgid ); #endif /* FORCE_UIDGID */ } else { LOG(log_error, logtype_afpd, "bad function %X", func ); asp->datalen = 0; reply = AFPERR_NOOP; } #ifdef DEBUG1 if ( obj->options.flags & OPTION_DEBUG ) { printf( "reply: %d, %d\n", reply, ccnt++ ); bprint( asp->data, asp->datalen ); } #endif if ( asp_cmdreply( asp, reply ) < 0 ) { LOG(log_error, logtype_afpd, "asp_cmdreply: %s", strerror(errno) ); afp_asp_die(EXITERR_CLNT); } break; case ASPFUNC_WRITE : func = (u_char) asp->commands[0]; #ifdef DEBUG1 if ( obj->options.flags & OPTION_DEBUG ) { printf( "(write) command: %d\n", func ); bprint( asp->commands, asp->cmdlen ); } #endif if ( afp_switch[ func ] != NULL ) { asp->datalen = ASP_DATASIZ; reply = (*afp_switch[ func ])(obj, asp->commands, asp->cmdlen, asp->data, &asp->datalen); #ifdef FORCE_UIDGID /* bring everything back to old euid, egid */ if (obj->force_uid) restore_uidgid ( &obj->uidgid ); #endif /* FORCE_UIDGID */ } else { LOG(log_error, logtype_afpd, "(write) bad function %X", func ); asp->datalen = 0; reply = AFPERR_NOOP; } #ifdef DEBUG1 if ( obj->options.flags & OPTION_DEBUG ) { printf( "(write) reply code: %d, %d\n", reply, ccnt++ ); bprint( asp->data, asp->datalen ); } #endif if ( asp_wrtreply( asp, reply ) < 0 ) { LOG(log_error, logtype_afpd, "asp_wrtreply: %s", strerror(errno) ); afp_asp_die(EXITERR_CLNT); } break; default: /* * Bad asp packet. Probably should have asp filter them, * since they are typically things like out-of-order packet. */ LOG(log_info, logtype_afpd, "main: asp_getrequest: %d", reply ); break; } #ifdef DEBUG1 if ( obj->options.flags & OPTION_DEBUG ) { #ifdef notdef pdesc( stdout ); #endif /* notdef */ of_pforkdesc( stdout ); fflush( stdout ); } #endif } } #endif netatalk-2.2.2/etc/afpd/afprun.c0000644000175200017500000001552211655731126013403 00000000000000/* Unix SMB/CIFS implementation. run a command as a specified user Copyright (C) Andrew Tridgell 1992-1998 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. modified for netatalk dgautheron@magic.fr */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #define __USE_GNU 1 #include #include #ifdef HAVE_SYS_WAIT_H #include #endif #include #include /* FIXME */ #ifdef linux #ifndef USE_SETRESUID #define USE_SETRESUID 1 #endif #else #ifndef USE_SETEUID #define USE_SETEUID 1 #endif #endif #include /**************************************************************************n Find a suitable temporary directory. The result should be copied immediately as it may be overwritten by a subsequent call. ****************************************************************************/ static const char *tmpdir(void) { char *p; if ((p = getenv("TMPDIR"))) return p; return "/tmp"; } /**************************************************************************** This is a utility function of afprun(). ****************************************************************************/ static int setup_out_fd(void) { int fd; char path[MAXPATHLEN +1]; snprintf(path, sizeof(path)-1, "%s/afp.XXXXXX", tmpdir()); /* now create the file */ fd = mkstemp(path); if (fd == -1) { LOG(log_error, logtype_afpd, "setup_out_fd: Failed to create file %s. (%s)",path, strerror(errno) ); return -1; } /* Ensure file only kept around by open fd. */ unlink(path); return fd; } /**************************************************************************** Gain root privilege before doing something. We want to end up with ruid==euid==0 ****************************************************************************/ static void gain_root_privilege(void) { seteuid(0); } /**************************************************************************** Ensure our real and effective groups are zero. we want to end up with rgid==egid==0 ****************************************************************************/ static void gain_root_group_privilege(void) { setegid(0); } /**************************************************************************** Become the specified uid and gid - permanently ! there should be no way back if possible ****************************************************************************/ static void become_user_permanently(uid_t uid, gid_t gid) { /* * First - gain root privilege. We do this to ensure * we can lose it again. */ gain_root_privilege(); gain_root_group_privilege(); #if USE_SETRESUID setresgid(gid,gid,gid); setgid(gid); setresuid(uid,uid,uid); setuid(uid); #endif #if USE_SETREUID setregid(gid,gid); setgid(gid); setreuid(uid,uid); setuid(uid); #endif #if USE_SETEUID setegid(gid); setgid(gid); setuid(uid); seteuid(uid); setuid(uid); #endif #if USE_SETUIDX setgidx(ID_REAL, gid); setgidx(ID_EFFECTIVE, gid); setgid(gid); setuidx(ID_REAL, uid); setuidx(ID_EFFECTIVE, uid); setuid(uid); #endif } /**************************************************************************** run a command being careful about uid/gid handling and putting the output in outfd (or discard it if outfd is NULL). ****************************************************************************/ int afprun(int root, char *cmd, int *outfd) { pid_t pid; uid_t uid = geteuid(); gid_t gid = getegid(); /* point our stdout at the file we want output to go into */ if (outfd && ((*outfd = setup_out_fd()) == -1)) { return -1; } LOG(log_debug, logtype_afpd, "running %s as user %d", cmd, root?0:uid); /* in this method we will exec /bin/sh with the correct arguments, after first setting stdout to point at the file */ if ((pid=fork()) < 0) { LOG(log_error, logtype_afpd, "afprun: fork failed with error %s", strerror(errno) ); if (outfd) { close(*outfd); *outfd = -1; } return errno; } if (pid) { /* * Parent. */ int status=0; pid_t wpid; /* the parent just waits for the child to exit */ while((wpid = waitpid(pid,&status,0)) < 0) { if (errno == EINTR) { errno = 0; continue; } break; } if (wpid != pid) { LOG(log_error, logtype_afpd, "waitpid(%d) : %s",(int)pid, strerror(errno) ); if (outfd) { close(*outfd); *outfd = -1; } return -1; } /* Reset the seek pointer. */ if (outfd) { lseek(*outfd, 0, SEEK_SET); } #if defined(WIFEXITED) && defined(WEXITSTATUS) if (WIFEXITED(status)) { return WEXITSTATUS(status); } #endif return status; } /* we are in the child. we exec /bin/sh to do the work for us. we don't directly exec the command we want because it may be a pipeline or anything else the config file specifies */ /* point our stdout at the file we want output to go into */ if (outfd) { close(1); if (dup2(*outfd,1) != 1) { LOG(log_error, logtype_afpd, "Failed to create stdout file descriptor"); close(*outfd); exit(80); } } if (chdir("/") < 0) { LOG(log_error, logtype_afpd, "afprun: can't change directory to \"/\" %s", strerror(errno) ); exit(83); } /* now completely lose our privileges. This is a fairly paranoid way of doing it, but it does work on all systems that I know of */ if (root) { become_user_permanently(0, 0); uid = gid = 0; } else { become_user_permanently(uid, gid); } if (getuid() != uid || geteuid() != uid || getgid() != gid || getegid() != gid) { /* we failed to lose our privileges - do not execute the command */ exit(81); /* we can't print stuff at this stage, instead use exit codes for debugging */ } /* close all other file descriptors, leaving only 0, 1 and 2. 0 and 2 point to /dev/null from the startup code */ { int fd; for (fd=3;fd<256;fd++) close(fd); } execl("/bin/sh","sh","-c",cmd,NULL); /* not reached */ exit(82); return 1; } netatalk-2.2.2/etc/afpd/switch.c0000644000175200017500000001747211655731126013417 00000000000000/* * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include /* to pick up NULL */ #include /* works around a bug */ #include #include #include #include /* grab the FP functions */ #include "auth.h" #include "desktop.h" #include "switch.h" #include "fork.h" #include "file.h" #include "directory.h" #include "filedir.h" #include "status.h" #include "misc.h" #ifdef HAVE_ACLS #include "acls.h" #endif static int afp_null(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { LOG(log_info, logtype_afpd, "afp_null handle %d", *ibuf ); *rbuflen = 0; return( AFPERR_NOOP ); } /* * Routines marked "NULL" are not AFP functions. * Routines marked "afp_null" are AFP functions * which are not yet implemented. A fine line... */ static AFPCmd preauth_switch[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 - 7 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 8 - 15 */ NULL, NULL, afp_login, afp_logincont, afp_logout, NULL, NULL, NULL, /* 16 - 23 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 24 - 31 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 32 - 39 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 40 - 47 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 48 - 55 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, afp_login_ext, /* 56 - 63 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 64 - 71 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 72 - 79 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 80 - 87 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 88 - 95 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 96 - 103 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 104 - 111 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 112 - 119 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 120 - 127 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 128 - 135 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 136 - 143 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 144 - 151 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 152 - 159 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 160 - 167 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 168 - 175 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 176 - 183 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 184 - 191 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 192 - 199 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 200 - 207 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 208 - 215 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 216 - 223 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 224 - 231 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 232 - 239 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 240 - 247 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 248 - 255 */ }; AFPCmd *afp_switch = preauth_switch; AFPCmd postauth_switch[] = { NULL, afp_bytelock, afp_closevol, afp_closedir, afp_closefork, afp_copyfile, afp_createdir, afp_createfile, /* 0 - 7 */ afp_delete, afp_enumerate, afp_flush, afp_flushfork, afp_null, afp_null, afp_getforkparams, afp_getsrvrinfo, /* 8 - 15 */ afp_getsrvrparms, afp_getvolparams, afp_login, afp_logincont, afp_logout, afp_mapid, afp_mapname, afp_moveandrename, /* 16 - 23 */ afp_openvol, afp_opendir, afp_openfork, afp_read, afp_rename, afp_setdirparams, afp_setfilparams, afp_setforkparams, /* 24 - 31 */ afp_setvolparams, afp_write, afp_getfildirparams, afp_setfildirparams, afp_changepw, afp_getuserinfo, afp_getsrvrmesg, afp_createid, /* 32 - 39 */ afp_deleteid, afp_resolveid, afp_exchangefiles, afp_catsearch, afp_null, afp_null, afp_null, afp_null, /* 40 - 47 */ afp_opendt, afp_closedt, afp_null, afp_geticon, afp_geticoninfo, afp_addappl, afp_rmvappl, afp_getappl, /* 48 - 55 */ afp_addcomment, afp_rmvcomment, afp_getcomment, NULL, NULL, NULL, NULL, NULL, /* 56 - 63 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 64 - 71 */ NULL, NULL, NULL, NULL, NULL, NULL, afp_syncdir, afp_syncfork, /* 72 - 79 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 80 - 87 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 88 - 95 */ NULL, NULL, NULL, NULL, afp_getdiracl, afp_setdiracl, afp_afschangepw, NULL, /* 96 - 103 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 104 - 111 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 112 - 119 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 120 - 127 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 128 - 135 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 136 - 143 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 144 - 151 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 152 - 159 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 160 - 167 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 168 - 175 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 176 - 183 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 184 - 191 */ afp_addicon, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 192 - 199 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 200 - 207 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 208 - 215 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 216 - 223 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 224 - 231 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 232 - 239 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 240 - 247 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 248 - 255 */ }; /* add a new function if it's specified. return the old function in * "old" if there's a pointer there. */ int uam_afpserver_action(const int id, const int which, AFPCmd new_table, AFPCmd *old) { switch (which) { case UAM_AFPSERVER_PREAUTH: if (old) *old = preauth_switch[id]; if (new_table) preauth_switch[id] = new_table; break; case UAM_AFPSERVER_POSTAUTH: if (old) *old = postauth_switch[id]; if (new_table) postauth_switch[id] = new_table; break; default: LOG(log_debug, logtype_afpd, "uam_afpserver_action: unknown switch %d[%d]", which, id); return -1; } return 0; } netatalk-2.2.2/etc/afpd/messages.c0000644000175200017500000001252511655731126013717 00000000000000/* * $Id: messages.c,v 1.23 2009-11-24 15:44:40 didg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include #include #include #include #include #include #include #include "misc.h" #define MAXMESGSIZE 199 /* this is only used by afpd children, so it's okay. */ static char servermesg[MAXPATHLEN] = ""; static char localized_message[MAXPATHLEN] = ""; void setmessage(const char *message) { strlcpy(servermesg, message, MAXMESGSIZE); } void readmessage(AFPObj *obj) { /* Read server message from file defined as SERVERTEXT */ #ifdef SERVERTEXT FILE *message; char * filename; unsigned int i; int rc; static int c; uid_t euid; u_int32_t maxmsgsize; maxmsgsize = (obj->proto == AFPPROTO_DSI)?MIN(MAX(((DSI*)obj->handle)->attn_quantum, MAXMESGSIZE),MAXPATHLEN):MAXMESGSIZE; i=0; /* Construct file name SERVERTEXT/message.[pid] */ if ( NULL == (filename=(char*) malloc(sizeof(SERVERTEXT)+15)) ) { LOG(log_error, logtype_afpd, "readmessage: malloc: %s", strerror(errno) ); return; } sprintf(filename, "%s/message.%d", SERVERTEXT, getpid()); #ifdef DEBUG LOG(log_debug9, logtype_afpd, "Reading file %s ", filename); #endif message=fopen(filename, "r"); if (message==NULL) { /* try without the process id */ sprintf(filename, "%s/message", SERVERTEXT); message=fopen(filename, "r"); } /* if either message.pid or message exists */ if (message!=NULL) { /* added while loop to get characters and put in servermesg */ while ((( c=fgetc(message)) != EOF) && (i < (maxmsgsize - 1))) { if ( c == '\n') c = ' '; servermesg[i++] = c; } servermesg[i] = 0; /* cleanup */ fclose(message); /* Save effective uid and switch to root to delete file. */ /* Delete will probably fail otherwise, but let's try anyways */ euid = geteuid(); if (seteuid(0) < 0) { LOG(log_error, logtype_afpd, "Could not switch back to root: %s", strerror(errno)); } if ((rc = unlink(filename)) != 0) LOG(log_error, logtype_afpd, "File '%s' could not be deleted", strerror(errno)); /* Drop privs again, failing this is very bad */ if (seteuid(euid) < 0) { LOG(log_error, logtype_afpd, "Could not switch back to uid %d: %s", euid, strerror(errno)); exit(EXITERR_SYS); } if (rc < 0) { LOG(log_error, logtype_afpd, "Error deleting %s: %s", filename, strerror(rc)); } #ifdef DEBUG else { LOG(log_debug9, logtype_afpd, "Deleted %s", filename); } LOG(log_debug9, logtype_afpd, "Set server message to \"%s\"", servermesg); #endif } free(filename); #endif /* SERVERTEXT */ } int afp_getsrvrmesg(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { char *message; u_int16_t type, bitmap; u_int16_t msgsize; size_t outlen = 0; size_t msglen = 0; int utf8 = 0; *rbuflen = 0; msgsize = (obj->proto == AFPPROTO_DSI)?MAX(((DSI*)obj->handle)->attn_quantum, MAXMESGSIZE):MAXMESGSIZE; memcpy(&type, ibuf + 2, sizeof(type)); memcpy(&bitmap, ibuf + 4, sizeof(bitmap)); message = servermesg; switch (ntohs(type)) { case AFPMESG_LOGIN: /* login */ /* at least TIGER loses server messages * if it receives a server msg attention before * it has asked the login msg... * Workaround: concatenate the two if any, ugly. */ if (*message && *obj->options.loginmesg) { strlcat(message, " - ", MAXMESGSIZE); } strlcat(message, obj->options.loginmesg, MAXMESGSIZE); break; case AFPMESG_SERVER: /* server */ break; default: return AFPERR_BITMAP; } /* output format: * message type: 2 bytes * bitmap: 2 bytes * message length: 1 byte ( 2 bytes for utf8) * message: up to 199 bytes (dsi attn_quantum for utf8) */ memcpy(rbuf, &type, sizeof(type)); rbuf += sizeof(type); *rbuflen += sizeof(type); memcpy(rbuf, &bitmap, sizeof(bitmap)); rbuf += sizeof(bitmap); *rbuflen += sizeof(bitmap); utf8 = ntohs(bitmap) & 2; msglen = strlen(message); if (msglen > msgsize) msglen = msgsize; if (msglen) { if ( (size_t)-1 == (outlen = convert_string(obj->options.unixcharset, utf8?CH_UTF8_MAC:obj->options.maccharset, message, msglen, localized_message, msgsize)) ) { memcpy(rbuf+((utf8)?2:1), message, msglen); /*FIXME*/ outlen = msglen; } else { memcpy(rbuf+((utf8)?2:1), localized_message, outlen); } } if ( utf8 ) { /* UTF8 message, 2 byte length */ msgsize = htons(outlen); memcpy(rbuf, &msgsize, sizeof(msgsize)); *rbuflen += sizeof(msgsize); } else { *rbuf = outlen; *rbuflen += 1; } *rbuflen += outlen; *message = 0; return AFP_OK; } netatalk-2.2.2/etc/afpd/ofork.c0000644000175200017500000003031611655731126013226 00000000000000/* * Copyright (c) 1996 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include /* works around a bug */ #include #include #include #include #include #include #include #include #include "volume.h" #include "directory.h" #include "fork.h" /* we need to have a hashed list of oforks (by dev inode) */ #define OFORK_HASHSIZE 64 static struct ofork *ofork_table[OFORK_HASHSIZE]; /* forks hashed by dev/inode */ static struct ofork **oforks = NULL; /* point to allocated table of open forks pointers */ static int nforks = 0; static u_short lastrefnum = 0; /* OR some of each character for the hash*/ static unsigned long hashfn(const struct file_key *key) { return key->inode & (OFORK_HASHSIZE - 1); } static void of_hash(struct ofork *of) { struct ofork **table; table = &ofork_table[hashfn(&of->key)]; if ((of->next = *table) != NULL) (*table)->prevp = &of->next; *table = of; of->prevp = table; } static void of_unhash(struct ofork *of) { if (of->prevp) { if (of->next) of->next->prevp = of->prevp; *(of->prevp) = of->next; } } #ifdef DEBUG1 void of_pforkdesc( FILE *f) { int ofrefnum; if (!oforks) return; for ( ofrefnum = 0; ofrefnum < nforks; ofrefnum++ ) { if ( oforks[ ofrefnum ] != NULL ) { fprintf( f, "%hu <%s>\n", ofrefnum, of_name(oforks[ ofrefnum ])); } } } #endif int of_flush(const struct vol *vol) { int refnum; if (!oforks) return 0; for ( refnum = 0; refnum < nforks; refnum++ ) { if (oforks[ refnum ] != NULL && (oforks[refnum]->of_vol == vol) && flushfork( oforks[ refnum ] ) < 0 ) { LOG(log_error, logtype_afpd, "of_flush: %s", strerror(errno) ); } } return( 0 ); } int of_rename(const struct vol *vol, struct ofork *s_of, struct dir *olddir, const char *oldpath _U_, struct dir *newdir, const char *newpath) { struct ofork *of, *next; int done = 0; if (!s_of) return AFP_OK; next = ofork_table[hashfn(&s_of->key)]; while ((of = next)) { next = next->next; /* so we can unhash and still be all right. */ if (vol == of->of_vol && olddir->d_did == of->of_did && s_of->key.dev == of->key.dev && s_of->key.inode == of->key.inode ) { if (!done) { strlcpy( of_name(of), newpath, of->of_ad->ad_m_namelen); done = 1; } if (newdir != olddir) of->of_did = newdir->d_did; } } return AFP_OK; } #define min(a,b) ((a)<(b)?(a):(b)) struct ofork * of_alloc(struct vol *vol, struct dir *dir, char *path, u_int16_t *ofrefnum, const int eid, struct adouble *ad, struct stat *st) { struct ofork *of; u_int16_t refnum, of_refnum; int i; if (!oforks) { nforks = getdtablesize() - 10; /* protect against insane ulimit -n */ nforks = min(nforks, 0xffff); oforks = (struct ofork **) calloc(nforks, sizeof(struct ofork *)); if (!oforks) return NULL; } for ( refnum = ++lastrefnum, i = 0; i < nforks; i++, refnum++ ) { /* cf AFP3.0.pdf, File fork page 40 */ if (!refnum) refnum++; if ( oforks[ refnum % nforks ] == NULL ) { break; } } /* grr, Apple and their 'uniquely identifies' the next line is a protection against of_alloc() refnum % nforks = 3 lastrefnum = 3 oforks[3] != NULL refnum = 4 oforks[4] == NULL return 4 close(oforks[4]) of_alloc() refnum % nforks = 4 ... return 4 same if lastrefnum++ rather than ++lastrefnum. */ lastrefnum = refnum; if ( i == nforks ) { LOG(log_error, logtype_afpd, "of_alloc: maximum number of forks exceeded."); return( NULL ); } of_refnum = refnum % nforks; if (( oforks[ of_refnum ] = (struct ofork *)malloc( sizeof( struct ofork ))) == NULL ) { LOG(log_error, logtype_afpd, "of_alloc: malloc: %s", strerror(errno) ); return NULL; } of = oforks[of_refnum]; /* see if we need to allocate space for the adouble struct */ if (!ad) { ad = malloc( sizeof( struct adouble ) ); if (!ad) { LOG(log_error, logtype_afpd, "of_alloc: malloc: %s", strerror(errno) ); free(of); oforks[ of_refnum ] = NULL; return NULL; } /* initialize to zero. This is important to ensure that ad_open really does reinitialize the structure. */ ad_init(ad, vol->v_adouble, vol->v_ad_options); ad->ad_m_namelen = UTF8FILELEN_EARLY +1; /* here's the deal: we allocate enough for the standard mac file length. * in the future, we'll reallocate in fairly large jumps in case * of long unicode names */ if (( ad->ad_m_name =(char *)malloc( ad->ad_m_namelen )) == NULL ) { LOG(log_error, logtype_afpd, "of_alloc: malloc: %s", strerror(errno) ); free(ad); free(of); oforks[ of_refnum ] = NULL; return NULL; } strlcpy( ad->ad_m_name, path, ad->ad_m_namelen); } else { /* Increase the refcount on this struct adouble. This is decremented again in oforc_dealloc. */ ad->ad_refcount++; } of->of_ad = ad; of->of_vol = vol; of->of_did = dir->d_did; *ofrefnum = refnum; of->of_refnum = refnum; of->key.dev = st->st_dev; of->key.inode = st->st_ino; if (eid == ADEID_DFORK) of->of_flags = AFPFORK_DATA; else of->of_flags = AFPFORK_RSRC; of_hash(of); return( of ); } struct ofork *of_find(const u_int16_t ofrefnum ) { if (!oforks || !nforks) return NULL; return( oforks[ ofrefnum % nforks ] ); } /* -------------------------- */ int of_stat(struct path *path) { int ret; path->st_errno = 0; path->st_valid = 1; if ((ret = lstat(path->u_name, &path->st)) < 0) { LOG(log_debug, logtype_afpd, "of_stat('%s/%s': %s)", cfrombstr(curdir->d_fullpath), path->u_name, strerror(errno)); path->st_errno = errno; } return ret; } #ifdef HAVE_ATFUNCS int of_fstatat(int dirfd, struct path *path) { int ret; path->st_errno = 0; path->st_valid = 1; if ((ret = fstatat(dirfd, path->u_name, &path->st, AT_SYMLINK_NOFOLLOW)) < 0) path->st_errno = errno; return ret; } #endif /* HAVE_ATFUNCS */ /* -------------------------- stat the current directory. stat(".") works even if "." is deleted thus we have to stat ../name because we want to know if it's there */ int of_statdir(struct vol *vol, struct path *path) { static char pathname[ MAXPATHLEN + 1] = "../"; int ret; size_t len; struct dir *dir; if (*path->m_name) { /* not curdir */ return of_stat (path); } path->st_errno = 0; path->st_valid = 1; /* FIXME, what about: we don't have r-x perm anymore ? */ len = blength(path->d_dir->d_u_name); if (len > (MAXPATHLEN - 3)) len = MAXPATHLEN - 3; strncpy(pathname + 3, cfrombstr(path->d_dir->d_u_name), len + 1); LOG(log_debug, logtype_afpd, "of_statdir: stating: '%s'", pathname); if (!(ret = lstat(pathname, &path->st))) return 0; path->st_errno = errno; /* hmm, can't stat curdir anymore */ if (errno == EACCES && (dir = dirlookup(vol, curdir->d_pdid))) { if (movecwd(vol, dir)) return -1; path->st_errno = 0; if ((ret = lstat(cfrombstr(path->d_dir->d_u_name), &path->st)) < 0) path->st_errno = errno; } return ret; } /* -------------------------- */ struct ofork *of_findname(struct path *path) { struct ofork *of; struct file_key key; if (!path->st_valid) { of_stat(path); } if (path->st_errno) return NULL; key.dev = path->st.st_dev; key.inode = path->st.st_ino; for (of = ofork_table[hashfn(&key)]; of; of = of->next) { if (key.dev == of->key.dev && key.inode == of->key.inode ) { return of; } } return NULL; } /*! * @brief Search for open fork by dirfd/name * * Function call of_fstatat with dirfd and path and uses dev and ino * to search the open fork table. * * @param dirfd (r) directory fd * @param path (rw) pointer to struct path */ #ifdef HAVE_ATFUNCS struct ofork *of_findnameat(int dirfd, struct path *path) { struct ofork *of; struct file_key key; if ( ! path->st_valid) { of_fstatat(dirfd, path); } if (path->st_errno) return NULL; key.dev = path->st.st_dev; key.inode = path->st.st_ino; for (of = ofork_table[hashfn(&key)]; of; of = of->next) { if (key.dev == of->key.dev && key.inode == of->key.inode ) { return of; } } return NULL; } #endif void of_dealloc( struct ofork *of) { if (!oforks) return; of_unhash(of); oforks[ of->of_refnum % nforks ] = NULL; /* decrease refcount */ of->of_ad->ad_refcount--; if ( of->of_ad->ad_refcount <= 0) { free( of->of_ad->ad_m_name ); free( of->of_ad); } else {/* someone's still using it. just free this user's locks */ ad_unlock(of->of_ad, of->of_refnum); } free( of ); } /* --------------------------- */ int of_closefork(struct ofork *ofork) { struct timeval tv; int adflags, doflush = 0; int ret; adflags = 0; if ((ofork->of_flags & AFPFORK_DATA) && (ad_data_fileno( ofork->of_ad ) != -1)) { adflags |= ADFLAGS_DF; } if ( (ofork->of_flags & AFPFORK_OPEN) && ad_reso_fileno( ofork->of_ad ) != -1 ) { adflags |= ADFLAGS_HF; /* * Only set the rfork's length if we're closing the rfork. */ if ((ofork->of_flags & AFPFORK_RSRC)) { ad_refresh( ofork->of_ad ); if ((ofork->of_flags & AFPFORK_DIRTY) && !gettimeofday(&tv, NULL)) { ad_setdate(ofork->of_ad, AD_DATE_MODIFY | AD_DATE_UNIX,tv.tv_sec); doflush++; } if ( doflush ) { ad_flush( ofork->of_ad ); } } } /* Somone has used write_fork, we assume file was changed, register it to file change event api */ if (ofork->of_flags & AFPFORK_MODIFIED) { fce_register_file_modification(ofork); } ret = 0; if ( ad_close( ofork->of_ad, adflags ) < 0 ) { ret = -1; } of_dealloc( ofork ); return ret; } /* ---------------------- */ struct adouble *of_ad(const struct vol *vol, struct path *path, struct adouble *ad) { struct ofork *of; struct adouble *adp; if ((of = of_findname(path))) { adp = of->of_ad; } else { ad_init(ad, vol->v_adouble, vol->v_ad_options); adp = ad; } return adp; } /* ---------------------- close all forks for a volume */ void of_closevol(const struct vol *vol) { int refnum; if (!oforks) return; for ( refnum = 0; refnum < nforks; refnum++ ) { if (oforks[ refnum ] != NULL && oforks[refnum]->of_vol == vol) { if (of_closefork( oforks[ refnum ]) < 0 ) { LOG(log_error, logtype_afpd, "of_closevol: %s", strerror(errno) ); } } } return; } /* ---------------------- close all forks for a volume */ void of_close_all_forks(void) { int refnum; if (!oforks) return; for ( refnum = 0; refnum < nforks; refnum++ ) { if (oforks[ refnum ] != NULL) { if (of_closefork( oforks[ refnum ]) < 0 ) { LOG(log_error, logtype_afpd, "of_close_all_forks: %s", strerror(errno) ); } } } return; } netatalk-2.2.2/etc/afpd/desktop.c0000644000175200017500000006124011655731126013557 00000000000000/* * $Id: desktop.c,v 1.50.2.1 2010-02-01 10:56:08 franklahm Exp $ * * See COPYRIGHT. * * bug: * afp_XXXcomment are (the only) functions able to open * a ressource fork when there's no data fork, eg after * it was removed with samba. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "volume.h" #include "directory.h" #include "fork.h" #include "desktop.h" #include "mangle.h" int afp_opendt(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct vol *vol; u_int16_t vid; ibuf += 2; memcpy( &vid, ibuf, sizeof(vid)); if (NULL == ( vol = getvolbyvid( vid )) ) { *rbuflen = 0; return( AFPERR_PARAM ); } memcpy( rbuf, &vid, sizeof(vid)); *rbuflen = sizeof(vid); return( AFP_OK ); } int afp_closedt(AFPObj *obj _U_, char *ibuf _U_, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { *rbuflen = 0; return( AFP_OK ); } static struct savedt si = { { 0, 0, 0, 0 }, -1, 0, 0 }; static char *icon_dtfile(struct vol *vol, u_char creator[ 4 ]) { return dtfile( vol, creator, ".icon" ); } static int iconopen(struct vol *vol, u_char creator[ 4 ], int flags, int mode) { char *dtf, *adt, *adts; if ( si.sdt_fd != -1 ) { if ( memcmp( si.sdt_creator, creator, sizeof( CreatorType )) == 0 && si.sdt_vid == vol->v_vid ) { return 0; } close( si.sdt_fd ); si.sdt_fd = -1; } dtf = icon_dtfile( vol, creator); if (( si.sdt_fd = open( dtf, flags, ad_mode( dtf, mode ))) < 0 ) { if ( errno == ENOENT && ( flags & O_CREAT )) { if (( adts = strrchr( dtf, '/' )) == NULL ) { return -1; } *adts = '\0'; if (( adt = strrchr( dtf, '/' )) == NULL ) { return -1; } *adt = '\0'; (void) ad_mkdir( dtf, DIRBITS | 0777 ); *adt = '/'; (void) ad_mkdir( dtf, DIRBITS | 0777 ); *adts = '/'; if (( si.sdt_fd = open( dtf, flags, ad_mode( dtf, mode ))) < 0 ) { LOG(log_error, logtype_afpd, "iconopen(%s): open: %s", dtf, strerror(errno) ); return -1; } } else { return -1; } } memcpy( si.sdt_creator, creator, sizeof( CreatorType )); si.sdt_vid = vol->v_vid; si.sdt_index = 1; return 0; } int afp_addicon(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct vol *vol; #ifndef NO_DDP struct iovec iov[ 2 ]; #endif u_char fcreator[ 4 ], imh[ 12 ], irh[ 12 ], *p; int itype, cc = AFP_OK, iovcnt = 0; size_t buflen; u_int32_t ftype, itag; u_int16_t bsize, rsize, vid; buflen = *rbuflen; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { cc = AFPERR_PARAM; goto addicon_err; } memcpy( fcreator, ibuf, sizeof( fcreator )); ibuf += sizeof( fcreator ); memcpy( &ftype, ibuf, sizeof( ftype )); ibuf += sizeof( ftype ); itype = (unsigned char) *ibuf; ibuf += 2; memcpy( &itag, ibuf, sizeof( itag )); ibuf += sizeof( itag ); memcpy( &bsize, ibuf, sizeof( bsize )); bsize = ntohs( bsize ); if ( si.sdt_fd != -1 ) { (void)close( si.sdt_fd ); si.sdt_fd = -1; } if (iconopen( vol, fcreator, O_RDWR|O_CREAT, 0666 ) < 0) { cc = AFPERR_NOITEM; goto addicon_err; } if (lseek( si.sdt_fd, (off_t) 0L, SEEK_SET ) < 0) { close(si.sdt_fd); si.sdt_fd = -1; LOG(log_error, logtype_afpd, "afp_addicon(%s): lseek: %s", icon_dtfile(vol, fcreator), strerror(errno) ); cc = AFPERR_PARAM; goto addicon_err; } /* * Read icon elements until we find a match to replace, or * we get to the end to insert. */ p = imh; memcpy( p, &itag, sizeof( itag )); p += sizeof( itag ); memcpy( p, &ftype, sizeof( ftype )); p += sizeof( ftype ); *p++ = itype; *p++ = 0; bsize = htons( bsize ); memcpy( p, &bsize, sizeof( bsize )); bsize = ntohs( bsize ); while (( cc = read( si.sdt_fd, irh, sizeof( irh ))) > 0 ) { memcpy( &rsize, irh + 10, sizeof( rsize )); rsize = ntohs( rsize ); /* * Is this our set of headers? */ if ( memcmp( irh, imh, sizeof( irh ) - sizeof( u_short )) == 0 ) { /* * Is the size correct? */ if ( bsize != rsize ) cc = AFPERR_ITYPE; break; } if ( lseek( si.sdt_fd, (off_t) rsize, SEEK_CUR ) < 0 ) { LOG(log_error, logtype_afpd, "afp_addicon(%s): lseek: %s", icon_dtfile(vol, fcreator),strerror(errno) ); cc = AFPERR_PARAM; } } /* * Some error occurred, return. */ addicon_err: if ( cc < 0 ) { if (obj->proto == AFPPROTO_DSI) { dsi_writeinit(obj->handle, rbuf, buflen); dsi_writeflush(obj->handle); } return cc; } switch (obj->proto) { #ifndef NO_DDP case AFPPROTO_ASP: buflen = bsize; if ((asp_wrtcont(obj->handle, rbuf, &buflen) < 0) || buflen != bsize) return( AFPERR_PARAM ); #ifdef DEBUG1 if (obj->options.flags & OPTION_DEBUG) { printf("(write) len: %d\n", buflen); bprint(rbuf, buflen); } #endif /* * We're at the end of the file, add the headers, etc. */ if ( cc == 0 ) { iov[ 0 ].iov_base = (caddr_t)imh; iov[ 0 ].iov_len = sizeof( imh ); iov[ 1 ].iov_base = rbuf; iov[ 1 ].iov_len = bsize; iovcnt = 2; } /* * We found an icon to replace. */ if ( cc > 0 ) { iov[ 0 ].iov_base = rbuf; iov[ 0 ].iov_len = bsize; iovcnt = 1; } if ( writev( si.sdt_fd, iov, iovcnt ) < 0 ) { LOG(log_error, logtype_afpd, "afp_addicon(%s): writev: %s", icon_dtfile(vol, fcreator), strerror(errno) ); return( AFPERR_PARAM ); } break; #endif /* no afp/asp */ case AFPPROTO_DSI: { DSI *dsi = obj->handle; iovcnt = dsi_writeinit(dsi, rbuf, buflen); /* add headers at end of file */ if ((cc == 0) && (write(si.sdt_fd, imh, sizeof(imh)) < 0)) { LOG(log_error, logtype_afpd, "afp_addicon(%s): write: %s", icon_dtfile(vol, fcreator), strerror(errno)); dsi_writeflush(dsi); return AFPERR_PARAM; } if ((cc = write(si.sdt_fd, rbuf, iovcnt)) < 0) { LOG(log_error, logtype_afpd, "afp_addicon(%s): write: %s", icon_dtfile(vol, fcreator), strerror(errno)); dsi_writeflush(dsi); return AFPERR_PARAM; } while ((iovcnt = dsi_write(dsi, rbuf, buflen))) { if ((cc = write(si.sdt_fd, rbuf, iovcnt)) < 0) { LOG(log_error, logtype_afpd, "afp_addicon(%s): write: %s", icon_dtfile(vol, fcreator), strerror(errno)); dsi_writeflush(dsi); return AFPERR_PARAM; } } } break; } close( si.sdt_fd ); si.sdt_fd = -1; return( AFP_OK ); } static const u_char utag[] = { 0, 0, 0, 0 }; static const u_char ucreator[] = { 0, 0, 0, 0 };/* { 'U', 'N', 'I', 'X' };*/ static const u_char utype[] = { 0, 0, 0, 0 };/* { 'T', 'E', 'X', 'T' };*/ static const short usize = 256; #if 0 static const u_char uicon[] = { 0x1F, 0xFF, 0xFC, 0x00, 0x10, 0x00, 0x06, 0x00, 0x10, 0x00, 0x05, 0x00, 0x10, 0x00, 0x04, 0x80, 0x10, 0x00, 0x04, 0x40, 0x10, 0x00, 0x04, 0x20, 0x10, 0x00, 0x07, 0xF0, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x80, 0x02, 0x10, 0x11, 0x80, 0x03, 0x10, 0x12, 0x80, 0x02, 0x90, 0x12, 0x80, 0x02, 0x90, 0x14, 0x80, 0x02, 0x50, 0x14, 0x87, 0xC2, 0x50, 0x14, 0x58, 0x34, 0x50, 0x14, 0x20, 0x08, 0x50, 0x12, 0x16, 0xD0, 0x90, 0x11, 0x01, 0x01, 0x10, 0x12, 0x80, 0x02, 0x90, 0x12, 0x9C, 0x72, 0x90, 0x14, 0x22, 0x88, 0x50, 0x14, 0x41, 0x04, 0x50, 0x14, 0x49, 0x24, 0x50, 0x14, 0x55, 0x54, 0x50, 0x14, 0x5D, 0x74, 0x50, 0x14, 0x5D, 0x74, 0x50, 0x12, 0x49, 0x24, 0x90, 0x12, 0x22, 0x88, 0x90, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFC, 0x00, 0x1F, 0xFF, 0xFE, 0x00, 0x1F, 0xFF, 0xFF, 0x00, 0x1F, 0xFF, 0xFF, 0x80, 0x1F, 0xFF, 0xFF, 0xC0, 0x1F, 0xFF, 0xFF, 0xE0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, }; #endif int afp_geticoninfo(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct vol *vol; u_char fcreator[ 4 ], ih[ 12 ]; u_int16_t vid, iindex, bsize; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } memcpy( fcreator, ibuf, sizeof( fcreator )); ibuf += sizeof( fcreator ); memcpy( &iindex, ibuf, sizeof( iindex )); iindex = ntohs( iindex ); if ( memcmp( fcreator, ucreator, sizeof( ucreator )) == 0 ) { if ( iindex > 1 ) { return( AFPERR_NOITEM ); } memcpy( ih, utag, sizeof( utag )); memcpy( ih + sizeof( utag ), utype, sizeof( utype )); *( ih + sizeof( utag ) + sizeof( utype )) = 1; *( ih + sizeof( utag ) + sizeof( utype ) + 1 ) = 0; memcpy( ih + sizeof( utag ) + sizeof( utype ) + 2, &usize, sizeof( usize )); memcpy( rbuf, ih, sizeof( ih )); *rbuflen = sizeof( ih ); return( AFP_OK ); } if ( iconopen( vol, fcreator, O_RDONLY, 0 ) < 0) { return( AFPERR_NOITEM ); } if ( iindex < si.sdt_index ) { if ( lseek( si.sdt_fd, (off_t) 0L, SEEK_SET ) < 0 ) { return( AFPERR_PARAM ); } si.sdt_index = 1; } /* * Position to the correct spot. */ for (;;) { if ( read( si.sdt_fd, ih, sizeof( ih )) != sizeof( ih )) { close( si.sdt_fd ); si.sdt_fd = -1; return( AFPERR_NOITEM ); } memcpy( &bsize, ih + 10, sizeof( bsize )); bsize = ntohs(bsize); if ( lseek( si.sdt_fd, (off_t) bsize, SEEK_CUR ) < 0 ) { LOG(log_error, logtype_afpd, "afp_iconinfo(%s): lseek: %s", icon_dtfile(vol, fcreator), strerror(errno) ); return( AFPERR_PARAM ); } if ( si.sdt_index == iindex ) { memcpy( rbuf, ih, sizeof( ih )); *rbuflen = sizeof( ih ); return( AFP_OK ); } si.sdt_index++; } } int afp_geticon(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct vol *vol; off_t offset; ssize_t rc, buflen; u_char fcreator[ 4 ], ftype[ 4 ], itype, ih[ 12 ]; u_int16_t vid, bsize, rsize; buflen = *rbuflen; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } memcpy( fcreator, ibuf, sizeof( fcreator )); ibuf += sizeof( fcreator ); memcpy( ftype, ibuf, sizeof( ftype )); ibuf += sizeof( ftype ); itype = (unsigned char) *ibuf++; ibuf++; memcpy( &bsize, ibuf, sizeof( bsize )); bsize = ntohs( bsize ); #if 0 if ( memcmp( fcreator, ucreator, sizeof( ucreator )) == 0 && memcmp( ftype, utype, sizeof( utype )) == 0 && itype == 1 && bsize <= usize ) { memcpy( rbuf, uicon, bsize); *rbuflen = bsize; return( AFP_OK ); } #endif if ( iconopen( vol, fcreator, O_RDONLY, 0 ) < 0) { return( AFPERR_NOITEM ); } if ( lseek( si.sdt_fd, (off_t) 0L, SEEK_SET ) < 0 ) { close(si.sdt_fd); si.sdt_fd = -1; LOG(log_error, logtype_afpd, "afp_geticon(%s): lseek: %s", icon_dtfile(vol, fcreator), strerror(errno)); return( AFPERR_PARAM ); } si.sdt_index = 1; offset = 0; while (( rc = read( si.sdt_fd, ih, sizeof( ih ))) > 0 ) { si.sdt_index++; offset += sizeof(ih); if ( memcmp( ih + sizeof( int ), ftype, sizeof( ftype )) == 0 && *(ih + sizeof( int ) + sizeof( ftype )) == itype ) { break; } memcpy( &rsize, ih + 10, sizeof( rsize )); rsize = ntohs( rsize ); if ( lseek( si.sdt_fd, (off_t) rsize, SEEK_CUR ) < 0 ) { LOG(log_error, logtype_afpd, "afp_geticon(%s): lseek: %s", icon_dtfile(vol, fcreator), strerror(errno) ); return( AFPERR_PARAM ); } offset += rsize; } if ( rc < 0 ) { LOG(log_error, logtype_afpd, "afp_geticon(%s): read: %s", icon_dtfile(vol, fcreator), strerror(errno)); return( AFPERR_PARAM ); } if ( rc == 0 ) { return( AFPERR_NOITEM ); } memcpy( &rsize, ih + 10, sizeof( rsize )); rsize = ntohs( rsize ); #define min(a,b) ((a)<(b)?(a):(b)) rc = min( bsize, rsize ); if ((obj->proto == AFPPROTO_DSI) && (buflen < rc)) { DSI *dsi = obj->handle; struct stat st; off_t size; size = (fstat(si.sdt_fd, &st) < 0) ? 0 : st.st_size; if (size < rc + offset) { return AFPERR_PARAM; } if ((buflen = dsi_readinit(dsi, rbuf, buflen, rc, AFP_OK)) < 0) goto geticon_exit; *rbuflen = buflen; /* do to the streaming nature, we have to exit if we encounter * a problem. much confusion results otherwise. */ while (*rbuflen > 0) { #ifdef WITH_SENDFILE if (!obj->options.flags & OPTION_DEBUG) { if (dsi_stream_read_file(dsi, si.sdt_fd, offset, dsi->datasize) < 0) { switch (errno) { case ENOSYS: case EINVAL: /* there's no guarantee that all fs support sendfile */ break; default: goto geticon_exit; } } else { dsi_readdone(dsi); return AFP_OK; } } #endif buflen = read(si.sdt_fd, rbuf, *rbuflen); if (buflen < 0) goto geticon_exit; /* dsi_read() also returns buffer size of next allocation */ buflen = dsi_read(dsi, rbuf, buflen); /* send it off */ if (buflen < 0) goto geticon_exit; *rbuflen = buflen; } dsi_readdone(dsi); return AFP_OK; geticon_exit: LOG(log_error, logtype_afpd, "afp_geticon(%s): %s", icon_dtfile(vol, fcreator), strerror(errno)); dsi_readdone(dsi); obj->exit(EXITERR_SYS); return AFP_OK; } else { if ( read( si.sdt_fd, rbuf, rc ) < rc ) { return( AFPERR_PARAM ); } *rbuflen = rc; } return AFP_OK; } /* ---------------------- */ static const char hexdig[] = "0123456789abcdef"; char *dtfile(const struct vol *vol, u_char creator[], char *ext ) { static char path[ MAXPATHLEN + 1]; char *p; unsigned int i; strcpy( path, vol->v_path ); strcat( path, "/.AppleDesktop/" ); for ( p = path; *p != '\0'; p++ ) ; if ( !isprint( creator[ 0 ] ) || creator[ 0 ] == '/' ) { *p++ = hexdig[ ( creator[ 0 ] & 0xf0 ) >> 4 ]; *p++ = hexdig[ creator[ 0 ] & 0x0f ]; } else { *p++ = creator[ 0 ]; } *p++ = '/'; for ( i = 0; i < sizeof( CreatorType ); i++ ) { if ( !isprint( creator[ i ] ) || creator[ i ] == '/' ) { *p++ = hexdig[ ( creator[ i ] & 0xf0 ) >> 4 ]; *p++ = hexdig[ creator[ i ] & 0x0f ]; } else { *p++ = creator[ i ]; } } *p = '\0'; strcat( path, ext ); return( path ); } /* --------------------------- * mpath is only a filename * did filename parent directory ID. */ char *mtoupath(const struct vol *vol, char *mpath, cnid_t did, int utf8) { static char upath[ MAXPATHLEN + 2]; /* for convert_charset dest_len parameter +2 */ char *m, *u; size_t inplen; size_t outlen; u_int16_t flags; if ( *mpath == '\0' ) { strcpy(upath, "."); return upath; } /* set conversion flags */ flags = vol->v_mtou_flags; m = demangle(vol, mpath, did); if (m != mpath) { return m; } m = mpath; u = upath; inplen = strlen(m); outlen = MAXPATHLEN; if ((size_t)-1 == (outlen = convert_charset ( (utf8)?CH_UTF8_MAC:vol->v_maccharset, vol->v_volcharset, vol->v_maccharset, m, inplen, u, outlen, &flags)) ) { LOG(log_error, logtype_afpd, "conversion from %s to %s for %s failed.", (utf8)?"UTF8-MAC":vol->v_maccodepage, vol->v_volcodepage, mpath); return NULL; } #ifdef DEBUG LOG(log_debug9, logtype_afpd, "mtoupath: '%s':'%s'", mpath, upath); #endif /* DEBUG */ return( upath ); } /* --------------- * id filename ID */ char *utompath(const struct vol *vol, char *upath, cnid_t id, int utf8) { static char mpath[ MAXPATHLEN + 2]; /* for convert_charset dest_len parameter +2 */ char *m, *u; u_int16_t flags; size_t outlen; m = mpath; outlen = strlen(upath); flags = vol->v_utom_flags; u = upath; /* convert charsets */ if ((size_t)-1 == ( outlen = convert_charset ( vol->v_volcharset, (utf8)?CH_UTF8_MAC:vol->v_maccharset, vol->v_maccharset, u, outlen, mpath, MAXPATHLEN, &flags)) ) { LOG(log_error, logtype_afpd, "Conversion from %s to %s for %s (%u) failed.", vol->v_volcodepage, vol->v_maccodepage, u, ntohl(id)); goto utompath_error; } flags = !!(flags & CONV_REQMANGLE); if (utf8) flags |= 2; m = mangle(vol, mpath, outlen, upath, id, flags); #ifdef DEBUG LOG(log_debug9, logtype_afpd, "utompath: '%s':'%s':'%2.2X'", upath, m, ntohl(id)); #endif /* DEBUG */ return(m); utompath_error: u = "???"; m = mangle(vol, u, strlen(u), upath, id, (utf8)?3:1); return(m); } /* ------------------------- */ static int ad_addcomment(struct vol *vol, struct path *path, char *ibuf) { struct ofork *of; char *name, *upath; int isadir; int clen; struct adouble ad, *adp; clen = (u_char)*ibuf++; clen = min( clen, 199 ); upath = path->u_name; if (check_access(upath, OPENACC_WR ) < 0) { return AFPERR_ACCESS; } isadir = path_isadir(path); if (isadir || !(of = of_findname(path))) { ad_init(&ad, vol->v_adouble, vol->v_ad_options); adp = &ad; } else adp = of->of_ad; if (ad_open_metadata( upath , ( (isadir) ? ADFLAGS_DIR : 0), O_CREAT, adp) < 0 ) { return( AFPERR_ACCESS ); } if (ad_getentryoff(adp, ADEID_COMMENT)) { if ( (ad_get_MD_flags( adp ) & O_CREAT) ) { if ( *path->m_name == '\0' ) { name = (char *)curdir->d_m_name->data; } else { name = path->m_name; } ad_setname(adp, name); } ad_setentrylen( adp, ADEID_COMMENT, clen ); memcpy( ad_entry( adp, ADEID_COMMENT ), ibuf, clen ); ad_flush( adp ); } ad_close_metadata( adp); return( AFP_OK ); } /* ----------------------------- */ int afp_addcomment(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *vol; struct dir *dir; struct path *path; u_int32_t did; u_int16_t vid; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; } if (NULL == ( path = cname( vol, dir, &ibuf )) ) { return get_afp_errno(AFPERR_NOOBJ); } if ((u_long)ibuf & 1 ) { ibuf++; } return ad_addcomment(vol, path, ibuf); } /* -------------------- */ static int ad_getcomment(struct vol *vol, struct path *path, char *rbuf, size_t *rbuflen) { struct adouble ad, *adp; struct ofork *of; char *upath; int isadir; int clen; upath = path->u_name; isadir = path_isadir(path); if (isadir || !(of = of_findname(path))) { ad_init(&ad, vol->v_adouble, vol->v_ad_options); adp = &ad; } else adp = of->of_ad; if ( ad_metadata( upath, ((isadir) ? ADFLAGS_DIR : 0), adp) < 0 ) { return( AFPERR_NOITEM ); } if (!ad_getentryoff(adp, ADEID_COMMENT)) { ad_close_metadata( adp ); return AFPERR_NOITEM; } /* * Make sure the AD file is not bogus. */ if ( ad_getentrylen( adp, ADEID_COMMENT ) <= 0 || ad_getentrylen( adp, ADEID_COMMENT ) > 199 ) { ad_close_metadata( adp ); return( AFPERR_NOITEM ); } clen = min( ad_getentrylen( adp, ADEID_COMMENT ), 128 ); /* OSX only use 128, greater kill Adobe CS2 */ *rbuf++ = clen; memcpy( rbuf, ad_entry( adp, ADEID_COMMENT ), clen); *rbuflen = clen + 1; ad_close_metadata( adp); return( AFP_OK ); } /* -------------------- */ int afp_getcomment(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct vol *vol; struct dir *dir; struct path *s_path; u_int32_t did; u_int16_t vid; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; } if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) { return get_afp_errno(AFPERR_NOOBJ); } return ad_getcomment(vol, s_path, rbuf, rbuflen); } /* ----------------------- */ static int ad_rmvcomment(struct vol *vol, struct path *path) { struct adouble ad, *adp; struct ofork *of; int isadir; char *upath; upath = path->u_name; if (check_access(upath, OPENACC_WR ) < 0) { return AFPERR_ACCESS; } isadir = path_isadir(path); if (isadir || !(of = of_findname(path))) { ad_init(&ad, vol->v_adouble, vol->v_ad_options); adp = &ad; } else adp = of->of_ad; if ( ad_open_metadata( upath, (isadir) ? ADFLAGS_DIR : 0, 0, adp) < 0 ) { switch ( errno ) { case ENOENT : return( AFPERR_NOITEM ); case EACCES : return( AFPERR_ACCESS ); default : return( AFPERR_PARAM ); } } if (ad_getentryoff(adp, ADEID_COMMENT)) { ad_setentrylen( adp, ADEID_COMMENT, 0 ); ad_flush( adp ); } ad_close_metadata( adp); return( AFP_OK ); } /* ----------------------- */ int afp_rmvcomment(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *vol; struct dir *dir; struct path *s_path; u_int32_t did; u_int16_t vid; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; } if (NULL == ( s_path = cname( vol, dir, &ibuf ))) { return get_afp_errno(AFPERR_NOOBJ); } return ad_rmvcomment(vol, s_path); } netatalk-2.2.2/etc/afpd/hash.c0000644000175200017500000007654111655731126013043 00000000000000/* * Hash Table Data Type * Copyright (C) 1997 Kaz Kylheku * * Free Software License: * * All rights are reserved by the author, with the following exceptions: * Permission is granted to freely reproduce and distribute this software, * possibly in exchange for a fee, provided that this copyright notice appears * intact. Permission is also granted to adapt this software to produce * derivative works, as long as the modified versions carry this copyright * notice and additional notices stating that the work has been modified. * This source code may be translated into executable form and incorporated * into proprietary software; there is no requirement for such software to * contain a copyright notice related to this source. * * $Id: hash.c,v 1.4 2009-11-19 10:37:43 franklahm Exp $ * $Name: $ */ #define NDEBUG #include #include #include #include #define HASH_IMPLEMENTATION #include "hash.h" #ifdef KAZLIB_RCSID static const char rcsid[] = "$Id: hash.c,v 1.4 2009-11-19 10:37:43 franklahm Exp $"; #endif #define INIT_BITS 6 #define INIT_SIZE (1UL << (INIT_BITS)) /* must be power of two */ #define INIT_MASK ((INIT_SIZE) - 1) #define next hash_next #define key hash_key #define data hash_data #define hkey hash_hkey #define table hash_table #define nchains hash_nchains #define nodecount hash_nodecount #define maxcount hash_maxcount #define highmark hash_highmark #define lowmark hash_lowmark #define compare hash_compare #define function hash_function #define allocnode hash_allocnode #define freenode hash_freenode #define context hash_context #define mask hash_mask #define dynamic hash_dynamic #define table hash_table #define chain hash_chain static hnode_t *hnode_alloc(void *context); static void hnode_free(hnode_t *node, void *context); static hash_val_t hash_fun_default(const void *key); static hash_val_t hash_fun2(const void *key); static int hash_comp_default(const void *key1, const void *key2); int hash_val_t_bit; /* * Compute the number of bits in the hash_val_t type. We know that hash_val_t * is an unsigned integral type. Thus the highest value it can hold is a * Mersenne number (power of two, less one). We initialize a hash_val_t * object with this value and then shift bits out one by one while counting. * Notes: * 1. HASH_VAL_T_MAX is a Mersenne number---one that is one less than a power * of two. This means that its binary representation consists of all one * bits, and hence ``val'' is initialized to all one bits. * 2. While bits remain in val, we increment the bit count and shift it to the * right, replacing the topmost bit by zero. */ static void compute_bits(void) { hash_val_t val = HASH_VAL_T_MAX; /* 1 */ int bits = 0; while (val) { /* 2 */ bits++; val >>= 1; } hash_val_t_bit = bits; } /* * Verify whether the given argument is a power of two. */ static int is_power_of_two(hash_val_t arg) { if (arg == 0) return 0; while ((arg & 1) == 0) arg >>= 1; return (arg == 1); } /* * Compute a shift amount from a given table size */ static hash_val_t compute_mask(hashcount_t size) { assert (is_power_of_two(size)); assert (size >= 2); return size - 1; } /* * Initialize the table of pointers to null. */ static void clear_table(hash_t *hash) { hash_val_t i; for (i = 0; i < hash->nchains; i++) hash->table[i] = NULL; } /* * Double the size of a dynamic table. This works as follows. Each chain splits * into two adjacent chains. The shift amount increases by one, exposing an * additional bit of each hashed key. For each node in the original chain, the * value of this newly exposed bit will decide which of the two new chains will * receive the node: if the bit is 1, the chain with the higher index will have * the node, otherwise the lower chain will receive the node. In this manner, * the hash table will continue to function exactly as before without having to * rehash any of the keys. * Notes: * 1. Overflow check. * 2. The new number of chains is twice the old number of chains. * 3. The new mask is one bit wider than the previous, revealing a * new bit in all hashed keys. * 4. Allocate a new table of chain pointers that is twice as large as the * previous one. * 5. If the reallocation was successful, we perform the rest of the growth * algorithm, otherwise we do nothing. * 6. The exposed_bit variable holds a mask with which each hashed key can be * AND-ed to test the value of its newly exposed bit. * 7. Now loop over each chain in the table and sort its nodes into two * chains based on the value of each node's newly exposed hash bit. * 8. The low chain replaces the current chain. The high chain goes * into the corresponding sister chain in the upper half of the table. * 9. We have finished dealing with the chains and nodes. We now update * the various bookeeping fields of the hash structure. */ static void grow_table(hash_t *hash) { hnode_t **newtable; assert (2 * hash->nchains > hash->nchains); /* 1 */ newtable = realloc(hash->table, sizeof *newtable * hash->nchains * 2); /* 4 */ if (newtable) { /* 5 */ hash_val_t mask = (hash->mask << 1) | 1; /* 3 */ hash_val_t exposed_bit = mask ^ hash->mask; /* 6 */ hash_val_t chain; assert (mask != hash->mask); for (chain = 0; chain < hash->nchains; chain++) { /* 7 */ hnode_t *low_chain = NULL, *high_chain = NULL, *hptr, *next; for (hptr = newtable[chain]; hptr != NULL; hptr = next) { next = hptr->next; if (hptr->hkey & exposed_bit) { hptr->next = high_chain; high_chain = hptr; } else { hptr->next = low_chain; low_chain = hptr; } } newtable[chain] = low_chain; /* 8 */ newtable[chain + hash->nchains] = high_chain; } hash->table = newtable; /* 9 */ hash->mask = mask; hash->nchains *= 2; hash->lowmark *= 2; hash->highmark *= 2; } assert (hash_verify(hash)); } /* * Cut a table size in half. This is done by folding together adjacent chains * and populating the lower half of the table with these chains. The chains are * simply spliced together. Once this is done, the whole table is reallocated * to a smaller object. * Notes: * 1. It is illegal to have a hash table with one slot. This would mean that * hash->shift is equal to hash_val_t_bit, an illegal shift value. * Also, other things could go wrong, such as hash->lowmark becoming zero. * 2. Looping over each pair of sister chains, the low_chain is set to * point to the head node of the chain in the lower half of the table, * and high_chain points to the head node of the sister in the upper half. * 3. The intent here is to compute a pointer to the last node of the * lower chain into the low_tail variable. If this chain is empty, * low_tail ends up with a null value. * 4. If the lower chain is not empty, we simply tack the upper chain onto it. * If the upper chain is a null pointer, nothing happens. * 5. Otherwise if the lower chain is empty but the upper one is not, * If the low chain is empty, but the high chain is not, then the * high chain is simply transferred to the lower half of the table. * 6. Otherwise if both chains are empty, there is nothing to do. * 7. All the chain pointers are in the lower half of the table now, so * we reallocate it to a smaller object. This, of course, invalidates * all pointer-to-pointers which reference into the table from the * first node of each chain. * 8. Though it's unlikely, the reallocation may fail. In this case we * pretend that the table _was_ reallocated to a smaller object. * 9. Finally, update the various table parameters to reflect the new size. */ static void shrink_table(hash_t *hash) { hash_val_t chain, nchains; hnode_t **newtable, *low_tail, *low_chain, *high_chain; assert (hash->nchains >= 2); /* 1 */ nchains = hash->nchains / 2; for (chain = 0; chain < nchains; chain++) { low_chain = hash->table[chain]; /* 2 */ high_chain = hash->table[chain + nchains]; for (low_tail = low_chain; low_tail && low_tail->next; low_tail = low_tail->next) ; /* 3 */ if (low_chain != NULL) /* 4 */ low_tail->next = high_chain; else if (high_chain != NULL) /* 5 */ hash->table[chain] = high_chain; else assert (hash->table[chain] == NULL); /* 6 */ } newtable = realloc(hash->table, sizeof *newtable * nchains); /* 7 */ if (newtable) /* 8 */ hash->table = newtable; hash->mask >>= 1; /* 9 */ hash->nchains = nchains; hash->lowmark /= 2; hash->highmark /= 2; assert (hash_verify(hash)); } /* * Create a dynamic hash table. Both the hash table structure and the table * itself are dynamically allocated. Furthermore, the table is extendible in * that it will automatically grow as its load factor increases beyond a * certain threshold. * Notes: * 1. If the number of bits in the hash_val_t type has not been computed yet, * we do so here, because this is likely to be the first function that the * user calls. * 2. Allocate a hash table control structure. * 3. If a hash table control structure is successfully allocated, we * proceed to initialize it. Otherwise we return a null pointer. * 4. We try to allocate the table of hash chains. * 5. If we were able to allocate the hash chain table, we can finish * initializing the hash structure and the table. Otherwise, we must * backtrack by freeing the hash structure. * 6. INIT_SIZE should be a power of two. The high and low marks are always set * to be twice the table size and half the table size respectively. When the * number of nodes in the table grows beyond the high size (beyond load * factor 2), it will double in size to cut the load factor down to about * about 1. If the table shrinks down to or beneath load factor 0.5, * it will shrink, bringing the load up to about 1. However, the table * will never shrink beneath INIT_SIZE even if it's emptied. * 7. This indicates that the table is dynamically allocated and dynamically * resized on the fly. A table that has this value set to zero is * assumed to be statically allocated and will not be resized. * 8. The table of chains must be properly reset to all null pointers. */ hash_t *hash_create(hashcount_t maxcount, hash_comp_t compfun, hash_fun_t hashfun) { hash_t *hash; if (hash_val_t_bit == 0) /* 1 */ compute_bits(); hash = malloc(sizeof *hash); /* 2 */ if (hash) { /* 3 */ hash->table = malloc(sizeof *hash->table * INIT_SIZE); /* 4 */ if (hash->table) { /* 5 */ hash->nchains = INIT_SIZE; /* 6 */ hash->highmark = INIT_SIZE * 2; hash->lowmark = INIT_SIZE / 2; hash->nodecount = 0; hash->maxcount = maxcount; hash->compare = compfun ? compfun : hash_comp_default; hash->function = hashfun ? hashfun : hash_fun_default; hash->allocnode = hnode_alloc; hash->freenode = hnode_free; hash->context = NULL; hash->mask = INIT_MASK; hash->dynamic = 1; /* 7 */ clear_table(hash); /* 8 */ assert (hash_verify(hash)); return hash; } free(hash); } return NULL; } /* * Select a different set of node allocator routines. */ void hash_set_allocator(hash_t *hash, hnode_alloc_t al, hnode_free_t fr, void *context) { assert (hash_count(hash) == 0); assert ((al == 0 && fr == 0) || (al != 0 && fr != 0)); hash->allocnode = al ? al : hnode_alloc; hash->freenode = fr ? fr : hnode_free; hash->context = context; } /* * Free every node in the hash using the hash->freenode() function pointer, and * cause the hash to become empty. */ void hash_free_nodes(hash_t *hash) { hscan_t hs; hnode_t *node; hash_scan_begin(&hs, hash); while ((node = hash_scan_next(&hs))) { hash_scan_delete(hash, node); hash->freenode(node, hash->context); } hash->nodecount = 0; clear_table(hash); } /* * Obsolescent function for removing all nodes from a table, * freeing them and then freeing the table all in one step. */ void hash_free(hash_t *hash) { #ifdef KAZLIB_OBSOLESCENT_DEBUG assert ("call to obsolescent function hash_free()" && 0); #endif hash_free_nodes(hash); hash_destroy(hash); } /* * Free a dynamic hash table structure. */ void hash_destroy(hash_t *hash) { assert (hash_val_t_bit != 0); assert (hash_isempty(hash)); free(hash->table); free(hash); } /* * Initialize a user supplied hash structure. The user also supplies a table of * chains which is assigned to the hash structure. The table is static---it * will not grow or shrink. * 1. See note 1. in hash_create(). * 2. The user supplied array of pointers hopefully contains nchains nodes. * 3. See note 7. in hash_create(). * 4. We must dynamically compute the mask from the given power of two table * size. * 5. The user supplied table can't be assumed to contain null pointers, * so we reset it here. */ hash_t *hash_init(hash_t *hash, hashcount_t maxcount, hash_comp_t compfun, hash_fun_t hashfun, hnode_t **table, hashcount_t nchains) { if (hash_val_t_bit == 0) /* 1 */ compute_bits(); assert (is_power_of_two(nchains)); hash->table = table; /* 2 */ hash->nchains = nchains; hash->nodecount = 0; hash->maxcount = maxcount; hash->compare = compfun ? compfun : hash_comp_default; hash->function = hashfun ? hashfun : hash_fun_default; hash->dynamic = 0; /* 3 */ hash->mask = compute_mask(nchains); /* 4 */ clear_table(hash); /* 5 */ assert (hash_verify(hash)); return hash; } /* * Reset the hash scanner so that the next element retrieved by * hash_scan_next() shall be the first element on the first non-empty chain. * Notes: * 1. Locate the first non empty chain. * 2. If an empty chain is found, remember which one it is and set the next * pointer to refer to its first element. * 3. Otherwise if a chain is not found, set the next pointer to NULL * so that hash_scan_next() shall indicate failure. */ void hash_scan_begin(hscan_t *scan, hash_t *hash) { hash_val_t nchains = hash->nchains; hash_val_t chain; scan->table = hash; /* 1 */ for (chain = 0; chain < nchains && hash->table[chain] == NULL; chain++) ; if (chain < nchains) { /* 2 */ scan->chain = chain; scan->next = hash->table[chain]; } else { /* 3 */ scan->next = NULL; } } /* * Retrieve the next node from the hash table, and update the pointer * for the next invocation of hash_scan_next(). * Notes: * 1. Remember the next pointer in a temporary value so that it can be * returned. * 2. This assertion essentially checks whether the module has been properly * initialized. The first point of interaction with the module should be * either hash_create() or hash_init(), both of which set hash_val_t_bit to * a non zero value. * 3. If the next pointer we are returning is not NULL, then the user is * allowed to call hash_scan_next() again. We prepare the new next pointer * for that call right now. That way the user is allowed to delete the node * we are about to return, since we will no longer be needing it to locate * the next node. * 4. If there is a next node in the chain (next->next), then that becomes the * new next node, otherwise ... * 5. We have exhausted the current chain, and must locate the next subsequent * non-empty chain in the table. * 6. If a non-empty chain is found, the first element of that chain becomes * the new next node. Otherwise there is no new next node and we set the * pointer to NULL so that the next time hash_scan_next() is called, a null * pointer shall be immediately returned. */ hnode_t *hash_scan_next(hscan_t *scan) { hnode_t *next = scan->next; /* 1 */ hash_t *hash = scan->table; hash_val_t chain = scan->chain + 1; hash_val_t nchains = hash->nchains; assert (hash_val_t_bit != 0); /* 2 */ if (next) { /* 3 */ if (next->next) { /* 4 */ scan->next = next->next; } else { while (chain < nchains && hash->table[chain] == NULL) /* 5 */ chain++; if (chain < nchains) { /* 6 */ scan->chain = chain; scan->next = hash->table[chain]; } else { scan->next = NULL; } } } return next; } /* * Insert a node into the hash table. * Notes: * 1. It's illegal to insert more than the maximum number of nodes. The client * should verify that the hash table is not full before attempting an * insertion. * 2. The same key may not be inserted into a table twice. * 3. If the table is dynamic and the load factor is already at >= 2, * grow the table. * 4. We take the bottom N bits of the hash value to derive the chain index, * where N is the base 2 logarithm of the size of the hash table. */ void hash_insert(hash_t *hash, hnode_t *node, const void *key) { hash_val_t hkey, chain; assert (hash_val_t_bit != 0); assert (node->next == NULL); assert (hash->nodecount < hash->maxcount); /* 1 */ assert (hash_lookup(hash, key) == NULL); /* 2 */ if (hash->dynamic && hash->nodecount >= hash->highmark) /* 3 */ grow_table(hash); hkey = hash->function(key); chain = hkey & hash->mask; /* 4 */ node->key = key; node->hkey = hkey; node->next = hash->table[chain]; hash->table[chain] = node; hash->nodecount++; assert (hash_verify(hash)); } /* * Find a node in the hash table and return a pointer to it. * Notes: * 1. We hash the key and keep the entire hash value. As an optimization, when * we descend down the chain, we can compare hash values first and only if * hash values match do we perform a full key comparison. * 2. To locate the chain from among 2^N chains, we look at the lower N bits of * the hash value by anding them with the current mask. * 3. Looping through the chain, we compare the stored hash value inside each * node against our computed hash. If they match, then we do a full * comparison between the unhashed keys. If these match, we have located the * entry. */ hnode_t *hash_lookup(hash_t *hash, const void *key) { hash_val_t hkey, chain; hnode_t *nptr; hkey = hash->function(key); /* 1 */ chain = hkey & hash->mask; /* 2 */ for (nptr = hash->table[chain]; nptr; nptr = nptr->next) { /* 3 */ if (nptr->hkey == hkey && hash->compare(nptr->key, key) == 0) return nptr; } return NULL; } /* * Delete the given node from the hash table. Since the chains * are singly linked, we must locate the start of the node's chain * and traverse. * Notes: * 1. The node must belong to this hash table, and its key must not have * been tampered with. * 2. If this deletion will take the node count below the low mark, we * shrink the table now. * 3. Determine which chain the node belongs to, and fetch the pointer * to the first node in this chain. * 4. If the node being deleted is the first node in the chain, then * simply update the chain head pointer. * 5. Otherwise advance to the node's predecessor, and splice out * by updating the predecessor's next pointer. * 6. Indicate that the node is no longer in a hash table. */ hnode_t *hash_delete(hash_t *hash, hnode_t *node) { hash_val_t chain; hnode_t *hptr; assert (hash_lookup(hash, node->key) == node); /* 1 */ assert (hash_val_t_bit != 0); if (hash->dynamic && hash->nodecount <= hash->lowmark && hash->nodecount > INIT_SIZE) shrink_table(hash); /* 2 */ chain = node->hkey & hash->mask; /* 3 */ hptr = hash->table[chain]; if (hptr == node) { /* 4 */ hash->table[chain] = node->next; } else { while (hptr->next != node) { /* 5 */ assert (hptr != 0); hptr = hptr->next; } assert (hptr->next == node); hptr->next = node->next; } hash->nodecount--; assert (hash_verify(hash)); node->next = NULL; /* 6 */ return node; } int hash_alloc_insert(hash_t *hash, const void *key, void *data) { hnode_t *node = hash->allocnode(hash->context); if (node) { hnode_init(node, data); hash_insert(hash, node, key); return 1; } return 0; } void hash_delete_free(hash_t *hash, hnode_t *node) { hash_delete(hash, node); hash->freenode(node, hash->context); } /* * Exactly like hash_delete, except does not trigger table shrinkage. This is to be * used from within a hash table scan operation. See notes for hash_delete. */ hnode_t *hash_scan_delete(hash_t *hash, hnode_t *node) { hash_val_t chain; hnode_t *hptr; assert (hash_lookup(hash, node->key) == node); assert (hash_val_t_bit != 0); chain = node->hkey & hash->mask; hptr = hash->table[chain]; if (hptr == node) { hash->table[chain] = node->next; } else { while (hptr->next != node) hptr = hptr->next; hptr->next = node->next; } hash->nodecount--; assert (hash_verify(hash)); node->next = NULL; return node; } /* * Like hash_delete_free but based on hash_scan_delete. */ void hash_scan_delfree(hash_t *hash, hnode_t *node) { hash_scan_delete(hash, node); hash->freenode(node, hash->context); } /* * Verify whether the given object is a valid hash table. This means * Notes: * 1. If the hash table is dynamic, verify whether the high and * low expansion/shrinkage thresholds are powers of two. * 2. Count all nodes in the table, and test each hash value * to see whether it is correct for the node's chain. */ int hash_verify(hash_t *hash) { hashcount_t count = 0; hash_val_t chain; hnode_t *hptr; if (hash->dynamic) { /* 1 */ if (hash->lowmark >= hash->highmark) return 0; if (!is_power_of_two(hash->highmark)) return 0; if (!is_power_of_two(hash->lowmark)) return 0; } for (chain = 0; chain < hash->nchains; chain++) { /* 2 */ for (hptr = hash->table[chain]; hptr != NULL; hptr = hptr->next) { if ((hptr->hkey & hash->mask) != chain) return 0; count++; } } if (count != hash->nodecount) return 0; return 1; } /* * Test whether the hash table is full and return 1 if this is true, * 0 if it is false. */ #undef hash_isfull int hash_isfull(hash_t *hash) { return hash->nodecount == hash->maxcount; } /* * Test whether the hash table is empty and return 1 if this is true, * 0 if it is false. */ #undef hash_isempty int hash_isempty(hash_t *hash) { return hash->nodecount == 0; } static hnode_t *hnode_alloc(void *context _U_) { return malloc(sizeof *hnode_alloc(NULL)); } static void hnode_free(hnode_t *node, void *context _U_) { free(node); } /* * Create a hash table node dynamically and assign it the given data. */ hnode_t *hnode_create(void *data) { hnode_t *node = malloc(sizeof *node); if (node) { node->data = data; node->next = NULL; } return node; } /* * Initialize a client-supplied node */ hnode_t *hnode_init(hnode_t *hnode, void *data) { hnode->data = data; hnode->next = NULL; return hnode; } /* * Destroy a dynamically allocated node. */ void hnode_destroy(hnode_t *hnode) { free(hnode); } #undef hnode_put void hnode_put(hnode_t *node, void *data) { node->data = data; } #undef hnode_get void *hnode_get(hnode_t *node) { return node->data; } #undef hnode_getkey const void *hnode_getkey(hnode_t *node) { return node->key; } #undef hash_count hashcount_t hash_count(hash_t *hash) { return hash->nodecount; } #undef hash_size hashcount_t hash_size(hash_t *hash) { return hash->nchains; } static hash_val_t hash_fun_default(const void *key) { static unsigned long randbox[] = { 0x49848f1bU, 0xe6255dbaU, 0x36da5bdcU, 0x47bf94e9U, 0x8cbcce22U, 0x559fc06aU, 0xd268f536U, 0xe10af79aU, 0xc1af4d69U, 0x1d2917b5U, 0xec4c304dU, 0x9ee5016cU, 0x69232f74U, 0xfead7bb3U, 0xe9089ab6U, 0xf012f6aeU, }; const unsigned char *str = key; hash_val_t acc = 0; while (*str) { acc ^= randbox[(*str + acc) & 0xf]; acc = (acc << 1) | (acc >> 31); acc &= 0xffffffffU; acc ^= randbox[((*str++ >> 4) + acc) & 0xf]; acc = (acc << 2) | (acc >> 30); acc &= 0xffffffffU; } return acc; } /* From http://www.azillionmonkeys.com/qed/hash.html */ #undef get16bits #if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) #define get16bits(d) (*((const uint16_t *) (d))) #endif #if !defined (get16bits) #define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8) \ +(uint32_t)(((const uint8_t *)(d))[0]) ) #endif static hash_val_t hash_fun2(const void *key) { int len, rem; const unsigned char *data = key; hash_val_t hash = 0, tmp = 0; len = strlen((char *)data); rem = len & 3; len >>= 2; /* Main loop */ for (;len > 0; len--) { hash += get16bits (data); tmp = (get16bits (data+2) << 11) ^ hash; hash = (hash << 16) ^ tmp; data += 2*sizeof (uint16_t); hash += hash >> 11; } /* Handle end cases */ switch (rem) { case 3: hash += get16bits (data); hash ^= hash << 16; hash ^= data[sizeof (uint16_t)] << 18; hash += hash >> 11; break; case 2: hash += get16bits (data); hash ^= hash << 11; hash += hash >> 17; break; case 1: hash += *data; hash ^= hash << 10; hash += hash >> 1; } /* Force "avalanching" of final 127 bits */ hash ^= hash << 3; hash += hash >> 5; hash ^= hash << 4; hash += hash >> 17; hash ^= hash << 25; hash += hash >> 6; return hash; } static int hash_comp_default(const void *key1, const void *key2) { return strcmp(key1, key2); } #ifdef KAZLIB_TEST_MAIN #include #include #include typedef char input_t[256]; static int tokenize(char *string, ...) { char **tokptr; va_list arglist; int tokcount = 0; va_start(arglist, string); tokptr = va_arg(arglist, char **); while (tokptr) { while (*string && isspace((unsigned char) *string)) string++; if (!*string) break; *tokptr = string; while (*string && !isspace((unsigned char) *string)) string++; tokptr = va_arg(arglist, char **); tokcount++; if (!*string) break; *string++ = 0; } va_end(arglist); return tokcount; } static char *dupstring(char *str) { int sz = strlen(str) + 1; char *new = malloc(sz); if (new) memcpy(new, str, sz); return new; } static hnode_t *new_node(void *c) { static hnode_t few[5]; static int count; if (count < 5) return few + count++; return NULL; } static void del_node(hnode_t *n, void *c) { } int main(void) { input_t in; hash_t *h = hash_create(HASHCOUNT_T_MAX, 0, hash_fun2); hnode_t *hn; hscan_t hs; char *tok1, *tok2, *val; const char *key; int prompt = 0; char *help = "a add value to hash table\n" "d delete value from hash table\n" "l lookup value in hash table\n" "n show size of hash table\n" "c show number of entries\n" "t dump whole hash table\n" "+ increase hash table (private func)\n" "- decrease hash table (private func)\n" "b print hash_t_bit value\n" "p turn prompt on\n" "s switch to non-functioning allocator\n" "q quit"; if (!h) puts("hash_create failed"); for (;;) { if (prompt) putchar('>'); fflush(stdout); if (!fgets(in, sizeof(input_t), stdin)) break; switch(in[0]) { case '?': puts(help); break; case 'b': printf("%d\n", hash_val_t_bit); break; case 'a': if (tokenize(in+1, &tok1, &tok2, (char **) 0) != 2) { puts("what?"); break; } key = dupstring(tok1); val = dupstring(tok2); if (!key || !val) { puts("out of memory"); free((void *) key); free(val); } if (!hash_alloc_insert(h, key, val)) { puts("hash_alloc_insert failed"); free((void *) key); free(val); break; } break; case 'd': if (tokenize(in+1, &tok1, (char **) 0) != 1) { puts("what?"); break; } hn = hash_lookup(h, tok1); if (!hn) { puts("hash_lookup failed"); break; } val = hnode_get(hn); key = hnode_getkey(hn); hash_scan_delfree(h, hn); free((void *) key); free(val); break; case 'l': if (tokenize(in+1, &tok1, (char **) 0) != 1) { puts("what?"); break; } hn = hash_lookup(h, tok1); if (!hn) { puts("hash_lookup failed"); break; } val = hnode_get(hn); puts(val); break; case 'n': printf("%lu\n", (unsigned long) hash_size(h)); break; case 'c': printf("%lu\n", (unsigned long) hash_count(h)); break; case 't': hash_scan_begin(&hs, h); while ((hn = hash_scan_next(&hs))) printf("%s\t%s\n", (char*) hnode_getkey(hn), (char*) hnode_get(hn)); break; case '+': grow_table(h); /* private function */ break; case '-': shrink_table(h); /* private function */ break; case 'q': exit(0); break; case '\0': break; case 'p': prompt = 1; break; case 's': hash_set_allocator(h, new_node, del_node, NULL); break; default: putchar('?'); putchar('\n'); break; } } return 0; } #endif netatalk-2.2.2/etc/afpd/fork.h0000644000175200017500000000756411655731244013066 00000000000000/* * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifndef AFPD_FORK_H #define AFPD_FORK_H 1 #include #include #include #include #include "volume.h" #include "directory.h" struct file_key { dev_t dev; ino_t inode; }; struct ofork { struct file_key key; struct adouble *of_ad; struct vol *of_vol; cnid_t of_did; uint16_t of_refnum; int of_flags; struct ofork **prevp, *next; // struct ofork *of_d_prev, *of_d_next; }; #define OPENFORK_DATA (0) #define OPENFORK_RSCS (1<<7) #define OPENACC_RD (1<<0) #define OPENACC_WR (1<<1) #define OPENACC_DRD (1<<4) #define OPENACC_DWR (1<<5) /* ofork.of_flags bits */ #define AFPFORK_OPEN (1<<0) #define AFPFORK_RSRC (1<<1) #define AFPFORK_DATA (1<<2) #define AFPFORK_DIRTY (1<<3) #define AFPFORK_ACCRD (1<<4) #define AFPFORK_ACCWR (1<<5) #define AFPFORK_ACCMASK (AFPFORK_ACCRD | AFPFORK_ACCWR) #define AFPFORK_MODIFIED (1<<6) /* used in FCE for modified files */ #ifdef AFS extern struct ofork *writtenfork; #endif #define of_name(a) (a)->of_ad->ad_m_name /* in ofork.c */ extern struct ofork *of_alloc (struct vol *, struct dir *, char *, u_int16_t *, const int, struct adouble *, struct stat *); extern void of_dealloc (struct ofork *); extern struct ofork *of_find (const u_int16_t); extern struct ofork *of_findname (struct path *); extern int of_rename (const struct vol *, struct ofork *, struct dir *, const char *, struct dir *, const char *); extern int of_flush (const struct vol *); extern void of_pforkdesc (FILE *); extern int of_stat (struct path *); extern int of_statdir (struct vol *vol, struct path *); extern int of_closefork (struct ofork *ofork); extern void of_closevol (const struct vol *vol); extern void of_close_all_forks(void); extern struct adouble *of_ad (const struct vol *, struct path *, struct adouble *); #ifdef HAVE_ATFUNCS extern struct ofork *of_findnameat(int dirfd, struct path *path); extern int of_fstatat(int dirfd, struct path *path); #endif /* HAVE_ATFUNCS */ /* in fork.c */ extern int flushfork (struct ofork *); extern int getforkmode (struct adouble *, int , off_t ); /* FP functions */ int afp_openfork (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_bytelock (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_getforkparams (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_setforkparams (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_read (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_write (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_flushfork (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_flush (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_closefork (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_bytelock_ext (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_read_ext (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_write_ext (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_syncfork (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); #endif netatalk-2.2.2/etc/afpd/unix.h0000644000175200017500000001452711655731244013105 00000000000000/* * $Id: unix.h,v 1.23 2010-04-12 14:28:47 franklahm Exp $ */ #ifndef AFPD_UNIX_H #define AFPD_UNIX_H #ifdef HAVE_SYS_CDEFS_H #include #endif /* HAVE_SYS_CDEFS_H */ #include #include "config.h" #include "volume.h" #if defined( sun ) && !defined( __svr4__ ) #ifdef i386 typedef int mode_t; #endif /*i386*/ #endif /*sun __svr4__*/ #if defined(HAVE_SYS_VFS_H) || defined( sun ) || defined( ibm032 ) #include #endif /* HAVE_SYS_VFS_H || sun || ibm032 */ #if defined(_IBMR2) || defined(HAVE_STATFS_H) #include /* this might not be right. */ #define f_mntfromname f_fname #endif /* _IBMR2 || HAVE_STATFS_H */ #if defined(TRU64) #define f_frsize f_fsize #else /* TRU64 */ /* temp fix, was: defined(HAVE_SYS_STATVFS) || defined(__svr4__) */ #if defined(__svr4__) || (defined(__NetBSD__) && (__NetBSD_Version__ >= 200040000)) #include #define statfs statvfs #else /* HAVE_SYS_STATVFS || __svr4__ */ #define f_frsize f_bsize #endif /* USE_STATVFS_H */ #endif /* TRU64 */ #if defined(__svr4__) || defined(HAVE_SYS_MNTTAB_H) #include #endif /* __svr4__ || HAVE_SYS_MNTTAB_H */ #if defined(__DragonFly__) #define dqblk ufs_dqblk #endif #if defined(HAVE_SYS_MOUNT_H) || defined(BSD4_4) || \ defined(linux) || defined(ultrix) #include #endif /* HAVE_SYS_MOUNT_H || BSD4_4 || linux || ultrix */ #if defined(linux) || defined(HAVE_MNTENT_H) #include #endif /* linux || HAVE_MNTENT_H */ #ifndef NO_QUOTA_SUPPORT #if !defined(HAVE_LIBQUOTA) #if !(defined(__svr4__) || defined(HAVE_DQB_BTIMELIMIT)) #define dqb_btimelimit dqb_btime #endif /* ! __svr4__ || HAVE_DQB_BTIMELIMIT */ #if defined(linux) || defined(ultrix) || defined(HAVE_QUOTA_H) #ifndef NEED_QUOTACTL_WRAPPER /*#include */ /*long quotactl (int, const char *, unsigned int, caddr_t); */ /* extern long quotactl (int, const char *, long, caddr_t); */ #else /* ! NEED_QUOTACTL_WRAPPER */ #include #include #include #endif /* ! NEED_QUOTACTL_WRAPPER */ #endif /* linux || ultrix || HAVE_QUOTA_H */ #ifdef __svr4__ #include #endif /* __svr4__ */ #ifdef BSD4_4 #include #endif /* BSD4_4 */ #ifdef HAVE_UFS_QUOTA_H #include #endif /* HAVE_UFS_QUOTA_H */ #ifdef _IBMR2 #include #endif /* _IBMR2 */ #include #include #include #include "directory.h" #if defined (linux) #define MAXQUOTAS 2 /* definitions from sys/quota.h */ #define USRQUOTA 0 /* element used for user quotas */ #define GRPQUOTA 1 /* element used for group quotas */ /* * Command definitions for the 'quotactl' system call. * The commands are broken into a main command defined below * and a subcommand that is used to convey the type of * quota that is being manipulated (see above). */ #define SUBCMDMASK 0x00ff #define SUBCMDSHIFT 8 #define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK)) /* declare an internal version of the quota block struct */ typedef u_int64_t qsize_t; /* Type in which we store size limitations */ typedef u_int32_t qid_t; /* Type in which we store ids in memory */ struct dqblk { qsize_t bsize; qsize_t dqb_ihardlimit; /* absolute limit on allocated inodes */ qsize_t dqb_isoftlimit; /* preferred inode limit */ qsize_t dqb_curinodes; /* current # allocated inodes */ qsize_t dqb_bhardlimit; /* absolute limit on disk blks alloc */ qsize_t dqb_bsoftlimit; /* preferred limit on disk blks */ qsize_t dqb_curblocks; /* current block count */ time_t dqb_btime; /* time limit for excessive disk use */ time_t dqb_itime; /* time limit for excessive inode use */ }; /* API v1 command definitions */ #define Q_V1_GETQUOTA 0x0300 #define Q_V1_SYNC 0x0600 #define Q_V1_SETQLIM 0x0700 #define Q_V1_GETSTATS 0x0800 /* API v2 command definitions */ #define Q_V2_SYNC 0x0600 #define Q_V2_SETQLIM 0x0700 #define Q_V2_GETQUOTA 0x0D00 #define Q_V2_GETSTATS 0x1100 /* proc API command definitions */ #define Q_V3_SYNC 0x800001 #define Q_V3_GETQUOTA 0x800007 #define Q_V3_SETQUOTA 0x800008 /* Interface versions */ #define IFACE_UNSET 0 #define IFACE_VFSOLD 1 #define IFACE_VFSV0 2 #define IFACE_GENERIC 3 #define DEV_QBSIZE 1024 struct dqblk_v3 { u_int64_t dqb_bhardlimit; u_int64_t dqb_bsoftlimit; u_int64_t dqb_curspace; u_int64_t dqb_ihardlimit; u_int64_t dqb_isoftlimit; u_int64_t dqb_curinodes; u_int64_t dqb_btime; u_int64_t dqb_itime; u_int32_t dqb_valid; }; struct dqblk_v2 { unsigned int dqb_ihardlimit; unsigned int dqb_isoftlimit; unsigned int dqb_curinodes; unsigned int dqb_bhardlimit; unsigned int dqb_bsoftlimit; qsize_t dqb_curspace; time_t dqb_btime; time_t dqb_itime; }; struct dqstats_v2 { u_int32_t lookups; u_int32_t drops; u_int32_t reads; u_int32_t writes; u_int32_t cache_hits; u_int32_t allocated_dquots; u_int32_t free_dquots; u_int32_t syncs; u_int32_t version; }; struct dqblk_v1 { u_int32_t dqb_bhardlimit; u_int32_t dqb_bsoftlimit; u_int32_t dqb_curblocks; u_int32_t dqb_ihardlimit; u_int32_t dqb_isoftlimit; u_int32_t dqb_curinodes; time_t dqb_btime; time_t dqb_itime; }; extern long quotactl (unsigned int, const char *, int, caddr_t); #endif /* linux */ extern int getnfsquota (struct vol *, const int, const u_int32_t, struct dqblk *); #endif /* ! HAVE_LIBQUOTA */ extern int uquota_getvolspace (struct vol *, VolSpace *, VolSpace *, const u_int32_t); #endif /* NO_QUOTA_SUPPORT */ extern struct afp_options default_options; extern int gmem (const gid_t); extern int setdeskmode (const mode_t); extern int setdirunixmode (const struct vol *, const char *, mode_t); extern int setdirmode (const struct vol *, const char *, mode_t); extern int setdeskowner (const uid_t, const gid_t); extern int setdirowner (const struct vol *, const char *, const uid_t, const gid_t); extern int setfilunixmode (const struct vol *, struct path*, const mode_t); extern int setfilowner (const struct vol *, const uid_t, const gid_t, struct path*); extern void accessmode (const struct vol *, char *, struct maccess *, struct dir *, struct stat *); #ifdef AFS #define accessmode afsmode #endif #endif /* UNIX_H */ netatalk-2.2.2/etc/afpd/main.c0000644000175200017500000004167311655731244013043 00000000000000/* * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "afp_config.h" #include "status.h" #include "fork.h" #include "uam_auth.h" #include "afp_zeroconf.h" #ifdef TRU64 #include #include #include static int argc = 0; static char **argv = NULL; #endif /* TRU64 */ #define AFP_LISTENERS 32 #define FDSET_SAFETY 5 unsigned char nologin = 0; struct afp_options default_options; static AFPConfig *configs; static server_child *server_children; static sig_atomic_t reloadconfig = 0; static sig_atomic_t gotsigchld = 0; /* Two pointers to dynamic allocated arrays which store pollfds and associated data */ static struct pollfd *fdset; static struct polldata *polldata; static int fdset_size; /* current allocated size */ static int fdset_used; /* number of used elements */ static int disasociated_ipc_fd; /* disasociated sessions uses this fd for IPC */ #ifdef TRU64 void afp_get_cmdline( int *ac, char ***av) { *ac = argc; *av = argv; } #endif /* TRU64 */ /* This is registered with atexit() */ static void afp_exit(void) { if (parent_or_child == 0) /* Only do this in the parent */ server_unlock(default_options.pidfile); } /* ------------------ initialize fd set we are waiting for. */ static void fd_set_listening_sockets(void) { AFPConfig *config; for (config = configs; config; config = config->next) { if (config->fd < 0) /* for proxies */ continue; fdset_add_fd(default_options.connections + AFP_LISTENERS + FDSET_SAFETY, &fdset, &polldata, &fdset_used, &fdset_size, config->fd, LISTEN_FD, config); } if (default_options.flags & OPTION_KEEPSESSIONS) fdset_add_fd(default_options.connections + AFP_LISTENERS + FDSET_SAFETY, &fdset, &polldata, &fdset_used, &fdset_size, disasociated_ipc_fd, DISASOCIATED_IPC_FD, NULL); } static void fd_reset_listening_sockets(void) { AFPConfig *config; for (config = configs; config; config = config->next) { if (config->fd < 0) /* for proxies */ continue; fdset_del_fd(&fdset, &polldata, &fdset_used, &fdset_size, config->fd); } if (default_options.flags & OPTION_KEEPSESSIONS) fdset_del_fd(&fdset, &polldata, &fdset_used, &fdset_size, disasociated_ipc_fd); } /* ------------------ */ static void afp_goaway(int sig) { AFPConfig *config; #ifndef NO_DDP asp_kill(sig); #endif /* ! NO_DDP */ switch( sig ) { case SIGTERM: case SIGQUIT: switch (sig) { case SIGTERM: LOG(log_note, logtype_afpd, "AFP Server shutting down on SIGTERM"); break; case SIGQUIT: if (default_options.flags & OPTION_KEEPSESSIONS) { LOG(log_note, logtype_afpd, "AFP Server shutting down on SIGQUIT, NOT disconnecting clients"); } else { LOG(log_note, logtype_afpd, "AFP Server shutting down on SIGQUIT"); sig = SIGTERM; } break; } if (server_children) server_child_kill(server_children, CHILD_DSIFORK, sig); for (config = configs; config; config = config->next) if (config->server_cleanup) config->server_cleanup(config); server_unlock(default_options.pidfile); exit(0); break; case SIGUSR1 : nologin++; auth_unload(); LOG(log_info, logtype_afpd, "disallowing logins"); if (server_children) server_child_kill(server_children, CHILD_DSIFORK, sig); break; case SIGHUP : /* w/ a configuration file, we can force a re-read if we want */ reloadconfig = 1; break; case SIGCHLD: /* w/ a configuration file, we can force a re-read if we want */ gotsigchld = 1; break; default : LOG(log_error, logtype_afpd, "afp_goaway: bad signal" ); } return; } static void child_handler(void) { int fd; int status, i; pid_t pid; #ifndef WAIT_ANY #define WAIT_ANY (-1) #endif /* ! WAIT_ANY */ while ((pid = waitpid(WAIT_ANY, &status, WNOHANG)) > 0) { for (i = 0; i < server_children->nforks; i++) { if ((fd = server_child_remove(server_children, i, pid)) != -1) { fdset_del_fd(&fdset, &polldata, &fdset_used, &fdset_size, fd); break; } } if (WIFEXITED(status)) { if (WEXITSTATUS(status)) LOG(log_info, logtype_afpd, "child[%d]: exited %d", pid, WEXITSTATUS(status)); else LOG(log_info, logtype_afpd, "child[%d]: done", pid); } else { if (WIFSIGNALED(status)) LOG(log_info, logtype_afpd, "child[%d]: killed by signal %d", pid, WTERMSIG(status)); else LOG(log_info, logtype_afpd, "child[%d]: died", pid); } } } static int setlimits(void) { struct rlimit rlim; if (getrlimit(RLIMIT_NOFILE, &rlim) != 0) { LOG(log_warning, logtype_afpd, "setlimits: reading current limits failed: %s", strerror(errno)); return -1; } if (rlim.rlim_cur != RLIM_INFINITY && rlim.rlim_cur < 65535) { rlim.rlim_cur = 65535; if (rlim.rlim_max != RLIM_INFINITY && rlim.rlim_max < 65535) rlim.rlim_max = 65535; if (setrlimit(RLIMIT_NOFILE, &rlim) != 0) { LOG(log_warning, logtype_afpd, "setlimits: increasing limits failed: %s", strerror(errno)); return -1; } } return 0; } int main(int ac, char **av) { AFPConfig *config; fd_set rfds; void *ipc; struct sigaction sv; sigset_t sigs; int ret; #ifdef TRU64 argc = ac; argv = av; set_auth_parameters( ac, av ); #endif /* TRU64 */ /* Parse argv args and initialize default options */ afp_options_init(&default_options); if (!afp_options_parse(ac, av, &default_options)) exit(EXITERR_CONF); if (check_lockfile("afpd", default_options.pidfile) != 0) exit(EXITERR_SYS); if (!(default_options.flags & OPTION_DEBUG) && (daemonize(0, 0) != 0)) exit(EXITERR_SYS); if (create_lockfile("afpd", default_options.pidfile) != 0) exit(EXITERR_SYS); /* Log SIGBUS/SIGSEGV SBT */ fault_setup(NULL); /* Default log setup: log to syslog */ set_processname("afpd"); setuplog("default log_note"); /* Save the user's current umask */ default_options.save_mask = umask( default_options.umask ); atexit(afp_exit); /* install child handler for asp and dsi. we do this before afp_goaway * as afp_goaway references stuff from here. * XXX: this should really be setup after the initial connections. */ if (!(server_children = server_child_alloc(default_options.connections, CHILD_NFORKS))) { LOG(log_error, logtype_afpd, "main: server_child alloc: %s", strerror(errno) ); exit(EXITERR_SYS); } memset(&sv, 0, sizeof(sv)); /* linux at least up to 2.4.22 send a SIGXFZ for vfat fs, even if the file is open with O_LARGEFILE ! */ #ifdef SIGXFSZ sv.sa_handler = SIG_IGN; sigemptyset( &sv.sa_mask ); if (sigaction(SIGXFSZ, &sv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "main: sigaction: %s", strerror(errno) ); exit(EXITERR_SYS); } #endif sv.sa_handler = afp_goaway; /* handler for all sigs */ sigemptyset( &sv.sa_mask ); sigaddset(&sv.sa_mask, SIGALRM); sigaddset(&sv.sa_mask, SIGHUP); sigaddset(&sv.sa_mask, SIGTERM); sigaddset(&sv.sa_mask, SIGUSR1); sigaddset(&sv.sa_mask, SIGQUIT); sv.sa_flags = SA_RESTART; if ( sigaction( SIGCHLD, &sv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "main: sigaction: %s", strerror(errno) ); exit(EXITERR_SYS); } sigemptyset( &sv.sa_mask ); sigaddset(&sv.sa_mask, SIGALRM); sigaddset(&sv.sa_mask, SIGTERM); sigaddset(&sv.sa_mask, SIGHUP); sigaddset(&sv.sa_mask, SIGCHLD); sigaddset(&sv.sa_mask, SIGQUIT); sv.sa_flags = SA_RESTART; if ( sigaction( SIGUSR1, &sv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "main: sigaction: %s", strerror(errno) ); exit(EXITERR_SYS); } sigemptyset( &sv.sa_mask ); sigaddset(&sv.sa_mask, SIGALRM); sigaddset(&sv.sa_mask, SIGTERM); sigaddset(&sv.sa_mask, SIGUSR1); sigaddset(&sv.sa_mask, SIGCHLD); sigaddset(&sv.sa_mask, SIGQUIT); sv.sa_flags = SA_RESTART; if ( sigaction( SIGHUP, &sv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "main: sigaction: %s", strerror(errno) ); exit(EXITERR_SYS); } sigemptyset( &sv.sa_mask ); sigaddset(&sv.sa_mask, SIGALRM); sigaddset(&sv.sa_mask, SIGHUP); sigaddset(&sv.sa_mask, SIGUSR1); sigaddset(&sv.sa_mask, SIGCHLD); sigaddset(&sv.sa_mask, SIGQUIT); sv.sa_flags = SA_RESTART; if ( sigaction( SIGTERM, &sv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "main: sigaction: %s", strerror(errno) ); exit(EXITERR_SYS); } sigemptyset( &sv.sa_mask ); sigaddset(&sv.sa_mask, SIGALRM); sigaddset(&sv.sa_mask, SIGHUP); sigaddset(&sv.sa_mask, SIGUSR1); sigaddset(&sv.sa_mask, SIGCHLD); sigaddset(&sv.sa_mask, SIGTERM); sv.sa_flags = SA_RESTART; if (sigaction(SIGQUIT, &sv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "main: sigaction: %s", strerror(errno) ); exit(EXITERR_SYS); } /* afpd.conf: not in config file: lockfile, connections, configfile * preference: command-line provides defaults. * config file over-writes defaults. * * we also need to make sure that killing afpd during startup * won't leave any lingering registered names around. */ sigemptyset(&sigs); sigaddset(&sigs, SIGALRM); sigaddset(&sigs, SIGHUP); sigaddset(&sigs, SIGUSR1); #if 0 /* don't block SIGTERM */ sigaddset(&sigs, SIGTERM); #endif sigaddset(&sigs, SIGCHLD); pthread_sigmask(SIG_BLOCK, &sigs, NULL); if (!(configs = configinit(&default_options))) { LOG(log_error, logtype_afpd, "main: no servers configured"); exit(EXITERR_CONF); } pthread_sigmask(SIG_UNBLOCK, &sigs, NULL); /* Register CNID */ cnid_init(); /* watch atp, dsi sockets and ipc parent/child file descriptor. */ if (default_options.flags & OPTION_KEEPSESSIONS) { LOG(log_note, logtype_afpd, "Activating continous service"); disasociated_ipc_fd = ipc_server_uds(_PATH_AFP_IPC); } fd_set_listening_sockets(); /* set limits */ (void)setlimits(); afp_child_t *child; int fd[2]; /* we only use one, but server_child_add expects [2] */ pid_t pid; int saveerrno; /* wait for an appleshare connection. parent remains in the loop * while the children get handled by afp_over_{asp,dsi}. this is * currently vulnerable to a denial-of-service attack if a * connection is made without an actual login attempt being made * afterwards. establishing timeouts for logins is a possible * solution. */ while (1) { LOG(log_maxdebug, logtype_afpd, "main: polling %i fds", fdset_used); pthread_sigmask(SIG_UNBLOCK, &sigs, NULL); ret = poll(fdset, fdset_used, -1); pthread_sigmask(SIG_BLOCK, &sigs, NULL); saveerrno = errno; if (gotsigchld) { gotsigchld = 0; child_handler(); continue; } if (reloadconfig) { nologin++; auth_unload(); fd_reset_listening_sockets(); LOG(log_info, logtype_afpd, "re-reading configuration file"); for (config = configs; config; config = config->next) if (config->server_cleanup) config->server_cleanup(config); /* configfree close atp socket used for DDP tickle, there's an issue * with atp tid. */ configfree(configs, NULL); if (!(configs = configinit(&default_options))) { LOG(log_error, logtype_afpd, "config re-read: no servers configured"); exit(EXITERR_CONF); } fd_set_listening_sockets(); nologin = 0; reloadconfig = 0; errno = saveerrno; continue; } if (ret == 0) continue; if (ret < 0) { if (errno == EINTR) continue; LOG(log_error, logtype_afpd, "main: can't wait for input: %s", strerror(errno)); break; } for (int i = 0; i < fdset_used; i++) { if (fdset[i].revents & (POLLIN | POLLERR | POLLHUP)) { switch (polldata[i].fdtype) { case LISTEN_FD: config = (AFPConfig *)polldata[i].data; /* config->server_start is afp_config.c:dsi_start() for DSI */ if (child = config->server_start(config, configs, server_children)) { /* Add IPC fd to select fd set */ fdset_add_fd(default_options.connections + AFP_LISTENERS + FDSET_SAFETY, &fdset, &polldata, &fdset_used, &fdset_size, child->ipc_fds[0], IPC_FD, child); } break; case IPC_FD: child = (afp_child_t *)polldata[i].data; LOG(log_debug, logtype_afpd, "main: IPC request from child[%u]", child->pid); if (ipc_server_read(server_children, child->ipc_fds[0]) != 0) { fdset_del_fd(&fdset, &polldata, &fdset_used, &fdset_size, child->ipc_fds[0]); close(child->ipc_fds[0]); child->ipc_fds[0] = -1; if ((default_options.flags & OPTION_KEEPSESSIONS) && child->disasociated) { LOG(log_note, logtype_afpd, "main: removing reattached child[%u]", child->pid); server_child_remove(server_children, CHILD_DSIFORK, child->pid); } } break; case DISASOCIATED_IPC_FD: LOG(log_debug, logtype_afpd, "main: IPC reconnect request"); if ((fd[0] = accept(disasociated_ipc_fd, NULL, NULL)) == -1) { LOG(log_error, logtype_afpd, "main: accept: %s", strerror(errno)); break; } if (readt(fd[0], &pid, sizeof(pid_t), 0, 1) != sizeof(pid_t)) { LOG(log_error, logtype_afpd, "main: readt: %s", strerror(errno)); close(fd[0]); break; } LOG(log_note, logtype_afpd, "main: IPC reconnect from pid [%u]", pid); if ((child = server_child_add(server_children, CHILD_DSIFORK, pid, fd)) == NULL) { LOG(log_error, logtype_afpd, "main: server_child_add"); close(fd[0]); break; } child->disasociated = 1; fdset_add_fd(default_options.connections + AFP_LISTENERS + FDSET_SAFETY, &fdset, &polldata, &fdset_used, &fdset_size, fd[0], IPC_FD, child); break; default: LOG(log_debug, logtype_afpd, "main: IPC request for unknown type"); break; } /* switch */ } /* if */ } /* for (i)*/ } /* while (1) */ return 0; } netatalk-2.2.2/etc/afpd/gettok.c0000644000175200017500000000703511655731126013405 00000000000000/* * $Id: gettok.c,v 1.6 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include /* STDC check */ #if STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #include #include #include static char *l_curr; static char *l_end; void initline( int len, char *line) { l_curr = line; l_end = line + len; } #define ST_QUOTE 0 #define ST_WORD 1 #define ST_BEGIN 2 int parseline(int len, char *token) { char *p, *e; int state; state = ST_BEGIN; p = token; e = token + len; for (;;) { if ( l_curr > l_end ) { /* end of line */ *token = '\0'; return( -1 ); } switch ( *l_curr ) { case '"' : if ( state == ST_QUOTE ) { state = ST_WORD; } else { state = ST_QUOTE; } break; case '\0' : case '\t' : case '\n' : case ' ' : if ( state == ST_WORD ) { *p = '\0'; return( p - token ); } if ( state != ST_QUOTE ) { break; } /* FALL THROUGH */ default : if ( state == ST_BEGIN ) { state = ST_WORD; } if ( p > e ) { /* end of token */ *token = '\0'; return( -1 ); } *p++ = *l_curr; break; } l_curr++; } } #ifdef notdef void parseline(char *token, char *user) { char *p = pos, *t = token, *u, *q, buf[ MAXPATHLEN ]; struct passwd *pwent; int quoted = 0; while ( isspace( *p )) { p++; } /* * If we've reached the end of the line, or a comment, * don't return any more tokens. */ if ( *p == '\0' || *p == '#' ) { *token = '\0'; return; } if ( *p == '"' ) { p++; quoted = 1; } while ( *p != '\0' && ( quoted || !isspace( *p ))) { if ( *p == '"' ) { if ( quoted ) { *t = '\0'; break; } quoted = 1; p++; } else { *t++ = *p++; } } pos = p; *t = '\0'; /* * We got to the end of the line without closing an open quote */ if ( *p == '\0' && quoted ) { *token = '\0'; return; } t = token; if ( *t == '~' ) { t++; if ( *t == '\0' || *t == '/' ) { u = user; if ( *t == '/' ) { t++; } } else { u = t; if (( q = strchr( t, '/' )) == NULL ) { t = ""; } else { *q = '\0'; t = q + 1; } } if ( u == NULL || ( pwent = getpwnam( u )) == NULL ) { *token = '\0'; return; } strcpy( buf, pwent->pw_dir ); if ( *t != '\0' ) { strcat( buf, "/" ); strcat( buf, t ); } strcpy( token, buf ); } return; } #endif /* notdef */ netatalk-2.2.2/etc/afpd/volume.h0000644000175200017500000000267411655731126013430 00000000000000/* * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifndef AFPD_VOLUME_H #define AFPD_VOLUME_H 1 #include #include #include #include #include #include #include extern struct vol *getvolbyvid (const u_int16_t); extern int ustatfs_getvolspace (const struct vol *, VolSpace *, VolSpace *, u_int32_t *); extern void setvoltime (AFPObj *, struct vol *); extern int pollvoltime (AFPObj *); extern void load_volumes (AFPObj *obj); extern const struct vol *getvolumes(void); extern void unload_volumes_and_extmap(void); extern void vol_fce_tm_event(void); /* FP functions */ int afp_openvol (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_getvolparams (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_setvolparams (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_getsrvrparms (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_closevol (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); /* netatalk functions */ extern void close_all_vol (void); struct vol *current_vol; /* last volume from getvolbyvid() */ #endif netatalk-2.2.2/etc/afpd/volume.c0000644000175200017500000027070211664665101013421 00000000000000/* * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #ifdef HAVE_STRINGS_H #include #endif /* STDC check */ #if STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef CNID_DB #include #endif /* CNID_DB*/ #include "directory.h" #include "file.h" #include "volume.h" #include "unix.h" #include "mangle.h" #include "fork.h" #include "hash.h" #include "acls.h" extern int afprun(int root, char *cmd, int *outfd); #ifndef MIN #define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif /* ! MIN */ #ifndef UUID_PRINTABLE_STRING_LENGTH #define UUID_PRINTABLE_STRING_LENGTH 37 #endif /* Globals */ struct vol *current_vol; /* last volume from getvolbyvid() */ static struct vol *Volumes = NULL; static u_int16_t lastvid = 0; static char *Trash = "\02\024Network Trash Folder"; static struct extmap *Extmap = NULL, *Defextmap = NULL; static int Extmap_cnt; static void free_extmap(void); #define VOLOPT_ALLOW 0 /* user allow list */ #define VOLOPT_DENY 1 /* user deny list */ #define VOLOPT_RWLIST 2 /* user rw list */ #define VOLOPT_ROLIST 3 /* user ro list */ #define VOLOPT_PASSWORD 4 /* volume password */ #define VOLOPT_CASEFOLD 5 /* character case mangling */ #define VOLOPT_FLAGS 6 /* various flags */ #define VOLOPT_DBPATH 7 /* path to database */ #define VOLOPT_LIMITSIZE 8 /* Limit the size of the volume */ /* Usable slot: 9 */ #define VOLOPT_VETO 10 /* list of veto filespec */ #define VOLOPT_PREEXEC 11 /* preexec command */ #define VOLOPT_ROOTPREEXEC 12 /* root preexec command */ #define VOLOPT_POSTEXEC 13 /* postexec command */ #define VOLOPT_ROOTPOSTEXEC 14 /* root postexec command */ #define VOLOPT_ENCODING 15 /* mac encoding (pre OSX)*/ #define VOLOPT_MACCHARSET 16 #define VOLOPT_CNIDSCHEME 17 #define VOLOPT_ADOUBLE 18 /* adouble version */ #ifdef FORCE_UIDGID #warning UIDGID #include "uid.h" #define VOLOPT_FORCEUID 19 /* force uid for username x */ #define VOLOPT_FORCEGID 20 /* force gid for group x */ #endif /* FORCE_UIDGID */ #define VOLOPT_UMASK 21 #define VOLOPT_ALLOWED_HOSTS 22 #define VOLOPT_DENIED_HOSTS 23 #define VOLOPT_DPERM 24 /* dperm default directories perms */ #define VOLOPT_FPERM 25 /* fperm default files perms */ #define VOLOPT_DFLTPERM 26 /* perm */ #define VOLOPT_EA_VFS 27 /* Extended Attributes vfs indirection */ #define VOLOPT_CNIDSERVER 28 /* CNID Server ip address*/ #define VOLOPT_CNIDPORT 30 /* CNID server tcp port */ #define VOLOPT_MAX 31 /* <== IMPORTANT !!!!!! */ #define VOLOPT_NUM (VOLOPT_MAX + 1) #define VOLPASSLEN 8 #define VOLOPT_DEFAULT ":DEFAULT:" #define VOLOPT_DEFAULT_LEN 9 struct vol_option { char *c_value; int i_value; }; typedef struct _special_folder { const char *name; int precreate; mode_t mode; int hide; } _special_folder; static const _special_folder special_folders[] = { {"Network Trash Folder", 1, 0777, 1}, {"Temporary Items", 1, 0777, 1}, {".AppleDesktop", 1, 0777, 0}, #if 0 {"TheFindByContentFolder", 0, 0, 1}, {"TheVolumeSettingsFolder", 0, 0, 1}, #endif {NULL, 0, 0, 0}}; /* Forward declarations */ static void handle_special_folders (const struct vol *); static void deletevol(struct vol *vol); static void volume_free(struct vol *vol); static void check_ea_sys_support(struct vol *vol); static char *get_vol_uuid(const AFPObj *obj, const char *volname); static int readvolfile(AFPObj *obj, struct afp_volume_name *p1,char *p2, int user, struct passwd *pwent); static void volfree(struct vol_option *options, const struct vol_option *save) { int i; if (save) { for (i = 0; i < VOLOPT_MAX; i++) { if (options[i].c_value && (options[i].c_value != save[i].c_value)) free(options[i].c_value); } } else { for (i = 0; i < VOLOPT_MAX; i++) { if (options[i].c_value) free(options[i].c_value); } } } #define is_var(a, b) (strncmp((a), (b), 2) == 0) /* * Handle variable substitutions. here's what we understand: * $b -> basename of path * $c -> client ip/appletalk address * $d -> volume pathname on server * $f -> full name (whatever's in the gecos field) * $g -> group * $h -> hostname * $i -> client ip/appletalk address without port * $s -> server name (hostname if it doesn't exist) * $u -> username (guest is usually nobody) * $v -> volume name or basename if null * $z -> zone (may not exist) * $$ -> $ * * This get's called from readvolfile with * path = NULL, volname = NULL for xlating the volumes path * path = path, volname = NULL for xlating the volumes name * ... and from volumes options parsing code when xlating eg dbpath with * path = path, volname = volname * * Using this information we can reject xlation of any variable depeninding on a login * context which is not given in the afp master, where we must evaluate this whole stuff * too for the Zeroconf announcements. */ static char *volxlate(AFPObj *obj, char *dest, size_t destlen, char *src, struct passwd *pwd, char *path, char *volname) { char *p, *r; const char *q; int len; char *ret; int afpmaster = 0; int xlatevolname = 0; if (parent_or_child == 0) afpmaster = 1; if (path && !volname) /* cf above */ xlatevolname = 1; if (!src) { return NULL; } if (!dest) { dest = calloc(destlen +1, 1); } ret = dest; if (!ret) { return NULL; } strlcpy(dest, src, destlen +1); if ((p = strchr(src, '$')) == NULL) /* nothing to do */ return ret; /* first part of the path. just forward to the next variable. */ len = MIN((size_t)(p - src), destlen); if (len > 0) { destlen -= len; dest += len; } while (p && destlen > 0) { /* now figure out what the variable is */ q = NULL; if (is_var(p, "$b")) { if (afpmaster && xlatevolname) return NULL; if (path) { if ((q = strrchr(path, '/')) == NULL) q = path; else if (*(q + 1) != '\0') q++; } } else if (is_var(p, "$c")) { if (afpmaster && xlatevolname) return NULL; #ifndef NO_DDP if (obj->proto == AFPPROTO_ASP) { ASP asp = obj->handle; len = sprintf(dest, "%u.%u", ntohs(asp->asp_sat.sat_addr.s_net), asp->asp_sat.sat_addr.s_node); dest += len; destlen -= len; } #endif if (obj->proto == AFPPROTO_DSI) { DSI *dsi = obj->handle; len = sprintf(dest, "%s:%u", getip_string((struct sockaddr *)&dsi->client), getip_port((struct sockaddr *)&dsi->client)); dest += len; destlen -= len; } } else if (is_var(p, "$d")) { if (afpmaster && xlatevolname) return NULL; q = path; } else if (pwd && is_var(p, "$f")) { if (afpmaster && xlatevolname) return NULL; if ((r = strchr(pwd->pw_gecos, ','))) *r = '\0'; q = pwd->pw_gecos; } else if (pwd && is_var(p, "$g")) { if (afpmaster && xlatevolname) return NULL; struct group *grp = getgrgid(pwd->pw_gid); if (grp) q = grp->gr_name; } else if (is_var(p, "$h")) { q = obj->options.hostname; } else if (is_var(p, "$i")) { if (afpmaster && xlatevolname) return NULL; #ifndef NO_DDP if (obj->proto == AFPPROTO_ASP) { ASP asp = obj->handle; len = sprintf(dest, "%u", ntohs(asp->asp_sat.sat_addr.s_net)); dest += len; destlen -= len; } #endif if (obj->proto == AFPPROTO_DSI) { DSI *dsi = obj->handle; q = getip_string((struct sockaddr *)&dsi->client); } } else if (is_var(p, "$s")) { if (obj->Obj) q = obj->Obj; else if (obj->options.server) { q = obj->options.server; } else q = obj->options.hostname; } else if (obj->username && is_var(p, "$u")) { if (afpmaster && xlatevolname) return NULL; char* sep = NULL; if ( obj->options.ntseparator && (sep = strchr(obj->username, obj->options.ntseparator[0])) != NULL) q = sep+1; else q = obj->username; } else if (is_var(p, "$v")) { if (afpmaster && xlatevolname) return NULL; if (volname) { q = volname; } else if (path) { if ((q = strrchr(path, '/')) == NULL) q = path; else if (*(q + 1) != '\0') q++; } } else if (is_var(p, "$z")) { q = obj->Zone; } else if (is_var(p, "$$")) { q = "$"; } else q = p; /* copy the stuff over. if we don't understand something that we * should, just skip it over. */ if (q) { len = MIN(p == q ? 2 : strlen(q), destlen); strncpy(dest, q, len); dest += len; destlen -= len; } /* stuff up to next $ */ src = p + 2; p = strchr(src, '$'); len = p ? MIN((size_t)(p - src), destlen) : destlen; if (len > 0) { strncpy(dest, src, len); dest += len; destlen -= len; } } return ret; } /* to make sure that val is valid, make sure to select an opt that includes val */ static int optionok(const char *buf, const char *opt, const char *val) { if (!strstr(buf,opt)) return 0; if (!val[1]) return 0; return 1; } /* -------------------- */ static void setoption(struct vol_option *options, struct vol_option *save, int opt, const char *val) { if (options[opt].c_value && (!save || options[opt].c_value != save[opt].c_value)) free(options[opt].c_value); options[opt].c_value = strdup(val + 1); } /* ------------------------------------------ handle all the options. tmp can't be NULL. */ static void volset(struct vol_option *options, struct vol_option *save, char *volname, int vlen, const char *tmp) { char *val; val = strchr(tmp, ':'); if (!val) { /* we'll assume it's a volume name. */ strncpy(volname, tmp, vlen); volname[vlen] = 0; return; } #if 0 LOG(log_debug, logtype_afpd, "Parsing volset %s", val); #endif if (optionok(tmp, "allow:", val)) { setoption(options, save, VOLOPT_ALLOW, val); } else if (optionok(tmp, "deny:", val)) { setoption(options, save, VOLOPT_DENY, val); } else if (optionok(tmp, "rwlist:", val)) { setoption(options, save, VOLOPT_RWLIST, val); } else if (optionok(tmp, "rolist:", val)) { setoption(options, save, VOLOPT_ROLIST, val); } else if (optionok(tmp, "codepage:", val)) { LOG (log_error, logtype_afpd, "The old codepage system has been removed. Please make sure to read the documentation !!!!"); /* Make sure we don't screw anything */ exit (EXITERR_CONF); } else if (optionok(tmp, "volcharset:", val)) { setoption(options, save, VOLOPT_ENCODING, val); } else if (optionok(tmp, "maccharset:", val)) { setoption(options, save, VOLOPT_MACCHARSET, val); } else if (optionok(tmp, "veto:", val)) { setoption(options, save, VOLOPT_VETO, val); } else if (optionok(tmp, "cnidscheme:", val)) { setoption(options, save, VOLOPT_CNIDSCHEME, val); } else if (optionok(tmp, "casefold:", val)) { if (strcasecmp(val + 1, "tolower") == 0) options[VOLOPT_CASEFOLD].i_value = AFPVOL_UMLOWER; else if (strcasecmp(val + 1, "toupper") == 0) options[VOLOPT_CASEFOLD].i_value = AFPVOL_UMUPPER; else if (strcasecmp(val + 1, "xlatelower") == 0) options[VOLOPT_CASEFOLD].i_value = AFPVOL_UUPPERMLOWER; else if (strcasecmp(val + 1, "xlateupper") == 0) options[VOLOPT_CASEFOLD].i_value = AFPVOL_ULOWERMUPPER; } else if (optionok(tmp, "adouble:", val)) { if (strcasecmp(val + 1, "v1") == 0) options[VOLOPT_ADOUBLE].i_value = AD_VERSION1; #if AD_VERSION == AD_VERSION2 else if (strcasecmp(val + 1, "v2") == 0) options[VOLOPT_ADOUBLE].i_value = AD_VERSION2; else if (strcasecmp(val + 1, "osx") == 0) options[VOLOPT_ADOUBLE].i_value = AD_VERSION2_OSX; else if (strcasecmp(val + 1, "sfm") == 0) options[VOLOPT_ADOUBLE].i_value = AD_VERSION1_SFM; #endif } else if (optionok(tmp, "options:", val)) { char *p; if ((p = strtok(val + 1, ",")) == NULL) /* nothing */ return; while (p) { if (strcasecmp(p, "prodos") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_A2VOL; else if (strcasecmp(p, "mswindows") == 0) { options[VOLOPT_FLAGS].i_value |= AFPVOL_MSWINDOWS | AFPVOL_USEDOTS; } else if (strcasecmp(p, "crlf") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_CRLF; else if (strcasecmp(p, "noadouble") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_NOADOUBLE; else if (strcasecmp(p, "ro") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_RO; else if (strcasecmp(p, "nohex") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_NOHEX; else if (strcasecmp(p, "usedots") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_USEDOTS; else if (strcasecmp(p, "invisibledots") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_USEDOTS | AFPVOL_INV_DOTS; else if (strcasecmp(p, "limitsize") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_LIMITSIZE; /* support for either "dropbox" or "dropkludge" */ else if (strcasecmp(p, "dropbox") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_DROPBOX; else if (strcasecmp(p, "dropkludge") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_DROPBOX; else if (strcasecmp(p, "nofileid") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_NOFILEID; else if (strcasecmp(p, "nostat") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_NOSTAT; else if (strcasecmp(p, "preexec_close") == 0) options[VOLOPT_PREEXEC].i_value = 1; else if (strcasecmp(p, "root_preexec_close") == 0) options[VOLOPT_ROOTPREEXEC].i_value = 1; else if (strcasecmp(p, "upriv") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_UNIX_PRIV; else if (strcasecmp(p, "nodev") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_NODEV; else if (strcasecmp(p, "caseinsensitive") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_CASEINSEN; else if (strcasecmp(p, "illegalseq") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_EILSEQ; else if (strcasecmp(p, "nocnidcache") == 0) options[VOLOPT_FLAGS].i_value &= ~AFPVOL_CACHE; else if (strcasecmp(p, "tm") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_TM; else if (strcasecmp(p, "searchdb") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_SEARCHDB; else if (strcasecmp(p, "nonetids") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_NONETIDS; else if (strcasecmp(p, "noacls") == 0) options[VOLOPT_FLAGS].i_value &= ~AFPVOL_ACLS; p = strtok(NULL, ","); } } else if (optionok(tmp, "cnidserver:", val)) { setoption(options, save, VOLOPT_CNIDSERVER, val); char *p = strrchr(val + 1, ':'); if (p) { *p = 0; setoption(options, save, VOLOPT_CNIDPORT, p); } LOG(log_debug, logtype_afpd, "CNID Server for volume '%s': %s:%s", volname, val + 1, p ? p + 1 : Cnid_port); } else if (optionok(tmp, "dbpath:", val)) { setoption(options, save, VOLOPT_DBPATH, val); } else if (optionok(tmp, "umask:", val)) { options[VOLOPT_UMASK].i_value = (int)strtol(val +1, NULL, 8); } else if (optionok(tmp, "dperm:", val)) { options[VOLOPT_DPERM].i_value = (int)strtol(val+1, NULL, 8); } else if (optionok(tmp, "fperm:", val)) { options[VOLOPT_FPERM].i_value = (int)strtol(val+1, NULL, 8); } else if (optionok(tmp, "perm:", val)) { options[VOLOPT_DFLTPERM].i_value = (int)strtol(val+1, NULL, 8); } else if (optionok(tmp, "password:", val)) { setoption(options, save, VOLOPT_PASSWORD, val); #ifdef FORCE_UIDGID /* this code allows forced uid/gid per volume settings */ } else if (optionok(tmp, "forceuid:", val)) { setoption(options, save, VOLOPT_FORCEUID, val); } else if (optionok(tmp, "forcegid:", val)) { setoption(options, save, VOLOPT_FORCEGID, val); #endif /* FORCE_UIDGID */ } else if (optionok(tmp, "root_preexec:", val)) { setoption(options, save, VOLOPT_ROOTPREEXEC, val); } else if (optionok(tmp, "preexec:", val)) { setoption(options, save, VOLOPT_PREEXEC, val); } else if (optionok(tmp, "root_postexec:", val)) { setoption(options, save, VOLOPT_ROOTPOSTEXEC, val); } else if (optionok(tmp, "postexec:", val)) { setoption(options, save, VOLOPT_POSTEXEC, val); } else if (optionok(tmp, "allowed_hosts:", val)) { setoption(options, save, VOLOPT_ALLOWED_HOSTS, val); } else if (optionok(tmp, "denied_hosts:", val)) { setoption(options, save, VOLOPT_DENIED_HOSTS, val); } else if (optionok(tmp, "ea:", val)) { if (strcasecmp(val + 1, "ad") == 0) options[VOLOPT_EA_VFS].i_value = AFPVOL_EA_AD; else if (strcasecmp(val + 1, "sys") == 0) options[VOLOPT_EA_VFS].i_value = AFPVOL_EA_SYS; else if (strcasecmp(val + 1, "none") == 0) options[VOLOPT_EA_VFS].i_value = AFPVOL_EA_NONE; } else if (optionok(tmp, "volsizelimit:", val)) { options[VOLOPT_LIMITSIZE].i_value = (uint32_t)strtoul(val + 1, NULL, 10); } else { /* ignore unknown options */ LOG(log_debug, logtype_afpd, "ignoring unknown volume option: %s", tmp); } } /* ----------------- */ static void showvol(const ucs2_t *name) { struct vol *volume; for ( volume = Volumes; volume; volume = volume->v_next ) { if (volume->v_hide && !strcasecmp_w( volume->v_name, name ) ) { volume->v_hide = 0; return; } } } /* ------------------------------- */ static int creatvol(AFPObj *obj, struct passwd *pwd, char *path, char *name, struct vol_option *options, const int user /* user defined volume */ ) { struct vol *volume; int suffixlen, vlen, tmpvlen, u8mvlen, macvlen; int hide = 0; char tmpname[AFPVOL_U8MNAMELEN+1]; ucs2_t u8mtmpname[(AFPVOL_U8MNAMELEN+1)*2], mactmpname[(AFPVOL_MACNAMELEN+1)*2]; char suffix[6]; /* max is #FFFF */ u_int16_t flags; LOG(log_debug, logtype_afpd, "createvol: Volume '%s'", name); if ( name == NULL || *name == '\0' ) { if ((name = strrchr( path, '/' )) == NULL) { return -1; /* Obviously not a fully qualified path */ } /* if you wish to share /, you need to specify a name. */ if (*++name == '\0') return -1; } /* suffix for mangling use (lastvid + 1) */ /* because v_vid has not been decided yet. */ suffixlen = sprintf(suffix, "%c%X", MANGLE_CHAR, lastvid + 1 ); vlen = strlen( name ); /* Unicode Volume Name */ /* Firstly convert name from unixcharset to UTF8-MAC */ flags = CONV_IGNORE; tmpvlen = convert_charset(obj->options.unixcharset, CH_UTF8_MAC, 0, name, vlen, tmpname, AFPVOL_U8MNAMELEN, &flags); if (tmpvlen <= 0) { strcpy(tmpname, "???"); tmpvlen = 3; } /* Do we have to mangle ? */ if ( (flags & CONV_REQMANGLE) || (tmpvlen > obj->options.volnamelen)) { if (tmpvlen + suffixlen > obj->options.volnamelen) { flags = CONV_FORCE; tmpvlen = convert_charset(obj->options.unixcharset, CH_UTF8_MAC, 0, name, vlen, tmpname, obj->options.volnamelen - suffixlen, &flags); tmpname[tmpvlen >= 0 ? tmpvlen : 0] = 0; } strcat(tmpname, suffix); tmpvlen = strlen(tmpname); } /* Secondly convert name from UTF8-MAC to UCS2 */ if ( 0 >= ( u8mvlen = convert_string(CH_UTF8_MAC, CH_UCS2, tmpname, tmpvlen, u8mtmpname, AFPVOL_U8MNAMELEN*2)) ) return -1; LOG(log_maxdebug, logtype_afpd, "createvol: Volume '%s' -> UTF8-MAC Name: '%s'", name, tmpname); /* Maccharset Volume Name */ /* Firsty convert name from unixcharset to maccharset */ flags = CONV_IGNORE; tmpvlen = convert_charset(obj->options.unixcharset, obj->options.maccharset, 0, name, vlen, tmpname, AFPVOL_U8MNAMELEN, &flags); if (tmpvlen <= 0) { strcpy(tmpname, "???"); tmpvlen = 3; } /* Do we have to mangle ? */ if ( (flags & CONV_REQMANGLE) || (tmpvlen > AFPVOL_MACNAMELEN)) { if (tmpvlen + suffixlen > AFPVOL_MACNAMELEN) { flags = CONV_FORCE; tmpvlen = convert_charset(obj->options.unixcharset, obj->options.maccharset, 0, name, vlen, tmpname, AFPVOL_MACNAMELEN - suffixlen, &flags); tmpname[tmpvlen >= 0 ? tmpvlen : 0] = 0; } strcat(tmpname, suffix); tmpvlen = strlen(tmpname); } /* Secondly convert name from maccharset to UCS2 */ if ( 0 >= ( macvlen = convert_string(obj->options.maccharset, CH_UCS2, tmpname, tmpvlen, mactmpname, AFPVOL_U8MNAMELEN*2)) ) return -1; LOG(log_maxdebug, logtype_afpd, "createvol: Volume '%s' -> Longname: '%s'", name, tmpname); /* check duplicate */ for ( volume = Volumes; volume; volume = volume->v_next ) { if ((utf8_encoding() && (strcasecmp_w(volume->v_u8mname, u8mtmpname) == 0)) || (!utf8_encoding() && (strcasecmp_w(volume->v_macname, mactmpname) == 0))) { LOG (log_error, logtype_afpd, "Duplicate volume name, check AppleVolumes files: previous: \"%s\", new: \"%s\"", volume->v_localname, name); if (volume->v_deleted) { volume->v_new = hide = 1; } else { return -1; /* Won't be able to access it, anyway... */ } } } if (!( volume = (struct vol *)calloc(1, sizeof( struct vol ))) ) { LOG(log_error, logtype_afpd, "creatvol: malloc: %s", strerror(errno) ); return -1; } if ( NULL == ( volume->v_localname = strdup(name))) { LOG(log_error, logtype_afpd, "creatvol: malloc: %s", strerror(errno) ); free(volume); return -1; } if ( NULL == ( volume->v_u8mname = strdup_w(u8mtmpname))) { LOG(log_error, logtype_afpd, "creatvol: malloc: %s", strerror(errno) ); volume_free(volume); free(volume); return -1; } if ( NULL == ( volume->v_macname = strdup_w(mactmpname))) { LOG(log_error, logtype_afpd, "creatvol: malloc: %s", strerror(errno) ); volume_free(volume); free(volume); return -1; } if (!( volume->v_path = (char *)malloc( strlen( path ) + 1 )) ) { LOG(log_error, logtype_afpd, "creatvol: malloc: %s", strerror(errno) ); volume_free(volume); free(volume); return -1; } volume->v_name = utf8_encoding()?volume->v_u8mname:volume->v_macname; volume->v_hide = hide; strcpy( volume->v_path, path ); #ifdef __svr4__ volume->v_qfd = -1; #endif /* __svr4__ */ /* os X start at 1 and use network order ie. 1 2 3 */ volume->v_vid = ++lastvid; volume->v_vid = htons(volume->v_vid); #ifdef HAVE_ACLS if (!check_vol_acl_support(volume)) { LOG(log_debug, logtype_afpd, "creatvol(\"%s\"): disabling ACL support", volume->v_path); options[VOLOPT_FLAGS].i_value &= ~AFPVOL_ACLS; } #endif /* handle options */ if (options) { volume->v_casefold = options[VOLOPT_CASEFOLD].i_value; volume->v_flags |= options[VOLOPT_FLAGS].i_value; if (options[VOLOPT_EA_VFS].i_value) volume->v_vfs_ea = options[VOLOPT_EA_VFS].i_value; volume->v_ad_options = 0; if ((volume->v_flags & AFPVOL_NODEV)) volume->v_ad_options |= ADVOL_NODEV; if ((volume->v_flags & AFPVOL_CACHE)) volume->v_ad_options |= ADVOL_CACHE; if ((volume->v_flags & AFPVOL_UNIX_PRIV)) volume->v_ad_options |= ADVOL_UNIXPRIV; if ((volume->v_flags & AFPVOL_INV_DOTS)) volume->v_ad_options |= ADVOL_INVDOTS; if ((volume->v_flags & AFPVOL_NOADOUBLE)) volume->v_ad_options |= ADVOL_NOADOUBLE; if (options[VOLOPT_PASSWORD].c_value) volume->v_password = strdup(options[VOLOPT_PASSWORD].c_value); if (options[VOLOPT_VETO].c_value) volume->v_veto = strdup(options[VOLOPT_VETO].c_value); if (options[VOLOPT_ENCODING].c_value) volume->v_volcodepage = strdup(options[VOLOPT_ENCODING].c_value); if (options[VOLOPT_MACCHARSET].c_value) volume->v_maccodepage = strdup(options[VOLOPT_MACCHARSET].c_value); if (options[VOLOPT_DBPATH].c_value) volume->v_dbpath = volxlate(obj, NULL, MAXPATHLEN, options[VOLOPT_DBPATH].c_value, pwd, path, name); if (options[VOLOPT_CNIDSCHEME].c_value) volume->v_cnidscheme = strdup(options[VOLOPT_CNIDSCHEME].c_value); if (options[VOLOPT_CNIDSERVER].c_value) volume->v_cnidserver = strdup(options[VOLOPT_CNIDSERVER].c_value); if (options[VOLOPT_CNIDPORT].c_value) volume->v_cnidport = strdup(options[VOLOPT_CNIDPORT].c_value); if (options[VOLOPT_UMASK].i_value) volume->v_umask = (mode_t)options[VOLOPT_UMASK].i_value; if (options[VOLOPT_DPERM].i_value) volume->v_dperm = (mode_t)options[VOLOPT_DPERM].i_value; if (options[VOLOPT_FPERM].i_value) volume->v_fperm = (mode_t)options[VOLOPT_FPERM].i_value; if (options[VOLOPT_DFLTPERM].i_value) volume->v_perm = (mode_t)options[VOLOPT_DFLTPERM].i_value; if (options[VOLOPT_ADOUBLE].i_value) volume->v_adouble = options[VOLOPT_ADOUBLE].i_value; else volume->v_adouble = AD_VERSION; if (options[VOLOPT_LIMITSIZE].i_value) volume->v_limitsize = options[VOLOPT_LIMITSIZE].i_value; /* Mac to Unix conversion flags*/ volume->v_mtou_flags = 0; if (!(volume->v_flags & AFPVOL_NOHEX)) volume->v_mtou_flags |= CONV_ESCAPEHEX; if (!(volume->v_flags & AFPVOL_USEDOTS)) volume->v_mtou_flags |= CONV_ESCAPEDOTS; if ((volume->v_flags & AFPVOL_EILSEQ)) volume->v_mtou_flags |= CONV__EILSEQ; if ((volume->v_casefold & AFPVOL_MTOUUPPER)) volume->v_mtou_flags |= CONV_TOUPPER; else if ((volume->v_casefold & AFPVOL_MTOULOWER)) volume->v_mtou_flags |= CONV_TOLOWER; /* Unix to Mac conversion flags*/ volume->v_utom_flags = CONV_IGNORE | CONV_UNESCAPEHEX; if ((volume->v_casefold & AFPVOL_UTOMUPPER)) volume->v_utom_flags |= CONV_TOUPPER; else if ((volume->v_casefold & AFPVOL_UTOMLOWER)) volume->v_utom_flags |= CONV_TOLOWER; if ((volume->v_flags & AFPVOL_EILSEQ)) volume->v_utom_flags |= CONV__EILSEQ; #ifdef FORCE_UIDGID if (options[VOLOPT_FORCEUID].c_value) { volume->v_forceuid = strdup(options[VOLOPT_FORCEUID].c_value); } else { volume->v_forceuid = NULL; /* set as null so as to return 0 later on */ } if (options[VOLOPT_FORCEGID].c_value) { volume->v_forcegid = strdup(options[VOLOPT_FORCEGID].c_value); } else { volume->v_forcegid = NULL; /* set as null so as to return 0 later on */ } #endif if (!user) { if (options[VOLOPT_PREEXEC].c_value) volume->v_preexec = volxlate(obj, NULL, MAXPATHLEN, options[VOLOPT_PREEXEC].c_value, pwd, path, name); volume->v_preexec_close = options[VOLOPT_PREEXEC].i_value; if (options[VOLOPT_POSTEXEC].c_value) volume->v_postexec = volxlate(obj, NULL, MAXPATHLEN, options[VOLOPT_POSTEXEC].c_value, pwd, path, name); if (options[VOLOPT_ROOTPREEXEC].c_value) volume->v_root_preexec = volxlate(obj, NULL, MAXPATHLEN, options[VOLOPT_ROOTPREEXEC].c_value, pwd, path, name); volume->v_root_preexec_close = options[VOLOPT_ROOTPREEXEC].i_value; if (options[VOLOPT_ROOTPOSTEXEC].c_value) volume->v_root_postexec = volxlate(obj, NULL, MAXPATHLEN, options[VOLOPT_ROOTPOSTEXEC].c_value, pwd, path, name); } } volume->v_dperm |= volume->v_perm; volume->v_fperm |= volume->v_perm; /* Check EA support on volume */ if (volume->v_vfs_ea == AFPVOL_EA_AUTO) check_ea_sys_support(volume); initvol_vfs(volume); /* get/store uuid from file in afpd master*/ if ((parent_or_child == 0) && (volume->v_flags & AFPVOL_TM)) { char *uuid = get_vol_uuid(obj, volume->v_localname); if (!uuid) { LOG(log_error, logtype_afpd, "Volume '%s': couldn't get UUID", volume->v_localname); } else { volume->v_uuid = uuid; LOG(log_debug, logtype_afpd, "Volume '%s': UUID '%s'", volume->v_localname, volume->v_uuid); } } volume->v_next = Volumes; Volumes = volume; return 0; } /* ---------------- */ static char *myfgets( char *buf, int size, FILE *fp) { char *p; int c; p = buf; while ((EOF != ( c = getc( fp )) ) && ( size > 1 )) { if ( c == '\n' || c == '\r' ) { if (p != buf && *(p -1) == '\\') { p--; size++; continue; } *p++ = '\n'; break; } else { *p++ = c; } size--; } if ( p == buf ) { return( NULL ); } else { *p = '\0'; return( buf ); } } /* check access list. this function wants something of the following * form: * @group,name,name2,@group2,name3 * * a NULL argument allows everybody to have access. * we return three things: * -1: no list * 0: list exists, but name isn't in it * 1: in list */ #ifndef NO_REAL_USER_NAME /* authentication is case insensitive * FIXME should we do the same with group name? */ #define access_strcmp strcasecmp #else #define access_strcmp strcmp #endif static int accessvol(const char *args, const char *name) { char buf[MAXPATHLEN + 1], *p; struct group *gr; if (!args) return -1; strlcpy(buf, args, sizeof(buf)); if ((p = strtok(buf, ",")) == NULL) /* nothing, return okay */ return -1; while (p) { if (*p == '@') { /* it's a group */ if ((gr = getgrnam(p + 1)) && gmem(gr->gr_gid)) return 1; } else if (access_strcmp(p, name) == 0) /* it's a user name */ return 1; p = strtok(NULL, ","); } return 0; } static int hostaccessvol(int type, const char *volname, const char *args, const AFPObj *obj) { int mask_int; char buf[MAXPATHLEN + 1], *p, *b; DSI *dsi = obj->handle; struct sockaddr_storage client; if (!args) return -1; strlcpy(buf, args, sizeof(buf)); if ((p = strtok_r(buf, ",", &b)) == NULL) /* nothing, return okay */ return -1; if (obj->proto != AFPPROTO_DSI) return -1; while (p) { int ret; char *ipaddr, *mask_char; struct addrinfo hints, *ai; ipaddr = strtok(p, "/"); mask_char = strtok(NULL,"/"); /* Get address from string with getaddrinfo */ memset(&hints, 0, sizeof hints); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; if ((ret = getaddrinfo(ipaddr, NULL, &hints, &ai)) != 0) { LOG(log_error, logtype_afpd, "hostaccessvol: getaddrinfo: %s\n", gai_strerror(ret)); continue; } /* netmask */ if (mask_char != NULL) mask_int = atoi(mask_char); /* apply_ip_mask does range checking on it */ else { if (ai->ai_family == AF_INET) /* IPv4 */ mask_int = 32; else /* IPv6 */ mask_int = 128; } /* Apply mask to addresses */ client = dsi->client; apply_ip_mask((struct sockaddr *)&client, mask_int); apply_ip_mask(ai->ai_addr, mask_int); if (compare_ip((struct sockaddr *)&client, ai->ai_addr) == 0) { if (type == VOLOPT_DENIED_HOSTS) LOG(log_info, logtype_afpd, "AFP access denied for client IP '%s' to volume '%s' by denied list", getip_string((struct sockaddr *)&client), volname); freeaddrinfo(ai); return 1; } /* next address */ freeaddrinfo(ai); p = strtok_r(NULL, ",", &b); } if (type == VOLOPT_ALLOWED_HOSTS) LOG(log_info, logtype_afpd, "AFP access denied for client IP '%s' to volume '%s', not in allowed list", getip_string((struct sockaddr *)&dsi->client), volname); return 0; } static void setextmap(char *ext, char *type, char *creator, int user) { struct extmap *em; int cnt; if (Extmap == NULL) { if (( Extmap = calloc(1, sizeof( struct extmap ))) == NULL ) { LOG(log_error, logtype_afpd, "setextmap: calloc: %s", strerror(errno) ); return; } } ext++; for ( em = Extmap, cnt = 0; em->em_ext; em++, cnt++) { if ( (strdiacasecmp( em->em_ext, ext )) == 0 ) { break; } } if ( em->em_ext == NULL ) { if (!(Extmap = realloc( Extmap, sizeof( struct extmap ) * (cnt +2))) ) { LOG(log_error, logtype_afpd, "setextmap: realloc: %s", strerror(errno) ); return; } (Extmap +cnt +1)->em_ext = NULL; em = Extmap +cnt; } else if ( !user ) { return; } if (em->em_ext) free(em->em_ext); if (!(em->em_ext = strdup( ext))) { LOG(log_error, logtype_afpd, "setextmap: strdup: %s", strerror(errno) ); return; } if ( *type == '\0' ) { memcpy(em->em_type, "\0\0\0\0", sizeof( em->em_type )); } else { memcpy(em->em_type, type, sizeof( em->em_type )); } if ( *creator == '\0' ) { memcpy(em->em_creator, "\0\0\0\0", sizeof( em->em_creator )); } else { memcpy(em->em_creator, creator, sizeof( em->em_creator )); } } /* -------------------------- */ static int extmap_cmp(const void *map1, const void *map2) { const struct extmap *em1 = map1; const struct extmap *em2 = map2; return strdiacasecmp(em1->em_ext, em2->em_ext); } static void sortextmap( void) { struct extmap *em; Extmap_cnt = 0; if ((em = Extmap) == NULL) { return; } while (em->em_ext) { em++; Extmap_cnt++; } if (Extmap_cnt) { qsort(Extmap, Extmap_cnt, sizeof(struct extmap), extmap_cmp); if (*Extmap->em_ext == 0) { /* the first line is really "." the default entry, * we remove the leading '.' in setextmap */ Defextmap = Extmap; } } } /* ---------------------- */ static void free_extmap( void) { struct extmap *em; if (Extmap) { for ( em = Extmap; em->em_ext; em++) { free (em->em_ext); } free(Extmap); Extmap = NULL; Defextmap = Extmap; Extmap_cnt = 0; } } /* ---------------------- */ static int volfile_changed(struct afp_volume_name *p) { struct stat st; char *name; if (p->full_name) name = p->full_name; else name = p->name; if (!stat( name, &st) && st.st_mtime > p->mtime) { p->mtime = st.st_mtime; return 1; } return 0; } /* ---------------------- * Read a volume configuration file and add the volumes contained within to * the global volume list. This gets called from the forked afpd childs. * The master now reads this too for Zeroconf announcements. * * If p2 is non-NULL, the file that is opened is * p1/p2 * * Lines that begin with # and blank lines are ignored. * Volume lines are of the form: * [] [allow:,<@group>,...] \ * [codepage:] [casefold:] * TYPE [CREATOR] * */ static int readvolfile(AFPObj *obj, struct afp_volume_name *p1, char *p2, int user, struct passwd *pwent) { FILE *fp; char path[MAXPATHLEN + 1]; char tmp[MAXPATHLEN + 1]; char volname[AFPVOL_U8MNAMELEN + 1]; char buf[BUFSIZ]; char type[5], creator[5]; char *u, *p; int fd; int i; struct passwd *pw; struct vol_option save_options[VOLOPT_NUM]; struct vol_option default_options[VOLOPT_NUM]; struct vol_option options[VOLOPT_NUM]; struct stat st; if (!p1->name) return -1; p1->mtime = 0; strcpy( path, p1->name ); if ( p2 != NULL ) { strcat( path, "/" ); strcat( path, p2 ); if (p1->full_name) { free(p1->full_name); } p1->full_name = strdup(path); } if (NULL == ( fp = fopen( path, "r" )) ) { return( -1 ); } fd = fileno(fp); if (fd != -1 && !fstat( fd, &st) ) { p1->mtime = st.st_mtime; } /* try putting a read lock on the volume file twice, sleep 1 second if first attempt fails */ int retries = 2; while (1) { if ((read_lock(fd, 0, SEEK_SET, 0)) != 0) { retries--; if (!retries) { LOG(log_error, logtype_afpd, "readvolfile: can't lock volume file \"%s\"", path); if ( fclose( fp ) != 0 ) { LOG(log_error, logtype_afpd, "readvolfile: fclose: %s", strerror(errno) ); } return -1; } sleep(1); continue; } break; } memset(default_options, 0, sizeof(default_options)); /* Enable some default options for all volumes */ default_options[VOLOPT_FLAGS].i_value |= AFPVOL_CACHE; #ifdef HAVE_ACLS default_options[VOLOPT_FLAGS].i_value |= AFPVOL_ACLS; #endif default_options[VOLOPT_EA_VFS].i_value = AFPVOL_EA_AUTO; LOG(log_maxdebug, logtype_afpd, "readvolfile: seeding default umask: %04o", obj->options.umask); default_options[VOLOPT_UMASK].i_value = obj->options.umask; memcpy(save_options, default_options, sizeof(options)); LOG(log_debug, logtype_afpd, "readvolfile: \"%s\"", path); while ( myfgets( buf, sizeof( buf ), fp ) != NULL ) { initline( strlen( buf ), buf ); parseline( sizeof( path ) - 1, path ); switch ( *path ) { case '\0' : case '#' : continue; case ':': /* change the default options for this file */ if (strncmp(path, VOLOPT_DEFAULT, VOLOPT_DEFAULT_LEN) == 0) { volfree(default_options, save_options); memcpy(default_options, save_options, sizeof(options)); *tmp = '\0'; for (i = 0; i < VOLOPT_NUM; i++) { if (parseline( sizeof( path ) - VOLOPT_DEFAULT_LEN - 1, path + VOLOPT_DEFAULT_LEN) < 0) break; volset(default_options, NULL, tmp, sizeof(tmp) - 1, path + VOLOPT_DEFAULT_LEN); } } break; case '~' : if (( p = strchr( path, '/' )) != NULL ) { *p++ = '\0'; } u = path; u++; if ( *u == '\0' ) { u = obj->username; } if ( u == NULL || *u == '\0' || ( pw = getpwnam( u )) == NULL ) { continue; } strcpy( tmp, pw->pw_dir ); if ( p != NULL && *p != '\0' ) { strcat( tmp, "/" ); strcat( tmp, p ); } /* fall through */ case '/' : /* send path through variable substitution */ if (*path != '~') /* need to copy path to tmp */ strcpy(tmp, path); if (!pwent && obj->username) pwent = getpwnam(obj->username); if (volxlate(obj, path, sizeof(path) - 1, tmp, pwent, NULL, NULL) == NULL) continue; /* this is sort of braindead. basically, i want to be * able to specify things in any order, but i don't want to * re-write everything. */ memcpy(options, default_options, sizeof(options)); *volname = '\0'; /* read in up to VOLOP_NUM possible options */ for (i = 0; i < VOLOPT_NUM; i++) { if (parseline( sizeof( tmp ) - 1, tmp ) < 0) break; volset(options, default_options, volname, sizeof(volname) - 1, tmp); } /* check allow/deny lists (if not afpd master loading volumes for Zeroconf reg.): allow -> either no list (-1), or in list (1) deny -> either no list (-1), or not in list (0) */ if (parent_or_child == 0 || (accessvol(options[VOLOPT_ALLOW].c_value, obj->username) && (accessvol(options[VOLOPT_DENY].c_value, obj->username) < 1) && hostaccessvol(VOLOPT_ALLOWED_HOSTS, volname, options[VOLOPT_ALLOWED_HOSTS].c_value, obj) && (hostaccessvol(VOLOPT_DENIED_HOSTS, volname, options[VOLOPT_DENIED_HOSTS].c_value, obj) < 1))) { /* handle read-only behaviour. semantics: * 1) neither the rolist nor the rwlist exist -> rw * 2) rolist exists -> ro if user is in it. * 3) rwlist exists -> ro unless user is in it. */ if (parent_or_child == 1 && ((options[VOLOPT_FLAGS].i_value & AFPVOL_RO) == 0) && ((accessvol(options[VOLOPT_ROLIST].c_value, obj->username) == 1) || !accessvol(options[VOLOPT_RWLIST].c_value, obj->username))) options[VOLOPT_FLAGS].i_value |= AFPVOL_RO; /* do variable substitution for volname */ if (volxlate(obj, tmp, sizeof(tmp) - 1, volname, pwent, path, NULL) == NULL) continue; creatvol(obj, pwent, path, tmp, options, p2 != NULL); } volfree(options, default_options); break; case '.' : parseline( sizeof( type ) - 1, type ); parseline( sizeof( creator ) - 1, creator ); setextmap( path, type, creator, user); break; default : break; } } volfree(save_options, NULL); sortextmap(); if ( fclose( fp ) != 0 ) { LOG(log_error, logtype_afpd, "readvolfile: fclose: %s", strerror(errno) ); } p1->loaded = 1; return( 0 ); } /* ------------------------------- */ static void volume_free(struct vol *vol) { free(vol->v_localname); vol->v_localname = NULL; free(vol->v_u8mname); vol->v_u8mname = NULL; free(vol->v_macname); vol->v_macname = NULL; free(vol->v_path); free(vol->v_password); free(vol->v_veto); free(vol->v_volcodepage); free(vol->v_maccodepage); free(vol->v_cnidscheme); free(vol->v_dbpath); free(vol->v_gvs); #ifdef FORCE_UIDGID free(vol->v_forceuid); free(vol->v_forcegid); #endif /* FORCE_UIDGID */ if (vol->v_uuid) free(vol->v_uuid); } /* ------------------------------- */ static void free_volumes(void ) { struct vol *vol; struct vol *nvol, *ovol; for ( vol = Volumes; vol; vol = vol->v_next ) { if (( vol->v_flags & AFPVOL_OPEN ) ) { vol->v_deleted = 1; continue; } volume_free(vol); } for ( vol = Volumes, ovol = NULL; vol; vol = nvol) { nvol = vol->v_next; if (vol->v_localname == NULL) { if (Volumes == vol) { Volumes = nvol; ovol = Volumes; } else { ovol->v_next = nvol; } free(vol); } else { ovol = vol; } } } /* ------------------------------- */ static void volume_unlink(struct vol *volume) { struct vol *vol, *ovol, *nvol; if (volume == Volumes) { Volumes = Volumes->v_next; return; } for ( vol = Volumes->v_next, ovol = Volumes; vol; vol = nvol) { nvol = vol->v_next; if (vol == volume) { ovol->v_next = nvol; break; } else { ovol = vol; } } } /*! * Read band-size info from Info.plist XML file of an TM sparsebundle * * @param path (r) path to Info.plist file * @return band-size in bytes, -1 on error */ static long long int get_tm_bandsize(const char *path) { EC_INIT; FILE *file = NULL; char buf[512]; long long int bandsize = -1; EC_NULL_LOGSTR( file = fopen(path, "r"), "get_tm_bandsize(\"%s\"): %s", path, strerror(errno) ); while (fgets(buf, sizeof(buf), file) != NULL) { if (strstr(buf, "band-size") == NULL) continue; if (fscanf(file, " %lld", &bandsize) != 1) { LOG(log_error, logtype_afpd, "get_tm_bandsize(\"%s\"): can't parse band-size", path); EC_FAIL; } break; } EC_CLEANUP: if (file) fclose(file); LOG(log_debug, logtype_afpd, "get_tm_bandsize(\"%s\"): bandsize: %lld", path, bandsize); return bandsize; } /*! * Return number on entries in a directory * * @param path (r) path to dir * @return number of entries, -1 on error */ static long long int get_tm_bands(const char *path) { EC_INIT; long long int count = 0; DIR *dir = NULL; const struct dirent *entry; EC_NULL( dir = opendir(path) ); while ((entry = readdir(dir)) != NULL) count++; count -= 2; /* All OSens I'm aware of return "." and "..", so just substract them, avoiding string comparison in loop */ EC_CLEANUP: if (dir) closedir(dir); if (ret != 0) return -1; return count; } /*! * Calculate used size of a TimeMachine volume * * This assumes that the volume is used only for TimeMachine. * * 1) readdir(path of volume) * 2) for every element that matches regex "\(.*\)\.sparsebundle$" : * 3) parse "\1.sparsebundle/Info.plist" and read the band-size XML key integer value * 4) readdir "\1.sparsebundle/bands/" counting files * 5) calculate used size as: (file_count - 1) * band-size * * The result of the calculation is returned in "volume->v_tm_used". * "volume->v_appended" gets reset to 0. * "volume->v_tm_cachetime" is updated with the current time from time(NULL). * * "volume->v_tm_used" is cached for TM_USED_CACHETIME seconds and updated by * "volume->v_appended". The latter is increased by X every time the client * appends X bytes to a file (in fork.c). * * @param vol (rw) volume to calculate * @return 0 on success, -1 on error */ #define TM_USED_CACHETIME 60 /* cache for 60 seconds */ static int get_tm_used(struct vol * restrict vol) { EC_INIT; long long int bandsize; VolSpace used = 0; bstring infoplist = NULL; bstring bandsdir = NULL; DIR *dir = NULL; const struct dirent *entry; const char *p; struct stat st; long int links; time_t now = time(NULL); if (vol->v_tm_cachetime && ((vol->v_tm_cachetime + TM_USED_CACHETIME) >= now)) { if (vol->v_tm_used == -1) EC_FAIL; vol->v_tm_used += vol->v_appended; vol->v_appended = 0; LOG(log_debug, logtype_afpd, "getused(\"%s\"): cached: %" PRIu64 " bytes", vol->v_path, vol->v_tm_used); return 0; } vol->v_tm_cachetime = now; EC_NULL( dir = opendir(vol->v_path) ); while ((entry = readdir(dir)) != NULL) { if (((p = strstr(entry->d_name, "sparsebundle")) != NULL) && (strlen(entry->d_name) == (p + strlen("sparsebundle") - entry->d_name))) { EC_NULL_LOG( infoplist = bformat("%s/%s/%s", vol->v_path, entry->d_name, "Info.plist") ); if ((bandsize = get_tm_bandsize(cfrombstr(infoplist))) == -1) continue; EC_NULL_LOG( bandsdir = bformat("%s/%s/%s/", vol->v_path, entry->d_name, "bands") ); if ((links = get_tm_bands(cfrombstr(bandsdir))) == -1) continue; used += (links - 1) * bandsize; LOG(log_debug, logtype_afpd, "getused(\"%s\"): bands: %" PRIu64 " bytes", cfrombstr(bandsdir), used); } } vol->v_tm_used = used; EC_CLEANUP: if (infoplist) bdestroy(infoplist); if (bandsdir) bdestroy(bandsdir); if (dir) closedir(dir); LOG(log_debug, logtype_afpd, "getused(\"%s\"): %" PRIu64 " bytes", vol->v_path, vol->v_tm_used); EC_EXIT; } static int getvolspace(struct vol *vol, u_int32_t *bfree, u_int32_t *btotal, VolSpace *xbfree, VolSpace *xbtotal, u_int32_t *bsize) { int spaceflag, rc; u_int32_t maxsize; VolSpace used; #ifndef NO_QUOTA_SUPPORT VolSpace qfree, qtotal; #endif spaceflag = AFPVOL_GVSMASK & vol->v_flags; /* report up to 2GB if afp version is < 2.2 (4GB if not) */ maxsize = (vol->v_flags & AFPVOL_A2VOL) ? 0x01fffe00 : (((afp_version < 22) || (vol->v_flags & AFPVOL_LIMITSIZE)) ? 0x7fffffffL : 0xffffffffL); #ifdef AFS if ( spaceflag == AFPVOL_NONE || spaceflag == AFPVOL_AFSGVS ) { if ( afs_getvolspace( vol, xbfree, xbtotal, bsize ) == AFP_OK ) { vol->v_flags = ( ~AFPVOL_GVSMASK & vol->v_flags ) | AFPVOL_AFSGVS; goto getvolspace_done; } } #endif if (( rc = ustatfs_getvolspace( vol, xbfree, xbtotal, bsize)) != AFP_OK ) { return( rc ); } #ifndef NO_QUOTA_SUPPORT if ( spaceflag == AFPVOL_NONE || spaceflag == AFPVOL_UQUOTA ) { if ( uquota_getvolspace( vol, &qfree, &qtotal, *bsize ) == AFP_OK ) { vol->v_flags = ( ~AFPVOL_GVSMASK & vol->v_flags ) | AFPVOL_UQUOTA; *xbfree = MIN(*xbfree, qfree); *xbtotal = MIN(*xbtotal, qtotal); goto getvolspace_done; } } #endif vol->v_flags = ( ~AFPVOL_GVSMASK & vol->v_flags ) | AFPVOL_USTATFS; getvolspace_done: if (vol->v_limitsize) { if (get_tm_used(vol) != 0) return AFPERR_MISC; *xbtotal = MIN(*xbtotal, (vol->v_limitsize * 1024 * 1024)); *xbfree = MIN(*xbfree, *xbtotal < vol->v_tm_used ? 0 : *xbtotal - vol->v_tm_used); LOG(log_debug, logtype_afpd, "volparams: total: %" PRIu64 ", used: %" PRIu64 ", free: %" PRIu64 " bytes", *xbtotal, vol->v_tm_used, *xbfree); } *bfree = MIN(*xbfree, maxsize); *btotal = MIN(*xbtotal, maxsize); return( AFP_OK ); } #define FCE_TM_DELTA 10 /* send notification every 10 seconds */ void vol_fce_tm_event(void) { static time_t last; time_t now = time(NULL); struct vol *vol = Volumes; if ((last + FCE_TM_DELTA) < now) { last = now; for ( ; vol; vol = vol->v_next ) { if (vol->v_flags & AFPVOL_TM) (void)fce_register_tm_size(vol->v_path, vol->v_tm_used + vol->v_appended); } } } /* ----------------------- * set volume creation date * avoid duplicate, well at least it tries */ static void vol_setdate(u_int16_t id, struct adouble *adp, time_t date) { struct vol *volume; struct vol *vol = Volumes; for ( volume = Volumes; volume; volume = volume->v_next ) { if (volume->v_vid == id) { vol = volume; } else if ((time_t)(AD_DATE_FROM_UNIX(date)) == volume->v_ctime) { date = date+1; volume = Volumes; /* restart */ } } vol->v_ctime = AD_DATE_FROM_UNIX(date); ad_setdate(adp, AD_DATE_CREATE | AD_DATE_UNIX, date); } /* ----------------------- */ static int getvolparams( u_int16_t bitmap, struct vol *vol, struct stat *st, char *buf, size_t *buflen) { struct adouble ad; int bit = 0, isad = 1; u_int32_t aint; u_short ashort; u_int32_t bfree, btotal, bsize; VolSpace xbfree, xbtotal; /* extended bytes */ char *data, *nameoff = NULL; char *slash; LOG(log_debug, logtype_afpd, "getvolparams: Volume '%s'", vol->v_localname); /* courtesy of jallison@whistle.com: * For MacOS8.x support we need to create the * .Parent file here if it doesn't exist. */ ad_init(&ad, vol->v_adouble, vol->v_ad_options); if ( ad_open_metadata( vol->v_path, ADFLAGS_DIR, O_CREAT, &ad) < 0 ) { isad = 0; vol->v_ctime = AD_DATE_FROM_UNIX(st->st_mtime); } else if (ad_get_MD_flags( &ad ) & O_CREAT) { slash = strrchr( vol->v_path, '/' ); if(slash) slash++; else slash = vol->v_path; if (ad_getentryoff(&ad, ADEID_NAME)) { ad_setentrylen( &ad, ADEID_NAME, strlen( slash )); memcpy(ad_entry( &ad, ADEID_NAME ), slash, ad_getentrylen( &ad, ADEID_NAME )); } vol_setdate(vol->v_vid, &ad, st->st_mtime); ad_flush(&ad); } else { if (ad_getdate(&ad, AD_DATE_CREATE, &aint) < 0) vol->v_ctime = AD_DATE_FROM_UNIX(st->st_mtime); else vol->v_ctime = aint; } if (( bitmap & ( (1<>1; bit++; } switch ( bit ) { case VOLPBIT_ATTR : ashort = 0; /* check for read-only. * NOTE: we don't actually set the read-only flag unless * it's passed in that way as it's possible to mount * a read-write filesystem under a read-only one. */ if ((vol->v_flags & AFPVOL_RO) || ((utime(vol->v_path, NULL) < 0) && (errno == EROFS))) { ashort |= VOLPBIT_ATTR_RO; } /* prior 2.1 only VOLPBIT_ATTR_RO is defined */ if (afp_version > 20) { if (0 == (vol->v_flags & AFPVOL_NOFILEID) && vol->v_cdb != NULL && (vol->v_cdb->flags & CNID_FLAG_PERSISTENT)) { ashort |= VOLPBIT_ATTR_FILEID; } ashort |= VOLPBIT_ATTR_CATSEARCH; if (afp_version >= 30) { ashort |= VOLPBIT_ATTR_UTF8; if (vol->v_flags & AFPVOL_UNIX_PRIV) ashort |= VOLPBIT_ATTR_UNIXPRIV; if (vol->v_flags & AFPVOL_TM) ashort |= VOLPBIT_ATTR_TM; if (vol->v_flags & AFPVOL_NONETIDS) ashort |= VOLPBIT_ATTR_NONETIDS; if (afp_version >= 32) { if (vol->v_vfs_ea) ashort |= VOLPBIT_ATTR_EXT_ATTRS; if (vol->v_flags & AFPVOL_ACLS) ashort |= VOLPBIT_ATTR_ACLS; } } } ashort = htons(ashort); memcpy(data, &ashort, sizeof( ashort )); data += sizeof( ashort ); break; case VOLPBIT_SIG : ashort = htons( AFPVOLSIG_DEFAULT ); memcpy(data, &ashort, sizeof( ashort )); data += sizeof( ashort ); break; case VOLPBIT_CDATE : aint = vol->v_ctime; memcpy(data, &aint, sizeof( aint )); data += sizeof( aint ); break; case VOLPBIT_MDATE : if ( st->st_mtime > vol->v_mtime ) { vol->v_mtime = st->st_mtime; } aint = AD_DATE_FROM_UNIX(vol->v_mtime); memcpy(data, &aint, sizeof( aint )); data += sizeof( aint ); break; case VOLPBIT_BDATE : if (!isad || (ad_getdate(&ad, AD_DATE_BACKUP, &aint) < 0)) aint = AD_DATE_START; memcpy(data, &aint, sizeof( aint )); data += sizeof( aint ); break; case VOLPBIT_VID : memcpy(data, &vol->v_vid, sizeof( vol->v_vid )); data += sizeof( vol->v_vid ); break; case VOLPBIT_BFREE : bfree = htonl( bfree ); memcpy(data, &bfree, sizeof( bfree )); data += sizeof( bfree ); break; case VOLPBIT_BTOTAL : btotal = htonl( btotal ); memcpy(data, &btotal, sizeof( btotal )); data += sizeof( btotal ); break; #ifndef NO_LARGE_VOL_SUPPORT case VOLPBIT_XBFREE : xbfree = hton64( xbfree ); #if defined(__GNUC__) && defined(HAVE_GCC_MEMCPY_BUG) bcopy(&xbfree, data, sizeof(xbfree)); #else /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */ memcpy(data, &xbfree, sizeof( xbfree )); #endif /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */ data += sizeof( xbfree ); break; case VOLPBIT_XBTOTAL : xbtotal = hton64( xbtotal ); #if defined(__GNUC__) && defined(HAVE_GCC_MEMCPY_BUG) bcopy(&xbtotal, data, sizeof(xbtotal)); #else /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */ memcpy(data, &xbtotal, sizeof( xbtotal )); #endif /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */ data += sizeof( xbfree ); break; #endif /* ! NO_LARGE_VOL_SUPPORT */ case VOLPBIT_NAME : nameoff = data; data += sizeof( u_int16_t ); break; case VOLPBIT_BSIZE: /* block size */ bsize = htonl(bsize); memcpy(data, &bsize, sizeof(bsize)); data += sizeof(bsize); break; default : if ( isad ) { ad_close( &ad, ADFLAGS_HF ); } return( AFPERR_BITMAP ); } bitmap = bitmap>>1; bit++; } if ( nameoff ) { ashort = htons( data - buf ); memcpy(nameoff, &ashort, sizeof( ashort )); /* name is always in mac charset */ aint = ucs2_to_charset( vol->v_maccharset, vol->v_macname, data+1, AFPVOL_MACNAMELEN + 1); if ( aint <= 0 ) { *buflen = 0; return AFPERR_MISC; } *data++ = aint; data += aint; } if ( isad ) { ad_close_metadata( &ad); } *buflen = data - buf; return( AFP_OK ); } /* ------------------------- */ static int stat_vol(u_int16_t bitmap, struct vol *vol, char *rbuf, size_t *rbuflen) { struct stat st; int ret; size_t buflen; if ( stat( vol->v_path, &st ) < 0 ) { *rbuflen = 0; return( AFPERR_PARAM ); } /* save the volume device number */ vol->v_dev = st.st_dev; buflen = *rbuflen - sizeof( bitmap ); if (( ret = getvolparams( bitmap, vol, &st, rbuf + sizeof( bitmap ), &buflen )) != AFP_OK ) { *rbuflen = 0; return( ret ); } *rbuflen = buflen + sizeof( bitmap ); bitmap = htons( bitmap ); memcpy(rbuf, &bitmap, sizeof( bitmap )); return( AFP_OK ); } /* ------------------------------- */ void load_volumes(AFPObj *obj) { struct passwd *pwent; if (Volumes) { int changed = 0; /* check files date */ if (obj->options.defaultvol.loaded) { changed = volfile_changed(&obj->options.defaultvol); } if (obj->options.systemvol.loaded) { changed |= volfile_changed(&obj->options.systemvol); } if (obj->options.uservol.loaded) { changed |= volfile_changed(&obj->options.uservol); } if (!changed) return; free_extmap(); free_volumes(); } if (parent_or_child == 0) { LOG(log_debug, logtype_afpd, "load_volumes: AFP MASTER"); } else { LOG(log_debug, logtype_afpd, "load_volumes: user: %s", obj->username); } pwent = getpwnam(obj->username); if ( (obj->options.flags & OPTION_USERVOLFIRST) == 0 ) { readvolfile(obj, &obj->options.systemvol, NULL, 0, pwent); } if ((*obj->username == '\0') || (obj->options.flags & OPTION_NOUSERVOL)) { readvolfile(obj, &obj->options.defaultvol, NULL, 1, pwent); } else if (pwent) { /* * Read user's AppleVolumes or .AppleVolumes file * If neither are readable, read the default volumes file. if * that doesn't work, create a user share. */ if (obj->options.uservol.name) { free(obj->options.uservol.name); } obj->options.uservol.name = strdup(pwent->pw_dir); if ( readvolfile(obj, &obj->options.uservol, "AppleVolumes", 1, pwent) < 0 && readvolfile(obj, &obj->options.uservol, ".AppleVolumes", 1, pwent) < 0 && readvolfile(obj, &obj->options.uservol, "applevolumes", 1, pwent) < 0 && readvolfile(obj, &obj->options.uservol, ".applevolumes", 1, pwent) < 0 && obj->options.defaultvol.name != NULL ) { if (readvolfile(obj, &obj->options.defaultvol, NULL, 1, pwent) < 0) creatvol(obj, pwent, pwent->pw_dir, NULL, NULL, 1); } } if ( obj->options.flags & OPTION_USERVOLFIRST ) { readvolfile(obj, &obj->options.systemvol, NULL, 0, pwent ); } if ( obj->options.closevol ) { struct vol *vol; for ( vol = Volumes; vol; vol = vol->v_next ) { if (vol->v_deleted && !vol->v_new ) { of_closevol(vol); deletevol(vol); vol = Volumes; } } } } /* ------------------------------- */ int afp_getsrvrparms(AFPObj *obj, char *ibuf _U_, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct timeval tv; struct stat st; struct vol *volume; char *data; char *namebuf; int vcnt; size_t len; load_volumes(obj); data = rbuf + 5; for ( vcnt = 0, volume = Volumes; volume; volume = volume->v_next ) { if (!(volume->v_flags & AFPVOL_NOSTAT)) { struct maccess ma; if ( stat( volume->v_path, &st ) < 0 ) { LOG(log_info, logtype_afpd, "afp_getsrvrparms(%s): stat: %s", volume->v_path, strerror(errno) ); continue; /* can't access directory */ } if (!S_ISDIR(st.st_mode)) { continue; /* not a dir */ } accessmode(volume, volume->v_path, &ma, NULL, &st); if ((ma.ma_user & (AR_UREAD | AR_USEARCH)) != (AR_UREAD | AR_USEARCH)) { continue; /* no r-x access */ } } if (volume->v_hide) { continue; /* config file changed but the volume was mounted */ } if (utf8_encoding()) { len = ucs2_to_charset_allocate(CH_UTF8_MAC, &namebuf, volume->v_u8mname); } else { len = ucs2_to_charset_allocate(obj->options.maccharset, &namebuf, volume->v_macname); } if (len == (size_t)-1) continue; /* set password bit if there's a volume password */ *data = (volume->v_password) ? AFPSRVR_PASSWD : 0; /* Apple 2 clients running ProDOS-8 expect one volume to have bit 0 of this byte set. They will not recognize anything on the server unless this is the case. I have not completely worked this out, but it's related to booting from the server. Support for that function is a ways off.. */ *data |= (volume->v_flags & AFPVOL_A2VOL) ? AFPSRVR_CONFIGINFO : 0; *data++ |= 0; /* UNIX PRIVS BIT ..., OSX doesn't seem to use it, so we don't either */ *data++ = len; memcpy(data, namebuf, len ); data += len; free(namebuf); vcnt++; } *rbuflen = data - rbuf; data = rbuf; if ( gettimeofday( &tv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "afp_getsrvrparms(%s): gettimeofday: %s", volume->v_path, strerror(errno) ); *rbuflen = 0; return AFPERR_PARAM; } tv.tv_sec = AD_DATE_FROM_UNIX(tv.tv_sec); memcpy(data, &tv.tv_sec, sizeof( u_int32_t)); data += sizeof( u_int32_t); *data = vcnt; return( AFP_OK ); } /* ------------------------- */ static int volume_codepage(AFPObj *obj, struct vol *volume) { struct charset_functions *charset; /* Codepages */ if (!volume->v_volcodepage) volume->v_volcodepage = strdup("UTF8"); if ( (charset_t) -1 == ( volume->v_volcharset = add_charset(volume->v_volcodepage)) ) { LOG (log_error, logtype_afpd, "Setting codepage %s as volume codepage failed", volume->v_volcodepage); return -1; } if ( NULL == (charset = find_charset_functions(volume->v_volcodepage)) || charset->flags & CHARSET_ICONV ) { LOG (log_warning, logtype_afpd, "WARNING: volume encoding %s is *not* supported by netatalk, expect problems !!!!", volume->v_volcodepage); } if (!volume->v_maccodepage) volume->v_maccodepage = strdup(obj->options.maccodepage); if ( (charset_t) -1 == ( volume->v_maccharset = add_charset(volume->v_maccodepage)) ) { LOG (log_error, logtype_afpd, "Setting codepage %s as mac codepage failed", volume->v_maccodepage); return -1; } if ( NULL == ( charset = find_charset_functions(volume->v_maccodepage)) || ! (charset->flags & CHARSET_CLIENT) ) { LOG (log_error, logtype_afpd, "Fatal error: mac charset %s not supported", volume->v_maccodepage); return -1; } volume->v_kTextEncoding = htonl(charset->kTextEncoding); return 0; } /* ------------------------- */ static int volume_openDB(struct vol *volume) { int flags = 0; if ((volume->v_flags & AFPVOL_NODEV)) { flags |= CNID_FLAG_NODEV; } if (volume->v_cnidscheme == NULL) { volume->v_cnidscheme = strdup(DEFAULT_CNID_SCHEME); LOG(log_info, logtype_afpd, "Volume %s use CNID scheme %s.", volume->v_path, volume->v_cnidscheme); } LOG(log_info, logtype_afpd, "CNID server: %s:%s", volume->v_cnidserver ? volume->v_cnidserver : Cnid_srv, volume->v_cnidport ? volume->v_cnidport : Cnid_port); #if 0 /* Found this in branch dir-rewrite, maybe we want to use it sometimes */ /* Legacy pre 2.1 way of sharing eg CD-ROM */ if (strcmp(volume->v_cnidscheme, "last") == 0) { /* "last" is gone. We support it by switching to in-memory "tdb" */ volume->v_cnidscheme = strdup("tdb"); flags |= CNID_FLAG_MEMORY; } /* New way of sharing CD-ROM */ if (volume->v_flags & AFPVOL_CDROM) { flags |= CNID_FLAG_MEMORY; if (strcmp(volume->v_cnidscheme, "tdb") != 0) { free(volume->v_cnidscheme); volume->v_cnidscheme = strdup("tdb"); LOG(log_info, logtype_afpd, "Volume %s is ejectable, switching to scheme %s.", volume->v_path, volume->v_cnidscheme); } } #endif volume->v_cdb = cnid_open(volume->v_path, volume->v_umask, volume->v_cnidscheme, flags, volume->v_cnidserver ? volume->v_cnidserver : Cnid_srv, volume->v_cnidport ? volume->v_cnidport : Cnid_port); if ( ! volume->v_cdb && ! (flags & CNID_FLAG_MEMORY)) { /* The first attempt failed and it wasn't yet an attempt to open in-memory */ LOG(log_error, logtype_afpd, "Can't open volume \"%s\" CNID backend \"%s\" ", volume->v_path, volume->v_cnidscheme); LOG(log_error, logtype_afpd, "Reopen volume %s using in memory temporary CNID DB.", volume->v_path); flags |= CNID_FLAG_MEMORY; volume->v_cdb = cnid_open (volume->v_path, volume->v_umask, "tdb", flags, NULL, NULL); #ifdef SERVERTEXT /* kill ourself with SIGUSR2 aka msg pending */ if (volume->v_cdb) { setmessage("Something wrong with the volume's CNID DB, using temporary CNID DB instead." "Check server messages for details!"); kill(getpid(), SIGUSR2); /* deactivate cnid caching/storing in AppleDouble files */ volume->v_flags &= ~AFPVOL_CACHE; } #endif } return (!volume->v_cdb)?-1:0; } /* Check if the underlying filesystem supports EAs for ea:sys volumes. If not, switch to ea:ad. As we can't check (requires write access) on ro-volumes, we switch ea:auto volumes that are options:ro to ea:none. */ static void check_ea_sys_support(struct vol *vol) { uid_t process_uid = 0; char eaname[] = {"org.netatalk.supports-eas.XXXXXX"}; const char *eacontent = "yes"; if (vol->v_vfs_ea == AFPVOL_EA_AUTO) { if ((vol->v_flags & AFPVOL_RO) == AFPVOL_RO) { LOG(log_info, logtype_afpd, "read-only volume '%s', can't test for EA support, disabling EAs", vol->v_localname); vol->v_vfs_ea = AFPVOL_EA_NONE; return; } mktemp(eaname); process_uid = geteuid(); if (process_uid) if (seteuid(0) == -1) { LOG(log_error, logtype_afpd, "check_ea_sys_support: can't seteuid(0): %s", strerror(errno)); exit(EXITERR_SYS); } if ((sys_setxattr(vol->v_path, eaname, eacontent, 4, 0)) == 0) { sys_removexattr(vol->v_path, eaname); vol->v_vfs_ea = AFPVOL_EA_SYS; } else { LOG(log_warning, logtype_afpd, "volume \"%s\" does not support Extended Attributes, using ea:ad instead", vol->v_localname); vol->v_vfs_ea = AFPVOL_EA_AD; } if (process_uid) { if (seteuid(process_uid) == -1) { LOG(log_error, logtype_afpd, "can't seteuid back %s", strerror(errno)); exit(EXITERR_SYS); } } } } /* ------------------------- * we are the user here */ int afp_openvol(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct stat st; char *volname; char *p; struct vol *volume; struct dir *dir; int len, ret; size_t namelen; u_int16_t bitmap; char path[ MAXPATHLEN + 1]; char *vol_uname; char *vol_mname; char *volname_tmp; ibuf += 2; memcpy(&bitmap, ibuf, sizeof( bitmap )); bitmap = ntohs( bitmap ); ibuf += sizeof( bitmap ); *rbuflen = 0; if (( bitmap & (1<oldtmp; if ((volname_tmp = strchr(volname,'+')) != NULL) volname = volname_tmp+1; if (utf8_encoding()) { namelen = convert_string(CH_UTF8_MAC, CH_UCS2, ibuf, len, volname, sizeof(obj->oldtmp)); } else { namelen = convert_string(obj->options.maccharset, CH_UCS2, ibuf, len, volname, sizeof(obj->oldtmp)); } if ( namelen <= 0) { return AFPERR_PARAM; } ibuf += len; if ((len + 1) & 1) /* pad to an even boundary */ ibuf++; load_volumes(obj); for ( volume = Volumes; volume; volume = volume->v_next ) { if ( strcasecmp_w( (ucs2_t*) volname, volume->v_name ) == 0 ) { break; } } if ( volume == NULL ) { return AFPERR_PARAM; } /* check for a volume password */ if (volume->v_password && strncmp(ibuf, volume->v_password, VOLPASSLEN)) { return AFPERR_ACCESS; } if (( volume->v_flags & AFPVOL_OPEN ) ) { /* the volume is already open */ #ifdef FORCE_UIDGID set_uidgid ( volume ); #endif return stat_vol(bitmap, volume, rbuf, rbuflen); } if (volume->v_root_preexec) { if ((ret = afprun(1, volume->v_root_preexec, NULL)) && volume->v_root_preexec_close) { LOG(log_error, logtype_afpd, "afp_openvol(%s): root preexec : %d", volume->v_path, ret ); return AFPERR_MISC; } } #ifdef FORCE_UIDGID set_uidgid ( volume ); #endif if (volume->v_preexec) { if ((ret = afprun(0, volume->v_preexec, NULL)) && volume->v_preexec_close) { LOG(log_error, logtype_afpd, "afp_openvol(%s): preexec : %d", volume->v_path, ret ); return AFPERR_MISC; } } if ( stat( volume->v_path, &st ) < 0 ) { return AFPERR_PARAM; } if ( chdir( volume->v_path ) < 0 ) { return AFPERR_PARAM; } if ( NULL == getcwd(path, MAXPATHLEN)) { /* shouldn't be fatal but it will fail later */ LOG(log_error, logtype_afpd, "afp_openvol(%s): volume pathlen too long", volume->v_path); return AFPERR_MISC; } /* Normalize volume path */ #ifdef REALPATH_TAKES_NULL if ((volume->v_path = realpath(path, NULL)) == NULL) return AFPERR_MISC; #else if ((volume->v_path = malloc(MAXPATHLEN+1)) == NULL) return AFPERR_MISC; if (realpath(path, volume->v_path) == NULL) { free(volume->v_path); return AFPERR_MISC; } /* Safe some memory */ char *tmp; if ((tmp = strdup(volume->v_path)) == NULL) { free(volume->v_path); return AFPERR_MISC; } free(volume->v_path); volume->v_path = tmp; #endif if (volume_codepage(obj, volume) < 0) { ret = AFPERR_MISC; goto openvol_err; } /* initialize volume variables * FIXME file size */ if (utf8_encoding()) { volume->max_filename = UTF8FILELEN_EARLY; } else { volume->max_filename = MACFILELEN; } volume->v_flags |= AFPVOL_OPEN; volume->v_cdb = NULL; if (utf8_encoding()) { len = convert_string_allocate(CH_UCS2, CH_UTF8_MAC, volume->v_u8mname, namelen, &vol_mname); } else { len = convert_string_allocate(CH_UCS2, obj->options.maccharset, volume->v_macname, namelen, &vol_mname); } if ( !vol_mname || len <= 0) { ret = AFPERR_MISC; goto openvol_err; } if ((vol_uname = strrchr(path, '/')) == NULL) vol_uname = path; else if (*(vol_uname + 1) != '\0') vol_uname++; if ((dir = dir_new(vol_mname, vol_uname, volume, DIRDID_ROOT_PARENT, DIRDID_ROOT, bfromcstr(volume->v_path), &st) ) == NULL) { free(vol_mname); LOG(log_error, logtype_afpd, "afp_openvol(%s): malloc: %s", volume->v_path, strerror(errno) ); ret = AFPERR_MISC; goto openvol_err; } free(vol_mname); volume->v_root = dir; curdir = dir; if (volume_openDB(volume) < 0) { LOG(log_error, logtype_afpd, "Fatal error: cannot open CNID or invalid CNID backend for %s: %s", volume->v_path, volume->v_cnidscheme); ret = AFPERR_MISC; goto openvol_err; } ret = stat_vol(bitmap, volume, rbuf, rbuflen); if (ret == AFP_OK) { handle_special_folders(volume); savevolinfo(volume, volume->v_cnidserver ? volume->v_cnidserver : Cnid_srv, volume->v_cnidport ? volume->v_cnidport : Cnid_port); /* * If you mount a volume twice, the second time the trash appears on * the desk-top. That's because the Mac remembers the DID for the * trash (even for volumes in different zones, on different servers). * Just so this works better, we prime the DID cache with the trash, * fixing the trash at DID 17. * FIXME (RL): should it be done inside a CNID backend ? (always returning Trash DID when asked) ? */ if ((volume->v_cdb->flags & CNID_FLAG_PERSISTENT)) { /* FIXME find db time stamp */ if (cnid_getstamp(volume->v_cdb, volume->v_stamp, sizeof(volume->v_stamp)) < 0) { LOG (log_error, logtype_afpd, "afp_openvol(%s): Fatal error: Unable to get stamp value from CNID backend", volume->v_path); ret = AFPERR_MISC; goto openvol_err; } } else { p = Trash; cname( volume, volume->v_root, &p ); } return( AFP_OK ); } openvol_err: if (volume->v_root) { dir_free( volume->v_root ); volume->v_root = NULL; } volume->v_flags &= ~AFPVOL_OPEN; if (volume->v_cdb != NULL) { cnid_close(volume->v_cdb); volume->v_cdb = NULL; } *rbuflen = 0; return ret; } /* ------------------------- */ static void closevol(struct vol *vol) { if (!vol) return; dir_free( vol->v_root ); vol->v_root = NULL; if (vol->v_cdb != NULL) { cnid_close(vol->v_cdb); vol->v_cdb = NULL; } if (vol->v_postexec) { afprun(0, vol->v_postexec, NULL); } if (vol->v_root_postexec) { afprun(1, vol->v_root_postexec, NULL); } } /* ------------------------- */ void close_all_vol(void) { struct vol *ovol; curdir = NULL; for ( ovol = Volumes; ovol; ovol = ovol->v_next ) { if ( (ovol->v_flags & AFPVOL_OPEN) ) { ovol->v_flags &= ~AFPVOL_OPEN; closevol(ovol); } } } /* ------------------------- */ static void deletevol(struct vol *vol) { struct vol *ovol; vol->v_flags &= ~AFPVOL_OPEN; for ( ovol = Volumes; ovol; ovol = ovol->v_next ) { if ( (ovol->v_flags & AFPVOL_OPEN) ) { break; } } if ( ovol != NULL ) { /* Even if chdir fails, we can't say afp_closevol fails. */ if ( chdir( ovol->v_path ) == 0 ) { curdir = ovol->v_root; } } closevol(vol); if (vol->v_deleted) { showvol(vol->v_name); volume_free(vol); volume_unlink(vol); free(vol); } } /* ------------------------- */ int afp_closevol(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *vol; u_int16_t vid; *rbuflen = 0; ibuf += 2; memcpy(&vid, ibuf, sizeof( vid )); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } deletevol(vol); current_vol = NULL; return( AFP_OK ); } /* ------------------------- */ struct vol *getvolbyvid(const u_int16_t vid ) { struct vol *vol; for ( vol = Volumes; vol; vol = vol->v_next ) { if ( vid == vol->v_vid ) { break; } } if ( vol == NULL || ( vol->v_flags & AFPVOL_OPEN ) == 0 ) { return( NULL ); } #ifdef FORCE_UIDGID set_uidgid ( vol ); #endif /* FORCE_UIDGID */ current_vol = vol; return( vol ); } /* ------------------------ */ static int ext_cmp_key(const void *key, const void *obj) { const char *p = key; const struct extmap *em = obj; return strdiacasecmp(p, em->em_ext); } struct extmap *getextmap(const char *path) { char *p; struct extmap *em; if (!Extmap_cnt || NULL == ( p = strrchr( path, '.' )) ) { return( Defextmap ); } p++; if (!*p) { return( Defextmap ); } em = bsearch(p, Extmap, Extmap_cnt, sizeof(struct extmap), ext_cmp_key); if (em) { return( em ); } else { return( Defextmap ); } } /* ------------------------- */ struct extmap *getdefextmap(void) { return( Defextmap ); } /* -------------------------- poll if a volume is changed by other processes. return 0 no attention msg sent 1 attention msg sent -1 error (socket closed) Note: if attention return -1 no packet has been sent because the buffer is full, we don't care either there's no reader or there's a lot of traffic and another pollvoltime will follow */ int pollvoltime(AFPObj *obj) { struct vol *vol; struct timeval tv; struct stat st; if (!(afp_version > 21 && obj->options.server_notif)) return 0; if ( gettimeofday( &tv, NULL ) < 0 ) return 0; for ( vol = Volumes; vol; vol = vol->v_next ) { if ( (vol->v_flags & AFPVOL_OPEN) && vol->v_mtime + 30 < tv.tv_sec) { if ( !stat( vol->v_path, &st ) && vol->v_mtime != st.st_mtime ) { vol->v_mtime = st.st_mtime; if (!obj->attention(obj->handle, AFPATTN_NOTIFY | AFPATTN_VOLCHANGED)) return -1; return 1; } } } return 0; } /* ------------------------- */ void setvoltime(AFPObj *obj, struct vol *vol) { struct timeval tv; if ( gettimeofday( &tv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "setvoltime(%s): gettimeofday: %s", vol->v_path, strerror(errno) ); return; } if( utime( vol->v_path, NULL ) < 0 ) { /* write of time failed ... probably a read only filesys, * where no other users can interfere, so there's no issue here */ } /* a little granularity */ if (vol->v_mtime < tv.tv_sec) { vol->v_mtime = tv.tv_sec; /* or finder doesn't update free space * AFP 3.2 and above clients seem to be ok without so many notification */ if (afp_version < 32 && obj->options.server_notif) { obj->attention(obj->handle, AFPATTN_NOTIFY | AFPATTN_VOLCHANGED); } } } /* ------------------------- */ int afp_getvolparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_,char *rbuf, size_t *rbuflen) { struct vol *vol; u_int16_t vid, bitmap; ibuf += 2; memcpy(&vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); memcpy(&bitmap, ibuf, sizeof( bitmap )); bitmap = ntohs( bitmap ); if (NULL == ( vol = getvolbyvid( vid )) ) { *rbuflen = 0; return( AFPERR_PARAM ); } return stat_vol(bitmap, vol, rbuf, rbuflen); } /* ------------------------- */ int afp_setvolparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct adouble ad; struct vol *vol; u_int16_t vid, bitmap; u_int32_t aint; ibuf += 2; *rbuflen = 0; memcpy(&vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); memcpy(&bitmap, ibuf, sizeof( bitmap )); bitmap = ntohs( bitmap ); ibuf += sizeof(bitmap); if (( vol = getvolbyvid( vid )) == NULL ) { return( AFPERR_PARAM ); } if ((vol->v_flags & AFPVOL_RO)) return AFPERR_VLOCK; /* we can only set the backup date. */ if (bitmap != (1 << VOLPBIT_BDATE)) return AFPERR_BITMAP; ad_init(&ad, vol->v_adouble, vol->v_ad_options); if ( ad_open( vol->v_path, ADFLAGS_HF|ADFLAGS_DIR, O_RDWR, 0666, &ad) < 0 ) { if (errno == EROFS) return AFPERR_VLOCK; return AFPERR_ACCESS; } memcpy(&aint, ibuf, sizeof(aint)); ad_setdate(&ad, AD_DATE_BACKUP, aint); ad_flush(&ad); ad_close(&ad, ADFLAGS_HF); return( AFP_OK ); } /* ------------------------- */ int wincheck(const struct vol *vol, const char *path) { int len; if (!(vol->v_flags & AFPVOL_MSWINDOWS)) return 1; /* empty paths are not allowed */ if ((len = strlen(path)) == 0) return 0; /* leading or trailing whitespaces are not allowed, carriage returns * and probably other whitespace is okay, tabs are not allowed */ if ((path[0] == ' ') || (path[len-1] == ' ')) return 0; /* certain characters are not allowed */ if (strpbrk(path, MSWINDOWS_BADCHARS)) return 0; /* everything else is okay */ return 1; } /* * precreate a folder * this is only intended for folders in the volume root * It will *not* work if the folder name contains extended characters */ static int create_special_folder (const struct vol *vol, const struct _special_folder *folder) { char *p,*q,*r; struct adouble ad; u_int16_t attr; struct stat st; int ret; p = (char *) malloc ( strlen(vol->v_path)+strlen(folder->name)+2); if ( p == NULL) { LOG(log_error, logtype_afpd,"malloc failed"); exit (EXITERR_SYS); } q=strdup(folder->name); if ( q == NULL) { LOG(log_error, logtype_afpd,"malloc failed"); exit (EXITERR_SYS); } strcpy(p, vol->v_path); strcat(p, "/"); r=q; while (*r) { if ((vol->v_casefold & AFPVOL_MTOUUPPER)) *r=toupper(*r); else if ((vol->v_casefold & AFPVOL_MTOULOWER)) *r=tolower(*r); r++; } strcat(p, q); if ( (ret = stat( p, &st )) < 0 ) { if (folder->precreate) { if (ad_mkdir(p, folder->mode)) { LOG(log_debug, logtype_afpd,"Creating '%s' failed in %s: %s", p, vol->v_path, strerror(errno)); free(p); free(q); return -1; } ret = 0; } } if ( !ret && folder->hide) { /* Hide it */ ad_init(&ad, vol->v_adouble, vol->v_ad_options); if (ad_open_metadata( p, ADFLAGS_DIR, O_CREAT, &ad) < 0) { free (p); free(q); return (-1); } ad_setname(&ad, folder->name); ad_getattr(&ad, &attr); attr |= htons( ntohs( attr ) | ATTRBIT_INVISIBLE ); ad_setattr(&ad, attr); /* do the same with the finder info */ if (ad_entry(&ad, ADEID_FINDERI)) { memcpy(&attr, ad_entry(&ad, ADEID_FINDERI) + FINDERINFO_FRFLAGOFF, sizeof(attr)); attr |= htons(FINDERINFO_INVISIBLE); memcpy(ad_entry(&ad, ADEID_FINDERI) + FINDERINFO_FRFLAGOFF,&attr, sizeof(attr)); } ad_flush( &ad ); ad_close_metadata( &ad); } free(p); free(q); return 0; } static void handle_special_folders (const struct vol * vol) { const _special_folder *p = &special_folders[0]; uid_t process_uid; process_uid = geteuid(); if (process_uid) { if (seteuid(0) == -1) { process_uid = 0; } } for (; p->name != NULL; p++) { create_special_folder (vol, p); } if (process_uid) { if (seteuid(process_uid) == -1) { LOG(log_error, logtype_logger, "can't seteuid back %s", strerror(errno)); exit(EXITERR_SYS); } } } const struct vol *getvolumes(void) { return Volumes; } void unload_volumes_and_extmap(void) { LOG(log_debug, logtype_afpd, "unload_volumes_and_extmap"); free_extmap(); free_volumes(); } /* * Get a volumes UUID from the config file. * If there is none, it is generated and stored there. * * Returns pointer to allocated storage on success, NULL on error. */ static char *get_vol_uuid(const AFPObj *obj, const char *volname) { char *volname_conf; char buf[1024], uuid[UUID_PRINTABLE_STRING_LENGTH], *p; FILE *fp; struct stat tmpstat; int fd; if ((fp = fopen(obj->options.uuidconf, "r")) != NULL) { /* read open? */ /* scan in the conf file */ while (fgets(buf, sizeof(buf), fp) != NULL) { p = buf; while (p && isblank(*p)) p++; if (!p || (*p == '#') || (*p == '\n')) continue; /* invalid line */ if (*p == '"') { p++; if ((volname_conf = strtok( p, "\"" )) == NULL) continue; /* syntax error */ } else { if ((volname_conf = strtok( p, " \t" )) == NULL) continue; /* syntax error: invalid name */ } p = strchr(p, '\0'); p++; if (*p == '\0') continue; /* syntax error */ if (strcmp(volname, volname_conf) != 0) continue; /* another volume name */ while (p && isblank(*p)) p++; if (sscanf(p, "%36s", uuid) == 1 ) { for (int i=0; uuid[i]; i++) uuid[i] = toupper(uuid[i]); LOG(log_debug, logtype_afpd, "get_uuid('%s'): UUID: '%s'", volname, uuid); fclose(fp); return strdup(uuid); } } } if (fp) fclose(fp); /* not found or no file, reopen in append mode */ if (stat(obj->options.uuidconf, &tmpstat)) { /* no file */ if (( fd = creat(obj->options.uuidconf, 0644 )) < 0 ) { LOG(log_error, logtype_afpd, "ERROR: Cannot create %s (%s).", obj->options.uuidconf, strerror(errno)); return NULL; } if (( fp = fdopen( fd, "w" )) == NULL ) { LOG(log_error, logtype_afpd, "ERROR: Cannot fdopen %s (%s).", obj->options.uuidconf, strerror(errno)); close(fd); return NULL; } } else if ((fp = fopen(obj->options.uuidconf, "a+")) == NULL) { /* not found */ LOG(log_error, logtype_afpd, "Cannot create or append to %s (%s).", obj->options.uuidconf, strerror(errno)); return NULL; } fseek(fp, 0L, SEEK_END); if(ftell(fp) == 0) { /* size = 0 */ fprintf(fp, "# DON'T TOUCH NOR COPY THOUGHTLESSLY!\n"); fprintf(fp, "# This file is auto-generated by afpd\n"); fprintf(fp, "# and stores UUIDs for TM volumes.\n\n"); } else { fseek(fp, -1L, SEEK_END); if(fgetc(fp) != '\n') fputc('\n', fp); /* last char is \n? */ } /* generate uuid and write to file */ atalk_uuid_t id; const char *cp; randombytes((void *)id, 16); cp = uuid_bin2string(id); LOG(log_debug, logtype_afpd, "get_uuid('%s'): generated UUID '%s'", volname, cp); fprintf(fp, "\"%s\"\t%36s\n", volname, cp); fclose(fp); return strdup(cp); } netatalk-2.2.2/etc/afpd/desktop.h0000644000175200017500000000454211655731126013566 00000000000000/* * $Id: desktop.h,v 1.6 2009-10-15 10:43:13 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef AFPD_DESKTOP_H #define AFPD_DESKTOP_H 1 #include #include #include "volume.h" struct savedt { u_char sdt_creator[ 4 ]; int sdt_fd; int sdt_index; short sdt_vid; }; typedef unsigned char CreatorType[4]; extern char *dtfile (const struct vol *, u_char [], char *); extern char *mtoupath (const struct vol *, char *, cnid_t, int utf8); extern char *utompath (const struct vol *, char *, cnid_t, int utf8); /* FP functions */ int afp_opendt (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_addcomment (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_getcomment (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_rmvcomment (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_addappl (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_rmvappl (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_getappl (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_closedt (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_addicon (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_geticoninfo (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_geticon (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); #endif netatalk-2.2.2/etc/afpd/quota.c0000644000175200017500000005632111655731244013244 00000000000000/* * $Id: quota.c,v 1.35 2010-04-03 07:11:35 franklahm Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifndef NO_QUOTA_SUPPORT #include #include #include #include #include /* STDC check */ #if STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #include #include #include "auth.h" #include "volume.h" #include "unix.h" #ifdef HAVE_LIBQUOTA #include static int getfreespace(struct vol *vol, VolSpace *bfree, VolSpace *btotal, uid_t uid, const char *classq) { int retq; struct ufs_quota_entry ufsq[QUOTA_NLIMITS]; time_t now; if (time(&now) == -1) { LOG(log_info, logtype_afpd, "time(): %s", strerror(errno)); return -1; } if ( seteuid( getuid() ) != 0 ) { LOG(log_info, logtype_afpd, "seteuid(): %s", strerror(errno)); return -1; } if ((retq = getfsquota(vol->v_path, ufsq, uid, classq)) < 0) { LOG(log_info, logtype_afpd, "getfsquota(%s, %s): %s", vol->v_path, classq, strerror(errno)); } seteuid( uid ); if (retq < 1) return retq; switch(QL_STATUS(quota_check_limit(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_cur, 1, ufsq[QUOTA_LIMIT_BLOCK].ufsqe_softlimit, ufsq[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit, ufsq[QUOTA_LIMIT_BLOCK].ufsqe_time, now))) { case QL_S_DENY_HARD: case QL_S_DENY_GRACE: *bfree = 0; *btotal = dbtob(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_cur); break; default: *bfree = dbtob(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit - ufsq[QUOTA_LIMIT_BLOCK].ufsqe_cur); *btotal = dbtob(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit); break; } return 1; } int uquota_getvolspace( struct vol *vol, VolSpace *bfree, VolSpace *btotal, const u_int32_t bsize) { int uretq, gretq; VolSpace ubfree, ubtotal; VolSpace gbfree, gbtotal; uretq = getfreespace(vol, &ubfree, &ubtotal, uuid, QUOTADICT_CLASS_USER); LOG(log_info, logtype_afpd, "getfsquota(%s): %d %d", vol->v_path, (int)ubfree, (int)ubtotal); if (ngroups >= 1) { gretq = getfreespace(vol, &ubfree, &ubtotal, groups[0], QUOTADICT_CLASS_GROUP); } else gretq = -1; if (uretq < 1 && gretq < 1) { /* no quota for this fs */ return AFPERR_PARAM; } if (uretq < 1) { /* use group quotas */ *bfree = gbfree; *btotal = gbtotal; } else if (gretq < 1) { /* use user quotas */ *bfree = ubfree; *btotal = ubtotal; } else { /* return smallest remaining space of user and group */ if (ubfree < gbfree) { *bfree = ubfree; *btotal = ubtotal; } else { *bfree = gbfree; *btotal = gbtotal; } } return AFP_OK; } #else /* HAVE_LIBQUOTA */ /* #define DEBUG_QUOTA 0 */ #define WANT_USER_QUOTA 0 #define WANT_GROUP_QUOTA 1 #ifdef NEED_QUOTACTL_WRAPPER int quotactl(int cmd, const char *special, int id, caddr_t addr) { return syscall(__NR_quotactl, cmd, special, id, addr); } #endif /* NEED_QUOTACTL_WRAPPER */ static int overquota( struct dqblk *); #ifdef linux #ifdef HAVE_LINUX_XQM_H #include #else #ifdef HAVE_XFS_XQM_H #include #define HAVE_LINUX_XQM_H #else #ifdef HAVE_LINUX_DQBLK_XFS_H #include #define HAVE_LINUX_XQM_H #endif /* HAVE_LINUX_DQBLK_XFS_H */ #endif /* HAVE_XFS_XQM_H */ #endif /* HAVE_LINUX_XQM_H */ #include static int is_xfs = 0; static int get_linux_xfs_quota(int, char*, uid_t, struct dqblk *); static int get_linux_fs_quota(int, char*, uid_t, struct dqblk *); /* format supported by current kernel */ static int kernel_iface = IFACE_UNSET; /* ** Check kernel quota version ** Taken from quota-tools 3.08 by Jan Kara */ static void linuxquota_get_api( void ) { #ifndef LINUX_API_VERSION struct stat st; if (stat("/proc/sys/fs/quota", &st) == 0) { kernel_iface = IFACE_GENERIC; } else { struct dqstats_v2 v2_stats; struct sigaction sig; struct sigaction oldsig; /* This signal handling is needed because old kernels send us SIGSEGV as they try to resolve the device */ sig.sa_handler = SIG_IGN; sig.sa_sigaction = NULL; sig.sa_flags = 0; sigemptyset(&sig.sa_mask); if (sigaction(SIGSEGV, &sig, &oldsig) < 0) { LOG( log_error, logtype_afpd, "cannot set SEGV signal handler: %s", strerror(errno)); goto failure; } if (quotactl(QCMD(Q_V2_GETSTATS, 0), NULL, 0, (void *)&v2_stats) >= 0) { kernel_iface = IFACE_VFSV0; } else if (errno != ENOSYS && errno != ENOTSUP) { /* RedHat 7.1 (2.4.2-2) newquota check * Q_V2_GETSTATS in it's old place, Q_GETQUOTA in the new place * (they haven't moved Q_GETSTATS to its new value) */ int err_stat = 0; int err_quota = 0; char tmp[1024]; /* Just temporary buffer */ if (quotactl(QCMD(Q_V1_GETSTATS, 0), NULL, 0, tmp)) err_stat = errno; if (quotactl(QCMD(Q_V1_GETQUOTA, 0), "/dev/null", 0, tmp)) err_quota = errno; /* On a RedHat 2.4.2-2 we expect 0, EINVAL * On a 2.4.x we expect 0, ENOENT * On a 2.4.x-ac we wont get here */ if (err_stat == 0 && err_quota == EINVAL) { kernel_iface = IFACE_VFSV0; } else { kernel_iface = IFACE_VFSOLD; } } else { /* This branch is *not* in quota-tools 3.08 ** but without it quota version is not correctly ** identified for the original SuSE 8.0 kernel */ unsigned int vers_no; FILE * qf; if ((qf = fopen("/proc/fs/quota", "r"))) { if (fscanf(qf, "Version %u", &vers_no) == 1) { if ( (vers_no == (6*10000 + 5*100 + 0)) || (vers_no == (6*10000 + 5*100 + 1)) ) { kernel_iface = IFACE_VFSV0; } } fclose(qf); } } if (sigaction(SIGSEGV, &oldsig, NULL) < 0) { LOG(log_error, logtype_afpd, "cannot reset signal handler: %s", strerror(errno)); goto failure; } } failure: if (kernel_iface == IFACE_UNSET) kernel_iface = IFACE_VFSOLD; #else /* defined LINUX_API_VERSION */ kernel_iface = LINUX_API_VERSION; #endif } /****************************************************************************/ static int get_linux_quota(int what, char *path, uid_t euser_id, struct dqblk *dp) { int r; /* result */ if ( is_xfs ) r=get_linux_xfs_quota(what, path, euser_id, dp); else r=get_linux_fs_quota(what, path, euser_id, dp); return r; } /**************************************************************************** Abstract out the XFS Quota Manager quota get call. ****************************************************************************/ static int get_linux_xfs_quota(int what, char *path, uid_t euser_id, struct dqblk *dqb) { int ret = -1; #ifdef HAVE_LINUX_XQM_H struct fs_disk_quota D; memset (&D, 0, sizeof(D)); if ((ret = quotactl(QCMD(Q_XGETQUOTA,(what ? GRPQUOTA : USRQUOTA)), path, euser_id, (caddr_t)&D))) return ret; dqb->bsize = (u_int64_t)512; dqb->dqb_bsoftlimit = (u_int64_t)D.d_blk_softlimit; dqb->dqb_bhardlimit = (u_int64_t)D.d_blk_hardlimit; dqb->dqb_ihardlimit = (u_int64_t)D.d_ino_hardlimit; dqb->dqb_isoftlimit = (u_int64_t)D.d_ino_softlimit; dqb->dqb_curinodes = (u_int64_t)D.d_icount; dqb->dqb_curblocks = (u_int64_t)D.d_bcount; #endif return ret; } /* ** Wrapper for the quotactl(GETQUOTA) call. ** For API v2 the results are copied back into a v1 structure. ** Taken from quota-1.4.8 perl module */ static int get_linux_fs_quota(int what, char *path, uid_t euser_id, struct dqblk *dqb) { int ret; if (kernel_iface == IFACE_UNSET) linuxquota_get_api(); if (kernel_iface == IFACE_GENERIC) { struct dqblk_v3 dqb3; ret = quotactl(QCMD(Q_V3_GETQUOTA, (what ? GRPQUOTA : USRQUOTA)), path, euser_id, (caddr_t) &dqb3); if (ret == 0) { dqb->dqb_bhardlimit = dqb3.dqb_bhardlimit; dqb->dqb_bsoftlimit = dqb3.dqb_bsoftlimit; dqb->dqb_curblocks = dqb3.dqb_curspace / DEV_QBSIZE; dqb->dqb_ihardlimit = dqb3.dqb_ihardlimit; dqb->dqb_isoftlimit = dqb3.dqb_isoftlimit; dqb->dqb_curinodes = dqb3.dqb_curinodes; dqb->dqb_btime = dqb3.dqb_btime; dqb->dqb_itime = dqb3.dqb_itime; dqb->bsize = DEV_QBSIZE; } } else if (kernel_iface == IFACE_VFSV0) { struct dqblk_v2 dqb2; ret = quotactl(QCMD(Q_V2_GETQUOTA, (what ? GRPQUOTA : USRQUOTA)), path, euser_id, (caddr_t) &dqb2); if (ret == 0) { dqb->dqb_bhardlimit = dqb2.dqb_bhardlimit; dqb->dqb_bsoftlimit = dqb2.dqb_bsoftlimit; dqb->dqb_curblocks = dqb2.dqb_curspace / DEV_QBSIZE; dqb->dqb_ihardlimit = dqb2.dqb_ihardlimit; dqb->dqb_isoftlimit = dqb2.dqb_isoftlimit; dqb->dqb_curinodes = dqb2.dqb_curinodes; dqb->dqb_btime = dqb2.dqb_btime; dqb->dqb_itime = dqb2.dqb_itime; dqb->bsize = DEV_QBSIZE; } } else /* if (kernel_iface == IFACE_VFSOLD) */ { struct dqblk_v1 dqb1; ret = quotactl(QCMD(Q_V1_GETQUOTA, (what ? GRPQUOTA : USRQUOTA)), path, euser_id, (caddr_t) &dqb1); if (ret == 0) { dqb->dqb_bhardlimit = dqb1.dqb_bhardlimit; dqb->dqb_bsoftlimit = dqb1.dqb_bsoftlimit; dqb->dqb_curblocks = dqb1.dqb_curblocks; dqb->dqb_ihardlimit = dqb1.dqb_ihardlimit; dqb->dqb_isoftlimit = dqb1.dqb_isoftlimit; dqb->dqb_curinodes = dqb1.dqb_curinodes; dqb->dqb_btime = dqb1.dqb_btime; dqb->dqb_itime = dqb1.dqb_itime; dqb->bsize = DEV_QBSIZE; } } return ret; } #endif /* linux */ #if defined(HAVE_SYS_MNTTAB_H) || defined(__svr4__) /* * Return the mount point associated with the filesystem * on which "file" resides. Returns NULL on failure. */ static char * mountp( char *file, int *nfs) { struct stat sb; FILE *mtab; dev_t devno; static struct mnttab mnt; if ( lstat( file, &sb ) < 0 ) { return( NULL ); } devno = sb.st_dev; if (( mtab = fopen( "/etc/mnttab", "r" )) == NULL ) { return( NULL ); } while ( getmntent( mtab, &mnt ) == 0 ) { /* local fs */ if ( (lstat( mnt.mnt_special, &sb ) == 0) && (devno == sb.st_rdev)) { fclose( mtab ); return mnt.mnt_mountp; } /* check for nfs. we probably should use * strcmp(mnt.mnt_fstype, MNTTYPE_NFS), but that's not as fast. */ if ((lstat(mnt.mnt_mountp, &sb) == 0) && (devno == sb.st_dev) && strchr(mnt.mnt_special, ':')) { *nfs = 1; fclose( mtab ); return mnt.mnt_special; } } fclose( mtab ); return( NULL ); } #else /* __svr4__ */ #ifdef ultrix /* * Return the block-special device name associated with the filesystem * on which "file" resides. Returns NULL on failure. */ static char * special( char *file, int *nfs) { static struct fs_data fsd; if ( getmnt(0, &fsd, 0, STAT_ONE, file ) < 0 ) { LOG(log_info, logtype_afpd, "special: getmnt %s: %s", file, strerror(errno) ); return( NULL ); } /* XXX: does this really detect an nfs mounted fs? */ if (strchr(fsd.fd_req.devname, ':')) *nfs = 1; return( fsd.fd_req.devname ); } #else /* ultrix */ #if (defined(HAVE_SYS_MOUNT_H) && !defined(__linux__)) || defined(BSD4_4) || defined(_IBMR2) static char * special(char *file, int *nfs) { static struct statfs sfs; if ( statfs( file, &sfs ) < 0 ) { return( NULL ); } #ifdef TRU64 /* Digital UNIX: The struct sfs contains a field sfs.f_type, * the MOUNT_* constants are defined in */ if ((sfs.f_type == MOUNT_NFS)||(sfs.f_type == MOUNT_NFS3)) #else /* TRU64 */ /* XXX: make sure this really detects an nfs mounted fs */ if (strchr(sfs.f_mntfromname, ':')) #endif /* TRU64 */ *nfs = 1; return( sfs.f_mntfromname ); } #else /* BSD4_4 */ static char * special(char *file, int *nfs) { struct stat sb; FILE *mtab; dev_t devno; struct mntent *mnt; int found=0; if ( lstat( file, &sb ) < 0 ) { return( NULL ); } devno = sb.st_dev; if (( mtab = setmntent( "/etc/mtab", "r" )) == NULL ) { return( NULL ); } while (( mnt = getmntent( mtab )) != NULL ) { /* check for local fs */ if ( (lstat( mnt->mnt_fsname, &sb ) == 0) && devno == sb.st_rdev) { found = 1; break; } /* check for an nfs mount entry. the alternative is to use * strcmp(mnt->mnt_type, MNTTYPE_NFS) instead of the strchr. */ if ((lstat(mnt->mnt_dir, &sb) == 0) && (devno == sb.st_dev) && strchr(mnt->mnt_fsname, ':')) { *nfs = 1; found = 1; break; } } endmntent( mtab ); if (!found) return (NULL); #ifdef linux if (strcmp(mnt->mnt_type, "xfs") == 0) is_xfs = 1; #endif return( mnt->mnt_fsname ); } #endif /* BSD4_4 */ #endif /* ultrix */ #endif /* __svr4__ */ static int getfsquota(struct vol *vol, const int uid, struct dqblk *dq) { struct dqblk dqg; #ifdef __svr4__ struct quotctl qc; #endif memset(&dqg, 0, sizeof(dqg)); #ifdef __svr4__ qc.op = Q_GETQUOTA; qc.uid = uid; qc.addr = (caddr_t)dq; if ( ioctl( vol->v_qfd, Q_QUOTACTL, &qc ) < 0 ) { return( AFPERR_PARAM ); } #else /* __svr4__ */ #ifdef ultrix if ( quota( Q_GETDLIM, uid, vol->v_gvs, dq ) != 0 ) { return( AFPERR_PARAM ); } #else /* ultrix */ #ifndef USRQUOTA #define USRQUOTA 0 #endif #ifndef QCMD #define QCMD(a,b) (a) #endif #ifndef TRU64 /* for group quotas. we only use these if the user belongs * to one group. */ #endif /* TRU64 */ #ifdef BSD4_4 if ( seteuid( getuid() ) == 0 ) { if ( quotactl( vol->v_path, QCMD(Q_GETQUOTA,USRQUOTA), uid, (char *)dq ) != 0 ) { /* try group quotas */ if (ngroups >= 1) { if ( quotactl(vol->v_path, QCMD(Q_GETQUOTA, GRPQUOTA), groups[0], (char *) &dqg) != 0 ) { seteuid( uid ); return( AFPERR_PARAM ); } } } seteuid( uid ); } #elif defined(TRU64) if ( seteuid( getuid() ) == 0 ) { if ( quotactl( vol->v_path, QCMD(Q_GETQUOTA, USRQUOTA), uid, (char *)dq ) != 0 ) { seteuid( uid ); return ( AFPERR_PARAM ); } seteuid( uid ); } #else /* BSD4_4 */ if (get_linux_quota (WANT_USER_QUOTA, vol->v_gvs, uid, dq) !=0) { return( AFPERR_PARAM ); } if (get_linux_quota(WANT_GROUP_QUOTA, vol->v_gvs, getegid(), &dqg) != 0) { #ifdef DEBUG_QUOTA LOG(log_debug, logtype_afpd, "group quota did not work!" ); #endif /* DEBUG_QUOTA */ return AFP_OK; /* no need to check user vs group quota */ } #endif /* BSD4_4 */ #ifndef TRU64 /* return either the group quota entry or user quota entry, whichever has the least amount of space remaining */ /* if user space remaining > group space remaining */ if( /* if overquota, free space is 0 otherwise hard-current */ ( overquota( dq ) ? 0 : ( dq->dqb_bhardlimit ? dq->dqb_bhardlimit - dq->dqb_curblocks : ~((u_int64_t) 0) ) ) > ( overquota( &dqg ) ? 0 : ( dqg.dqb_bhardlimit ? dqg.dqb_bhardlimit - dqg.dqb_curblocks : ~((u_int64_t) 0) ) ) ) /* if */ { /* use group quota limits rather than user limits */ dq->dqb_curblocks = dqg.dqb_curblocks; dq->dqb_bhardlimit = dqg.dqb_bhardlimit; dq->dqb_bsoftlimit = dqg.dqb_bsoftlimit; dq->dqb_btimelimit = dqg.dqb_btimelimit; } /* if */ #endif /* TRU64 */ #endif /* ultrix */ #endif /* __svr4__ */ return AFP_OK; } static int getquota( struct vol *vol, struct dqblk *dq, const u_int32_t bsize) { char *p; #ifdef __svr4__ char buf[ MAXPATHLEN + 1]; if ( vol->v_qfd == -1 && vol->v_gvs == NULL) { if (( p = mountp( vol->v_path, &vol->v_nfs)) == NULL ) { LOG(log_info, logtype_afpd, "getquota: mountp %s fails", vol->v_path ); return( AFPERR_PARAM ); } if (vol->v_nfs) { if (( vol->v_gvs = (char *)malloc( strlen( p ) + 1 )) == NULL ) { LOG(log_error, logtype_afpd, "getquota: malloc: %s", strerror(errno) ); return AFPERR_MISC; } strcpy( vol->v_gvs, p ); } else { sprintf( buf, "%s/quotas", p ); if (( vol->v_qfd = open( buf, O_RDONLY, 0 )) < 0 ) { LOG(log_info, logtype_afpd, "open %s: %s", buf, strerror(errno) ); return( AFPERR_PARAM ); } } } #else if ( vol->v_gvs == NULL ) { if (( p = special( vol->v_path, &vol->v_nfs )) == NULL ) { LOG(log_info, logtype_afpd, "getquota: special %s fails", vol->v_path ); return( AFPERR_PARAM ); } if (( vol->v_gvs = (char *)malloc( strlen( p ) + 1 )) == NULL ) { LOG(log_error, logtype_afpd, "getquota: malloc: %s", strerror(errno) ); return AFPERR_MISC; } strcpy( vol->v_gvs, p ); } #endif #ifdef TRU64 /* Digital UNIX: Two forms of specifying an NFS filesystem are possible, either 'hostname:path' or 'path@hostname' (Ultrix heritage) */ if (vol->v_nfs) { char *hostpath; char pathstring[MNAMELEN]; /* MNAMELEN ist defined in */ int result; if ((hostpath = strchr(vol->v_gvs,'@')) != NULL ) { /* convert 'path@hostname' to 'hostname:path', * call getnfsquota(), * convert 'hostname:path' back to 'path@hostname' */ *hostpath = '\0'; sprintf(pathstring,"%s:%s",hostpath+1,vol->v_gvs); strcpy(vol->v_gvs,pathstring); result = getnfsquota(vol, uuid, bsize, dq); hostpath = strchr(vol->v_gvs,':'); *hostpath = '\0'; sprintf(pathstring,"%s@%s",hostpath+1,vol->v_gvs); strcpy(vol->v_gvs,pathstring); return result; } else /* vol->v_gvs is of the form 'hostname:path' */ return getnfsquota(vol, uuid, bsize, dq); } else /* local filesystem */ return getfsquota(vol, uuid, dq); #else /* TRU64 */ return vol->v_nfs ? getnfsquota(vol, uuid, bsize, dq) : getfsquota(vol, uuid, dq); #endif /* TRU64 */ } static int overquota( struct dqblk *dqblk) { struct timeval tv; if ( dqblk->dqb_curblocks > dqblk->dqb_bhardlimit && dqblk->dqb_bhardlimit != 0 ) { return( 1 ); } if ( dqblk->dqb_curblocks < dqblk->dqb_bsoftlimit || dqblk->dqb_bsoftlimit == 0 ) { return( 0 ); } #ifdef ultrix if ( dqblk->dqb_bwarn ) { return( 0 ); } #else /* ultrix */ if ( gettimeofday( &tv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "overquota: gettimeofday: %s", strerror(errno) ); return( AFPERR_PARAM ); } if ( dqblk->dqb_btimelimit && dqblk->dqb_btimelimit > tv.tv_sec ) { return( 0 ); } #endif /* ultrix */ return( 1 ); } /* * This next bit is basically for linux -- everything is fine * if you use 1k blocks... but if you try (for example) to mount * a volume via nfs from a netapp (which might use 4k blocks) everything * gets reported improperly. I have no idea about dbtob on other * platforms. */ #ifdef HAVE_BROKEN_DBTOB #undef dbtob #define dbtob(a, b) ((VolSpace)((VolSpace)(a) * (VolSpace)(b))) #define HAVE_2ARG_DBTOB #endif #ifndef dbtob #define dbtob(a) ((a) << 10) #endif /* i do the cast to VolSpace here to make sure that 64-bit shifts work */ #ifdef HAVE_2ARG_DBTOB #define tobytes(a, b) dbtob((VolSpace) (a), (VolSpace) (b)) #else #define tobytes(a, b) dbtob((VolSpace) (a)) #endif int uquota_getvolspace( struct vol *vol, VolSpace *bfree, VolSpace *btotal, const u_int32_t bsize) { u_int64_t this_bsize; struct dqblk dqblk; this_bsize = bsize; if (getquota( vol, &dqblk, bsize) != 0 ) { return( AFPERR_PARAM ); } #ifdef linux this_bsize = dqblk.bsize; #endif #ifdef DEBUG_QUOTA LOG(log_debug, logtype_afpd, "after calling getquota in uquota_getvolspace!" ); LOG(log_debug, logtype_afpd, "dqb_ihardlimit: %u", dqblk.dqb_ihardlimit ); LOG(log_debug, logtype_afpd, "dqb_isoftlimit: %u", dqblk.dqb_isoftlimit ); LOG(log_debug, logtype_afpd, "dqb_curinodes : %u", dqblk.dqb_curinodes ); LOG(log_debug, logtype_afpd, "dqb_bhardlimit: %u", dqblk.dqb_bhardlimit ); LOG(log_debug, logtype_afpd, "dqb_bsoftlimit: %u", dqblk.dqb_bsoftlimit ); LOG(log_debug, logtype_afpd, "dqb_curblocks : %u", dqblk.dqb_curblocks ); LOG(log_debug, logtype_afpd, "dqb_btime : %u", dqblk.dqb_btime ); LOG(log_debug, logtype_afpd, "dqb_itime : %u", dqblk.dqb_itime ); LOG(log_debug, logtype_afpd, "bsize/this_bsize : %u/%u", bsize, this_bsize ); LOG(log_debug, logtype_afpd, "dqblk.dqb_bhardlimit size: %u", tobytes( dqblk.dqb_bhardlimit, this_bsize )); LOG(log_debug, logtype_afpd, "dqblk.dqb_bsoftlimit size: %u", tobytes( dqblk.dqb_bsoftlimit, this_bsize )); LOG(log_debug, logtype_afpd, "dqblk.dqb_curblocks size: %u", tobytes( dqblk.dqb_curblocks, this_bsize )); #endif /* DEBUG_QUOTA */ /* no limit set for this user. it might be set in the future. */ if (dqblk.dqb_bsoftlimit == 0 && dqblk.dqb_bhardlimit == 0) { *btotal = *bfree = ~((VolSpace) 0); } else if ( overquota( &dqblk )) { if ( tobytes( dqblk.dqb_curblocks, this_bsize ) > tobytes( dqblk.dqb_bsoftlimit, this_bsize ) ) { *btotal = tobytes( dqblk.dqb_curblocks, this_bsize ); *bfree = 0; } else { *btotal = tobytes( dqblk.dqb_bsoftlimit, this_bsize ); *bfree = tobytes( dqblk.dqb_bsoftlimit, this_bsize ) - tobytes( dqblk.dqb_curblocks, this_bsize ); } } else { *btotal = tobytes( dqblk.dqb_bhardlimit, this_bsize ); *bfree = tobytes( dqblk.dqb_bhardlimit, this_bsize ) - tobytes( dqblk.dqb_curblocks, this_bsize ); } #ifdef DEBUG_QUOTA LOG(log_debug, logtype_afpd, "bfree : %u", *bfree ); LOG(log_debug, logtype_afpd, "btotal : %u", *btotal ); LOG(log_debug, logtype_afpd, "bfree : %uKB", *bfree/1024 ); LOG(log_debug, logtype_afpd, "btotal : %uKB", *btotal/1024 ); #endif return( AFP_OK ); } #endif /* HAVE_LIBQUOTA */ #endif netatalk-2.2.2/etc/afpd/afp_options.c0000644000175200017500000005667711674111343014443 00000000000000/* * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * * modified from main.c. this handles afp options. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_NETDB_H #include #endif /* HAVE_NETDB_H */ #ifdef ADMIN_GRP #include #include #endif /* ADMIN_GRP */ #include #include #include #include #include #include "status.h" #include "auth.h" #include "dircache.h" #ifndef MIN #define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif /* MIN */ /* FIXME CNID */ const char *Cnid_srv = "localhost"; const char *Cnid_port = "4700"; #define OPTIONS "dn:f:s:uc:g:P:ptDS:TL:F:U:hIvVm:" #define LENGTH 512 /* return an option. this uses an internal array, so it's necessary * to duplicate it if you want to hold it for long. this is probably * non-optimal. */ static char *getoption(char *buf, const char *option) { static char string[LENGTH + 1]; char *end; int len; if (option && (buf = strstr(buf, option))) buf = strpbrk(buf, " \t"); while (buf && isspace(*buf)) buf++; if (!buf) return NULL; /* search for any quoted stuff */ if (*buf == '"' && (end = strchr(buf + 1, '"'))) { buf++; len = MIN(end - buf, LENGTH); } else if ((end = strpbrk(buf, " \t\n"))) /* option or eoln */ len = MIN(end - buf, LENGTH); else len = MIN(strlen(buf), LENGTH); strncpy(string, buf, len); string[len] = '\0'; return string; } /* get rid of any allocated afp_option buffers. */ void afp_options_free(struct afp_options *opt, const struct afp_options *save) { if (opt->defaultvol.name && (opt->defaultvol.name != save->defaultvol.name)) free(opt->defaultvol.name); if (opt->defaultvol.full_name && (opt->defaultvol.full_name != save->defaultvol.full_name)) free(opt->defaultvol.full_name); if (opt->systemvol.name && (opt->systemvol.name != save->systemvol.name)) free(opt->systemvol.name); if (opt->systemvol.full_name && (opt->systemvol.full_name != save->systemvol.full_name)) free(opt->systemvol.full_name); if (opt->uservol.name && (opt->uservol.name != save->uservol.name)) free(opt->uservol.name); if (opt->uservol.full_name && (opt->uservol.full_name != save->uservol.full_name)) free(opt->uservol.full_name); if (opt->loginmesg && (opt->loginmesg != save->loginmesg)) free(opt->loginmesg); if (opt->guest && (opt->guest != save->guest)) free(opt->guest); if (opt->server && (opt->server != save->server)) free(opt->server); if (opt->ipaddr && (opt->ipaddr != save->ipaddr)) free(opt->ipaddr); if (opt->port && (opt->port != save->port)) free(opt->port); if (opt->fqdn && (opt->fqdn != save->fqdn)) free(opt->fqdn); if (opt->uampath && (opt->uampath != save->uampath)) free(opt->uampath); if (opt->uamlist && (opt->uamlist != save->uamlist)) free(opt->uamlist); if (opt->passwdfile && (opt->passwdfile != save->passwdfile)) free(opt->passwdfile); if (opt->signatureopt && (opt->signatureopt != save->signatureopt)) free(opt->signatureopt); if (opt->k5service && (opt->k5service != save->k5service)) free(opt->k5service); if (opt->k5realm && (opt->k5realm != save->k5realm)) free(opt->k5realm); if (opt->k5keytab && (opt->k5keytab != save->k5keytab)) free(opt->k5keytab); if (opt->unixcodepage && (opt->unixcodepage != save->unixcodepage)) free(opt->unixcodepage); if (opt->maccodepage && (opt->maccodepage != save->maccodepage)) free(opt->maccodepage); if (opt->ntdomain && (opt->ntdomain != save->ntdomain)) free(opt->ntdomain); if (opt->ntseparator && (opt->ntseparator != save->ntseparator)) free(opt->ntseparator); if (opt->logconfig && (opt->logconfig != save->logconfig)) free(opt->logconfig); if (opt->mimicmodel && (opt->mimicmodel != save->mimicmodel)) free(opt->mimicmodel); if (opt->adminauthuser && (opt->adminauthuser != save->adminauthuser)) free(opt->adminauthuser); } /* initialize options */ void afp_options_init(struct afp_options *options) { memset(options, 0, sizeof(struct afp_options)); options->connections = 20; options->pidfile = _PATH_AFPDLOCK; options->defaultvol.name = _PATH_AFPDDEFVOL; options->systemvol.name = _PATH_AFPDSYSVOL; options->configfile = _PATH_AFPDCONF; options->sigconffile = _PATH_AFPDSIGCONF; options->uuidconf = _PATH_AFPDUUIDCONF; options->uampath = _PATH_AFPDUAMPATH; options->uamlist = "uams_dhx.so,uams_dhx2.so"; options->guest = "nobody"; options->loginmesg = ""; options->transports = AFPTRANS_TCP; /* TCP only */ options->passwdfile = _PATH_AFPDPWFILE; options->tickleval = 30; options->timeout = 4; /* 4 tickles = 2 minutes */ options->sleep = 10 * 60 * 2; /* 10 h in 30 seconds tick */ options->disconnected = 10 * 60 * 2; /* 10 h in 30 seconds tick */ options->server_notif = 1; options->authprintdir = NULL; options->signatureopt = "auto"; options->umask = 0; #ifdef ADMIN_GRP options->admingid = 0; #endif /* ADMIN_GRP */ options->k5service = NULL; options->k5realm = NULL; options->k5keytab = NULL; options->unixcharset = CH_UNIX; options->unixcodepage = "LOCALE"; options->maccharset = CH_MAC; options->maccodepage = "MAC_ROMAN"; options->volnamelen = 80; /* spec: 255, 10.1: 73, 10.4/10.5: 80 */ options->ntdomain = NULL; options->ntseparator = NULL; #ifdef USE_SRVLOC /* don't advertize slp by default */ options->flags |= OPTION_NOSLP; #endif options->dircachesize = DEFAULT_MAX_DIRCACHE_SIZE; options->flags |= OPTION_ACL2MACCESS; options->flags |= OPTION_UUID; options->tcp_sndbuf = 0; /* 0 means don't change OS default */ options->tcp_rcvbuf = 0; /* 0 means don't change OS default */ options->dsireadbuf = 12; options->mimicmodel = NULL; options->fce_fmodwait = 60; /* put fmod events 60 seconds on hold */ options->adminauthuser = NULL; } /* parse an afpd.conf line. i'm doing it this way because it's * easy. it is, however, massively hokey. sample afpd.conf: * server:AFPServer@zone -loginmesg "blah blah blah" -nodsi * "private machine"@zone2 -noguest -port 11012 * server2 -nocleartxt -nodsi * * NOTE: this ignores unknown options */ int afp_options_parseline(char *buf, struct afp_options *options) { char *c, *opt; /* handle server */ if (*buf != '-' && (c = getoption(buf, NULL)) && (opt = strdup(c))) options->server = opt; /* parse toggles */ if (strstr(buf, " -nodebug")) options->flags &= ~OPTION_DEBUG; #ifdef USE_SRVLOC if (strstr(buf, " -slp")) options->flags &= ~OPTION_NOSLP; #endif #ifdef USE_ZEROCONF if (strstr(buf, " -nozeroconf")) options->flags |= OPTION_NOZEROCONF; #endif if (strstr(buf, " -nouservolfirst")) options->flags &= ~OPTION_USERVOLFIRST; if (strstr(buf, " -uservolfirst")) options->flags |= OPTION_USERVOLFIRST; if (strstr(buf, " -nouservol")) options->flags |= OPTION_NOUSERVOL; if (strstr(buf, " -uservol")) options->flags &= ~OPTION_NOUSERVOL; if (strstr(buf, " -proxy")) options->flags |= OPTION_PROXY; if (strstr(buf, " -noicon")) options->flags &= ~OPTION_CUSTOMICON; if (strstr(buf, " -icon")) options->flags |= OPTION_CUSTOMICON; if (strstr(buf, " -advertise_ssh")) options->flags |= OPTION_ANNOUNCESSH; if (strstr(buf, " -noacl2maccess")) options->flags &= ~OPTION_ACL2MACCESS; if (strstr(buf, " -keepsessions")) { default_options.flags |= OPTION_KEEPSESSIONS; options->flags |= OPTION_KEEPSESSIONS; } /* passwd bits */ if (strstr(buf, " -nosavepassword")) options->passwdbits |= PASSWD_NOSAVE; if (strstr(buf, " -savepassword")) options->passwdbits &= ~PASSWD_NOSAVE; if (strstr(buf, " -nosetpassword")) options->passwdbits &= ~PASSWD_SET; if (strstr(buf, " -setpassword")) options->passwdbits |= PASSWD_SET; /* transports */ if (strstr(buf, " -transall")) options->transports = AFPTRANS_ALL; if (strstr(buf, " -notransall")) options->transports = AFPTRANS_NONE; if (strstr(buf, " -tcp")) options->transports |= AFPTRANS_TCP; if (strstr(buf, " -notcp")) options->transports &= ~AFPTRANS_TCP; if (strstr(buf, " -ddp")) options->transports |= AFPTRANS_DDP; if (strstr(buf, " -noddp")) options->transports &= ~AFPTRANS_DDP; if (strstr(buf, "-client_polling")) options->server_notif = 0; /* figure out options w/ values. currently, this will ignore the setting * if memory is lacking. */ if ((c = getoption(buf, "-hostname"))) { int len = strlen (c); if (len <= MAXHOSTNAMELEN) { memcpy(options->hostname, c, len); options->hostname[len] = 0; } else LOG(log_info, logtype_afpd, "WARNING: hostname %s is too long (%d)",c,len); } if ((c = getoption(buf, "-defaultvol")) && (opt = strdup(c))) options->defaultvol.name = opt; if ((c = getoption(buf, "-systemvol")) && (opt = strdup(c))) options->systemvol.name = opt; if ((c = getoption(buf, "-loginmesg")) && (opt = strdup(c))) { int i = 0, j = 0; while (c[i]) { if (c[i] != '\\') { opt[j++] = c[i]; } else { i++; if (c[i] == 'n') opt[j++] = '\n'; } i++; } opt[j] = 0; options->loginmesg = opt; } if ((c = getoption(buf, "-guestname")) && (opt = strdup(c))) options->guest = opt; if ((c = getoption(buf, "-passwdfile")) && (opt = strdup(c))) options->passwdfile = opt; if ((c = getoption(buf, "-passwdminlen"))) options->passwdminlen = MIN(1, atoi(c)); if ((c = getoption(buf, "-loginmaxfail"))) options->loginmaxfail = atoi(c); if ((c = getoption(buf, "-tickleval"))) { options->tickleval = atoi(c); if (options->tickleval <= 0) { options->tickleval = 30; } } if ((c = getoption(buf, "-timeout"))) { options->timeout = atoi(c); if (options->timeout <= 0) { options->timeout = 4; } } if ((c = getoption(buf, "-sleep"))) { options->disconnected = options->sleep = atoi(c) * 120; if (options->sleep <= 4) { options->disconnected = options->sleep = 4; } } if ((c = getoption(buf, "-dsireadbuf"))) { options->dsireadbuf = atoi(c); if (options->dsireadbuf < 6) options->dsireadbuf = 6; } if ((c = getoption(buf, "-server_quantum"))) options->server_quantum = strtoul(c, NULL, 0); if ((c = getoption(buf, "-volnamelen"))) { options->volnamelen = atoi(c); if (options->volnamelen < 8) { options->volnamelen = 8; /* max mangled volname "???#FFFF" */ } if (options->volnamelen > 255) { options->volnamelen = 255; /* AFP3 spec */ } } /* -[no]setuplog []*/ c = buf; /* Now THIS is hokey! Multiple occurrences are not supported by our current code, */ /* so I have to loop myself. */ while (NULL != (c = strstr(c, "-setuplog"))) { char *optstr; if ((optstr = getoption(c, "-setuplog"))) { /* hokey2: options->logconfig must be converted to store an array of logstrings */ if (options->logconfig) free(options->logconfig); options->logconfig = strdup(optstr); setuplog(optstr); c += sizeof("-setuplog"); } } if ((c = getoption(buf, "-unsetuplog"))) unsetuplog(c); #ifdef ADMIN_GRP if ((c = getoption(buf, "-admingroup"))) { struct group *gr = getgrnam(c); if (gr != NULL) { options->admingid = gr->gr_gid; } } #endif /* ADMIN_GRP */ if ((c = getoption(buf, "-k5service")) && (opt = strdup(c))) options->k5service = opt; if ((c = getoption(buf, "-k5realm")) && (opt = strdup(c))) options->k5realm = opt; if ((c = getoption(buf, "-k5keytab"))) { if ( NULL == (options->k5keytab = (char *) malloc(sizeof(char)*(strlen(c)+14)) )) { LOG(log_error, logtype_afpd, "malloc failed"); exit(-1); } snprintf(options->k5keytab, strlen(c)+14, "KRB5_KTNAME=%s", c); putenv(options->k5keytab); /* setenv( "KRB5_KTNAME", c, 1 ); */ } if ((c = getoption(buf, "-authprintdir")) && (opt = strdup(c))) options->authprintdir = opt; if ((c = getoption(buf, "-uampath")) && (opt = strdup(c))) options->uampath = opt; if ((c = getoption(buf, "-uamlist")) && (opt = strdup(c))) options->uamlist = opt; if ((c = getoption(buf, "-ipaddr"))) { #if 0 struct in_addr inaddr; if (inet_aton(c, &inaddr) && (opt = strdup(c))) { if (!gethostbyaddr((const char *) &inaddr, sizeof(inaddr), AF_INET)) LOG(log_info, logtype_afpd, "WARNING: can't find %s", opt); options->ipaddr = opt; } else { LOG(log_error, logtype_afpd, "Error parsing -ipaddr, is %s in numbers-and-dots notation?", c); } #endif options->ipaddr = strdup(c); } /* FIXME CNID Cnid_srv is a server attribute */ if ((c = getoption(buf, "-cnidserver"))) { char *p = strrchr(c, ':'); if (p) *p = 0; Cnid_srv = strdup(c); if (p) Cnid_port = strdup(p + 1); LOG(log_debug, logtype_afpd, "CNID Server: %s:%s", Cnid_srv, Cnid_port); } if ((c = getoption(buf, "-port"))) options->port = strdup(c); #ifndef NO_DDP if ((c = getoption(buf, "-ddpaddr"))) atalk_aton(c, &options->ddpaddr); #endif if ((c = getoption(buf, "-signature")) && (opt = strdup(c))) options->signatureopt = opt; /* do a little checking for the domain name. */ if ((c = getoption(buf, "-fqdn"))) { char *p = strchr(c, ':'); if (p) *p = '\0'; if (gethostbyname(c)) { if (p) *p = ':'; if ((opt = strdup(c))) options->fqdn = opt; } else { LOG(log_error, logtype_afpd, "error parsing -fqdn, gethostbyname failed for: %s", c); } } if ((c = getoption(buf, "-unixcodepage"))) { if ((charset_t)-1 == ( options->unixcharset = add_charset(c)) ) { options->unixcharset = CH_UNIX; LOG(log_warning, logtype_afpd, "setting Unix codepage to '%s' failed", c); } else { if ((opt = strdup(c))) options->unixcodepage = opt; } } if ((c = getoption(buf, "-maccodepage"))) { if ((charset_t)-1 == ( options->maccharset = add_charset(c)) ) { options->maccharset = CH_MAC; LOG(log_warning, logtype_afpd, "setting Mac codepage to '%s' failed", c); } else { if ((opt = strdup(c))) options->maccodepage = opt; } } if ((c = strstr(buf, "-closevol"))) { options->closevol= 1; } if ((c = getoption(buf, "-ntdomain")) && (opt = strdup(c))) options->ntdomain = opt; if ((c = getoption(buf, "-ntseparator")) && (opt = strdup(c))) options->ntseparator = opt; if ((c = getoption(buf, "-dircachesize"))) options->dircachesize = atoi(c); if ((c = getoption(buf, "-tcpsndbuf"))) options->tcp_sndbuf = atoi(c); if ((c = getoption(buf, "-tcprcvbuf"))) options->tcp_rcvbuf = atoi(c); if ((c = getoption(buf, "-fcelistener"))) { LOG(log_note, logtype_afpd, "Adding fce listener \"%s\"", c); fce_add_udp_socket(c); } if ((c = getoption(buf, "-fcecoalesce"))) { LOG(log_note, logtype_afpd, "Fce coalesce: %s", c); fce_set_coalesce(c); } if ((c = getoption(buf, "-fceevents"))) { LOG(log_note, logtype_afpd, "Fce events: %s", c); fce_set_events(c); } if ((c = getoption(buf, "-fceholdfmod"))) options->fce_fmodwait = atoi(c); if ((c = getoption(buf, "-mimicmodel")) && (opt = strdup(c))) options->mimicmodel = opt; if ((c = getoption(buf, "-adminauthuser")) && (opt = strdup(c))) options->adminauthuser = opt; return 1; } /* * Show version information about afpd. * Used by "afp -v". */ static void show_version( void ) { int num, i; printf( "afpd %s - Apple Filing Protocol (AFP) daemon of Netatalk\n\n", VERSION ); puts( "This program is free software; you can redistribute it and/or modify it under" ); puts( "the terms of the GNU General Public License as published by the Free Software" ); puts( "Foundation; either version 2 of the License, or (at your option) any later" ); puts( "version. Please see the file COPYING for further information and details.\n" ); puts( "afpd has been compiled with support for these features:\n" ); num = sizeof( afp_versions ) / sizeof( afp_versions[ 0 ] ); printf( " AFP versions:\t" ); for ( i = 0; i < num; i++ ) { printf( "%d.%d ", afp_versions[ i ].av_number/10, afp_versions[ i ].av_number%10); } puts( "" ); printf( "DDP(AppleTalk) Support:\t" ); #ifdef NO_DDP puts( "No" ); #else puts( "Yes" ); #endif printf( " CNID backends:\t" ); #ifdef CNID_BACKEND_CDB printf( "cdb "); #endif #ifdef CNID_BACKEND_DB3 printf( "db3 " ); #endif #ifdef CNID_BACKEND_DBD #ifdef CNID_BACKEND_DBD_TXN printf( "dbd-txn " ); #else printf( "dbd " ); #endif #endif #ifdef CNID_BACKEND_HASH printf( "hash " ); #endif #ifdef CNID_BACKEND_LAST printf( "last " ); #endif #ifdef CNID_BACKEND_MTAB printf( "mtab " ); #endif #ifdef CNID_BACKEND_TDB printf( "tdb " ); #endif puts( "" ); } /* * Show extended version information about afpd and Netatalk. * Used by "afp -V". */ static void show_version_extended(void ) { show_version( ); printf( " SLP support:\t" ); #ifdef USE_SRVLOC puts( "Yes" ); #else puts( "No" ); #endif printf( " Zeroconf support:\t" ); #ifdef USE_ZEROCONF puts( "Yes" ); #else puts( "No" ); #endif printf( " TCP wrappers support:\t" ); #ifdef TCPWRAP puts( "Yes" ); #else puts( "No" ); #endif printf( " Quota support:\t" ); #ifndef NO_QUOTA_SUPPORT puts( "Yes" ); #else puts( "No" ); #endif printf( " Admin group support:\t" ); #ifdef ADMIN_GRP puts( "Yes" ); #else puts( "No" ); #endif printf( " Valid shell checks:\t" ); #ifndef DISABLE_SHELLCHECK puts( "Yes" ); #else puts( "No" ); #endif printf( " cracklib support:\t" ); #ifdef USE_CRACKLIB puts( "Yes" ); #else puts( "No" ); #endif printf( " Dropbox kludge:\t" ); #ifdef DROPKLUDGE puts( "Yes" ); #else puts( "No" ); #endif printf( " Force volume uid/gid:\t" ); #ifdef FORCE_UIDGID puts( "Yes" ); #else puts( "No" ); #endif printf( " EA support:\t" ); puts( EA_MODULES ); printf( " ACL support:\t" ); #ifdef HAVE_ACLS puts( "Yes" ); #else puts( "No" ); #endif printf( " LDAP support:\t" ); #ifdef HAVE_LDAP puts( "Yes" ); #else puts( "No" ); #endif } /* * Display compiled-in default paths */ static void show_paths( void ) { printf( " afpd.conf:\t%s\n", _PATH_AFPDCONF ); printf( " AppleVolumes.system:\t%s\n", _PATH_AFPDSYSVOL ); printf( " AppleVolumes.default:\t%s\n", _PATH_AFPDDEFVOL ); printf( " afp_signature.conf:\t%s\n", _PATH_AFPDSIGCONF ); printf( " afp_voluuid.conf:\t%s\n", _PATH_AFPDUUIDCONF ); #ifdef HAVE_LDAP printf( " afp_ldap.conf:\t%s\n", _PATH_ACL_LDAPCONF ); #else printf( " afp_ldap.conf:\tnot supported\n"); #endif printf( " UAM search path:\t%s\n", _PATH_AFPDUAMPATH ); printf( " Server messages path:\t%s\n", SERVERTEXT); printf( " lockfile:\t%s\n", _PATH_AFPDLOCK); } /* * Display usage information about afpd. */ static void show_usage( char *name ) { fprintf( stderr, "Usage:\t%s [-duptDTI] [-f defaultvolumes] [-s systemvolumes] [-n nbpname]\n", name ); fprintf( stderr, "\t [-c maxconnections] [-g guest] [-P pidfile] [-S port] [-L message]\n" ); fprintf( stderr, "\t [-F configfile] [-U uams] [-m umask]\n" ); fprintf( stderr, "\t%s -h|-v|-V\n", name ); } int afp_options_parse(int ac, char **av, struct afp_options *options) { extern char *optarg; extern int optind; char *p; char *tmp; /* Used for error checking the result of strtol */ int c, err = 0; if (gethostname(options->hostname, sizeof(options->hostname )) < 0 ) { perror( "gethostname" ); return 0; } if (NULL != ( p = strchr(options->hostname, '.' )) ) { *p = '\0'; } #ifdef ultrix if (NULL == ( p = strrchr( av[ 0 ], '/' )) ) { p = av[ 0 ]; } else { p++; } openlog( p, LOG_PID ); /* ultrix only */ #endif /* ultrix */ while (EOF != ( c = getopt( ac, av, OPTIONS )) ) { switch ( c ) { case 'd' : options->flags |= OPTION_DEBUG; break; case 'n' : options->server = optarg; break; case 'f' : options->defaultvol.name = optarg; break; case 's' : options->systemvol.name = optarg; break; case 'u' : options->flags |= OPTION_USERVOLFIRST; break; case 'c' : options->connections = atoi( optarg ); break; case 'g' : options->guest = optarg; break; case 'P' : options->pidfile = optarg; break; case 'p': options->passwdbits |= PASSWD_NOSAVE; break; case 't': options->passwdbits |= PASSWD_SET; break; case 'D': options->transports &= ~AFPTRANS_DDP; break; case 'S': options->port = optarg; break; case 'T': options->transports &= ~AFPTRANS_TCP; break; case 'L': options->loginmesg = optarg; break; case 'F': options->configfile = optarg; break; case 'U': options->uamlist = optarg; break; case 'v': /* version */ show_version( ); puts( "" ); show_paths( ); puts( "" ); exit( 0 ); break; case 'V': /* extended version */ show_version_extended( ); puts( "" ); show_paths( ); puts( "" ); exit( 0 ); break; case 'h': /* usage */ show_usage( p ); exit( 0 ); break; case 'I': options->flags |= OPTION_CUSTOMICON; break; case 'm': options->umask = strtoul(optarg, &tmp, 8); if ((options->umask > 0777)) { fprintf(stderr, "%s: out of range umask setting provided\n", p); err++; } if (tmp[0] != '\0') { fprintf(stderr, "%s: invalid characters in umask setting provided\n", p); err++; } break; default : err++; } } if ( err || optind != ac ) { show_usage( p ); exit( 2 ); } return 1; } netatalk-2.2.2/etc/afpd/afp_dsi.c0000644000175200017500000005574711664176240013532 00000000000000/* * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * * modified from main.c. this handles afp over tcp. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #ifdef HAVE_SYS_STAT_H #include #endif /* HAVE_SYS_STAT_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "switch.h" #include "auth.h" #include "fork.h" #include "dircache.h" #ifdef FORCE_UIDGID #warning UIDGID #include "uid.h" #endif /* FORCE_UIDGID */ /* * We generally pass this from afp_over_dsi to all afp_* funcs, so it should already be * available everywhere. Unfortunately some funcs (eg acltoownermode) need acces to it * but are deeply nested in the function chain with the caller already without acces to it. * Changing this would require adding a reference to the caller which itself might be * called in many places (eg acltoownermode is called from accessmode). * The only sane way out is providing a copy of it here: */ AFPObj *AFPobj = NULL; typedef struct { uint16_t DSIreqID; uint8_t AFPcommand; uint32_t result; } rc_elem_t; /* * AFP replay cache: * - fix sized array * - indexed just by taking DSIreqID mod REPLAYCACHE_SIZE */ static rc_elem_t replaycache[REPLAYCACHE_SIZE]; static sigjmp_buf recon_jmp; static void afp_dsi_close(AFPObj *obj) { DSI *dsi = obj->handle; close(obj->ipc_fd); obj->ipc_fd = -1; /* we may have been called from a signal handler caught when afpd was running * as uid 0, that's the wrong user for volume's prexec_close scripts if any, * restore our login user */ if (geteuid() != obj->uid) { if (seteuid( obj->uid ) < 0) { LOG(log_error, logtype_afpd, "can't seteuid(%u) back %s: uid: %u, euid: %u", obj->uid, strerror(errno), getuid(), geteuid()); exit(EXITERR_SYS); } } close_all_vol(); if (obj->logout) (*obj->logout)(); LOG(log_note, logtype_afpd, "AFP statistics: %.2f KB read, %.2f KB written", dsi->read_count/1024.0, dsi->write_count/1024.0); log_dircache_stat(); dsi_close(dsi); } /* ------------------------------- * SIGTERM * a little bit of code duplication. */ static void afp_dsi_die(int sig) { DSI *dsi = (DSI *)AFPobj->handle; if (dsi->flags & DSI_RECONINPROG) { /* Primary reconnect succeeded, got SIGTERM from afpd parent */ dsi->flags &= ~DSI_RECONINPROG; return; /* this returns to afp_disconnect */ } if (dsi->flags & DSI_DISCONNECTED) { LOG(log_note, logtype_afpd, "Disconnected session terminating"); exit(0); } dsi_attention(AFPobj->handle, AFPATTN_SHUTDOWN); afp_dsi_close(AFPobj); if (sig) /* if no signal, assume dieing because logins are disabled & don't log it (maintenance mode)*/ LOG(log_info, logtype_afpd, "Connection terminated"); if (sig == SIGTERM || sig == SIGALRM) { exit( 0 ); } else { exit(sig); } } /* SIGQUIT handler */ static void ipc_reconnect_handler(int sig _U_) { DSI *dsi = (DSI *)AFPobj->handle; if (reconnect_ipc(AFPobj) != 0) { LOG(log_error, logtype_afpd, "ipc_reconnect_handler: failed IPC reconnect"); afp_dsi_close(AFPobj); exit(EXITERR_SYS); } if (ipc_child_write(AFPobj->ipc_fd, IPC_GETSESSION, AFPobj->sinfo.clientid_len, AFPobj->sinfo.clientid) != 0) { LOG(log_error, logtype_afpd, "ipc_reconnect_handler: failed IPC ID resend"); afp_dsi_close(AFPobj); exit(EXITERR_SYS); } LOG(log_note, logtype_afpd, "ipc_reconnect_handler: IPC reconnect done"); } /* SIGURG handler (primary reconnect) */ static void afp_dsi_transfer_session(int sig _U_) { uint16_t dsiID; int socket; DSI *dsi = (DSI *)AFPobj->handle; LOG(log_debug, logtype_afpd, "afp_dsi_transfer_session: got SIGURG, trying to receive session"); if (readt(AFPobj->ipc_fd, &dsiID, 2, 0, 2) != 2) { LOG(log_error, logtype_afpd, "afp_dsi_transfer_session: couldn't receive DSI id, goodbye"); afp_dsi_close(AFPobj); exit(EXITERR_SYS); } if ((socket = recv_fd(AFPobj->ipc_fd, 1)) == -1) { LOG(log_error, logtype_afpd, "afp_dsi_transfer_session: couldn't receive session fd, goodbye"); afp_dsi_close(AFPobj); exit(EXITERR_SYS); } LOG(log_debug, logtype_afpd, "afp_dsi_transfer_session: received socket fd: %i", socket); dsi->proto_close(dsi); dsi->socket = socket; dsi->flags = DSI_RECONSOCKET; dsi->datalen = 0; dsi->eof = dsi->start = dsi->buffer; dsi->in_write = 0; dsi->header.dsi_requestID = dsiID; dsi->header.dsi_command = DSIFUNC_CMD; /* * The session transfer happens in the middle of FPDisconnect old session, thus we * have to send the reply now. */ if (!dsi_cmdreply(dsi, AFP_OK)) { LOG(log_error, logtype_afpd, "dsi_cmdreply: %s", strerror(errno) ); afp_dsi_close(AFPobj); exit(EXITERR_CLNT); } LOG(log_note, logtype_afpd, "afp_dsi_transfer_session: succesfull primary reconnect"); /* * Now returning from this signal handler return to dsi_receive which should start * reading/continuing from the connected socket that was passed via the parent from * another session. The parent will terminate that session. */ siglongjmp(recon_jmp, 1); } /* ------------------- */ static void afp_dsi_timedown(int sig _U_) { struct sigaction sv; struct itimerval it; DSI *dsi = (DSI *)AFPobj->handle; dsi->flags |= DSI_DIE; /* shutdown and don't reconnect. server going down in 5 minutes. */ setmessage("The server is going down for maintenance."); if (dsi_attention(AFPobj->handle, AFPATTN_SHUTDOWN | AFPATTN_NORECONNECT | AFPATTN_MESG | AFPATTN_TIME(5)) < 0) { DSI *dsi = (DSI *)AFPobj->handle; dsi->down_request = 1; } it.it_interval.tv_sec = 0; it.it_interval.tv_usec = 0; it.it_value.tv_sec = 300; it.it_value.tv_usec = 0; if ( setitimer( ITIMER_REAL, &it, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "afp_timedown: setitimer: %s", strerror(errno) ); afp_dsi_die(EXITERR_SYS); } memset(&sv, 0, sizeof(sv)); sv.sa_handler = afp_dsi_die; sigemptyset( &sv.sa_mask ); sigaddset(&sv.sa_mask, SIGHUP); sigaddset(&sv.sa_mask, SIGTERM); sv.sa_flags = SA_RESTART; if ( sigaction( SIGALRM, &sv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "afp_timedown: sigaction: %s", strerror(errno) ); afp_dsi_die(EXITERR_SYS); } /* ignore myself */ sv.sa_handler = SIG_IGN; sigemptyset( &sv.sa_mask ); sv.sa_flags = SA_RESTART; if ( sigaction( SIGUSR1, &sv, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "afp_timedown: sigaction SIGHUP: %s", strerror(errno) ); afp_dsi_die(EXITERR_SYS); } } /* --------------------------------- * SIGHUP reload configuration file */ volatile int reload_request = 0; static void afp_dsi_reload(int sig _U_) { reload_request = 1; } /* --------------------------------- * SIGINT: enable max_debug LOGging */ static volatile sig_atomic_t debug_request = 0; static void afp_dsi_debug(int sig _U_) { debug_request = 1; } /* ---------------------- */ static void afp_dsi_getmesg (int sig _U_) { DSI *dsi = (DSI *)AFPobj->handle; dsi->msg_request = 1; if (dsi_attention(AFPobj->handle, AFPATTN_MESG | AFPATTN_TIME(5)) < 0) dsi->msg_request = 2; } static void alarm_handler(int sig _U_) { int err; DSI *dsi = (DSI *)AFPobj->handle; /* we have to restart the timer because some libraries may use alarm() */ setitimer(ITIMER_REAL, &dsi->timer, NULL); /* we got some traffic from the client since the previous timer tick. */ if ((dsi->flags & DSI_DATA)) { dsi->flags &= ~DSI_DATA; return; } dsi->tickle++; LOG(log_maxdebug, logtype_afpd, "alarm: tickles: %u, flags: %s|%s|%s|%s|%s|%s|%s|%s|%s", dsi->tickle, (dsi->flags & DSI_DATA) ? "DSI_DATA" : "-", (dsi->flags & DSI_RUNNING) ? "DSI_RUNNING" : "-", (dsi->flags & DSI_SLEEPING) ? "DSI_SLEEPING" : "-", (dsi->flags & DSI_EXTSLEEP) ? "DSI_EXTSLEEP" : "-", (dsi->flags & DSI_DISCONNECTED) ? "DSI_DISCONNECTED" : "-", (dsi->flags & DSI_DIE) ? "DSI_DIE" : "-", (dsi->flags & DSI_NOREPLY) ? "DSI_NOREPLY" : "-", (dsi->flags & DSI_RECONSOCKET) ? "DSI_RECONSOCKET" : "-", (dsi->flags & DSI_RECONINPROG) ? "DSI_RECONINPROG" : "-"); if (dsi->flags & DSI_SLEEPING) { if (dsi->tickle > AFPobj->options.sleep) { LOG(log_note, logtype_afpd, "afp_alarm: sleep time ended"); afp_dsi_die(EXITERR_CLNT); } return; } if (dsi->flags & DSI_DISCONNECTED) { if (geteuid() == 0) { LOG(log_note, logtype_afpd, "afp_alarm: unauthenticated user, connection problem"); afp_dsi_die(EXITERR_CLNT); } if (dsi->tickle > AFPobj->options.disconnected) { LOG(log_error, logtype_afpd, "afp_alarm: reconnect timer expired, goodbye"); afp_dsi_die(EXITERR_CLNT); } return; } /* if we're in the midst of processing something, don't die. */ if (dsi->tickle >= AFPobj->options.timeout) { LOG(log_error, logtype_afpd, "afp_alarm: child timed out, entering disconnected state"); if (dsi_disconnect(dsi) != 0) afp_dsi_die(EXITERR_CLNT); return; } if ((err = pollvoltime(AFPobj)) == 0) LOG(log_debug, logtype_afpd, "afp_alarm: sending DSI tickle"); err = dsi_tickle(AFPobj->handle); if (err <= 0) { if (geteuid() == 0) { LOG(log_note, logtype_afpd, "afp_alarm: unauthenticated user, connection problem"); afp_dsi_die(EXITERR_CLNT); } LOG(log_error, logtype_afpd, "afp_alarm: connection problem, entering disconnected state"); if (dsi_disconnect(dsi) != 0) afp_dsi_die(EXITERR_CLNT); } } /* ----------------- if dsi->in_write is set attention, tickle (and close?) msg aren't sent. We don't care about tickle */ static void pending_request(DSI *dsi) { /* send pending attention */ /* read msg if any, it could be done in afp_getsrvrmesg */ if (dsi->msg_request) { if (dsi->msg_request == 2) { /* didn't send it in signal handler */ dsi_attention(AFPobj->handle, AFPATTN_MESG | AFPATTN_TIME(5)); } dsi->msg_request = 0; readmessage(AFPobj); } if (dsi->down_request) { dsi->down_request = 0; dsi_attention(AFPobj->handle, AFPATTN_SHUTDOWN | AFPATTN_NORECONNECT | AFPATTN_MESG | AFPATTN_TIME(5)); } } /* ------------------------------------------- afp over dsi. this never returns. */ void afp_over_dsi(AFPObj *obj) { DSI *dsi = (DSI *) obj->handle; int rc_idx; u_int32_t err, cmd; u_int8_t function; struct sigaction action; AFPobj = obj; dsi->AFPobj = obj; obj->exit = afp_dsi_die; obj->reply = (int (*)()) dsi_cmdreply; obj->attention = (int (*)(void *, AFPUserBytes)) dsi_attention; dsi->tickle = 0; memset(&action, 0, sizeof(action)); sigfillset(&action.sa_mask); action.sa_flags = SA_RESTART; /* install SIGHUP */ action.sa_handler = afp_dsi_reload; if ( sigaction( SIGHUP, &action, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) ); afp_dsi_die(EXITERR_SYS); } /* install SIGURG */ action.sa_handler = afp_dsi_transfer_session; if ( sigaction( SIGURG, &action, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) ); afp_dsi_die(EXITERR_SYS); } /* install SIGTERM */ action.sa_handler = afp_dsi_die; if ( sigaction( SIGTERM, &action, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) ); afp_dsi_die(EXITERR_SYS); } /* install SIGQUIT */ action.sa_handler = ipc_reconnect_handler; if ( sigaction(SIGQUIT, &action, NULL ) < 0 ) { LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) ); afp_dsi_die(EXITERR_SYS); } /* SIGUSR2 - server message support */ action.sa_handler = afp_dsi_getmesg; if ( sigaction( SIGUSR2, &action, NULL) < 0 ) { LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) ); afp_dsi_die(EXITERR_SYS); } /* SIGUSR1 - set down in 5 minutes */ action.sa_handler = afp_dsi_timedown; action.sa_flags = SA_RESTART; if ( sigaction( SIGUSR1, &action, NULL) < 0 ) { LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) ); afp_dsi_die(EXITERR_SYS); } /* SIGINT - enable max_debug LOGging to /tmp/afpd.PID.XXXXXX */ action.sa_handler = afp_dsi_debug; if ( sigaction( SIGINT, &action, NULL) < 0 ) { LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) ); afp_dsi_die(EXITERR_SYS); } #ifndef DEBUGGING /* SIGALRM - tickle handler */ action.sa_handler = alarm_handler; if ((sigaction(SIGALRM, &action, NULL) < 0) || (setitimer(ITIMER_REAL, &dsi->timer, NULL) < 0)) { afp_dsi_die(EXITERR_SYS); } #endif /* DEBUGGING */ if (dircache_init(obj->options.dircachesize) != 0) afp_dsi_die(EXITERR_SYS); /* set TCP snd/rcv buf */ if (obj->options.tcp_rcvbuf) { if (setsockopt(dsi->socket, SOL_SOCKET, SO_RCVBUF, &obj->options.tcp_rcvbuf, sizeof(obj->options.tcp_rcvbuf)) != 0) { LOG(log_error, logtype_dsi, "afp_over_dsi: setsockopt(SO_RCVBUF): %s", strerror(errno)); } } if (obj->options.tcp_sndbuf) { if (setsockopt(dsi->socket, SOL_SOCKET, SO_SNDBUF, &obj->options.tcp_sndbuf, sizeof(obj->options.tcp_sndbuf)) != 0) { LOG(log_error, logtype_dsi, "afp_over_dsi: setsockopt(SO_SNDBUF): %s", strerror(errno)); } } /* get stuck here until the end */ while (1) { if (sigsetjmp(recon_jmp, 1) != 0) /* returning from SIGALARM handler for a primary reconnect */ continue; /* Blocking read on the network socket */ cmd = dsi_stream_receive(dsi); if (cmd == 0) { /* cmd == 0 is the error condition */ if (dsi->flags & DSI_RECONSOCKET) { /* we just got a reconnect so we immediately try again to receive on the new fd */ dsi->flags &= ~DSI_RECONSOCKET; continue; } /* the client sometimes logs out (afp_logout) but doesn't close the DSI session */ if (dsi->flags & DSI_AFP_LOGGED_OUT) { LOG(log_note, logtype_afpd, "afp_over_dsi: client logged out, terminating DSI session"); afp_dsi_close(obj); exit(0); } #if 0 /* got ECONNRESET in read from client => exit*/ if (dsi->flags & DSI_GOT_ECONNRESET) { LOG(log_note, logtype_afpd, "afp_over_dsi: client connection reset"); afp_dsi_close(obj); exit(0); } #endif if (dsi->flags & DSI_RECONINPROG) { LOG(log_note, logtype_afpd, "afp_over_dsi: failed reconnect"); afp_dsi_close(obj); exit(0); } /* Some error on the client connection, enter disconnected state */ if (dsi_disconnect(dsi) != 0) afp_dsi_die(EXITERR_CLNT); while (dsi->flags & DSI_DISCONNECTED) pause(); /* gets interrupted by SIGALARM or SIGURG tickle */ continue; /* continue receiving until disconnect timer expires * or a primary reconnect succeeds */ } if (!(dsi->flags & DSI_EXTSLEEP) && (dsi->flags & DSI_SLEEPING)) { LOG(log_debug, logtype_afpd, "afp_over_dsi: got data, ending normal sleep"); dsi->flags &= ~DSI_SLEEPING; dsi->tickle = 0; } if (reload_request) { reload_request = 0; load_volumes(AFPobj); } /* The first SIGINT enables debugging, the next restores the config */ if (debug_request) { static int debugging = 0; debug_request = 0; dircache_dump(); uuidcache_dump(); if (debugging) { if (obj->options.logconfig) setuplog(obj->options.logconfig); else setuplog("default log_note"); debugging = 0; } else { char logstr[50]; debugging = 1; sprintf(logstr, "default log_maxdebug /tmp/afpd.%u.XXXXXX", getpid()); setuplog(logstr); } } dsi->flags |= DSI_DATA; dsi->tickle = 0; switch(cmd) { case DSIFUNC_CLOSE: LOG(log_debug, logtype_afpd, "DSI: close session request"); afp_dsi_close(obj); LOG(log_note, logtype_afpd, "done"); exit(0); case DSIFUNC_TICKLE: dsi->flags &= ~DSI_DATA; /* thats no data in the sense we use it in alarm_handler */ LOG(log_debug, logtype_afpd, "DSI: client tickle"); /* timer is not every 30 seconds anymore, so we don't get killed on the client side. */ if ((dsi->flags & DSI_DIE)) dsi_tickle(dsi); break; case DSIFUNC_CMD: #ifdef AFS if ( writtenfork ) { if ( flushfork( writtenfork ) < 0 ) { LOG(log_error, logtype_afpd, "main flushfork: %s", strerror(errno) ); } writtenfork = NULL; } #endif /* AFS */ function = (u_char) dsi->commands[0]; /* AFP replay cache */ rc_idx = dsi->clientID % REPLAYCACHE_SIZE; LOG(log_debug, logtype_dsi, "DSI request ID: %u", dsi->clientID); if (replaycache[rc_idx].DSIreqID == dsi->clientID && replaycache[rc_idx].AFPcommand == function) { LOG(log_note, logtype_afpd, "AFP Replay Cache match: id: %u / cmd: %s", dsi->clientID, AfpNum2name(function)); err = replaycache[rc_idx].result; /* AFP replay cache end */ } else { /* send off an afp command. in a couple cases, we take advantage * of the fact that we're a stream-based protocol. */ if (afp_switch[function]) { dsi->datalen = DSI_DATASIZ; dsi->flags |= DSI_RUNNING; LOG(log_debug, logtype_afpd, "<== Start AFP command: %s", AfpNum2name(function)); err = (*afp_switch[function])(obj, (char *)&dsi->commands, dsi->cmdlen, (char *)&dsi->data, &dsi->datalen); LOG(log_debug, logtype_afpd, "==> Finished AFP command: %s -> %s", AfpNum2name(function), AfpErr2name(err)); dir_free_invalid_q(); #ifdef FORCE_UIDGID /* bring everything back to old euid, egid */ if (obj->force_uid) restore_uidgid ( &obj->uidgid ); #endif /* FORCE_UIDGID */ dsi->flags &= ~DSI_RUNNING; /* Add result to the AFP replay cache */ replaycache[rc_idx].DSIreqID = dsi->clientID; replaycache[rc_idx].AFPcommand = function; replaycache[rc_idx].result = err; } else { LOG(log_error, logtype_afpd, "bad function %X", function); dsi->datalen = 0; err = AFPERR_NOOP; } } /* single shot toggle that gets set by dsi_readinit. */ if (dsi->flags & DSI_NOREPLY) { dsi->flags &= ~DSI_NOREPLY; break; } else if (!dsi_cmdreply(dsi, err)) { LOG(log_error, logtype_afpd, "dsi_cmdreply(%d): %s", dsi->socket, strerror(errno) ); if (dsi_disconnect(dsi) != 0) afp_dsi_die(EXITERR_CLNT); } break; case DSIFUNC_WRITE: /* FPWrite and FPAddIcon */ function = (u_char) dsi->commands[0]; if ( afp_switch[ function ] != NULL ) { dsi->datalen = DSI_DATASIZ; dsi->flags |= DSI_RUNNING; LOG(log_debug, logtype_afpd, "<== Start AFP command: %s", AfpNum2name(function)); err = (*afp_switch[function])(obj, (char *)&dsi->commands, dsi->cmdlen, (char *)&dsi->data, &dsi->datalen); LOG(log_debug, logtype_afpd, "==> Finished AFP command: %s -> %s", AfpNum2name(function), AfpErr2name(err)); dsi->flags &= ~DSI_RUNNING; #ifdef FORCE_UIDGID /* bring everything back to old euid, egid */ if (obj->force_uid) restore_uidgid ( &obj->uidgid ); #endif /* FORCE_UIDGID */ } else { LOG(log_error, logtype_afpd, "(write) bad function %x", function); dsi->datalen = 0; err = AFPERR_NOOP; } if (!dsi_wrtreply(dsi, err)) { LOG(log_error, logtype_afpd, "dsi_wrtreply: %s", strerror(errno) ); if (dsi_disconnect(dsi) != 0) afp_dsi_die(EXITERR_CLNT); } break; case DSIFUNC_ATTN: /* attention replies */ break; /* error. this usually implies a mismatch of some kind * between server and client. if things are correct, * we need to flush the rest of the packet if necessary. */ default: LOG(log_info, logtype_afpd,"afp_dsi: spurious command %d", cmd); dsi_writeinit(dsi, dsi->data, DSI_DATASIZ); dsi_writeflush(dsi); break; } pending_request(dsi); fce_pending_events(obj); } /* error */ afp_dsi_die(EXITERR_CLNT); } netatalk-2.2.2/etc/afpd/status.h0000644000175200017500000000332211655731244013434 00000000000000#ifndef AFPD_STATUS_H #define AFPD_STATUS_H 1 #include #include #include #include #include "afp_config.h" /* we use these to prevent whacky alignment problems */ #define AFPSTATUS_MACHOFF 0 #define AFPSTATUS_VERSOFF 2 #define AFPSTATUS_UAMSOFF 4 #define AFPSTATUS_ICONOFF 6 #define AFPSTATUS_FLAGOFF 8 /* AFPSTATUS_PRELEN is the number of bytes for status data prior to * the ServerName field. * * This is two bytes of offset space for the MachineType, AFPVersionCount, * UAMCount, VolumeIconAndMask, and the 16-bit "Fixed" status flags. */ #define AFPSTATUS_PRELEN 10 /* AFPSTATUS_POSTLEN is the number of bytes for offset records * after the ServerName field. * * Right now, this is 2 bytes each for ServerSignature, networkAddressCount, * DirectoryNameCount, and UTF-8 ServerName */ #define AFPSTATUS_POSTLEN 8 #define AFPSTATUS_LEN (AFPSTATUS_PRELEN + AFPSTATUS_POSTLEN) /* AFPSTATUS_MACHLEN is the number of characters for the MachineType. */ #define AFPSTATUS_MACHLEN 16 #define PASSWD_NONE 0 #define PASSWD_SET (1 << 0) #define PASSWD_NOSAVE (1 << 1) #define PASSWD_ALL (PASSWD_SET | PASSWD_NOSAVE) extern void status_versions (char * /*status*/, #ifndef NO_DDP const ASP, #endif const DSI *); extern void status_uams (char * /*status*/, const char * /*authlist*/); extern void status_init (AFPConfig *, AFPConfig *, const struct afp_options *); extern void set_signature(struct afp_options *); /* FP functions */ int afp_getsrvrinfo (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); #endif netatalk-2.2.2/etc/afpd/mangle.c0000644000175200017500000002234411655731126013353 00000000000000/* * Copyright (c) 2002. Joe Marcus Clarke (marcus@marcuscom.com) * All Rights Reserved. See COPYRIGHT. * * mangle, demangle (filename): * mangle or demangle filenames if they are greater than the max allowed * characters for a given version of AFP. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include "mangle.h" #include "desktop.h" #define hextoint( c ) ( isdigit( c ) ? c - '0' : c + 10 - 'A' ) #define isuxdigit(x) (isdigit(x) || (isupper(x) && isxdigit(x))) static size_t mangle_extension(const struct vol *vol, const char* uname, char* extension, charset_t charset) { char *p = strrchr(uname, '.'); if (p && p != uname) { u_int16_t flags = CONV_FORCE | CONV_UNESCAPEHEX; size_t len = convert_charset(vol->v_volcharset, charset, vol->v_maccharset, p, strlen(p), extension, MAX_EXT_LENGTH, &flags); if (len != (size_t)-1) return len; } return 0; } static char *demangle_checks(const struct vol *vol, char* uname, char * mfilename, size_t prefix, char * ext) { u_int16_t flags; static char buffer[MAXPATHLEN +2]; /* for convert_charset dest_len parameter +2 */ size_t len; size_t mfilenamelen; /* We need to check, whether we really need to demangle the filename */ /* i.e. it's not just a file with a valid #HEX in the name ... */ /* but we don't want to miss valid demangle as well. */ /* check whether file extensions match */ char buf[MAX_EXT_LENGTH + 2]; /* for convert_charset dest_len parameter +2 */ size_t ext_len = mangle_extension(vol, uname, buf, CH_UTF8_MAC); if (ext_len) { buf[ext_len] = '\0'; if (strcmp(ext, buf)) return mfilename; } else { if (*ext) return mfilename; } /* First we convert the unix name to our volume maccharset */ /* This assumes, OSX will not send us a mangled name for *any* */ /* other reason than a hint/filename mismatch on the OSX side!! */ /* If the filename needed mangling, we'll get the mac filename */ /* till the first unconvertable char, so these have to match */ /* the mangled name we got .. */ flags = CONV_IGNORE | CONV_UNESCAPEHEX; if ( (size_t) -1 == (len = convert_charset(vol->v_volcharset, vol->v_maccharset, 0, uname, strlen(uname), buffer, MAXPATHLEN, &flags)) ) { return mfilename; } /* If the filename is too long we also needed to mangle */ mfilenamelen = strlen(mfilename); if ( len >= vol->max_filename || mfilenamelen == MACFILELEN ) { flags |= CONV_REQMANGLE; len = prefix; } /* Ok, mangling was needed, now we do some further checks */ /* this is still necessary, as we might have a file abcde:xx */ /* with id 12, mangled to abcde#12, and a passed filename */ /* abcd#12 */ /* if we only checked if "prefix" number of characters match */ /* we get a false postive in above case */ if ( (flags & CONV_REQMANGLE) ) { if (len) { /* convert the buffer to UTF8_MAC ... */ if ((size_t) -1 == (len = convert_charset(vol->v_maccharset, CH_UTF8_MAC, 0, buffer, len, buffer, MAXPATHLEN, &flags)) ) { return mfilename; } /* Now compare the two names, they have to match the number of characters in buffer */ /* prefix can be longer than len, OSX might send us the first character(s) of a */ /* decomposed char as the *last* character(s) before the #, so our match below will */ /* still work, but leaves room for a race ... FIXME */ if ( (prefix >= len || mfilenamelen == MACFILELEN) && !strncmp (mfilename, buffer, len)) { return uname; } } else { /* We couldn't convert the name to maccharset at all, so we'd expect a name */ /* in the "???#ID" form ... */ if ( !strncmp("???", mfilename, prefix)) { return uname; } /* ..but OSX might send us only the first characters of a decomposed character. */ /* So convert to UTF8_MAC again, now at least the prefix number of */ /* characters have to match ... again a possible race FIXME */ if ( (size_t) -1 == (len = convert_charset(vol->v_volcharset, CH_UTF8_MAC, 0, uname, strlen(uname), buffer, MAXPATHLEN, &flags)) ) { return mfilename; } if ( !strncmp (mfilename, buffer, prefix) ) { return uname; } } } return mfilename; } /* ------------------------------------------------------- */ static char * private_demangle(const struct vol *vol, char *mfilename, cnid_t did, cnid_t *osx) { char *t; char *u_name; u_int32_t id, file_id; static char buffer[12 + MAXPATHLEN + 1]; int len = 12 + MAXPATHLEN + 1; struct dir *dir; size_t prefix; id = file_id = 0; t = strchr(mfilename, MANGLE_CHAR); if (t == NULL) { return mfilename; } prefix = t - mfilename; /* FIXME * is prefix == 0 a valid mangled filename ? */ /* may be a mangled filename */ t++; if (*t == '0') { /* can't start with a 0 */ return mfilename; } while(isuxdigit(*t)) { id = (id *16) + hextoint(*t); t++; } if ((*t != 0 && *t != '.') || strlen(t) > MAX_EXT_LENGTH || id < 17) { return mfilename; } file_id = id = htonl(id); if (osx) { *osx = id; } /* is it a dir?, there's a conflict with pre OSX 'trash #2' */ if ((dir = dirlookup(vol, id))) { if (dir->d_pdid != did) { /* not in the same folder, there's a race with outdate cache * but we have to live with it, hopefully client will recover */ return mfilename; } if (!osx) { /* it's not from cname so mfilename and dir must be the same */ if (strcmp(cfrombstr(dir->d_m_name), mfilename) == 0) { return cfrombstr(dir->d_u_name); } } else { return demangle_checks(vol, cfrombstr(dir->d_u_name), mfilename, prefix, t); } } else if (NULL != (u_name = cnid_resolve(vol->v_cdb, &id, buffer, len)) ) { if (id != did) { return mfilename; } if (!osx) { /* convert back to mac name and check it's the same */ t = utompath(vol, u_name, file_id, utf8_encoding()); if (!strcmp(t, mfilename)) { return u_name; } } else { return demangle_checks (vol, u_name, mfilename, prefix, t); } } return mfilename; } /* ------------------------------------------------------- */ char * demangle(const struct vol *vol, char *mfilename, cnid_t did) { return private_demangle(vol, mfilename, did, NULL); } /* ------------------------------------------------------- * OS X */ char * demangle_osx(const struct vol *vol, char *mfilename, cnid_t did, cnid_t *fileid) { return private_demangle(vol, mfilename, did, fileid); } /* ------------------------------------------------------- FIXME !!! Early Mac OS X (10.0-10.4.?) had the limitation up to 255 Byte. Current implementation is: volcharset -> UTF16-MAC -> truncated 255 UTF8-MAC Recent Mac OS X (10.4.?-) don't have this limitation. Desirable implementation is: volcharset -> truncated 510 UTF16-MAC -> UTF8-MAC ------------------------ with utf8 filename not always round trip filename mac filename too long or first chars if unmatchable chars. uname unix filename id file/folder ID or 0 */ char * mangle(const struct vol *vol, char *filename, size_t filenamelen, char *uname, cnid_t id, int flags) { char *m = NULL; static char mfilename[MAXPATHLEN]; /* way > maxlen */ char mangle_suffix[MANGLE_LENGTH + 1]; char ext[MAX_EXT_LENGTH +2]; /* for convert_charset dest_len parameter +2 */ size_t ext_len; size_t maxlen; int k; maxlen = (flags & 2)?UTF8FILELEN_EARLY:MACFILELEN; /* was vol->max_filename */ /* Do we really need to mangle this filename? */ if (!(flags & 1) && filenamelen <= maxlen) { return filename; } if (!id) { /* we don't have the file id! only catsearch call mangle with id == 0 */ return NULL; } /* First, attempt to locate a file extension. */ ext_len = mangle_extension(vol, uname, ext, (flags & 2) ? CH_UTF8_MAC : vol->v_maccharset); m = mfilename; k = sprintf(mangle_suffix, "%c%X", MANGLE_CHAR, ntohl(id)); if (filenamelen + k + ext_len > maxlen) { u_int16_t opt = CONV_FORCE | CONV_UNESCAPEHEX; size_t n = convert_charset(vol->v_volcharset, (flags & 2) ? CH_UTF8_MAC : vol->v_maccharset, vol->v_maccharset, uname, strlen(uname), m, maxlen - k - ext_len, &opt); m[n != (size_t)-1 ? n : 0] = 0; } else { strlcpy(m, filename, filenamelen + 1); } if (*m == 0) { strcat(m, "???"); } strcat(m, mangle_suffix); if (ext_len) { strncat(m, ext, ext_len); } return m; } netatalk-2.2.2/etc/afpd/file.c0000644000175200017500000021067011655731244013031 00000000000000/* * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include /* STDC check */ #if STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #include #include #include #include #include #include #include #include #include #include #include #include #include "directory.h" #include "dircache.h" #include "desktop.h" #include "volume.h" #include "fork.h" #include "file.h" #include "filedir.h" #include "unix.h" /* the format for the finderinfo fields (from IM: Toolbox Essentials): * field bytes subfield bytes * * files: * ioFlFndrInfo 16 -> type 4 type field * creator 4 creator field * flags 2 finder flags: * alias, bundle, etc. * location 4 location in window * folder 2 window that contains file * * ioFlXFndrInfo 16 -> iconID 2 icon id * unused 6 reserved * script 1 script system * xflags 1 reserved * commentID 2 comment id * putawayID 4 home directory id */ const u_char ufinderi[ADEDLEN_FINDERI] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; static const u_char old_ufinderi[] = { 'T', 'E', 'X', 'T', 'U', 'N', 'I', 'X' }; /* ---------------------- */ static int default_type(void *finder) { if (!memcmp(finder, ufinderi, 8) || !memcmp(finder, old_ufinderi, 8)) return 1; return 0; } /* FIXME path : unix or mac name ? (for now it's unix name ) */ void *get_finderinfo(const struct vol *vol, const char *upath, struct adouble *adp, void *data, int islink) { struct extmap *em; void *ad_finder = NULL; int chk_ext = 0; if (adp) ad_finder = ad_entry(adp, ADEID_FINDERI); if (ad_finder) { memcpy(data, ad_finder, ADEDLEN_FINDERI); /* default type ? */ if (default_type(ad_finder)) chk_ext = 1; } else { memcpy(data, ufinderi, ADEDLEN_FINDERI); chk_ext = 1; if (vol_inv_dots(vol) && *upath == '.') { /* make it invisible */ u_int16_t ashort; ashort = htons(FINDERINFO_INVISIBLE); memcpy((char *)data + FINDERINFO_FRFLAGOFF, &ashort, sizeof(ashort)); } } if (islink){ u_int16_t linkflag; memcpy(&linkflag, (char *)data + FINDERINFO_FRFLAGOFF, 2); linkflag |= htons(FINDERINFO_ISALIAS); memcpy((char *)data + FINDERINFO_FRFLAGOFF, &linkflag, 2); memcpy((char *)data + FINDERINFO_FRTYPEOFF,"slnk",4); memcpy((char *)data + FINDERINFO_FRCREATOFF,"rhap",4); chk_ext = 0; } /** Only enter if no appledouble information and no finder information found. */ if (chk_ext && (em = getextmap( upath ))) { memcpy(data, em->em_type, sizeof( em->em_type )); memcpy((char *)data + 4, em->em_creator, sizeof(em->em_creator)); } return data; } /* --------------------- */ char *set_name(const struct vol *vol, char *data, cnid_t pid, char *name, cnid_t id, u_int32_t utf8) { u_int32_t aint; char *tp = NULL; char *src = name; aint = strlen( name ); if (!utf8) { /* want mac name */ if (utf8_encoding()) { /* but name is an utf8 mac name */ char *u, *m; /* global static variable... */ tp = strdup(name); if (!(u = mtoupath(vol, name, pid, 1)) || !(m = utompath(vol, u, id, 0))) { aint = 0; } else { aint = strlen(m); src = m; } } if (aint > MACFILELEN) aint = MACFILELEN; *data++ = aint; } else { u_int16_t temp; if (aint > UTF8FILELEN_EARLY) /* FIXME safeguard, anyway if no ascii char it's game over*/ aint = UTF8FILELEN_EARLY; utf8 = vol->v_kTextEncoding; memcpy(data, &utf8, sizeof(utf8)); data += sizeof(utf8); temp = htons(aint); memcpy(data, &temp, sizeof(temp)); data += sizeof(temp); } memcpy( data, src, aint ); data += aint; if (tp) { strcpy(name, tp); free(tp); } return data; } /* * FIXME: PDINFO is UTF8 and doesn't need adp */ #define PARAM_NEED_ADP(b) ((b) & ((1 << FILPBIT_ATTR) |\ (1 << FILPBIT_CDATE) |\ (1 << FILPBIT_MDATE) |\ (1 << FILPBIT_BDATE) |\ (1 << FILPBIT_FINFO) |\ (1 << FILPBIT_RFLEN) |\ (1 << FILPBIT_EXTRFLEN) |\ (1 << FILPBIT_PDINFO) |\ (1 << FILPBIT_FNUM) |\ (1 << FILPBIT_UNIXPR))) /*! * @brief Get CNID for did/upath args both from database and adouble file * * 1. Get the objects CNID as stored in its adouble file * 2. Get the objects CNID from the database * 3. If there's a problem with a "dbd" database, fallback to "tdb" in memory * 4. In case 2 and 3 differ, store 3 in the adouble file * * @param vol (rw) volume * @param adp (rw) adouble struct of object upath, might be NULL * @param st (r) stat of upath, must NOT be NULL * @param did (r) parent CNID of upath * @param upath (r) name of object * @param len (r) strlen of upath */ uint32_t get_id(struct vol *vol, struct adouble *adp, const struct stat *st, const cnid_t did, const char *upath, const int len) { static int first = 1; /* mark if this func is called the first time */ u_int32_t adcnid; u_int32_t dbcnid = CNID_INVALID; restart: if (vol->v_cdb != NULL) { /* prime aint with what we think is the cnid, set did to zero for catching moved files */ adcnid = ad_getid(adp, st->st_dev, st->st_ino, 0, vol->v_stamp); /* (1) */ dbcnid = cnid_add(vol->v_cdb, st, did, upath, len, adcnid); /* (2) */ /* Throw errors if cnid_add fails. */ if (dbcnid == CNID_INVALID) { switch (errno) { case CNID_ERR_CLOSE: /* the db is closed */ break; case CNID_ERR_PARAM: LOG(log_error, logtype_afpd, "get_id: Incorrect parameters passed to cnid_add"); afp_errno = AFPERR_PARAM; goto exit; case CNID_ERR_PATH: afp_errno = AFPERR_PARAM; goto exit; default: /* Close CNID backend if "dbd" and switch to temp in-memory "tdb" */ /* we have to do it here for "dbd" because it uses "lazy opening" */ /* In order to not end in a loop somehow with goto restart below */ /* */ if (first && (strcmp(vol->v_cnidscheme, "dbd") == 0)) { /* (3) */ cnid_close(vol->v_cdb); free(vol->v_cnidscheme); vol->v_cnidscheme = strdup("tdb"); int flags = CNID_FLAG_MEMORY; if ((vol->v_flags & AFPVOL_NODEV)) { flags |= CNID_FLAG_NODEV; } LOG(log_error, logtype_afpd, "Reopen volume %s using in memory temporary CNID DB.", vol->v_path); vol->v_cdb = cnid_open(vol->v_path, vol->v_umask, "tdb", flags, NULL, NULL); if (vol->v_cdb) { /* deactivate cnid caching/storing in AppleDouble files and set ro mode*/ vol->v_flags &= ~AFPVOL_CACHE; vol->v_flags |= AFPVOL_RO; #ifdef SERVERTEXT /* kill ourself with SIGUSR2 aka msg pending */ setmessage("Something wrong with the volume's CNID DB, using temporary CNID DB instead." "Check server messages for details. Switching to read-only mode."); kill(getpid(), SIGUSR2); #endif goto restart; /* not try again with the temp CNID db */ } else { #ifdef SERVERTEXT setmessage("Something wrong with the volume's CNID DB, using temporary CNID DB failed too!" "Check server messages for details, can't recover from this state!"); #endif } } afp_errno = AFPERR_MISC; goto exit; } } else if (adp && (adcnid != dbcnid)) { /* 4 */ /* Update the ressource fork. For a folder adp is always null */ LOG(log_debug, logtype_afpd, "get_id(%s/%s): calling ad_setid(old: %u, new: %u)", getcwdpath(), upath, htonl(adcnid), htonl(dbcnid)); if (ad_setid(adp, st->st_dev, st->st_ino, dbcnid, did, vol->v_stamp)) { ad_flush(adp); } } } exit: first = 0; return dbcnid; } /* -------------------------- */ int getmetadata(struct vol *vol, u_int16_t bitmap, struct path *path, struct dir *dir, char *buf, size_t *buflen, struct adouble *adp) { char *data, *l_nameoff = NULL, *upath; char *utf_nameoff = NULL; int bit = 0; u_int32_t aint; cnid_t id = 0; u_int16_t ashort; u_char achar, fdType[4]; u_int32_t utf8 = 0; struct stat *st; struct maccess ma; LOG(log_debug, logtype_afpd, "getmetadata(\"%s\")", path->u_name); upath = path->u_name; st = &path->st; data = buf; if ( ((bitmap & ( (1 << FILPBIT_FINFO)|(1 << FILPBIT_LNAME)|(1 <m_name) || (bitmap & ( (1 << FILPBIT_LNAME) ) && utf8_encoding()) /* FIXME should be m_name utf8 filename */ || (bitmap & (1 << FILPBIT_FNUM))) { if (!path->id) { bstring fullpath; struct dir *cachedfile; int len = strlen(upath); if ((cachedfile = dircache_search_by_name(vol, dir, upath, len)) != NULL) id = cachedfile->d_did; else { id = get_id(vol, adp, st, dir->d_did, upath, len); /* Add it to the cache */ LOG(log_debug, logtype_afpd, "getmetadata: caching: did:%u, \"%s\", cnid:%u", ntohl(dir->d_did), upath, ntohl(id)); /* Get macname from unixname first */ if (path->m_name == NULL) { if ((path->m_name = utompath(vol, upath, id, utf8_encoding())) == NULL) { LOG(log_error, logtype_afpd, "getmetadata: utompath error"); return AFPERR_MISC; } } /* Build fullpath */ if (((fullpath = bstrcpy(dir->d_fullpath)) == NULL) || (bconchar(fullpath, '/') != BSTR_OK) || (bcatcstr(fullpath, upath)) != BSTR_OK) { LOG(log_error, logtype_afpd, "getmetadata: fullpath: %s", strerror(errno)); return AFPERR_MISC; } if ((cachedfile = dir_new(path->m_name, upath, vol, dir->d_did, id, fullpath, st)) == NULL) { LOG(log_error, logtype_afpd, "getmetadata: error from dir_new"); return AFPERR_MISC; } if ((dircache_add(vol, cachedfile)) != 0) { LOG(log_error, logtype_afpd, "getmetadata: fatal dircache error"); return AFPERR_MISC; } } } else { id = path->id; } if (id == CNID_INVALID) return afp_errno; if (!path->m_name) { path->m_name = utompath(vol, upath, id, utf8_encoding()); } } while ( bitmap != 0 ) { while (( bitmap & 1 ) == 0 ) { bitmap = bitmap>>1; bit++; } switch ( bit ) { case FILPBIT_ATTR : if ( adp ) { ad_getattr(adp, &ashort); } else if (vol_inv_dots(vol) && *upath == '.') { ashort = htons(ATTRBIT_INVISIBLE); } else ashort = 0; #if 0 /* FIXME do we want a visual clue if the file is read only */ struct maccess ma; accessmode(vol, ".", &ma, dir , NULL); if ((ma.ma_user & AR_UWRITE)) { accessmode(vol, upath, &ma, dir , st); if (!(ma.ma_user & AR_UWRITE)) { ashort |= htons(ATTRBIT_NOWRITE); } } #endif memcpy(data, &ashort, sizeof( ashort )); data += sizeof( ashort ); LOG(log_debug, logtype_afpd, "metadata('%s'): AFP Attributes: %04x", path->u_name, ntohs(ashort)); break; case FILPBIT_PDID : memcpy(data, &dir->d_did, sizeof( u_int32_t )); data += sizeof( u_int32_t ); LOG(log_debug, logtype_afpd, "metadata('%s'): Parent DID: %u", path->u_name, ntohl(dir->d_did)); break; case FILPBIT_CDATE : if (!adp || (ad_getdate(adp, AD_DATE_CREATE, &aint) < 0)) aint = AD_DATE_FROM_UNIX(st->st_mtime); memcpy(data, &aint, sizeof( aint )); data += sizeof( aint ); break; case FILPBIT_MDATE : if ( adp && (ad_getdate(adp, AD_DATE_MODIFY, &aint) == 0)) { if ((st->st_mtime > AD_DATE_TO_UNIX(aint))) { aint = AD_DATE_FROM_UNIX(st->st_mtime); } } else { aint = AD_DATE_FROM_UNIX(st->st_mtime); } memcpy(data, &aint, sizeof( int )); data += sizeof( int ); break; case FILPBIT_BDATE : if (!adp || (ad_getdate(adp, AD_DATE_BACKUP, &aint) < 0)) aint = AD_DATE_START; memcpy(data, &aint, sizeof( int )); data += sizeof( int ); break; case FILPBIT_FINFO : get_finderinfo(vol, upath, adp, (char *)data,S_ISLNK(st->st_mode)); data += ADEDLEN_FINDERI; break; case FILPBIT_LNAME : l_nameoff = data; data += sizeof( u_int16_t ); break; case FILPBIT_SNAME : memset(data, 0, sizeof(u_int16_t)); data += sizeof( u_int16_t ); break; case FILPBIT_FNUM : memcpy(data, &id, sizeof( id )); data += sizeof( id ); LOG(log_debug, logtype_afpd, "metadata('%s'): CNID: %u", path->u_name, ntohl(id)); break; case FILPBIT_DFLEN : if (st->st_size > 0xffffffff) aint = 0xffffffff; else aint = htonl( st->st_size ); memcpy(data, &aint, sizeof( aint )); data += sizeof( aint ); break; case FILPBIT_RFLEN : if ( adp ) { if (adp->ad_rlen > 0xffffffff) aint = 0xffffffff; else aint = htonl( adp->ad_rlen); } else { aint = 0; } memcpy(data, &aint, sizeof( aint )); data += sizeof( aint ); break; /* Current client needs ProDOS info block for this file. Use simple heuristic and let the Mac "type" string tell us what the PD file code should be. Everything gets a subtype of 0x0000 unless the original value was hashed to "pXYZ" when we created it. See IA, Ver 2. */ case FILPBIT_PDINFO : if (afp_version >= 30) { /* UTF8 name */ utf8 = kTextEncodingUTF8; utf_nameoff = data; data += sizeof( u_int16_t ); aint = 0; memcpy(data, &aint, sizeof( aint )); data += sizeof( aint ); } else { if ( adp ) { memcpy(fdType, ad_entry( adp, ADEID_FINDERI ), 4 ); if ( memcmp( fdType, "TEXT", 4 ) == 0 ) { achar = '\x04'; ashort = 0x0000; } else if ( memcmp( fdType, "PSYS", 4 ) == 0 ) { achar = '\xff'; ashort = 0x0000; } else if ( memcmp( fdType, "PS16", 4 ) == 0 ) { achar = '\xb3'; ashort = 0x0000; } else if ( memcmp( fdType, "BINA", 4 ) == 0 ) { achar = '\x00'; ashort = 0x0000; } else if ( fdType[0] == 'p' ) { achar = fdType[1]; ashort = (fdType[2] * 256) + fdType[3]; } else { achar = '\x00'; ashort = 0x0000; } } else { achar = '\x00'; ashort = 0x0000; } *data++ = achar; *data++ = 0; memcpy(data, &ashort, sizeof( ashort )); data += sizeof( ashort ); memset(data, 0, sizeof( ashort )); data += sizeof( ashort ); } break; case FILPBIT_EXTDFLEN: aint = htonl(st->st_size >> 32); memcpy(data, &aint, sizeof( aint )); data += sizeof( aint ); aint = htonl(st->st_size); memcpy(data, &aint, sizeof( aint )); data += sizeof( aint ); break; case FILPBIT_EXTRFLEN: aint = 0; if (adp) aint = htonl(adp->ad_rlen >> 32); memcpy(data, &aint, sizeof( aint )); data += sizeof( aint ); if (adp) aint = htonl(adp->ad_rlen); memcpy(data, &aint, sizeof( aint )); data += sizeof( aint ); break; case FILPBIT_UNIXPR : /* accessmode may change st_mode with ACLs */ accessmode(vol, upath, &ma, dir , st); aint = htonl(st->st_uid); memcpy( data, &aint, sizeof( aint )); data += sizeof( aint ); aint = htonl(st->st_gid); memcpy( data, &aint, sizeof( aint )); data += sizeof( aint ); /* FIXME: ugly hack type == slnk indicates an OSX style symlink, we have to add S_IFLNK to the mode, otherwise 10.3 clients freak out. */ aint = st->st_mode; if (adp) { memcpy(fdType, ad_entry( adp, ADEID_FINDERI ), 4 ); if ( memcmp( fdType, "slnk", 4 ) == 0 ) { aint |= S_IFLNK; } } aint = htonl(aint); memcpy( data, &aint, sizeof( aint )); data += sizeof( aint ); *data++ = ma.ma_user; *data++ = ma.ma_world; *data++ = ma.ma_group; *data++ = ma.ma_owner; break; default : return( AFPERR_BITMAP ); } bitmap = bitmap>>1; bit++; } if ( l_nameoff ) { ashort = htons( data - buf ); memcpy(l_nameoff, &ashort, sizeof( ashort )); data = set_name(vol, data, dir->d_did, path->m_name, id, 0); } if ( utf_nameoff ) { ashort = htons( data - buf ); memcpy(utf_nameoff, &ashort, sizeof( ashort )); data = set_name(vol, data, dir->d_did, path->m_name, id, utf8); } *buflen = data - buf; return (AFP_OK); } /* ----------------------- */ int getfilparams(struct vol *vol, u_int16_t bitmap, struct path *path, struct dir *dir, char *buf, size_t *buflen ) { struct adouble ad, *adp; int opened = 0; int rc; LOG(log_debug, logtype_afpd, "getfilparams(\"%s\")", path->u_name); opened = PARAM_NEED_ADP(bitmap); adp = NULL; if (opened) { char *upath; int flags = (bitmap & (1 << FILPBIT_ATTR))?ADFLAGS_OPENFORKS:0; adp = of_ad(vol, path, &ad); upath = path->u_name; if ( ad_metadata( upath, flags|ADFLAGS_CREATE, adp) < 0 ) { switch (errno) { case EACCES: LOG(log_error, logtype_afpd, "getfilparams(%s): %s: check resource fork permission?", upath, strerror(errno)); return AFPERR_ACCESS; case EIO: LOG(log_error, logtype_afpd, "getfilparams(%s): bad resource fork", upath); /* fall through */ case ENOENT: default: adp = NULL; break; } } } rc = getmetadata(vol, bitmap, path, dir, buf, buflen, adp); if ( adp ) { ad_close_metadata( adp); } return( rc ); } /* ----------------------------- */ int afp_createfile(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct adouble ad, *adp; struct vol *vol; struct dir *dir; struct ofork *of = NULL; char *path, *upath; int creatf, did, openf, retvalue = AFP_OK; u_int16_t vid; struct path *s_path; *rbuflen = 0; ibuf++; creatf = (unsigned char) *ibuf++; memcpy(&vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } if (vol->v_flags & AFPVOL_RO) return AFPERR_VLOCK; memcpy(&did, ibuf, sizeof( did)); ibuf += sizeof( did ); if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; } if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) { return get_afp_errno(AFPERR_PARAM); } if ( *s_path->m_name == '\0' ) { return( AFPERR_BADTYPE ); } upath = s_path->u_name; /* if upath is deleted we already in trouble anyway */ if ((of = of_findname(s_path))) { adp = of->of_ad; } else { ad_init(&ad, vol->v_adouble, vol->v_ad_options); adp = &ad; } if ( creatf) { /* on a hard create, fail if file exists and is open */ if (of) return AFPERR_BUSY; openf = O_RDWR|O_CREAT|O_TRUNC; } else { /* on a soft create, if the file is open then ad_open won't fail because open syscall is not called */ if (of) { return AFPERR_EXIST; } openf = O_RDWR|O_CREAT|O_EXCL; } if ( ad_open( upath, ADFLAGS_DF|ADFLAGS_HF|ADFLAGS_NOHF|ADFLAGS_CREATE, openf, 0666, adp) < 0 ) { switch ( errno ) { case EROFS: return AFPERR_VLOCK; case ENOENT : /* we were already in 'did folder' so chdir() didn't fail */ return ( AFPERR_NOOBJ ); case EEXIST : return( AFPERR_EXIST ); case EACCES : return( AFPERR_ACCESS ); case EDQUOT: case ENOSPC : return( AFPERR_DFULL ); default : return( AFPERR_PARAM ); } } if ( ad_reso_fileno( adp ) == -1 ) { /* Hard META / HF */ /* on noadouble volumes, just creating the data fork is ok */ if (vol_noadouble(vol)) { ad_close( adp, ADFLAGS_DF ); goto createfile_done; } /* FIXME with hard create on an existing file, we already * corrupted the data file. */ netatalk_unlink( upath ); ad_close( adp, ADFLAGS_DF ); return AFPERR_ACCESS; } path = s_path->m_name; ad_setname(adp, path); struct stat st; if (lstat(upath, &st) != 0) { LOG(log_error, logtype_afpd, "afp_createfile(\"%s\"): stat: %s", upath, strerror(errno)); ad_close( adp, ADFLAGS_DF|ADFLAGS_HF); return AFPERR_MISC; } (void)get_id(vol, adp, &st, dir->d_did, upath, strlen(upath)); ad_flush( adp); fce_register_new_file(s_path); ad_close( adp, ADFLAGS_DF|ADFLAGS_HF ); createfile_done: curdir->d_offcnt++; #ifdef DROPKLUDGE if (vol->v_flags & AFPVOL_DROPBOX) { retvalue = matchfile2dirperms(upath, vol, did); } #endif /* DROPKLUDGE */ setvoltime(obj, vol ); return (retvalue); } int afp_setfilparams(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *vol; struct dir *dir; struct path *s_path; int did, rc; u_int16_t vid, bitmap; *rbuflen = 0; ibuf += 2; memcpy(&vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } if (vol->v_flags & AFPVOL_RO) return AFPERR_VLOCK; memcpy(&did, ibuf, sizeof( did )); ibuf += sizeof( did ); if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; /* was AFPERR_NOOBJ */ } memcpy(&bitmap, ibuf, sizeof( bitmap )); bitmap = ntohs( bitmap ); ibuf += sizeof( bitmap ); if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) { return get_afp_errno(AFPERR_PARAM); } if (path_isadir(s_path)) { return( AFPERR_BADTYPE ); /* it's a directory */ } if ( s_path->st_errno != 0 ) { return( AFPERR_NOOBJ ); } if ((u_long)ibuf & 1 ) { ibuf++; } if (AFP_OK == ( rc = setfilparams(vol, s_path, bitmap, ibuf )) ) { setvoltime(obj, vol ); } return( rc ); } /* * cf AFP3.0.pdf page 252 for change_mdate and change_parent_mdate logic * */ extern struct path Cur_Path; int setfilparams(struct vol *vol, struct path *path, u_int16_t f_bitmap, char *buf ) { struct adouble ad, *adp; struct extmap *em; int bit, isad = 1, err = AFP_OK; char *upath; u_char achar, *fdType, xyy[4]; /* uninitialized, OK 310105 */ u_int16_t ashort, bshort, oshort; u_int32_t aint; u_int32_t upriv; u_int16_t upriv_bit = 0; struct utimbuf ut; int change_mdate = 0; int change_parent_mdate = 0; int newdate = 0; struct timeval tv; uid_t f_uid; gid_t f_gid; u_int16_t bitmap = f_bitmap; u_int32_t cdate,bdate; u_char finder_buf[32]; #ifdef DEBUG LOG(log_debug9, logtype_afpd, "begin setfilparams:"); #endif /* DEBUG */ adp = of_ad(vol, path, &ad); upath = path->u_name; if (!vol_unix_priv(vol) && check_access(upath, OPENACC_WR ) < 0) { return AFPERR_ACCESS; } /* with unix priv maybe we have to change adouble file priv first */ bit = 0; while ( bitmap != 0 ) { while (( bitmap & 1 ) == 0 ) { bitmap = bitmap>>1; bit++; } switch( bit ) { case FILPBIT_ATTR : change_mdate = 1; memcpy(&ashort, buf, sizeof( ashort )); buf += sizeof( ashort ); break; case FILPBIT_CDATE : change_mdate = 1; memcpy(&cdate, buf, sizeof(cdate)); buf += sizeof( cdate ); break; case FILPBIT_MDATE : memcpy(&newdate, buf, sizeof( newdate )); buf += sizeof( newdate ); break; case FILPBIT_BDATE : change_mdate = 1; memcpy(&bdate, buf, sizeof( bdate)); buf += sizeof( bdate ); break; case FILPBIT_FINFO : change_mdate = 1; memcpy(finder_buf, buf, 32 ); if (memcmp(buf,"slnkrhap",8)==0 && !S_ISLNK(path->st.st_mode)){ // SLFINFO int fp; ssize_t len; int erc=1; char buf[PATH_MAX+1]; if ((fp=open(path->u_name,O_RDONLY))>=0){ if ((len=read(fp,buf,PATH_MAX+1))){ if (unlink(path->u_name)==0){ buf[len]=0; erc = symlink(buf, path->u_name); if (!erc) of_stat(path); } } close(fp); } if (erc!=0){ err=AFPERR_BITMAP; goto setfilparam_done; } } buf += 32; break; case FILPBIT_UNIXPR : if (!vol_unix_priv(vol)) { /* this volume doesn't use unix priv */ err = AFPERR_BITMAP; bitmap = 0; break; } change_mdate = 1; change_parent_mdate = 1; memcpy( &aint, buf, sizeof( aint )); f_uid = ntohl (aint); buf += sizeof( aint ); memcpy( &aint, buf, sizeof( aint )); f_gid = ntohl (aint); buf += sizeof( aint ); setfilowner(vol, f_uid, f_gid, path); memcpy( &upriv, buf, sizeof( upriv )); buf += sizeof( upriv ); upriv = ntohl (upriv); if ((upriv & S_IWUSR)) { setfilunixmode(vol, path, upriv); } else { /* do it later */ upriv_bit = 1; } break; case FILPBIT_PDINFO : if (afp_version < 30) { /* else it's UTF8 name */ achar = *buf; buf += 2; /* Keep special case to support crlf translations */ if ((unsigned int) achar == 0x04) { fdType = (u_char *)"TEXT"; buf += 2; } else { xyy[0] = ( u_char ) 'p'; xyy[1] = achar; xyy[3] = *buf++; xyy[2] = *buf++; fdType = xyy; } break; } /* fallthrough */ default : err = AFPERR_BITMAP; /* break while loop */ bitmap = 0; break; } bitmap = bitmap>>1; bit++; } /* second try with adouble open */ if ( ad_open_metadata( upath, 0, O_CREAT, adp) < 0) { LOG(log_debug, logtype_afpd, "setfilparams: ad_open_metadata error"); /* * For some things, we don't need an adouble header: * - change of modification date * - UNIX privs (Bug-ID #2863424) */ if (!vol_noadouble(vol) && (f_bitmap & ~(1<m_name); } bit = 0; bitmap = f_bitmap; while ( bitmap != 0 ) { while (( bitmap & 1 ) == 0 ) { bitmap = bitmap>>1; bit++; } switch( bit ) { case FILPBIT_ATTR : ad_getattr(adp, &bshort); oshort = bshort; if ( ntohs( ashort ) & ATTRBIT_SETCLR ) { bshort |= htons( ntohs( ashort ) & ~ATTRBIT_SETCLR ); } else { bshort &= ~ashort; } if ((bshort & htons(ATTRBIT_INVISIBLE)) != (oshort & htons(ATTRBIT_INVISIBLE))) change_parent_mdate = 1; ad_setattr(adp, bshort); break; case FILPBIT_CDATE : ad_setdate(adp, AD_DATE_CREATE, cdate); break; case FILPBIT_MDATE : break; case FILPBIT_BDATE : ad_setdate(adp, AD_DATE_BACKUP, bdate); break; case FILPBIT_FINFO : if (default_type( ad_entry( adp, ADEID_FINDERI )) && ( ((em = getextmap( path->m_name )) && !memcmp(finder_buf, em->em_type, sizeof( em->em_type )) && !memcmp(finder_buf + 4, em->em_creator,sizeof( em->em_creator))) || ((em = getdefextmap()) && !memcmp(finder_buf, em->em_type, sizeof( em->em_type )) && !memcmp(finder_buf + 4, em->em_creator,sizeof( em->em_creator))) )) { memcpy(finder_buf, ufinderi, 8 ); } memcpy(ad_entry( adp, ADEID_FINDERI ), finder_buf, 32 ); break; case FILPBIT_UNIXPR : if (upriv_bit) { setfilunixmode(vol, path, upriv); } break; case FILPBIT_PDINFO : if (afp_version < 30) { /* else it's UTF8 name */ memcpy(ad_entry( adp, ADEID_FINDERI ), fdType, 4 ); memcpy(ad_entry( adp, ADEID_FINDERI ) + 4, "pdos", 4 ); break; } /* fallthrough */ default : err = AFPERR_BITMAP; goto setfilparam_done; } bitmap = bitmap>>1; bit++; } setfilparam_done: if (change_mdate && newdate == 0 && gettimeofday(&tv, NULL) == 0) { newdate = AD_DATE_FROM_UNIX(tv.tv_sec); } if (newdate) { if (isad) ad_setdate(adp, AD_DATE_MODIFY, newdate); ut.actime = ut.modtime = AD_DATE_TO_UNIX(newdate); utime(upath, &ut); } if (isad) { ad_flush( adp); ad_close_metadata( adp); } if (change_parent_mdate && gettimeofday(&tv, NULL) == 0) { newdate = AD_DATE_FROM_UNIX(tv.tv_sec); bitmap = 1< dst[\"%s\"]", sdir_fd, src, dst); if ( unix_rename( sdir_fd, src, -1, dst ) < 0 ) { switch ( errno ) { case ENOENT : return( AFPERR_NOOBJ ); case EPERM: case EACCES : return( AFPERR_ACCESS ); case EROFS: return AFPERR_VLOCK; case EXDEV : /* Cross device move -- try copy */ /* NOTE: with open file it's an error because after the copy we will * get two files, it's fixable for our process (eg reopen the new file, get the * locks, and so on. But it doesn't solve the case with a second process */ if (adp->ad_open_forks) { /* FIXME warning in syslog so admin'd know there's a conflict ?*/ return AFPERR_OLOCK; /* little lie */ } if (AFP_OK != ( rc = copyfile(vol, vol, sdir_fd, src, dst, newname, NULL )) ) { /* on error copyfile delete dest */ return( rc ); } return deletefile(vol, sdir_fd, src, 0); default : return( AFPERR_PARAM ); } } if (vol->vfs->vfs_renamefile(vol, sdir_fd, src, dst) < 0 ) { int err; err = errno; /* try to undo the data fork rename, * we know we are on the same device */ if (err) { unix_rename(-1, dst, sdir_fd, src ); /* return the first error */ switch ( err) { case ENOENT : return AFPERR_NOOBJ; case EPERM: case EACCES : return AFPERR_ACCESS ; case EROFS: return AFPERR_VLOCK; default : return AFPERR_PARAM ; } } } /* don't care if we can't open the newly renamed ressource fork */ if (!ad_open( dst, ADFLAGS_HF, O_RDWR, 0666, adp)) { ad_setname(adp, newname); ad_flush( adp ); ad_close( adp, ADFLAGS_HF ); } return( AFP_OK ); } /* ---------------- convert a Mac long name to an utf8 name, */ size_t mtoUTF8(const struct vol *vol, const char *src, size_t srclen, char *dest, size_t destlen) { size_t outlen; if ((size_t)-1 == (outlen = convert_string ( vol->v_maccharset, CH_UTF8_MAC, src, srclen, dest, destlen)) ) { return -1; } return outlen; } /* ---------------- */ int copy_path_name(const struct vol *vol, char *newname, char *ibuf) { char type = *ibuf; size_t plen = 0; u_int16_t len16; u_int32_t hint; if ( type != 2 && !(afp_version >= 30 && type == 3) ) { return -1; } ibuf++; switch (type) { case 2: if (( plen = (unsigned char)*ibuf++ ) != 0 ) { if (afp_version >= 30) { /* convert it to UTF8 */ if ((plen = mtoUTF8(vol, ibuf, plen, newname, AFPOBJ_TMPSIZ)) == (size_t)-1) return -1; } else { strncpy( newname, ibuf, plen ); newname[ plen ] = '\0'; } if (strlen(newname) != plen) { /* there's \0 in newname, e.g. it's a pathname not * only a filename. */ return -1; } } break; case 3: memcpy(&hint, ibuf, sizeof(hint)); ibuf += sizeof(hint); memcpy(&len16, ibuf, sizeof(len16)); ibuf += sizeof(len16); plen = ntohs(len16); if (plen) { if (plen > AFPOBJ_TMPSIZ) { return -1; } strncpy( newname, ibuf, plen ); newname[ plen ] = '\0'; if (strlen(newname) != plen) { return -1; } } break; } return plen; } /* ----------------------------------- */ int afp_copyfile(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *s_vol, *d_vol; struct dir *dir; char *newname, *p, *upath; struct path *s_path; u_int32_t sdid, ddid; int err, retvalue = AFP_OK; u_int16_t svid, dvid; struct adouble ad, *adp; int denyreadset; *rbuflen = 0; ibuf += 2; memcpy(&svid, ibuf, sizeof( svid )); ibuf += sizeof( svid ); if (NULL == ( s_vol = getvolbyvid( svid )) ) { return( AFPERR_PARAM ); } memcpy(&sdid, ibuf, sizeof( sdid )); ibuf += sizeof( sdid ); if (NULL == ( dir = dirlookup( s_vol, sdid )) ) { return afp_errno; } memcpy(&dvid, ibuf, sizeof( dvid )); ibuf += sizeof( dvid ); memcpy(&ddid, ibuf, sizeof( ddid )); ibuf += sizeof( ddid ); if (NULL == ( s_path = cname( s_vol, dir, &ibuf )) ) { return get_afp_errno(AFPERR_PARAM); } if ( path_isadir(s_path) ) { return( AFPERR_BADTYPE ); } /* don't allow copies when the file is open. * XXX: the spec only calls for read/deny write access. * however, copyfile doesn't have any of that info, * and locks need to stay coherent. as a result, * we just balk if the file is opened already. */ adp = of_ad(s_vol, s_path, &ad); if (ad_open(s_path->u_name , ADFLAGS_DF |ADFLAGS_HF | ADFLAGS_NOHF, O_RDONLY, 0, adp) < 0) { return AFPERR_DENYCONF; } denyreadset = (getforkmode(adp, ADEID_DFORK, AD_FILELOCK_DENY_RD) != 0 || getforkmode(adp, ADEID_RFORK, AD_FILELOCK_DENY_RD) != 0 ); if (denyreadset) { retvalue = AFPERR_DENYCONF; goto copy_exit; } newname = obj->newtmp; strcpy( newname, s_path->m_name ); p = ctoupath( s_vol, curdir, newname ); if (!p) { retvalue = AFPERR_PARAM; goto copy_exit; } #ifdef FORCE_UIDGID /* FIXME svid != dvid && dvid's user can't read svid */ #endif if (NULL == ( d_vol = getvolbyvid( dvid )) ) { retvalue = AFPERR_PARAM; goto copy_exit; } if (d_vol->v_flags & AFPVOL_RO) { retvalue = AFPERR_VLOCK; goto copy_exit; } if (NULL == ( dir = dirlookup( d_vol, ddid )) ) { retvalue = afp_errno; goto copy_exit; } if (( s_path = cname( d_vol, dir, &ibuf )) == NULL ) { retvalue = get_afp_errno(AFPERR_NOOBJ); goto copy_exit; } if ( *s_path->m_name != '\0' ) { retvalue =path_error(s_path, AFPERR_NOOBJ); goto copy_exit; } /* one of the handful of places that knows about the path type */ if (copy_path_name(d_vol, newname, ibuf) < 0) { retvalue = AFPERR_PARAM; goto copy_exit; } /* newname is always only a filename so curdir *is* its * parent folder */ if (NULL == (upath = mtoupath(d_vol, newname, curdir->d_did, utf8_encoding()))) { retvalue =AFPERR_PARAM; goto copy_exit; } if ( (err = copyfile(s_vol, d_vol, -1, p, upath , newname, adp)) < 0 ) { retvalue = err; goto copy_exit; } curdir->d_offcnt++; #ifdef DROPKLUDGE if (vol->v_flags & AFPVOL_DROPBOX) { retvalue=matchfile2dirperms(upath, vol, ddid); /* FIXME sdir or ddid */ } #endif /* DROPKLUDGE */ setvoltime(obj, d_vol ); copy_exit: ad_close( adp, ADFLAGS_DF |ADFLAGS_HF ); return( retvalue ); } /* ----------------------- */ static int copy_all(const int dfd, const void *buf, size_t buflen) { ssize_t cc; #ifdef DEBUG LOG(log_debug9, logtype_afpd, "begin copy_all:"); #endif /* DEBUG */ while (buflen > 0) { if ((cc = write(dfd, buf, buflen)) < 0) { switch (errno) { case EINTR: continue; default: return -1; } } buflen -= cc; } #ifdef DEBUG LOG(log_debug9, logtype_afpd, "end copy_all:"); #endif /* DEBUG */ return 0; } /* -------------------------- * copy only the fork data stream */ static int copy_fork(int eid, struct adouble *add, struct adouble *ads) { ssize_t cc; int err = 0; char filebuf[8192]; int sfd, dfd; if (eid == ADEID_DFORK) { sfd = ad_data_fileno(ads); dfd = ad_data_fileno(add); } else { sfd = ad_reso_fileno(ads); dfd = ad_reso_fileno(add); } if ((off_t)-1 == lseek(sfd, ad_getentryoff(ads, eid), SEEK_SET)) return -1; if ((off_t)-1 == lseek(dfd, ad_getentryoff(add, eid), SEEK_SET)) return -1; #if 0 /* ifdef SENDFILE_FLAVOR_LINUX */ /* doesn't work With 2.6 FIXME, only check for EBADFD ? */ off_t offset = 0; size_t size; struct stat st; #define BUF 128*1024*1024 if (fstat(sfd, &st) == 0) { while (1) { if ( offset >= st.st_size) { return 0; } size = (st.st_size -offset > BUF)?BUF:st.st_size -offset; if ((cc = sys_sendfile(dfd, sfd, &offset, size)) < 0) { switch (errno) { case ENOSYS: case EINVAL: /* there's no guarantee that all fs support sendfile */ goto no_sendfile; default: return -1; } } } } no_sendfile: lseek(sfd, offset, SEEK_SET); #endif while (1) { if ((cc = read(sfd, filebuf, sizeof(filebuf))) < 0) { if (errno == EINTR) continue; err = -1; break; } if (!cc || ((err = copy_all(dfd, filebuf, cc)) < 0)) { break; } } return err; } /* ---------------------------------- * if newname is NULL (from directory.c) we don't want to copy the resource fork. * because we are doing it elsewhere. * currently if newname is NULL then adp is NULL. */ int copyfile(const struct vol *s_vol, const struct vol *d_vol, int sfd, char *src, char *dst, char *newname, struct adouble *adp) { struct adouble ads, add; int err = 0; int ret_err = 0; int adflags; int stat_result; struct stat st; LOG(log_debug, logtype_afpd, "copyfile(sfd:%d,s:'%s',d:'%s',n:'%s')", sfd, src, dst, newname); if (adp == NULL) { ad_init(&ads, s_vol->v_adouble, s_vol->v_ad_options); adp = &ads; } adflags = ADFLAGS_DF; if (newname) { adflags |= ADFLAGS_HF; } if (ad_openat(sfd, src, adflags | ADFLAGS_NOHF, O_RDONLY, 0, adp) < 0) { ret_err = errno; goto done; } if (ad_meta_fileno(adp) == -1 && ad_reso_fileno(adp) == -1) { /* META / HF */ /* no resource fork, don't create one for dst file */ adflags &= ~ADFLAGS_HF; } stat_result = fstat(ad_data_fileno(adp), &st); /* saving stat exit code, thus saving us on one more stat later on */ if (stat_result < 0) { /* unlikely but if fstat fails, the default file mode will be 0666. */ st.st_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; } ad_init(&add, d_vol->v_adouble, d_vol->v_ad_options); if (ad_open(dst , adflags, O_RDWR|O_CREAT|O_EXCL, st.st_mode, &add) < 0) { ret_err = errno; ad_close( adp, adflags ); if (EEXIST != ret_err) { deletefile(d_vol, -1, dst, 0); goto done; } return AFPERR_EXIST; } /* * XXX if the source and the dest don't use the same resource type it's broken */ if (ad_reso_fileno(adp) == -1 || 0 == (err = copy_fork(ADEID_RFORK, &add, adp))){ /* copy the data fork */ if ((err = copy_fork(ADEID_DFORK, &add, adp)) == 0) { if (ad_meta_fileno(adp) != -1) err = d_vol->vfs->vfs_copyfile(d_vol, sfd, src, dst); } } if (err < 0) { ret_err = errno; } if (!ret_err && newname && (adflags & ADFLAGS_HF)) { /* set the new name in the resource fork */ ad_copy_header(&add, adp); ad_setname(&add, newname); ad_flush( &add ); } ad_close( adp, adflags ); if (ad_close( &add, adflags ) <0) { ret_err = errno; } if (ret_err) { deletefile(d_vol, -1, dst, 0); } else if (stat_result == 0) { /* set dest modification date to src date */ struct utimbuf ut; ut.actime = ut.modtime = st.st_mtime; utime(dst, &ut); /* FIXME netatalk doesn't use resource fork file date * but maybe we should set its modtime too. */ } done: switch ( ret_err ) { case 0: return AFP_OK; case EDQUOT: case EFBIG: case ENOSPC: return AFPERR_DFULL; case ENOENT: return AFPERR_NOOBJ; case EACCES: return AFPERR_ACCESS; case EROFS: return AFPERR_VLOCK; } return AFPERR_PARAM; } /* ----------------------------------- vol: not NULL delete cnid entry. then we are in curdir and file is a only filename checkAttrib: 1 check kFPDeleteInhibitBit (deletfile called by afp_delete) when deletefile is called we don't have lock on it, file is closed (for us) untrue if called by renamefile ad_open always try to open file RDWR first and ad_lock takes care of WRITE lock on read only file. */ static int check_attrib(struct adouble *adp) { u_int16_t bshort = 0; ad_getattr(adp, &bshort); /* * Does kFPDeleteInhibitBit (bit 8) set? */ if ((bshort & htons(ATTRBIT_NODELETE))) { return AFPERR_OLOCK; } if ((bshort & htons(ATTRBIT_DOPEN | ATTRBIT_ROPEN))) { return AFPERR_BUSY; } return 0; } /* * dirfd can be used for unlinkat semantics */ int deletefile(const struct vol *vol, int dirfd, char *file, int checkAttrib) { struct adouble ad; struct adouble *adp = NULL; int adflags, err = AFP_OK; int meta = 0; LOG(log_debug, logtype_afpd, "deletefile('%s')", file); ad_init(&ad, vol->v_adouble, vol->v_ad_options); if (checkAttrib) { /* was EACCESS error try to get only metadata */ /* we never want to create a resource fork here, we are going to delete it * moreover sometimes deletefile is called with a no existent file and * ad_open would create a 0 byte resource fork */ if ( ad_metadataat(dirfd, file, ADFLAGS_OPENFORKS, &ad) == 0 ) { if ((err = check_attrib(&ad))) { ad_close_metadata(&ad); return err; } meta = 1; } } /* try to open both forks at once */ adflags = ADFLAGS_DF; if ( ad_openat(dirfd, file, adflags |ADFLAGS_HF|ADFLAGS_NOHF, O_RDONLY, 0, &ad ) < 0 ) { switch (errno) { case ENOENT: err = AFPERR_NOOBJ; goto end; case EACCES: /* maybe it's a file with no write mode for us */ break; /* was return AFPERR_ACCESS;*/ case EROFS: err = AFPERR_VLOCK; goto end; default: err = AFPERR_PARAM; goto end; } } else { adp = &ad; } if ( adp && ad_reso_fileno( adp ) != -1 ) { /* there's a resource fork */ adflags |= ADFLAGS_HF; /* FIXME we have a pb here because we want to know if a file is open * there's a 'priority inversion' if you can't open the ressource fork RW * you can delete it if it's open because you can't get a write lock. * * ADLOCK_FILELOCK means the whole ressource fork, not only after the * metadatas * * FIXME it doesn't work for RFORK open read only and fork open without deny mode */ if (ad_tmplock(&ad, ADEID_RFORK, ADLOCK_WR |ADLOCK_FILELOCK, 0, 0, 0) < 0 ) { err = AFPERR_BUSY; goto end; } } if (adp && ad_tmplock( &ad, ADEID_DFORK, ADLOCK_WR, 0, 0, 0 ) < 0) { err = AFPERR_BUSY; } else if (!(err = vol->vfs->vfs_deletefile(vol, dirfd, file)) && !(err = netatalk_unlinkat(dirfd, file )) ) { cnid_t id; if (checkAttrib && (id = cnid_get(vol->v_cdb, curdir->d_did, file, strlen(file)))) { cnid_delete(vol->v_cdb, id); } } end: if (meta) ad_close_metadata(&ad); if (adp) ad_close( &ad, adflags ); /* ad_close removes locks if any */ return err; } /* ------------------------------------ */ /* return a file id */ int afp_createid(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct stat *st; struct vol *vol; struct dir *dir; char *upath; int len; cnid_t did, id; u_short vid; struct path *s_path; *rbuflen = 0; ibuf += 2; memcpy(&vid, ibuf, sizeof(vid)); ibuf += sizeof(vid); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM); } if (vol->v_cdb == NULL || !(vol->v_cdb->flags & CNID_FLAG_PERSISTENT)) { return AFPERR_NOOP; } if (vol->v_flags & AFPVOL_RO) return AFPERR_VLOCK; memcpy(&did, ibuf, sizeof( did )); ibuf += sizeof(did); if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; /* was AFPERR_PARAM */ } if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) { return get_afp_errno(AFPERR_NOOBJ); /* was AFPERR_PARAM */ } if ( path_isadir(s_path) ) { return( AFPERR_BADTYPE ); } upath = s_path->u_name; switch (s_path->st_errno) { case 0: break; /* success */ case EPERM: case EACCES: return AFPERR_ACCESS; case ENOENT: return AFPERR_NOOBJ; default: return AFPERR_PARAM; } st = &s_path->st; if ((id = cnid_lookup(vol->v_cdb, st, did, upath, len = strlen(upath)))) { memcpy(rbuf, &id, sizeof(id)); *rbuflen = sizeof(id); return AFPERR_EXISTID; } if ((id = get_id(vol, NULL, st, did, upath, len)) != CNID_INVALID) { memcpy(rbuf, &id, sizeof(id)); *rbuflen = sizeof(id); return AFP_OK; } return afp_errno; } /* ------------------------------- */ struct reenum { struct vol *vol; cnid_t did; }; static int reenumerate_loop(struct dirent *de, char *mname _U_, void *data) { struct path path; struct reenum *param = data; struct vol *vol = param->vol; cnid_t did = param->did; cnid_t aint; if ( lstat(de->d_name, &path.st)<0 ) return 0; /* update or add to cnid */ aint = cnid_add(vol->v_cdb, &path.st, did, de->d_name, strlen(de->d_name), 0); /* ignore errors */ #if AD_VERSION > AD_VERSION1 if (aint != CNID_INVALID && !S_ISDIR(path.st.st_mode)) { struct adouble ad, *adp; path.st_errno = 0; path.st_valid = 1; path.u_name = de->d_name; adp = of_ad(vol, &path, &ad); if ( ad_open_metadata( de->d_name, 0, 0, adp ) < 0 ) { return 0; } if (ad_setid(adp, path.st.st_dev, path.st.st_ino, aint, did, vol->v_stamp)) { ad_flush(adp); } ad_close_metadata(adp); } #endif /* AD_VERSION > AD_VERSION1 */ return 0; } /* -------------------- * Ok the db is out of synch with the dir. * but if it's a deleted file we don't want to do it again and again. */ static int reenumerate_id(struct vol *vol, char *name, struct dir *dir) { int ret; struct reenum data; struct stat st; if (vol->v_cdb == NULL) { return -1; } /* FIXME use of_statdir ? */ if (lstat(name, &st)) { return -1; } if (dirreenumerate(dir, &st)) { /* we already did it once and the dir haven't been modified */ return dir->d_offcnt; } data.vol = vol; data.did = dir->d_did; if ((ret = for_each_dirent(vol, name, reenumerate_loop, (void *)&data)) >= 0) { setdiroffcnt(curdir, &st, ret); dir->d_flags |= DIRF_CNID; } return ret; } /* ------------------------------ resolve a file id */ int afp_resolveid(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct vol *vol; struct dir *dir; char *upath; struct path path; int err, retry=0; size_t buflen; cnid_t id, cnid; u_int16_t vid, bitmap; static char buffer[12 + MAXPATHLEN + 1]; int len = 12 + MAXPATHLEN + 1; *rbuflen = 0; ibuf += 2; memcpy(&vid, ibuf, sizeof(vid)); ibuf += sizeof(vid); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM); } if (vol->v_cdb == NULL || !(vol->v_cdb->flags & CNID_FLAG_PERSISTENT)) { return AFPERR_NOOP; } memcpy(&id, ibuf, sizeof( id )); ibuf += sizeof(id); cnid = id; if (!id) { /* some MacOS versions after a catsearch do a *lot* of afp_resolveid with 0 */ return AFPERR_NOID; } retry: if (NULL == (upath = cnid_resolve(vol->v_cdb, &id, buffer, len)) ) { return AFPERR_NOID; /* was AFPERR_BADID, but help older Macs */ } if (NULL == ( dir = dirlookup( vol, id )) ) { return AFPERR_NOID; /* idem AFPERR_PARAM */ } if (movecwd(vol, dir) < 0) { switch (errno) { case EACCES: case EPERM: return AFPERR_ACCESS; case ENOENT: return AFPERR_NOID; default: return AFPERR_PARAM; } } memset(&path, 0, sizeof(path)); path.u_name = upath; if ( of_stat(&path) < 0 ) { #ifdef ESTALE /* with nfs and our working directory is deleted */ if (errno == ESTALE) { errno = ENOENT; } #endif if ( errno == ENOENT && !retry) { /* cnid db is out of sync, reenumerate the directory and update ids */ reenumerate_id(vol, ".", dir); id = cnid; retry = 1; goto retry; } switch (errno) { case EACCES: case EPERM: return AFPERR_ACCESS; case ENOENT: return AFPERR_NOID; default: return AFPERR_PARAM; } } /* directories are bad */ if (S_ISDIR(path.st.st_mode)) { /* OS9 and OSX don't return the same error code */ return (afp_version >=30)?AFPERR_NOID:AFPERR_BADTYPE; } memcpy(&bitmap, ibuf, sizeof(bitmap)); bitmap = ntohs( bitmap ); if (NULL == (path.m_name = utompath(vol, upath, cnid, utf8_encoding()))) { return AFPERR_NOID; } path.id = cnid; if (AFP_OK != (err = getfilparams(vol, bitmap, &path , curdir, rbuf + sizeof(bitmap), &buflen))) { return err; } *rbuflen = buflen + sizeof(bitmap); memcpy(rbuf, ibuf, sizeof(bitmap)); return AFP_OK; } /* ------------------------------ */ int afp_deleteid(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct stat st; struct vol *vol; struct dir *dir; char *upath; int err; cnid_t id; cnid_t fileid; u_short vid; static char buffer[12 + MAXPATHLEN + 1]; int len = 12 + MAXPATHLEN + 1; *rbuflen = 0; ibuf += 2; memcpy(&vid, ibuf, sizeof(vid)); ibuf += sizeof(vid); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM); } if (vol->v_cdb == NULL || !(vol->v_cdb->flags & CNID_FLAG_PERSISTENT)) { return AFPERR_NOOP; } if (vol->v_flags & AFPVOL_RO) return AFPERR_VLOCK; memcpy(&id, ibuf, sizeof( id )); ibuf += sizeof(id); fileid = id; if (NULL == (upath = cnid_resolve(vol->v_cdb, &id, buffer, len)) ) { return AFPERR_NOID; } if (NULL == ( dir = dirlookup( vol, id )) ) { if (afp_errno == AFPERR_NOOBJ) { err = AFPERR_NOOBJ; goto delete; } return( AFPERR_PARAM ); } err = AFP_OK; if ((movecwd(vol, dir) < 0) || (lstat(upath, &st) < 0)) { switch (errno) { case EACCES: case EPERM: return AFPERR_ACCESS; #ifdef ESTALE case ESTALE: #endif case ENOENT: /* still try to delete the id */ err = AFPERR_NOOBJ; break; default: return AFPERR_PARAM; } } else if (S_ISDIR(st.st_mode)) /* directories are bad */ return AFPERR_BADTYPE; delete: if (cnid_delete(vol->v_cdb, fileid)) { switch (errno) { case EROFS: return AFPERR_VLOCK; case EPERM: case EACCES: return AFPERR_ACCESS; default: return AFPERR_PARAM; } } return err; } /* ------------------------------ */ static struct adouble *find_adouble(struct path *path, struct ofork **of, struct adouble *adp) { int ret; if (path->st_errno) { switch (path->st_errno) { case ENOENT: afp_errno = AFPERR_NOID; break; case EPERM: case EACCES: afp_errno = AFPERR_ACCESS; break; default: afp_errno = AFPERR_PARAM; break; } return NULL; } /* we use file_access both for legacy Mac perm and * for unix privilege, rename will take care of folder perms */ if (file_access(path, OPENACC_WR ) < 0) { afp_errno = AFPERR_ACCESS; return NULL; } if ((*of = of_findname(path))) { /* reuse struct adouble so it won't break locks */ adp = (*of)->of_ad; } else { ret = ad_open( path->u_name, ADFLAGS_HF, O_RDONLY, 0, adp); /* META and HF */ if ( !ret && ad_reso_fileno(adp) != -1 && !(adp->ad_resource_fork.adf_flags & ( O_RDWR | O_WRONLY))) { /* from AFP spec. * The user must have the Read & Write privilege for both files in order to use this command. */ ad_close(adp, ADFLAGS_HF); afp_errno = AFPERR_ACCESS; return NULL; } } return adp; } #define APPLETEMP ".AppleTempXXXXXX" int afp_exchangefiles(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct stat srcst, destst; struct vol *vol; struct dir *dir, *sdir; char *spath, temp[17], *p; char *supath, *upath; struct path *path; int err; struct adouble ads; struct adouble add; struct adouble *adsp = NULL; struct adouble *addp = NULL; struct ofork *s_of = NULL; struct ofork *d_of = NULL; int crossdev; int slen, dlen; u_int32_t sid, did; u_int16_t vid; uid_t uid; gid_t gid; *rbuflen = 0; ibuf += 2; memcpy(&vid, ibuf, sizeof(vid)); ibuf += sizeof(vid); if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM); } if ((vol->v_flags & AFPVOL_RO)) return AFPERR_VLOCK; /* source and destination dids */ memcpy(&sid, ibuf, sizeof(sid)); ibuf += sizeof(sid); memcpy(&did, ibuf, sizeof(did)); ibuf += sizeof(did); /* source file */ if (NULL == (dir = dirlookup( vol, sid )) ) { return afp_errno; /* was AFPERR_PARAM */ } if (NULL == ( path = cname( vol, dir, &ibuf )) ) { return get_afp_errno(AFPERR_NOOBJ); } if ( path_isadir(path) ) { return AFPERR_BADTYPE; /* it's a dir */ } /* save some stuff */ srcst = path->st; sdir = curdir; spath = obj->oldtmp; supath = obj->newtmp; strcpy(spath, path->m_name); strcpy(supath, path->u_name); /* this is for the cnid changing */ p = absupath( vol, sdir, supath); if (!p) { /* pathname too long */ return AFPERR_PARAM ; } ad_init(&ads, vol->v_adouble, vol->v_ad_options); if (!(adsp = find_adouble( path, &s_of, &ads))) { return afp_errno; } /* ***** from here we may have resource fork open **** */ /* look for the source cnid. if it doesn't exist, don't worry about * it. */ sid = cnid_lookup(vol->v_cdb, &srcst, sdir->d_did, supath,slen = strlen(supath)); if (NULL == ( dir = dirlookup( vol, did )) ) { err = afp_errno; /* was AFPERR_PARAM */ goto err_exchangefile; } if (NULL == ( path = cname( vol, dir, &ibuf )) ) { err = get_afp_errno(AFPERR_NOOBJ); goto err_exchangefile; } if ( path_isadir(path) ) { err = AFPERR_BADTYPE; goto err_exchangefile; } /* FPExchangeFiles is the only call that can return the SameObj * error */ if ((curdir == sdir) && strcmp(spath, path->m_name) == 0) { err = AFPERR_SAMEOBJ; goto err_exchangefile; } ad_init(&add, vol->v_adouble, vol->v_ad_options); if (!(addp = find_adouble( path, &d_of, &add))) { err = afp_errno; goto err_exchangefile; } destst = path->st; /* they are not on the same device and at least one is open * FIXME broken for for crossdev and adouble v2 * return an error */ crossdev = (srcst.st_dev != destst.st_dev); if (/* (d_of || s_of) && */ crossdev) { err = AFPERR_MISC; goto err_exchangefile; } /* look for destination id. */ upath = path->u_name; did = cnid_lookup(vol->v_cdb, &destst, curdir->d_did, upath, dlen = strlen(upath)); /* construct a temp name. * NOTE: the temp file will be in the dest file's directory. it * will also be inaccessible from AFP. */ memcpy(temp, APPLETEMP, sizeof(APPLETEMP)); if (!mktemp(temp)) { err = AFPERR_MISC; goto err_exchangefile; } if (crossdev) { /* FIXME we need to close fork for copy, both s_of and d_of are null */ ad_close(adsp, ADFLAGS_HF); ad_close(addp, ADFLAGS_HF); } /* now, quickly rename the file. we error if we can't. */ if ((err = renamefile(vol, -1, p, temp, temp, adsp)) != AFP_OK) goto err_exchangefile; of_rename(vol, s_of, sdir, spath, curdir, temp); /* rename destination to source */ if ((err = renamefile(vol, -1, upath, p, spath, addp)) != AFP_OK) goto err_src_to_tmp; of_rename(vol, d_of, curdir, path->m_name, sdir, spath); /* rename temp to destination */ if ((err = renamefile(vol, -1, temp, upath, path->m_name, adsp)) != AFP_OK) goto err_dest_to_src; of_rename(vol, s_of, curdir, temp, curdir, path->m_name); /* id's need switching. src -> dest and dest -> src. * we need to re-stat() if it was a cross device copy. */ if (sid) cnid_delete(vol->v_cdb, sid); if (did) cnid_delete(vol->v_cdb, did); if ((did && ( (crossdev && lstat( upath, &srcst) < 0) || cnid_update(vol->v_cdb, did, &srcst, curdir->d_did,upath, dlen) < 0)) || (sid && ( (crossdev && lstat(p, &destst) < 0) || cnid_update(vol->v_cdb, sid, &destst, sdir->d_did,supath, slen) < 0)) ) { switch (errno) { case EPERM: case EACCES: err = AFPERR_ACCESS; break; default: err = AFPERR_PARAM; } goto err_temp_to_dest; } /* here we need to reopen if crossdev */ if (sid && ad_setid(addp, destst.st_dev, destst.st_ino, sid, sdir->d_did, vol->v_stamp)) { ad_flush( addp ); } if (did && ad_setid(adsp, srcst.st_dev, srcst.st_ino, did, curdir->d_did, vol->v_stamp)) { ad_flush( adsp ); } /* change perms, src gets dest perm and vice versa */ uid = geteuid(); gid = getegid(); if (seteuid(0)) { LOG(log_error, logtype_afpd, "seteuid failed %s", strerror(errno)); err = AFP_OK; /* ignore error */ goto err_temp_to_dest; } /* * we need to exchange ACL entries as well */ /* exchange_acls(vol, p, upath); */ path->st = srcst; path->st_valid = 1; path->st_errno = 0; path->m_name = NULL; path->u_name = upath; setfilunixmode(vol, path, destst.st_mode); setfilowner(vol, destst.st_uid, destst.st_gid, path); path->st = destst; path->st_valid = 1; path->st_errno = 0; path->u_name = p; setfilunixmode(vol, path, srcst.st_mode); setfilowner(vol, srcst.st_uid, srcst.st_gid, path); if ( setegid(gid) < 0 || seteuid(uid) < 0) { LOG(log_error, logtype_afpd, "can't seteuid back %s", strerror(errno)); exit(EXITERR_SYS); } err = AFP_OK; goto err_exchangefile; /* all this stuff is so that we can unwind a failed operation * properly. */ err_temp_to_dest: /* rename dest to temp */ renamefile(vol, -1, upath, temp, temp, adsp); of_rename(vol, s_of, curdir, upath, curdir, temp); err_dest_to_src: /* rename source back to dest */ renamefile(vol, -1, p, upath, path->m_name, addp); of_rename(vol, d_of, sdir, spath, curdir, path->m_name); err_src_to_tmp: /* rename temp back to source */ renamefile(vol, -1, temp, p, spath, adsp); of_rename(vol, s_of, curdir, temp, sdir, spath); err_exchangefile: if ( !s_of && adsp && ad_meta_fileno(adsp) != -1 ) { /* META */ ad_close(adsp, ADFLAGS_HF); } if ( !d_of && addp && ad_meta_fileno(addp) != -1 ) {/* META */ ad_close(addp, ADFLAGS_HF); } struct dir *cached; if ((cached = dircache_search_by_did(vol, sid)) != NULL) (void)dir_remove(vol, cached); if ((cached = dircache_search_by_did(vol, did)) != NULL) (void)dir_remove(vol, cached); return err; } netatalk-2.2.2/etc/afpd/auth.h0000644000175200017500000000362411655731244013057 00000000000000/* * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifndef AFPD_AUTH_H #define AFPD_AUTH_H 1 #ifdef HAVE_LIMITS_H #include #endif /* HAVE_LIMITS_H */ #ifdef HAVE_SYS_CDEFS_H #include #endif /* HAVE_SYS_CDEFS_H */ #include struct afp_versions { char *av_name; int av_number; }; static const struct afp_versions afp_versions[] = { #ifndef NO_DDP { "AFPVersion 1.1", 11 }, { "AFPVersion 2.0", 20 }, { "AFPVersion 2.1", 21 }, #endif /* ! NO_DDP */ { "AFP2.2", 22 }, { "AFPX03", 30 }, { "AFP3.1", 31 }, { "AFP3.2", 32 }, { "AFP3.3", 33 } }; /* for GetUserInfo */ #define USERIBIT_USER (1 << 0) #define USERIBIT_GROUP (1 << 1) #define USERIBIT_UUID (1 << 2) #define USERIBIT_ALL (USERIBIT_USER | USERIBIT_GROUP | USERIBIT_UUID) extern uid_t uuid; #if defined( sun ) && !defined( __svr4__ ) || defined( ultrix ) extern int *groups; #else /*sun __svr4__ ultrix*/ extern gid_t *groups; #endif /*sun __svr4__ ultrix*/ extern int ngroups; /* FP functions */ int afp_login (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_login_ext (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_logincont (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_changepw (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_logout (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_getuserinfo (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_getsession (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_disconnect (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); int afp_zzz (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen); #endif /* auth.h */ netatalk-2.2.2/etc/afpd/afs.c0000644000175200017500000001741511655731244012665 00000000000000/* * $Id: afs.c,v 1.18 2009-10-15 10:43:13 didg Exp $ * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef AFS #include #include #include #include #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include "globals.h" #include "directory.h" #include "volume.h" #include "misc.h" #include "unix.h" int afs_getvolspace( vol, bfree, btotal, bsize ) struct vol *vol; VolSpace *bfree, *btotal; u_int32_t *bsize; { struct ViceIoctl vi; struct VolumeStatus *vs; char venuspace[ sizeof( struct VolumeStatus ) + 3 ]; int total, free; vi.in_size = 0; vi.out_size = sizeof( venuspace ); vi.out = venuspace; if ( pioctl( vol->v_path, VIOCGETVOLSTAT, &vi, 1 ) < 0 ) { return( AFPERR_PARAM ); } vs = (struct VolumeStatus *)venuspace; if ( vs->PartBlocksAvail > 0 ) { if ( vs->MaxQuota != 0 ) { #ifdef min #undef min #endif #define min(x,y) (((x)<(y))?(x):(y)) free = min( vs->MaxQuota - vs->BlocksInUse, vs->PartBlocksAvail ); } else { free = vs->PartBlocksAvail; } } else { free = 0; } if ( vs->MaxQuota != 0 ) { total = free + vs->BlocksInUse; } else { total = vs->PartMaxBlocks; } *bsize = 1024; *bfree = (VolSpace) free * 1024; *btotal = (VolSpace) total * 1024; return( AFP_OK ); } int afp_getdiracl(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { struct ViceIoctl vi; struct vol *vol; struct dir *dir; struct path *path; u_int32_t did; u_int16_t vid; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( short ); if (( vol = getvolbyvid( vid )) == NULL ) { *rbuflen = 0; return( AFPERR_PARAM ); } memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( int ); if (( dir = dirlookup( vol, did )) == NULL ) { *rbuflen = 0; return afp_errno; } if (( path = cname( vol, dir, &ibuf )) == NULL ) { *rbuflen = 0; return get_afp_errno(AFPERR_PARAM); } if ( *path->m_name != '\0' ) { *rbuflen = 0; return (path_isadir( path))? afp_errno: AFPERR_BITMAP; } vi.in_size = 0; vi.out_size = *rbuflen; vi.out = rbuf; if ( pioctl( ".", VIOCGETAL, &vi, 1 ) < 0 ) { *rbuflen = 0; return( AFPERR_PARAM ); } *rbuflen = strlen( vi.out ) + 1; return( AFP_OK ); } /* * Calculate the mode for a directory in AFS. First, make sure the * directory is in AFS. Could probably use something less heavy than * VIOCGETAL. If the directory is on AFS, use access() calls to * estimate permission, a la mdw. */ #ifdef accessmode #undef accessmode #endif void afsmode( vol, path, ma, dir, st ) const struct volume *vol; char *path; struct maccess *ma; struct dir *dir; struct stat *st; { struct ViceIoctl vi; char buf[ 1024 ]; if (( dir->d_flags & DIRF_FSMASK ) == DIRF_NOFS ) { vi.in_size = 0; vi.out_size = sizeof( buf ); vi.out = buf; if ( pioctl( path, VIOCGETAL, &vi, 1 ) < 0 ) { dir->d_flags |= DIRF_UFS; } else { dir->d_flags |= DIRF_AFS; } } if (( dir->d_flags & DIRF_FSMASK ) != DIRF_AFS ) { return; } accessmode(vol, path, ma, dir, st ); return; } extern struct dir *curdir; /* * cmd | 0 | vid | did | pathtype | pathname | 0 | acl */ int afp_setdiracl(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { struct ViceIoctl vi; struct vol *vol; struct dir *dir; char *iend; struct path *path; u_int32_t did; u_int16_t vid; *rbuflen = 0; iend = ibuf + ibuflen; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( short ); if (( vol = getvolbyvid( vid )) == NULL ) { *rbuflen = 0; return( AFPERR_PARAM ); } memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( int ); if (( dir = dirlookup( vol, did )) == NULL ) { *rbuflen = 0; return afp_errno; } if (( path = cname( vol, dir, &ibuf )) == NULL ) { *rbuflen = 0; return get_afp_errno(AFPERR_PARAM); } if ( *path->m_name != '\0' ) { *rbuflen = 0; return (path_isadir( path))? afp_errno: AFPERR_BITMAP; } if ((int)ibuf & 1 ) { ibuf++; } vi.in_size = iend - ibuf; vi.in = ibuf; vi.out_size = 0; if ( pioctl( ".", VIOCSETAL, &vi, 1 ) < 0 ) { *rbuflen = 0; return( AFPERR_PARAM ); } pioctl( ".AppleDouble", VIOCSETAL, &vi, 1 ); if ( curdir->d_did == DIRDID_ROOT ) { pioctl( ".AppleDesktop", VIOCSETAL, &vi, 1 ); } return( AFP_OK ); } #ifdef UAM_AFSKRB #include #include #include #include extern C_Block seskey; extern Key_schedule seskeysched; int afp_afschangepw(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { char name[ MAXKTCNAMELEN ], instance[ MAXKTCNAMELEN ]; char realm[ MAXKTCREALMLEN ]; char oldpw[ 9 ], newpw[ 9 ]; int len, rc; u_int16_t clen; struct ktc_encryptionKey oldkey, newkey; struct ktc_token adtok; struct ubik_client *conn; *rbuflen = 0; ++ibuf; len = (unsigned char) *ibuf++; ibuf[ len ] = '\0'; *name = *instance = *realm = '\0'; ka_ParseLoginName( ibuf, name, instance, realm ); ucase( realm ); if ( *realm == '\0' ) { if ( krb_get_lrealm( realm, 1 ) != KSUCCESS ) { LOG(log_error, logtype_afpd, "krb_get_lrealm failed" ); return( AFPERR_BADUAM ); } } if ( strlen( name ) < 2 || strlen( name ) > 18 ) { return( AFPERR_PARAM ); } ibuf += len; memcpy( &clen, ibuf, sizeof( clen )); clen = ntohs( clen ); if ( clen % 8 != 0 ) { return( AFPERR_PARAM ); } ibuf += sizeof( short ); pcbc_encrypt((C_Block *)ibuf, (C_Block *)ibuf, clen, seskeysched, seskey, DES_DECRYPT ); len = (unsigned char) *ibuf++; if ( len > 8 ) { return( AFPERR_PARAM ); } memset( oldpw, 0, sizeof( oldpw )); memcpy( oldpw, ibuf, len ); ibuf += len; oldpw[ len ] = '\0'; len = (unsigned char) *ibuf++; if ( len > 8 ) { return( AFPERR_PARAM ); } memset( newpw, 0, sizeof( newpw )); memcpy( newpw, ibuf, len ); ibuf += len; newpw[ len ] = '\0'; LOG(log_info, logtype_afpd, "changing password for <%s>.<%s>@<%s>", name, instance, realm ); ka_StringToKey( oldpw, realm, &oldkey ); memset( oldpw, 0, sizeof( oldpw )); ka_StringToKey( newpw, realm, &newkey ); memset( newpw, 0, sizeof( newpw )); rc = ka_GetAdminToken( name, instance, realm, &oldkey, 60, &adtok, 0 ); memset( &oldkey, 0, sizeof( oldkey )); switch ( rc ) { case 0: break; case KABADREQUEST: memset( &newkey, 0, sizeof( newkey )); return( AFPERR_NOTAUTH ); default: memset( &newkey, 0, sizeof( newkey )); return( AFPERR_BADUAM ); } if ( ka_AuthServerConn( realm, KA_MAINTENANCE_SERVICE, &adtok, &conn ) != 0 ) { memset( &newkey, 0, sizeof( newkey )); return( AFPERR_BADUAM ); } rc = ka_ChangePassword( name, instance, conn, 0, &newkey ); memset( &newkey, 0, sizeof( newkey )); if ( rc != 0 ) { return( AFPERR_BADUAM ); } LOG(log_debug, logtype_afpd, "password changed succeeded" ); return( AFP_OK ); } #endif /* UAM_AFSKRB */ #endif /* AFS */ netatalk-2.2.2/etc/afpd/appl.c0000644000175200017500000003173511665651044013051 00000000000000/* * $Id: appl.c,v 1.18.4.1 2010-02-01 10:56:08 franklahm Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include "volume.h" #include "directory.h" #include "file.h" #include "desktop.h" static struct savedt sa = { { 0, 0, 0, 0 }, -1, 0, 0}; static int pathcmp(char *p, int plen, char *q, int qlen) { return (( plen == qlen && memcmp( p, q, plen ) == 0 ) ? 0 : 1 ); } static int applopen(struct vol *vol, u_char creator[ 4 ], int flags, int mode) { char *dtf, *adt, *adts; if ( sa.sdt_fd != -1 ) { if ( !(flags & ( O_RDWR | O_WRONLY )) && memcmp( sa.sdt_creator, creator, sizeof( CreatorType )) == 0 && sa.sdt_vid == vol->v_vid ) { return( AFP_OK ); } close( sa.sdt_fd ); sa.sdt_fd = -1; } dtf = dtfile( vol, creator, ".appl" ); if (( sa.sdt_fd = open( dtf, flags, ad_mode( dtf, mode ))) < 0 ) { if ( errno == ENOENT && ( flags & O_CREAT )) { if (( adts = strrchr( dtf, '/' )) == NULL ) { return( AFPERR_PARAM ); } *adts = '\0'; if (( adt = strrchr( dtf, '/' )) == NULL ) { return( AFPERR_PARAM ); } *adt = '\0'; (void) ad_mkdir( dtf, DIRBITS | 0777 ); *adt = '/'; (void) ad_mkdir( dtf, DIRBITS | 0777 ); *adts = '/'; if (( sa.sdt_fd = open( dtf, flags, ad_mode( dtf, mode ))) < 0 ) { return( AFPERR_PARAM ); } } else { return( AFPERR_PARAM ); } } memcpy( sa.sdt_creator, creator, sizeof( CreatorType )); sa.sdt_vid = vol->v_vid; sa.sdt_index = 0; return( AFP_OK ); } /* * copy appls to new file, deleting any matching (old) appl entries */ static int copyapplfile(int sfd, int dfd, char *mpath, u_short mplen) { int cc; char *p; u_int16_t len; u_char appltag[ 4 ]; char buf[ MAXPATHLEN ]; while (( cc = read( sfd, buf, sizeof(appltag) + sizeof( u_short ))) > 0 ) { p = buf + sizeof(appltag); memcpy( &len, p, sizeof(len)); len = ntohs( len ); p += sizeof( len ); if (( cc = read( sa.sdt_fd, p, len )) < len ) { break; } if ( pathcmp( mpath, mplen, p, len ) != 0 ) { p += len; if ( write( dfd, buf, p - buf ) != p - buf ) { cc = -1; break; } } } return( cc ); } /* * build mac. path (backwards) by traversing the directory tree * * The old way: dir and path refer to an app, path is a mac format * pathname. makemacpath() builds something that looks like a cname, * but uses upaths instead of mac format paths. * * The new way: dir and path refer to an app, path is a mac format * pathname. makemacpath() builds a cname. (zero is a path separator * and it's not \0 terminated). * * See afp_getappl() for the backward compatiblity code. */ static char * makemacpath(const struct vol *vol, char *mpath, int mpathlen, struct dir *dir, char *path) { char *p; p = mpath + mpathlen; p -= strlen( path ); memcpy( p, path, strlen( path )); while ( dir->d_did != DIRDID_ROOT ) { p -= blength(dir->d_m_name) + 1; if (p < mpath) { /* FIXME: pathname too long */ return NULL; } memcpy(p, cfrombstr(dir->d_m_name), blength(dir->d_m_name) + 1); if ((dir = dirlookup(vol, dir->d_pdid)) == NULL) return NULL; } return( p ); #if 0 char buffer[12 + MAXPATHLEN + 1]; int buflen = 12 + MAXPATHLEN + 1; char *ret = mpath; char *path = name; char *uname = NULL; struct bstrList *pathlist = NULL; cnid_t cnid = dir->d_pdid; /* Create list for path elements, request 16 list elements for now*/ if ((pathlist = bstListCreateMin(16)) == NULL) { LOG(log_error, logtype_afpd, "makemacpath: OOM: %s", strerror(errno)); return NULL; } while ( cnid != DIRDID_ROOT ) { /* construct path, copy already found uname to path element list*/ if ((bstrListPush(pathlist, bfromcstr(path))) != BSTR_OK) { afp_errno = AFPERR_MISC; ret = NULL; goto exit; } /* next part */ if ((uname = cnid_resolve(vol->v_cdb, &cnid, buffer, buflen)) == NULL ) { afp_errno = AFPERR_NOOBJ; ret = NULL; goto exit; } if ((path = utompath(vol, uname, cnid, utf8_encoding())) == NULL) { afp_errno = AFPERR_MISC; ret = NULL; goto exit; } } exit: if (pathlist) bstrListDestroy(pathlist); return(ret); #endif } int afp_addappl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *vol; struct dir *dir; int tfd, cc; u_int32_t did; u_int16_t vid, mplen; struct path *path; char *dtf, *p, *mp; u_char creator[ 4 ]; u_char appltag[ 4 ]; char *mpath, *tempfile; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid ))) { return( AFPERR_PARAM ); } memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; } memcpy( creator, ibuf, sizeof( creator )); ibuf += sizeof( creator ); memcpy( appltag, ibuf, sizeof( appltag )); ibuf += sizeof( appltag ); if (NULL == ( path = cname( vol, dir, &ibuf )) ) { return get_afp_errno(AFPERR_PARAM); } if ( path_isadir(path) ) { return( AFPERR_BADTYPE ); } if ( applopen( vol, creator, O_RDWR|O_CREAT, 0666 ) != AFP_OK ) { return( AFPERR_PARAM ); } if ( lseek( sa.sdt_fd, 0L, SEEK_SET ) < 0 ) { return( AFPERR_PARAM ); } dtf = dtfile( vol, creator, ".appl.temp" ); tempfile = obj->oldtmp; strcpy( tempfile, dtf ); if (( tfd = open( tempfile, O_RDWR|O_CREAT, 0666 )) < 0 ) { return( AFPERR_PARAM ); } mpath = obj->newtmp; mp = makemacpath( vol, mpath, AFPOBJ_TMPSIZ, curdir, path->m_name ); if (!mp) { close(tfd); return AFPERR_PARAM; } mplen = mpath + AFPOBJ_TMPSIZ - mp; /* write the new appl entry at start of temporary file */ p = mp - sizeof( u_short ); mplen = htons( mplen ); memcpy( p, &mplen, sizeof( mplen )); mplen = ntohs( mplen ); p -= sizeof( appltag ); memcpy(p, appltag, sizeof( appltag )); cc = mpath + AFPOBJ_TMPSIZ - p; if ( write( tfd, p, cc ) != cc ) { close(tfd); unlink( tempfile ); return( AFPERR_PARAM ); } cc = copyapplfile( sa.sdt_fd, tfd, mp, mplen ); close( tfd ); close( sa.sdt_fd ); sa.sdt_fd = -1; if ( cc < 0 ) { unlink( tempfile ); return( AFPERR_PARAM ); } if ( rename( tempfile, dtfile( vol, creator, ".appl" )) < 0 ) { return( AFPERR_PARAM ); } return( AFP_OK ); } int afp_rmvappl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *vol; struct dir *dir; int tfd, cc; u_int32_t did; u_int16_t vid, mplen; struct path *path; char *dtf, *mp; u_char creator[ 4 ]; char *tempfile, *mpath; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid ))) { return( AFPERR_PARAM ); } memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; } memcpy( creator, ibuf, sizeof( creator )); ibuf += sizeof( creator ); if (NULL == ( path = cname( vol, dir, &ibuf )) ) { return get_afp_errno(AFPERR_PARAM); } if ( path_isadir(path) ) { return( AFPERR_BADTYPE ); } if ( applopen( vol, creator, O_RDWR, 0666 ) != AFP_OK ) { return( AFPERR_NOOBJ ); } if ( lseek( sa.sdt_fd, 0L, SEEK_SET ) < 0 ) { return( AFPERR_PARAM ); } dtf = dtfile( vol, creator, ".appl.temp" ); tempfile = obj->oldtmp; strcpy( tempfile, dtf ); if (( tfd = open( tempfile, O_RDWR|O_CREAT, 0666 )) < 0 ) { return( AFPERR_PARAM ); } mpath = obj->newtmp; mp = makemacpath( vol, mpath, AFPOBJ_TMPSIZ, curdir, path->m_name ); if (!mp) { return AFPERR_PARAM ; } mplen = mpath + AFPOBJ_TMPSIZ - mp; cc = copyapplfile( sa.sdt_fd, tfd, mp, mplen ); close( tfd ); close( sa.sdt_fd ); sa.sdt_fd = -1; if ( cc < 0 ) { unlink( tempfile ); return( AFPERR_PARAM ); } if ( rename( tempfile, dtfile( vol, creator, ".appl" )) < 0 ) { return( AFPERR_PARAM ); } return( AFP_OK ); } int afp_getappl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct vol *vol; char *p, *q; int cc; size_t buflen; u_int16_t vid, aindex, bitmap, len; u_char creator[ 4 ]; u_char appltag[ 4 ]; char *buf, *cbuf; struct path *path; ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { *rbuflen = 0; return( AFPERR_PARAM ); } memcpy( creator, ibuf, sizeof( creator )); ibuf += sizeof( creator ); memcpy( &aindex, ibuf, sizeof( aindex )); ibuf += sizeof( aindex ); aindex = ntohs( aindex ); if ( aindex ) { /* index 0 == index 1 */ --aindex; } memcpy( &bitmap, ibuf, sizeof( bitmap )); bitmap = ntohs( bitmap ); ibuf += sizeof( bitmap ); if ( applopen( vol, creator, O_RDONLY, 0666 ) != AFP_OK ) { *rbuflen = 0; return( AFPERR_NOITEM ); } if ( aindex < sa.sdt_index ) { if ( lseek( sa.sdt_fd, 0L, SEEK_SET ) < 0 ) { *rbuflen = 0; return( AFPERR_PARAM ); } sa.sdt_index = 0; } /* position to correct spot within appl file */ buf = obj->oldtmp; while (( cc = read( sa.sdt_fd, buf, sizeof( appltag ) + sizeof( u_short ))) > 0 ) { p = buf + sizeof( appltag ); memcpy( &len, p, sizeof( len )); len = ntohs( len ); p += sizeof( u_short ); if (( cc = read( sa.sdt_fd, p, len )) < len ) { break; } if ( sa.sdt_index == aindex ) { break; } sa.sdt_index++; } if ( cc <= 0 || sa.sdt_index != aindex ) { *rbuflen = 0; return( AFPERR_NOITEM ); } sa.sdt_index++; #ifdef APPLCNAME /* * Check to see if this APPL mapping has an mpath or a upath. If * there are any ':'s in the name, it is a upath and must be converted * to an mpath. Hopefully, this code will go away. */ { #define hextoint( c ) ( isdigit( c ) ? c - '0' : c + 10 - 'a' ) #define islxdigit(x) (!isupper(x)&&isxdigit(x)) char utomname[ MAXPATHLEN + 1]; char *u, *m; int i, h; u = p; m = utomname; i = len; while ( i ) { if ( *u == ':' && *(u+1) != '\0' && islxdigit( *(u+1)) && *(u+2) != '\0' && islxdigit( *(u+2))) { ++u, --i; h = hextoint( *u ) << 4; ++u, --i; h |= hextoint( *u ); *m++ = h; } else { *m++ = *u; } ++u, --i; } len = m - utomname; p = utomname; if ( p[ len - 1 ] == '\0' ) { len--; } } #endif /* APPLCNAME */ /* fake up a cname */ cbuf = obj->newtmp; q = cbuf; *q++ = 2; /* long path type */ *q++ = (unsigned char)len; memcpy( q, p, len ); q = cbuf; if (( path = cname( vol, vol->v_root, &q )) == NULL ) { *rbuflen = 0; return( AFPERR_NOITEM ); } if ( path_isadir(path) || path->st_errno ) { *rbuflen = 0; return( AFPERR_NOITEM ); } buflen = *rbuflen - sizeof( bitmap ) - sizeof( appltag ); if ( getfilparams(vol, bitmap, path, curdir, rbuf + sizeof( bitmap ) + sizeof( appltag ), &buflen ) != AFP_OK ) { *rbuflen = 0; return( AFPERR_BITMAP ); } *rbuflen = buflen + sizeof( bitmap ) + sizeof( appltag ); bitmap = htons( bitmap ); memcpy( rbuf, &bitmap, sizeof( bitmap )); rbuf += sizeof( bitmap ); memcpy( rbuf, appltag, sizeof( appltag )); rbuf += sizeof( appltag ); return( AFP_OK ); } netatalk-2.2.2/etc/afpd/fce_api.c0000644000175200017500000004514511667370453013507 00000000000000/* * Copyright (c) 2010 Mark Williams * * File change event API for netatalk * * for every detected filesystem change a UDP packet is sent to an arbitrary list * of listeners. Each packet contains unix path of modified filesystem element, * event reason, and a consecutive event id (32 bit). Technically we are UDP client and are sending * out packets synchronuosly as they are created by the afp functions. This should not affect * performance measurably. The only delaying calls occur during initialization, if we have to * resolve non-IP hostnames to IP. All numeric data inside the packet is network byte order, so use * ntohs / ntohl to resolve length and event id. Ideally a listener receives every packet with * no gaps in event ids, starting with event id 1 and mode FCE_CONN_START followed by * data events from id 2 up to 0xFFFFFFFF, followed by 0 to 0xFFFFFFFF and so on. * * A gap or not starting with 1 mode FCE_CONN_START or receiving mode FCE_CONN_BROKEN means that * the listener has lost at least one filesystem event * * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "fork.h" #include "file.h" #include "directory.h" #include "desktop.h" #include "volume.h" // ONLY USED IN THIS FILE #include "fce_api_internal.h" #define FCE_TRUE 1 #define FCE_FALSE 0 /* We store our connection data here */ static struct udp_entry udp_socket_list[FCE_MAX_UDP_SOCKS]; static int udp_sockets = 0; static int udp_initialized = FCE_FALSE; static unsigned long fce_ev_enabled = (1 << FCE_FILE_MODIFY) | (1 << FCE_FILE_DELETE) | (1 << FCE_DIR_DELETE) | (1 << FCE_FILE_CREATE) | (1 << FCE_DIR_CREATE); static uint64_t tm_used; /* used for passing to event handler */ #define MAXIOBUF 1024 static char iobuf[MAXIOBUF]; static const char *skip_files[] = { ".DS_Store", NULL }; static struct fce_close_event last_close_event; /* * * Initialize network structs for any listeners * We dont give return code because all errors are handled internally (I hope..) * * */ void fce_init_udp() { int rv; struct addrinfo hints, *servinfo, *p; if (udp_initialized == FCE_TRUE) return; memset(&hints, 0, sizeof hints); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; for (int i = 0; i < udp_sockets; i++) { struct udp_entry *udp_entry = udp_socket_list + i; /* Close any pending sockets */ if (udp_entry->sock != -1) close(udp_entry->sock); if ((rv = getaddrinfo(udp_entry->addr, udp_entry->port, &hints, &servinfo)) != 0) { LOG(log_error, logtype_afpd, "fce_init_udp: getaddrinfo(%s:%s): %s", udp_entry->addr, udp_entry->port, gai_strerror(rv)); continue; } /* loop through all the results and make a socket */ for (p = servinfo; p != NULL; p = p->ai_next) { if ((udp_entry->sock = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) { LOG(log_error, logtype_afpd, "fce_init_udp: socket(%s:%s): %s", udp_entry->addr, udp_entry->port, strerror(errno)); continue; } break; } if (p == NULL) { LOG(log_error, logtype_afpd, "fce_init_udp: no socket for %s:%s", udp_entry->addr, udp_entry->port); } udp_entry->addrinfo = *p; memcpy(&udp_entry->addrinfo, p, sizeof(struct addrinfo)); memcpy(&udp_entry->sockaddr, p->ai_addr, sizeof(struct sockaddr_storage)); freeaddrinfo(servinfo); } udp_initialized = FCE_TRUE; } void fce_cleanup() { if (udp_initialized == FCE_FALSE ) return; for (int i = 0; i < udp_sockets; i++) { struct udp_entry *udp_entry = udp_socket_list + i; /* Close any pending sockets */ if (udp_entry->sock != -1) { close( udp_entry->sock ); udp_entry->sock = -1; } } udp_initialized = FCE_FALSE; } /* * Construct a UDP packet for our listeners and return packet size * */ static ssize_t build_fce_packet( struct fce_packet *packet, char *path, int mode, uint32_t event_id ) { size_t pathlen = 0; ssize_t data_len = 0; uint64_t *t; /* Set content of packet */ memcpy(packet->magic, FCE_PACKET_MAGIC, sizeof(packet->magic) ); packet->version = FCE_PACKET_VERSION; packet->mode = mode; packet->event_id = event_id; pathlen = strlen(path); /* exclude string terminator */ /* This should never happen, but before we bust this server, we send nonsense, fce listener has to cope */ if (pathlen >= MAXPATHLEN) pathlen = MAXPATHLEN - 1; packet->datalen = pathlen; /* This is the payload len. Means: the packet has len bytes more until packet is finished */ data_len = FCE_PACKET_HEADER_SIZE + pathlen; switch (mode) { case FCE_TM_SIZE: t = (uint64_t *)packet->data; *t = hton64(tm_used); memcpy(packet->data + sizeof(tm_used), path, pathlen); packet->datalen = pathlen + sizeof(tm_used); data_len += sizeof(tm_used); break; default: memcpy(packet->data, path, pathlen); break; } /* return the packet len */ return data_len; } /* * Handle Endianess and write into buffer w/o padding **/ static void pack_fce_packet(struct fce_packet *packet, unsigned char *buf, int maxlen) { unsigned char *p = buf; memcpy(p, &packet->magic[0], sizeof(packet->magic)); p += sizeof(packet->magic); *p = packet->version; p++; *p = packet->mode; p++; uint32_t *id = (uint32_t*)p; *id = htonl(packet->event_id); p += sizeof(packet->event_id); uint16_t *l = ( uint16_t *)p; *l = htons(packet->datalen); p += sizeof(packet->datalen); if (((p - buf) + packet->datalen) < maxlen) { memcpy(p, &packet->data[0], packet->datalen); } } /* * Send the fce information to all (connected) listeners * We dont give return code because all errors are handled internally (I hope..) * */ static void send_fce_event( char *path, int mode ) { static int first_event = FCE_TRUE; struct fce_packet packet; void *data = &packet; static uint32_t event_id = 0; /* the unique packet couter to detect packet/data loss. Going from 0xFFFFFFFF to 0x0 is a valid increment */ time_t now = time(NULL); LOG(log_debug, logtype_afpd, "send_fce_event: start"); /* initialized ? */ if (first_event == FCE_TRUE) { first_event = FCE_FALSE; fce_init_udp(); /* Notify listeners the we start from the beginning */ send_fce_event( "", FCE_CONN_START ); } /* build our data packet */ ssize_t data_len = build_fce_packet( &packet, path, mode, ++event_id ); pack_fce_packet(&packet, iobuf, MAXIOBUF); for (int i = 0; i < udp_sockets; i++) { int sent_data = 0; struct udp_entry *udp_entry = udp_socket_list + i; /* we had a problem earlier ? */ if (udp_entry->sock == -1) { /* We still have to wait ?*/ if (now < udp_entry->next_try_on_error) continue; /* Reopen socket */ udp_entry->sock = socket(udp_entry->addrinfo.ai_family, udp_entry->addrinfo.ai_socktype, udp_entry->addrinfo.ai_protocol); if (udp_entry->sock == -1) { /* failed again, so go to rest again */ LOG(log_error, logtype_afpd, "Cannot recreate socket for fce UDP connection: errno %d", errno ); udp_entry->next_try_on_error = now + FCE_SOCKET_RETRY_DELAY_S; continue; } udp_entry->next_try_on_error = 0; /* Okay, we have a running socket again, send server that we had a problem on our side*/ data_len = build_fce_packet( &packet, "", FCE_CONN_BROKEN, 0 ); pack_fce_packet(&packet, iobuf, MAXIOBUF); sendto(udp_entry->sock, iobuf, data_len, 0, (struct sockaddr *)&udp_entry->sockaddr, udp_entry->addrinfo.ai_addrlen); /* Rebuild our original data packet */ data_len = build_fce_packet( &packet, path, mode, event_id ); pack_fce_packet(&packet, iobuf, MAXIOBUF); } sent_data = sendto(udp_entry->sock, iobuf, data_len, 0, (struct sockaddr *)&udp_entry->sockaddr, udp_entry->addrinfo.ai_addrlen); /* Problems ? */ if (sent_data != data_len) { /* Argh, socket broke, we close and retry later */ LOG(log_error, logtype_afpd, "send_fce_event: error sending packet to %s:%s, transfered %d of %d: %s", udp_entry->addr, udp_entry->port, sent_data, data_len, strerror(errno)); close( udp_entry->sock ); udp_entry->sock = -1; udp_entry->next_try_on_error = now + FCE_SOCKET_RETRY_DELAY_S; } } } static int add_udp_socket(const char *target_ip, const char *target_port ) { if (target_port == NULL) target_port = FCE_DEFAULT_PORT_STRING; if (udp_sockets >= FCE_MAX_UDP_SOCKS) { LOG(log_error, logtype_afpd, "Too many file change api UDP connections (max %d allowed)", FCE_MAX_UDP_SOCKS ); return AFPERR_PARAM; } udp_socket_list[udp_sockets].addr = strdup(target_ip); udp_socket_list[udp_sockets].port = strdup(target_port); udp_socket_list[udp_sockets].sock = -1; memset(&udp_socket_list[udp_sockets].addrinfo, 0, sizeof(struct addrinfo)); memset(&udp_socket_list[udp_sockets].sockaddr, 0, sizeof(struct sockaddr_storage)); udp_socket_list[udp_sockets].next_try_on_error = 0; udp_sockets++; return AFP_OK; } static void save_close_event(const char *path) { time_t now = time(NULL); /* Check if it's a close for the same event as the last one */ if (last_close_event.time /* is there any saved event ? */ && (strcmp(path, last_close_event.path) != 0)) { /* no, so send the saved event out now */ send_fce_event(last_close_event.path, FCE_FILE_MODIFY); } LOG(log_debug, logtype_afpd, "save_close_event: %s", path); last_close_event.time = now; strncpy(last_close_event.path, path, MAXPATHLEN); } /* * * Dispatcher for all incoming file change events * * */ static int register_fce(const char *u_name, int is_dir, int mode) { static int first_event = FCE_TRUE; if (udp_sockets == 0) /* No listeners configured */ return AFP_OK; if (u_name == NULL) return AFPERR_PARAM; /* do some initialization on the fly the first time */ if (first_event) { fce_initialize_history(); first_event = FCE_FALSE; } /* handle files which should not cause events (.DS_Store atc. ) */ for (int i = 0; skip_files[i] != NULL; i++) { if (!strcmp( u_name, skip_files[i])) return AFP_OK; } char full_path_buffer[MAXPATHLEN + 1] = {""}; const char *cwd = getcwdpath(); if (mode == FCE_TM_SIZE) { strlcpy(full_path_buffer, u_name, MAXPATHLEN); } else if (!is_dir || mode == FCE_DIR_DELETE) { if (strlen( cwd ) + strlen( u_name) + 1 >= MAXPATHLEN) { LOG(log_error, logtype_afpd, "FCE file name too long: %s/%s", cwd, u_name ); return AFPERR_PARAM; } sprintf( full_path_buffer, "%s/%s", cwd, u_name ); } else { if (strlen( cwd ) >= MAXPATHLEN) { LOG(log_error, logtype_afpd, "FCE directory name too long: %s", cwd); return AFPERR_PARAM; } strcpy( full_path_buffer, cwd); } /* Can we ignore this event based on type or history? */ if (!(mode & FCE_TM_SIZE) && fce_handle_coalescation( full_path_buffer, is_dir, mode )) { LOG(log_debug9, logtype_afpd, "Coalesced fc event <%d> for <%s>", mode, full_path_buffer ); return AFP_OK; } LOG(log_debug9, logtype_afpd, "Detected fc event <%d> for <%s>", mode, full_path_buffer ); if (mode & FCE_FILE_MODIFY) { save_close_event(full_path_buffer); return AFP_OK; } send_fce_event( full_path_buffer, mode ); return AFP_OK; } static void check_saved_close_events(int fmodwait) { time_t now = time(NULL); /* check if configured holdclose time has passed */ if (last_close_event.time && ((last_close_event.time + fmodwait) < now)) { LOG(log_debug, logtype_afpd, "check_saved_close_events: sending event: %s", last_close_event.path); /* yes, send event */ send_fce_event(&last_close_event.path[0], FCE_FILE_MODIFY); last_close_event.path[0] = 0; last_close_event.time = 0; } } /******************** External calls start here **************************/ /* * API-Calls for file change api, called form outside (file.c directory.c ofork.c filedir.c) * */ #ifndef FCE_TEST_MAIN void fce_pending_events(AFPObj *obj) { vol_fce_tm_event(); check_saved_close_events(obj->options.fce_fmodwait); } int fce_register_delete_file( struct path *path ) { int ret = AFP_OK; if (path == NULL) return AFPERR_PARAM; if (!(fce_ev_enabled & (1 << FCE_FILE_DELETE))) return ret; ret = register_fce( path->u_name, false, FCE_FILE_DELETE ); return ret; } int fce_register_delete_dir( char *name ) { int ret = AFP_OK; if (name == NULL) return AFPERR_PARAM; if (!(fce_ev_enabled & (1 << FCE_DIR_DELETE))) return ret; ret = register_fce( name, true, FCE_DIR_DELETE); return ret; } int fce_register_new_dir( struct path *path ) { int ret = AFP_OK; if (path == NULL) return AFPERR_PARAM; if (!(fce_ev_enabled & (1 << FCE_DIR_CREATE))) return ret; ret = register_fce( path->u_name, true, FCE_DIR_CREATE ); return ret; } int fce_register_new_file( struct path *path ) { int ret = AFP_OK; if (path == NULL) return AFPERR_PARAM; if (!(fce_ev_enabled & (1 << FCE_FILE_CREATE))) return ret; ret = register_fce( path->u_name, false, FCE_FILE_CREATE ); return ret; } int fce_register_file_modification( struct ofork *ofork ) { char *u_name = NULL; struct vol *vol; int ret = AFP_OK; if (ofork == NULL || ofork->of_vol == NULL) return AFPERR_PARAM; if (!(fce_ev_enabled & (1 << FCE_FILE_MODIFY))) return ret; vol = ofork->of_vol; if (NULL == (u_name = mtoupath(vol, of_name(ofork), ofork->of_did, utf8_encoding()))) { return AFPERR_MISC; } ret = register_fce( u_name, false, FCE_FILE_MODIFY ); return ret; } int fce_register_tm_size(const char *vol, size_t used) { int ret = AFP_OK; if (vol == NULL) return AFPERR_PARAM; if (!(fce_ev_enabled & (1 << FCE_TM_SIZE))) return ret; tm_used = used; /* oh what a hack */ ret = register_fce(vol, false, FCE_TM_SIZE); return ret; } #endif /* * * Extern connect to afpd parameter, can be called multiple times for multiple listeners (up to MAX_UDP_SOCKS times) * * */ int fce_add_udp_socket(const char *target) { const char *port = FCE_DEFAULT_PORT_STRING; char target_ip[256] = {""}; strncpy(target_ip, target, sizeof(target_ip) -1); char *port_delim = strchr( target_ip, ':' ); if (port_delim) { *port_delim = 0; port = port_delim + 1; } return add_udp_socket(target_ip, port); } int fce_set_events(const char *events) { char *e; char *p; if (events == NULL) return AFPERR_PARAM; e = strdup(events); fce_ev_enabled = 0; for (p = strtok(e, ","); p; p = strtok(NULL, ",")) { if (strcmp(p, "fmod") == 0) { fce_ev_enabled |= (1 << FCE_FILE_MODIFY); } else if (strcmp(p, "fdel") == 0) { fce_ev_enabled |= (1 << FCE_FILE_DELETE); } else if (strcmp(p, "ddel") == 0) { fce_ev_enabled |= (1 << FCE_DIR_DELETE); } else if (strcmp(p, "fcre") == 0) { fce_ev_enabled |= (1 << FCE_FILE_CREATE); } else if (strcmp(p, "dcre") == 0) { fce_ev_enabled |= (1 << FCE_DIR_CREATE); } else if (strcmp(p, "tmsz") == 0) { fce_ev_enabled |= (1 << FCE_TM_SIZE); } } free(e); return AFP_OK; } #ifdef FCE_TEST_MAIN void shortsleep( unsigned int us ) { usleep( us ); } int main( int argc, char*argv[] ) { int c,ret; char *port = FCE_DEFAULT_PORT_STRING; char *host = "localhost"; int delay_between_events = 1000; int event_code = FCE_FILE_MODIFY; char pathbuff[1024]; int duration_in_seconds = 0; // TILL ETERNITY char target[256]; char *path = getcwd( pathbuff, sizeof(pathbuff) ); // FULLSPEED TEST IS "-s 1001" -> delay is 0 -> send packets without pause while ((c = getopt(argc, argv, "d:e:h:p:P:s:")) != -1) { switch(c) { case '?': fprintf(stdout, "%s: [ -p Port -h Listener1 [ -h Listener2 ...] -P path -s Delay_between_events_in_us -e event_code -d Duration ]\n", argv[0]); exit(1); break; case 'd': duration_in_seconds = atoi(optarg); break; case 'e': event_code = atoi(optarg); break; case 'h': host = strdup(optarg); break; case 'p': port = strdup(optarg); break; case 'P': path = strdup(optarg); break; case 's': delay_between_events = atoi(optarg); break; } } sprintf(target, "%s:%s", host, port); if (fce_add_udp_socket(target) != 0) return 1; int ev_cnt = 0; time_t start_time = time(NULL); time_t end_time = 0; if (duration_in_seconds) end_time = start_time + duration_in_seconds; while (1) { time_t now = time(NULL); if (now > start_time) { start_time = now; fprintf( stdout, "%d events/s\n", ev_cnt ); ev_cnt = 0; } if (end_time && now >= end_time) break; register_fce( path, 0, event_code ); ev_cnt++; shortsleep( delay_between_events ); } } #endif /* TESTMAIN*/ netatalk-2.2.2/etc/afpd/dircache.c0000644000175200017500000005427511665651044013663 00000000000000/* Copyright (c) 2010 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dircache.h" #include "directory.h" #include "hash.h" /* * Directory Cache * =============== * * Cache files and directories in a LRU cache. * * The directory cache caches directories and files(!). The main reason for having the cache * is avoiding recursive walks up the path, querying the CNID database each time, when * we have to calculate the location of eg directory with CNID 30, which is located in a dir with * CNID 25, next CNID 20 and then CNID 2 (the volume root as per AFP spec). * If all these dirs where in the cache, each database look up can be avoided. Additionally there's * the element "fullpath" in struct dir, which is used to avoid the recursion in any case. Wheneveer * a struct dir is initialized, the fullpath to the directory is stored there. * * In order to speed up the CNID query for files too, which eg happens when a directory is enumerated, * files are stored too in the dircache. In order to differentiate between files and dirs, we set * the flag DIRF_ISFILE in struct dir.d_flags for files. * * The most frequent codepatch that leads to caching is directory enumeration (cf enumerate.c): * - if a element is a directory: * (1) the cache is searched by dircache_search_by_name() * (2) if it wasn't found a new struct dir is created and cached both from within dir_add() * - for files the caching happens a little bit down the call chain: * (3) first getfilparams() is called, which calls * (4) getmetadata() where the cache is searched with dircache_search_by_name() * (5) if the element is not found * (6) get_id() queries the CNID from the database * (7) then a struct dir is initialized via dir_new() (note the fullpath arg is NULL) * (8) finally added to the cache with dircache_add() * (2) of course does contain the steps 6,7 and 8. * * The dircache is a LRU cache, whenever it fills up we call dircache_evict internally which removes * DIRCACHE_FREE_QUANTUM elements from the cache. * * There is only one cache for all volumes, so of course we use the volume id in hashing calculations. * * In order to avoid cache poisoning, we store the cached entries st_ctime from stat in * struct dir.ctime_dircache. Later when we search the cache we compare the stored * value with the result of a fresh stat. If the times differ, we remove the cached * entry and return "no entry found in cache". * A elements ctime changes when * 1) the element is renamed * (we loose the cached entry here, but it will expire when the cache fills) * 2) its a directory and an object has been created therein * 3) the element is deleted and recreated under the same name * Using ctime leads to cache eviction in case 2) where it wouldn't be necessary, because * the dir itself (name, CNID, ...) hasn't changed, but there's no other way. * * Indexes * ======= * * The maximum dircache size is: * max(DEFAULT_MAX_DIRCACHE_SIZE, min(size, MAX_POSSIBLE_DIRCACHE_SIZE)). * It is a hashtable which we use to store "struct dir"s in. If the cache get full, oldest * entries are evicted in chunks of DIRCACHE_FREE. * * We have/need two indexes: * - a DID/name index on the main dircache, another hashtable * - a queue index on the dircache, for evicting the oldest entries * * Debugging * ========= * * Sending SIGINT to a afpd child causes it to dump the dircache to a file "/tmp/dircache.PID". */ /******************************************************** * Local funcs and variables ********************************************************/ /***************************** * the dircache */ static hash_t *dircache; /* The actual cache */ static unsigned int dircache_maxsize; /* cache maximum size */ static struct dircache_stat { unsigned long long lookups; unsigned long long hits; unsigned long long misses; unsigned long long added; unsigned long long removed; unsigned long long expunged; unsigned long long evicted; } dircache_stat; /* FNV 1a */ static hash_val_t hash_vid_did(const void *key) { const struct dir *k = (const struct dir *)key; hash_val_t hash = 2166136261; hash ^= k->d_vid >> 8; hash *= 16777619; hash ^= k->d_vid; hash *= 16777619; hash ^= k->d_did >> 24; hash *= 16777619; hash ^= (k->d_did >> 16) & 0xff; hash *= 16777619; hash ^= (k->d_did >> 8) & 0xff; hash *= 16777619; hash ^= (k->d_did >> 0) & 0xff; hash *= 16777619; return hash; } static int hash_comp_vid_did(const void *key1, const void *key2) { const struct dir *k1 = key1; const struct dir *k2 = key2; return !(k1->d_did == k2->d_did && k1->d_vid == k2->d_vid); } /************************************************** * DID/name index on dircache (another hashtable) */ static hash_t *index_didname; #undef get16bits #if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) #define get16bits(d) (*((const uint16_t *) (d))) #endif #if !defined (get16bits) #define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8) \ +(uint32_t)(((const uint8_t *)(d))[0]) ) #endif static hash_val_t hash_didname(const void *p) { const struct dir *key = (const struct dir *)p; const unsigned char *data = key->d_u_name->data; int len = key->d_u_name->slen; hash_val_t hash = key->d_pdid + key->d_vid; hash_val_t tmp; int rem = len & 3; len >>= 2; /* Main loop */ for (;len > 0; len--) { hash += get16bits (data); tmp = (get16bits (data+2) << 11) ^ hash; hash = (hash << 16) ^ tmp; data += 2*sizeof (uint16_t); hash += hash >> 11; } /* Handle end cases */ switch (rem) { case 3: hash += get16bits (data); hash ^= hash << 16; hash ^= data[sizeof (uint16_t)] << 18; hash += hash >> 11; break; case 2: hash += get16bits (data); hash ^= hash << 11; hash += hash >> 17; break; case 1: hash += *data; hash ^= hash << 10; hash += hash >> 1; } /* Force "avalanching" of final 127 bits */ hash ^= hash << 3; hash += hash >> 5; hash ^= hash << 4; hash += hash >> 17; hash ^= hash << 25; hash += hash >> 6; return hash; } static int hash_comp_didname(const void *k1, const void *k2) { const struct dir *key1 = (const struct dir *)k1; const struct dir *key2 = (const struct dir *)k2; return ! (key1->d_vid == key2->d_vid && key1->d_pdid == key2->d_pdid && (bstrcmp(key1->d_u_name, key2->d_u_name) == 0) ); } /*************************** * queue index on dircache */ static q_t *index_queue; /* the index itself */ static unsigned long queue_count; /*! * @brief Remove a fixed number of (oldest) entries from the cache and indexes * * The default is to remove the 256 oldest entries from the cache. * 1. Get the oldest entry * 2. If it's in use ie open forks reference it or it's curdir requeue it, * dont remove it * 3. Remove the dir from the main cache and the didname index * 4. Free the struct dir structure and all its members */ static void dircache_evict(void) { int i = DIRCACHE_FREE_QUANTUM; struct dir *dir; LOG(log_debug, logtype_afpd, "dircache: {starting cache eviction}"); while (i--) { if ((dir = (struct dir *)dequeue(index_queue)) == NULL) { /* 1 */ dircache_dump(); AFP_PANIC("dircache_evict"); } queue_count--; if (curdir == dir) { /* 2 */ if ((dir->qidx_node = enqueue(index_queue, dir)) == NULL) { dircache_dump(); AFP_PANIC("dircache_evict"); } queue_count++; continue; } dircache_remove(NULL, dir, DIRCACHE | DIDNAME_INDEX); /* 3 */ dir_free(dir); /* 4 */ } AFP_ASSERT(queue_count == dircache->hash_nodecount); dircache_stat.evicted += DIRCACHE_FREE_QUANTUM; LOG(log_debug, logtype_afpd, "dircache: {finished cache eviction}"); } /******************************************************** * Interface ********************************************************/ /*! * @brief Search the dircache via a CNID for a directory * * Found cache entries are expunged if both the parent directory st_ctime and the objects * st_ctime are modified. * This func builds on the fact, that all our code only ever needs to and does search * the dircache by CNID expecting directories to be returned, but not files. * Thus * (1) if we find a file for a given CNID we * (1a) remove it from the cache * (1b) return NULL indicating nothing found * (2) we can then use d_fullpath to stat the directory * * @param vol (r) pointer to struct vol * @param cnid (r) CNID of the directory to search * * @returns Pointer to struct dir if found, else NULL */ struct dir *dircache_search_by_did(const struct vol *vol, cnid_t cnid) { struct dir *cdir = NULL; struct dir key; struct stat st; hnode_t *hn; AFP_ASSERT(vol); AFP_ASSERT(ntohl(cnid) >= CNID_START); dircache_stat.lookups++; key.d_vid = vol->v_vid; key.d_did = cnid; if ((hn = hash_lookup(dircache, &key))) cdir = hnode_get(hn); if (cdir) { if (cdir->d_flags & DIRF_ISFILE) { /* (1) */ LOG(log_debug, logtype_afpd, "dircache(cnid:%u): {not a directory:\"%s\"}", ntohl(cnid), cfrombstr(cdir->d_u_name)); (void)dir_remove(vol, cdir); /* (1a) */ dircache_stat.expunged++; return NULL; /* (1b) */ } if (lstat(cfrombstr(cdir->d_fullpath), &st) != 0) { LOG(log_debug, logtype_afpd, "dircache(cnid:%u): {missing:\"%s\"}", ntohl(cnid), cfrombstr(cdir->d_fullpath)); (void)dir_remove(vol, cdir); dircache_stat.expunged++; return NULL; } if ((cdir->dcache_ctime != st.st_ctime) || (cdir->dcache_ino != st.st_ino)) { LOG(log_debug, logtype_afpd, "dircache(cnid:%u): {modified:\"%s\"}", ntohl(cnid), cfrombstr(cdir->d_u_name)); (void)dir_remove(vol, cdir); dircache_stat.expunged++; return NULL; } LOG(log_debug, logtype_afpd, "dircache(cnid:%u): {cached: path:\"%s\"}", ntohl(cnid), cfrombstr(cdir->d_fullpath)); dircache_stat.hits++; } else { LOG(log_debug, logtype_afpd, "dircache(cnid:%u): {not in cache}", ntohl(cnid)); dircache_stat.misses++; } return cdir; } /*! * @brief Search the cache via did/name hashtable * * Found cache entries are expunged if both the parent directory st_ctime and the objects * st_ctime are modified. * * @param vol (r) volume * @param dir (r) directory * @param name (r) name (server side encoding) * @parma len (r) strlen of name * * @returns pointer to struct dir if found in cache, else NULL */ struct dir *dircache_search_by_name(const struct vol *vol, const struct dir *dir, char *name, int len) { struct dir *cdir = NULL; struct dir key; struct stat st; hnode_t *hn; static_bstring uname = {-1, len, (unsigned char *)name}; AFP_ASSERT(vol); AFP_ASSERT(dir); AFP_ASSERT(name); AFP_ASSERT(len == strlen(name)); AFP_ASSERT(len < 256); dircache_stat.lookups++; LOG(log_debug, logtype_afpd, "dircache_search_by_name(did:%u, \"%s\")", ntohl(dir->d_did), name); if (dir->d_did != DIRDID_ROOT_PARENT) { key.d_vid = vol->v_vid; key.d_pdid = dir->d_did; key.d_u_name = &uname; if ((hn = hash_lookup(index_didname, &key))) cdir = hnode_get(hn); } if (cdir) { if (lstat(cfrombstr(cdir->d_fullpath), &st) != 0) { LOG(log_debug, logtype_afpd, "dircache(did:%u,\"%s\"): {missing:\"%s\"}", ntohl(dir->d_did), name, cfrombstr(cdir->d_fullpath)); (void)dir_remove(vol, cdir); dircache_stat.expunged++; return NULL; } /* Remove modified directories and files */ if ((cdir->dcache_ctime != st.st_ctime) || (cdir->dcache_ino != st.st_ino)) { LOG(log_debug, logtype_afpd, "dircache(did:%u,\"%s\"): {modified}", ntohl(dir->d_did), name); (void)dir_remove(vol, cdir); dircache_stat.expunged++; return NULL; } LOG(log_debug, logtype_afpd, "dircache(did:%u,\"%s\"): {found in cache}", ntohl(dir->d_did), name); dircache_stat.hits++; } else { LOG(log_debug, logtype_afpd, "dircache(did:%u,\"%s\"): {not in cache}", ntohl(dir->d_did), name); dircache_stat.misses++; } return cdir; } /*! * @brief create struct dir from struct path * * Add a struct dir to the cache and its indexes. * * @param dir (r) pointer to parrent directory * * @returns 0 on success, -1 on error which should result in an abort */ int dircache_add(const struct vol *vol, struct dir *dir) { struct dir *cdir = NULL; struct dir key; hnode_t *hn; AFP_ASSERT(dir); AFP_ASSERT(ntohl(dir->d_pdid) >= 2); AFP_ASSERT(ntohl(dir->d_did) >= CNID_START); AFP_ASSERT(dir->d_u_name); AFP_ASSERT(dir->d_vid); AFP_ASSERT(dircache->hash_nodecount <= dircache_maxsize); /* Check if cache is full */ if (dircache->hash_nodecount == dircache_maxsize) dircache_evict(); /* * Make sure we don't add duplicates */ /* Search primary cache by CNID */ key.d_vid = dir->d_vid; key.d_did = dir->d_did; if ((hn = hash_lookup(dircache, &key))) { /* Found an entry with the same CNID, delete it */ dir_remove(vol, hnode_get(hn)); dircache_stat.expunged++; } key.d_vid = vol->v_vid; key.d_pdid = dir->d_pdid; key.d_u_name = dir->d_u_name; if ((hn = hash_lookup(index_didname, &key))) { /* Found an entry with the same DID/name, delete it */ dir_remove(vol, hnode_get(hn)); dircache_stat.expunged++; } /* Add it to the main dircache */ if (hash_alloc_insert(dircache, dir, dir) == 0) { dircache_dump(); exit(EXITERR_SYS); } /* Add it to the did/name index */ if (hash_alloc_insert(index_didname, dir, dir) == 0) { dircache_dump(); exit(EXITERR_SYS); } /* Add it to the fifo queue index */ if ((dir->qidx_node = enqueue(index_queue, dir)) == NULL) { dircache_dump(); exit(EXITERR_SYS); } else { queue_count++; } dircache_stat.added++; LOG(log_debug, logtype_afpd, "dircache(did:%u,'%s'): {added}", ntohl(dir->d_did), cfrombstr(dir->d_u_name)); AFP_ASSERT(queue_count == index_didname->hash_nodecount && queue_count == dircache->hash_nodecount); return 0; } /*! * @brief Remove an entry from the dircache * * Callers outside of dircache.c should call this with * flags = QUEUE_INDEX | DIDNAME_INDEX | DIRCACHE. */ void dircache_remove(const struct vol *vol _U_, struct dir *dir, int flags) { hnode_t *hn; AFP_ASSERT(dir); AFP_ASSERT((flags & ~(QUEUE_INDEX | DIDNAME_INDEX | DIRCACHE)) == 0); if (flags & QUEUE_INDEX) { /* remove it from the queue index */ dequeue(dir->qidx_node->prev); /* this effectively deletes the dequeued node */ queue_count--; } if (flags & DIDNAME_INDEX) { if ((hn = hash_lookup(index_didname, dir)) == NULL) { LOG(log_error, logtype_afpd, "dircache_remove(%u,\"%s\"): not in didname index", ntohl(dir->d_did), cfrombstr(dir->d_u_name)); dircache_dump(); AFP_PANIC("dircache_remove"); } hash_delete_free(index_didname, hn); } if (flags & DIRCACHE) { if ((hn = hash_lookup(dircache, dir)) == NULL) { LOG(log_error, logtype_afpd, "dircache_remove(%u,\"%s\"): not in dircache", ntohl(dir->d_did), cfrombstr(dir->d_u_name)); dircache_dump(); AFP_PANIC("dircache_remove"); } hash_delete_free(dircache, hn); } LOG(log_debug, logtype_afpd, "dircache(did:%u,\"%s\"): {removed}", ntohl(dir->d_did), cfrombstr(dir->d_u_name)); dircache_stat.removed++; AFP_ASSERT(queue_count == index_didname->hash_nodecount && queue_count == dircache->hash_nodecount); } /*! * @brief Initialize the dircache and indexes * * This is called in child afpd initialisation. The maximum cache size will be * max(DEFAULT_MAX_DIRCACHE_SIZE, min(size, MAX_POSSIBLE_DIRCACHE_SIZE)). * It initializes a hashtable which we use to store a directory cache in. * It also initializes two indexes: * - a DID/name index on the main dircache * - a queue index on the dircache * * @param size (r) requested maximum size from afpd.conf * * @return 0 on success, -1 on error */ int dircache_init(int reqsize) { dircache_maxsize = DEFAULT_MAX_DIRCACHE_SIZE; /* Initialize the main dircache */ if (reqsize > DEFAULT_MAX_DIRCACHE_SIZE && reqsize < MAX_POSSIBLE_DIRCACHE_SIZE) { while ((dircache_maxsize < MAX_POSSIBLE_DIRCACHE_SIZE) && (dircache_maxsize < reqsize)) dircache_maxsize *= 2; } if ((dircache = hash_create(dircache_maxsize, hash_comp_vid_did, hash_vid_did)) == NULL) return -1; LOG(log_debug, logtype_afpd, "dircache_init: done. max dircache size: %u", dircache_maxsize); /* Initialize did/name index hashtable */ if ((index_didname = hash_create(dircache_maxsize, hash_comp_didname, hash_didname)) == NULL) return -1; /* Initialize index queue */ if ((index_queue = queue_init()) == NULL) return -1; else queue_count = 0; /* Initialize index queue */ if ((invalid_dircache_entries = queue_init()) == NULL) return -1; /* As long as directory.c hasn't got its own initializer call, we do it for it */ rootParent.d_did = DIRDID_ROOT_PARENT; rootParent.d_fullpath = bfromcstr("ROOT_PARENT"); rootParent.d_m_name = bfromcstr("ROOT_PARENT"); rootParent.d_u_name = rootParent.d_m_name; rootParent.d_rights_cache = 0xffffffff; return 0; } /*! * Log dircache statistics */ void log_dircache_stat(void) { LOG(log_info, logtype_afpd, "dircache statistics: " "entries: %lu, lookups: %llu, hits: %llu, misses: %llu, added: %llu, removed: %llu, expunged: %llu, evicted: %llu", queue_count, dircache_stat.lookups, dircache_stat.hits, dircache_stat.misses, dircache_stat.added, dircache_stat.removed, dircache_stat.expunged, dircache_stat.evicted); } /*! * @brief Dump dircache to /tmp/dircache.PID */ void dircache_dump(void) { char tmpnam[64]; FILE *dump; qnode_t *n = index_queue->next; hnode_t *hn; hscan_t hs; const struct dir *dir; int i; LOG(log_warning, logtype_afpd, "Dumping directory cache..."); sprintf(tmpnam, "/tmp/dircache.%u", getpid()); if ((dump = fopen(tmpnam, "w+")) == NULL) { LOG(log_error, logtype_afpd, "dircache_dump: %s", strerror(errno)); return; } setbuf(dump, NULL); fprintf(dump, "Number of cache entries in LRU queue: %lu\n", queue_count); fprintf(dump, "Configured maximum cache size: %u\n\n", dircache_maxsize); fprintf(dump, "Primary CNID index:\n"); fprintf(dump, " VID DID CNID STAT PATH\n"); fprintf(dump, "====================================================================\n"); hash_scan_begin(&hs, dircache); i = 1; while ((hn = hash_scan_next(&hs))) { dir = hnode_get(hn); fprintf(dump, "%05u: %3u %6u %6u %s %s\n", i++, ntohs(dir->d_vid), ntohl(dir->d_pdid), ntohl(dir->d_did), dir->d_flags & DIRF_ISFILE ? "f" : "d", cfrombstr(dir->d_fullpath)); } fprintf(dump, "\nSecondary DID/name index:\n"); fprintf(dump, " VID DID CNID STAT PATH\n"); fprintf(dump, "====================================================================\n"); hash_scan_begin(&hs, index_didname); i = 1; while ((hn = hash_scan_next(&hs))) { dir = hnode_get(hn); fprintf(dump, "%05u: %3u %6u %6u %s %s\n", i++, ntohs(dir->d_vid), ntohl(dir->d_pdid), ntohl(dir->d_did), dir->d_flags & DIRF_ISFILE ? "f" : "d", cfrombstr(dir->d_fullpath)); } fprintf(dump, "\nLRU Queue:\n"); fprintf(dump, " VID DID CNID STAT PATH\n"); fprintf(dump, "====================================================================\n"); for (i = 1; i <= queue_count; i++) { if (n == index_queue) break; dir = (struct dir *)n->data; fprintf(dump, "%05u: %3u %6u %6u %s %s\n", i, ntohs(dir->d_vid), ntohl(dir->d_pdid), ntohl(dir->d_did), dir->d_flags & DIRF_ISFILE ? "f" : "d", cfrombstr(dir->d_fullpath)); n = n->next; } fprintf(dump, "\n"); fflush(dump); fclose(dump); return; } netatalk-2.2.2/etc/afpd/fce_api_internal.h0000644000175200017500000000241411655731244015374 00000000000000/* * File: fce_api_internal.h * Author: mw * * Created on 1. Oktober 2010, 23:48 */ #ifndef _FCE_API_INTERNAL_H #define _FCE_API_INTERNAL_H #include #define FCE_MAX_UDP_SOCKS 5 /* Allow a maximum of udp listeners for file change events */ #define FCE_SOCKET_RETRY_DELAY_S 600 /* Pause this time in s after socket was broken */ #define FCE_PACKET_VERSION 1 #define FCE_HISTORY_LEN 10 /* This is used to coalesce events */ #define MAX_COALESCE_TIME_MS 1000 /* Events oldeer than this are not coalesced */ #define FCE_COALESCE_CREATE (1 << 0) #define FCE_COALESCE_DELETE (1 << 1) #define FCE_COALESCE_ALL (FCE_COALESCE_CREATE | FCE_COALESCE_DELETE) struct udp_entry { int sock; char *addr; char *port; struct addrinfo addrinfo; struct sockaddr_storage sockaddr; time_t next_try_on_error; /* In case of error set next timestamp to retry */ }; struct fce_history { unsigned char mode; int is_dir; char path[MAXPATHLEN + 1]; struct timeval tv; }; struct fce_close_event { time_t time; char path[MAXPATHLEN + 1]; }; #define PACKET_HDR_LEN (sizeof(struct fce_packet) - FCE_MAX_PATH_LEN) bool fce_handle_coalescation( char *path, int is_dir, int mode ); void fce_initialize_history(); #endif /* _FCE_API_INTERNAL_H */ netatalk-2.2.2/etc/afpd/mangle.h0000644000175200017500000000145011655731126013353 00000000000000/* * $Id: mangle.h,v 1.7 2009-10-13 22:55:37 didg Exp $ * */ #ifndef AFPD_MANGLE_H #define AFPD_MANGLE_H 1 #include #include #include #include #include #include #include #include "volume.h" #include "directory.h" #define MANGLE_CHAR '#' #define MAX_MANGLE_SUFFIX_LENGTH 999 #define MAX_EXT_LENGTH 5 /* XXX This cannot be greater than 27 */ #define MANGLE_LENGTH 9 /* #ffffffff This really can't be changed. */ #define MAX_LENGTH MACFILELEN extern char *mangle (const struct vol *, char *, size_t, char *, cnid_t, int); extern char *demangle (const struct vol *, char *, cnid_t did); extern char *demangle_osx (const struct vol *, char *, cnid_t did, cnid_t *fileid); #endif /* AFPD_MANGLE_H */ netatalk-2.2.2/etc/afpd/uam_auth.h0000644000175200017500000000370111655731126013714 00000000000000/* * $Id: uam_auth.h,v 1.7 2009-10-22 12:35:38 franklahm Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. * * interface between uam.c and auth.c */ #ifndef AFPD_UAM_AUTH_H #define AFPD_UAM_AUTH_H 1 #include #include #include #include struct uam_mod { void *uam_module; struct uam_export *uam_fcn; struct uam_mod *uam_prev, *uam_next; }; struct uam_obj { const char *uam_name; /* authentication method */ char *uam_path; /* where it's located */ int uam_count; union { struct { int (*login) (void *, struct passwd **, char *, int, char *, size_t *); int (*logincont) (void *, struct passwd **, char *, int, char *, size_t *); void (*logout) (void); int (*login_ext) (void *, char *, struct passwd **, char *, int, char *, size_t *); } uam_login; int (*uam_changepw) (void *, char *, struct passwd *, char *, int, char *, size_t *); } u; struct uam_obj *uam_prev, *uam_next; }; #define uam_attach(a, b) do { \ (a)->uam_prev->uam_next = (b); \ (b)->uam_prev = (a)->uam_prev; \ (b)->uam_next = (a); \ (a)->uam_prev = (b); \ } while (0) #define uam_detach(a) do { \ (a)->uam_prev->uam_next = (a)->uam_next; \ (a)->uam_next->uam_prev = (a)->uam_prev; \ } while (0) extern struct uam_mod *uam_load (const char *, const char *); extern void uam_unload (struct uam_mod *); /* auth.c */ int auth_load (const char *, const char *); int auth_register (const int, struct uam_obj *); #define auth_unregister(a) uam_detach(a) struct uam_obj *auth_uamfind (const int, const char *, const int); void auth_unload (void); /* uam.c */ int uam_random_string (AFPObj *,char *, int); #endif /* uam_auth.h */ netatalk-2.2.2/etc/afpd/extattrs.c0000644000175200017500000003534411655731126013772 00000000000000/* $Id: extattrs.c,v 1.29 2010-01-05 12:06:33 franklahm Exp $ Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include "volume.h" #include "desktop.h" #include "directory.h" #include "fork.h" #include "extattrs.h" static const char *ea_finderinfo = "com.apple.FinderInfo"; static const char *ea_resourcefork = "com.apple.ResourceFork"; /* This should be big enough to consecutively store the names of all attributes */ static char attrnamebuf[ATTRNAMEBUFSIZ]; #ifdef DEBUG static void hexdump(void *m, size_t l) { char *p = m; int count = 0, len; char buf[100]; char *bufp = buf; while (l--) { len = sprintf(bufp, "%02x ", *p++); bufp += len; count++; if ((count % 16) == 0) { LOG(log_debug9, logtype_afpd, "%s", buf); bufp = buf; } } } #endif /*************************************** * AFP funcs ****************************************/ /* Note: we're being called twice. Firstly the client only want the size of all EA names, secondly it wants these names. In order to avoid scanning EAs twice we cache them in a static buffer. */ int afp_listextattr(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { int ret, oflag = 0, adflags = 0; uint16_t vid, bitmap, uint16; uint32_t did, maxreply, tmpattr; struct vol *vol; struct dir *dir; struct path *s_path; struct stat *st; struct adouble ad, *adp = NULL; char *uname, *FinderInfo; char emptyFinderInfo[32] = { 0 }; static int buf_valid = 0; static size_t attrbuflen = 0; *rbuflen = 0; ibuf += 2; /* Get Bitmap and MaxReplySize first */ memcpy( &bitmap, ibuf +6, sizeof(bitmap)); bitmap = ntohs( bitmap ); memcpy( &maxreply, ibuf + 14, sizeof (maxreply)); maxreply = ntohl( maxreply ); /* If its the first request with maxreply=0 or if we didn't mark our buffers valid for whatever reason (just a safety check, it should be valid), then scan for attributes */ if ((maxreply == 0) || (buf_valid == 0)) { attrbuflen = 0; memcpy( &vid, ibuf, sizeof(vid)); ibuf += sizeof(vid); if (NULL == ( vol = getvolbyvid( vid )) ) { LOG(log_debug, logtype_afpd, "afp_listextattr: getvolbyvid error: %s", strerror(errno)); return AFPERR_ACCESS; } memcpy( &did, ibuf, sizeof(did)); ibuf += sizeof(did); if (NULL == ( dir = dirlookup( vol, did )) ) { LOG(log_debug, logtype_afpd, "afp_listextattr: dirlookup error: %s", strerror(errno)); return afp_errno; } if (bitmap & kXAttrNoFollow) oflag = O_NOFOLLOW; /* Skip Bitmap, ReqCount, StartIndex and maxreply*/ ibuf += 12; /* get name */ if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) { LOG(log_debug, logtype_afpd, "afp_listextattr: cname error: %s", strerror(errno)); return AFPERR_NOOBJ; } st = &s_path->st; if (!s_path->st_valid) { /* it's a dir in our cache, we didn't stat it, do it now */ of_statdir(vol, s_path); } if ( s_path->st_errno != 0 ) { return( AFPERR_NOOBJ ); } adp = of_ad(vol, s_path, &ad); uname = s_path->u_name; /* We have to check the FinderInfo for the file, because if they aren't all 0 we must return the synthetic attribute "com.apple.FinderInfo". Note: the client will never (never seen in traces) request that attribute via FPGetExtAttr ! */ if (S_ISDIR(st->st_mode)) adflags = ADFLAGS_DIR; if ( ad_metadata( uname, adflags, adp) < 0 ) { switch (errno) { case ENOENT: adp = NULL; break; case EACCES: LOG(log_error, logtype_afpd, "afp_listextattr(%s): %s: check resource fork permission?", uname, strerror(errno)); return AFPERR_ACCESS; default: LOG(log_error, logtype_afpd, "afp_listextattr(%s): error getting metadata: %s", uname, strerror(errno)); return AFPERR_MISC; } } if (adp) { FinderInfo = ad_entry(adp, ADEID_FINDERI); #ifdef DEBUG LOG(log_maxdebug, logtype_afpd, "afp_listextattr(%s): FinderInfo:", uname); hexdump( FinderInfo, 32); #endif if ((adflags & ADFLAGS_DIR)) { /* set default view */ uint16 = htons(FINDERINFO_CLOSEDVIEW); memcpy(emptyFinderInfo + FINDERINFO_FRVIEWOFF, &uint16, 2); } /* Check if FinderInfo equals default and empty FinderInfo*/ if (memcmp(FinderInfo, emptyFinderInfo, 32) != 0) { /* FinderInfo contains some non 0 bytes -> include "com.apple.FinderInfo" */ strcpy(attrnamebuf, ea_finderinfo); attrbuflen += strlen(ea_finderinfo) + 1; LOG(log_debug7, logtype_afpd, "afp_listextattr(%s): sending com.apple.FinderInfo", uname); } /* Now check for Ressource fork and add virtual EA "com.apple.ResourceFork" if size > 0 */ LOG(log_debug7, logtype_afpd, "afp_listextattr(%s): Ressourcefork size: %llu", uname, adp->ad_rlen); if (adp->ad_rlen > 0) { LOG(log_debug7, logtype_afpd, "afp_listextattr(%s): sending com.apple.RessourceFork.", uname); strcpy(attrnamebuf + attrbuflen, ea_resourcefork); attrbuflen += strlen(ea_resourcefork) + 1; } } ret = vol->vfs->vfs_ea_list(vol, attrnamebuf, &attrbuflen, uname, oflag); switch (ret) { case AFPERR_BADTYPE: /* its a symlink and client requested O_NOFOLLOW */ LOG(log_debug, logtype_afpd, "afp_listextattr(%s): encountered symlink with kXAttrNoFollow", uname); attrbuflen = 0; buf_valid = 0; ret = AFP_OK; goto exit; case AFPERR_MISC: attrbuflen = 0; goto exit; default: buf_valid = 1; } } /* Start building reply packet */ bitmap = htons(bitmap); memcpy( rbuf, &bitmap, sizeof(bitmap)); rbuf += sizeof(bitmap); *rbuflen += sizeof(bitmap); tmpattr = htonl(attrbuflen); memcpy( rbuf, &tmpattr, sizeof(tmpattr)); rbuf += sizeof(tmpattr); *rbuflen += sizeof(tmpattr); /* Only copy buffer if the client asked for it (2nd request, maxreply>0) and we didnt have an error (buf_valid) */ if (maxreply && buf_valid) { memcpy( rbuf, attrnamebuf, attrbuflen); *rbuflen += attrbuflen; buf_valid = 0; } ret = AFP_OK; exit: if (ret != AFP_OK) buf_valid = 0; if (adp) ad_close_metadata( adp); return ret; } static char *to_stringz(char *ibuf, uint16_t len) { static char attrmname[256]; if (len > 255) /* dont fool with us */ len = 255; /* we must copy the name as its not 0-terminated and I DONT WANT TO WRITE to ibuf */ strlcpy(attrmname, ibuf, len + 1); return attrmname; } int afp_getextattr(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { int ret, oflag = 0; uint16_t vid, bitmap, attrnamelen; uint32_t did, maxreply; char attruname[256]; struct vol *vol; struct dir *dir; struct path *s_path; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof(vid)); ibuf += sizeof(vid); if (NULL == ( vol = getvolbyvid( vid )) ) { LOG(log_debug, logtype_afpd, "afp_getextattr: getvolbyvid error: %s", strerror(errno)); return AFPERR_ACCESS; } memcpy( &did, ibuf, sizeof(did)); ibuf += sizeof(did); if (NULL == ( dir = dirlookup( vol, did )) ) { LOG(log_debug, logtype_afpd, "afp_getextattr: dirlookup error: %s", strerror(errno)); return afp_errno; } memcpy( &bitmap, ibuf, sizeof(bitmap)); bitmap = ntohs( bitmap ); ibuf += sizeof(bitmap); if (bitmap & kXAttrNoFollow) oflag = O_NOFOLLOW; /* Skip Offset and ReqCount */ ibuf += 16; /* Get MaxReply */ memcpy(&maxreply, ibuf, sizeof(maxreply)); maxreply = ntohl(maxreply); ibuf += sizeof(maxreply); /* get name */ if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) { LOG(log_debug, logtype_afpd, "afp_getextattr: cname error: %s", strerror(errno)); return AFPERR_NOOBJ; } if ((unsigned long)ibuf & 1) ibuf++; /* get length of EA name */ memcpy(&attrnamelen, ibuf, sizeof(attrnamelen)); attrnamelen = ntohs(attrnamelen); ibuf += sizeof(attrnamelen); LOG(log_debug, logtype_afpd, "afp_getextattr(%s): EA: %s", s_path->u_name, to_stringz(ibuf, attrnamelen)); /* Convert EA name in utf8 to unix charset */ if ( 0 >= convert_string(CH_UTF8_MAC, obj->options.unixcharset, ibuf, attrnamelen, attruname, 256) ) return AFPERR_MISC; /* write bitmap now */ bitmap = htons(bitmap); memcpy(rbuf, &bitmap, sizeof(bitmap)); rbuf += sizeof(bitmap); *rbuflen += sizeof(bitmap); /* Switch on maxreply: if its 0 we must return the size of the requested attribute, if its non 0 we must return the attribute. */ if (maxreply == 0) ret = vol->vfs->vfs_ea_getsize(vol, rbuf, rbuflen, s_path->u_name, oflag, attruname); else ret = vol->vfs->vfs_ea_getcontent(vol, rbuf, rbuflen, s_path->u_name, oflag, attruname, maxreply); return ret; } int afp_setextattr(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { int oflag = 0, ret; uint16_t vid, bitmap, attrnamelen; uint32_t did, attrsize; char attruname[256]; char *attrmname; struct vol *vol; struct dir *dir; struct path *s_path; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof(vid)); ibuf += sizeof(vid); if (NULL == ( vol = getvolbyvid( vid )) ) { LOG(log_debug, logtype_afpd, "afp_setextattr: getvolbyvid error: %s", strerror(errno)); return AFPERR_ACCESS; } memcpy( &did, ibuf, sizeof(did)); ibuf += sizeof(did); if (NULL == ( dir = dirlookup( vol, did )) ) { LOG(log_debug, logtype_afpd, "afp_setextattr: dirlookup error: %s", strerror(errno)); return afp_errno; } memcpy( &bitmap, ibuf, sizeof(bitmap)); bitmap = ntohs( bitmap ); ibuf += sizeof(bitmap); if (bitmap & kXAttrNoFollow) oflag |= O_NOFOLLOW; if (bitmap & kXAttrCreate) oflag |= O_CREAT; else if (bitmap & kXAttrReplace) oflag |= O_TRUNC; /* Skip Offset */ ibuf += 8; /* get name */ if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) { LOG(log_debug, logtype_afpd, "afp_setextattr: cname error: %s", strerror(errno)); return AFPERR_NOOBJ; } if ((unsigned long)ibuf & 1) ibuf++; /* get length of EA name */ memcpy(&attrnamelen, ibuf, sizeof(attrnamelen)); attrnamelen = ntohs(attrnamelen); ibuf += sizeof(attrnamelen); if (attrnamelen > 255) return AFPERR_PARAM; attrmname = ibuf; /* Convert EA name in utf8 to unix charset */ if ( 0 >= convert_string(CH_UTF8_MAC, obj->options.unixcharset, attrmname, attrnamelen, attruname, 256)) return AFPERR_MISC; ibuf += attrnamelen; /* get EA size */ memcpy(&attrsize, ibuf, sizeof(attrsize)); attrsize = ntohl(attrsize); ibuf += sizeof(attrsize); if (attrsize > MAX_EA_SIZE) /* we arbitrarily make this fatal */ return AFPERR_PARAM; LOG(log_debug, logtype_afpd, "afp_setextattr(%s): EA: %s, size: %u", s_path->u_name, to_stringz(attrmname, attrnamelen), attrsize); ret = vol->vfs->vfs_ea_set(vol, s_path->u_name, attruname, ibuf, attrsize, oflag); return ret; } int afp_remextattr(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { int oflag = 0, ret; uint16_t vid, bitmap, attrnamelen; uint32_t did; char attruname[256]; struct vol *vol; struct dir *dir; struct path *s_path; *rbuflen = 0; ibuf += 2; memcpy( &vid, ibuf, sizeof(vid)); ibuf += sizeof(vid); if (NULL == ( vol = getvolbyvid( vid )) ) { LOG(log_debug, logtype_afpd, "afp_remextattr: getvolbyvid error: %s", strerror(errno)); return AFPERR_ACCESS; } memcpy( &did, ibuf, sizeof(did)); ibuf += sizeof(did); if (NULL == ( dir = dirlookup( vol, did )) ) { LOG(log_debug, logtype_afpd, "afp_remextattr: dirlookup error: %s", strerror(errno)); return afp_errno; } memcpy( &bitmap, ibuf, sizeof(bitmap)); bitmap = ntohs( bitmap ); ibuf += sizeof(bitmap); if (bitmap & kXAttrNoFollow) oflag |= O_NOFOLLOW; /* get name */ if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) { LOG(log_debug, logtype_afpd, "afp_setextattr: cname error: %s", strerror(errno)); return AFPERR_NOOBJ; } if ((unsigned long)ibuf & 1) ibuf++; /* get length of EA name */ memcpy(&attrnamelen, ibuf, sizeof(attrnamelen)); attrnamelen = ntohs(attrnamelen); ibuf += sizeof(attrnamelen); if (attrnamelen > 255) return AFPERR_PARAM; /* Convert EA name in utf8 to unix charset */ if ( 0 >= (convert_string(CH_UTF8_MAC, obj->options.unixcharset,ibuf, attrnamelen, attruname, 256)) ) return AFPERR_MISC; LOG(log_debug, logtype_afpd, "afp_remextattr(%s): EA: %s", s_path->u_name, to_stringz(ibuf, attrnamelen)); ret = vol->vfs->vfs_ea_remove(vol, s_path->u_name, attruname, oflag); return ret; } netatalk-2.2.2/etc/afpd/uam.c0000644000175200017500000003702611655731244012676 00000000000000/* * $Id: uam.c,v 1.35 2009-11-08 01:15:31 didg Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include /* STDC check */ #if STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #include #include #include #include #include #ifdef HAVE_DLFCN_H #include #endif /* HAVE_DLFCN_H */ #include #include #include #include #include #include #include #include #include "afp_config.h" #include "auth.h" #include "uam_auth.h" #define utf8_encoding() (afp_version >= 30) #ifdef TRU64 #include #include #include #include #endif /* TRU64 */ /* --- server uam functions -- */ /* uam_load. uams must have a uam_setup function. */ struct uam_mod *uam_load(const char *path, const char *name) { char buf[MAXPATHLEN + 1], *p; struct uam_mod *mod; void *module; if ((module = mod_open(path)) == NULL) { LOG(log_error, logtype_afpd, "uam_load(%s): failed to load: %s", name, mod_error()); return NULL; } if ((mod = (struct uam_mod *) malloc(sizeof(struct uam_mod))) == NULL) { LOG(log_error, logtype_afpd, "uam_load(%s): malloc failed", name); goto uam_load_fail; } strlcpy(buf, name, sizeof(buf)); if ((p = strchr(buf, '.'))) *p = '\0'; if ((mod->uam_fcn = mod_symbol(module, buf)) == NULL) { LOG(log_error, logtype_afpd, "uam_load(%s): mod_symbol error for symbol %s", name, buf); goto uam_load_err; } if (mod->uam_fcn->uam_type != UAM_MODULE_SERVER) { LOG(log_error, logtype_afpd, "uam_load(%s): attempted to load a non-server module", name); goto uam_load_err; } /* version check would go here */ if (!mod->uam_fcn->uam_setup || ((*mod->uam_fcn->uam_setup)(name) < 0)) { LOG(log_error, logtype_afpd, "uam_load(%s): uam_setup failed", name); goto uam_load_err; } mod->uam_module = module; return mod; uam_load_err: free(mod); uam_load_fail: mod_close(module); return NULL; } /* unload the module. we check for a cleanup function, but we don't * die if one doesn't exist. however, things are likely to leak without one. */ void uam_unload(struct uam_mod *mod) { if (mod->uam_fcn->uam_cleanup) (*mod->uam_fcn->uam_cleanup)(); mod_close(mod->uam_module); free(mod); } /* -- client-side uam functions -- */ /* set up stuff for this uam. */ int uam_register(const int type, const char *path, const char *name, ...) { va_list ap; struct uam_obj *uam; int ret; if (!name) return -1; /* see if it already exists. */ if ((uam = auth_uamfind(type, name, strlen(name)))) { if (strcmp(uam->uam_path, path)) { /* it exists, but it's not the same module. */ LOG(log_error, logtype_afpd, "uam_register: \"%s\" already loaded by %s", name, path); return -1; } uam->uam_count++; return 0; } /* allocate space for uam */ if ((uam = calloc(1, sizeof(struct uam_obj))) == NULL) return -1; uam->uam_name = name; uam->uam_path = strdup(path); uam->uam_count++; va_start(ap, name); switch (type) { case UAM_SERVER_LOGIN_EXT: /* expect four arguments */ uam->u.uam_login.login = va_arg(ap, void *); uam->u.uam_login.logincont = va_arg(ap, void *); uam->u.uam_login.logout = va_arg(ap, void *); uam->u.uam_login.login_ext = va_arg(ap, void *); break; case UAM_SERVER_LOGIN: /* expect three arguments */ uam->u.uam_login.login_ext = NULL; uam->u.uam_login.login = va_arg(ap, void *); uam->u.uam_login.logincont = va_arg(ap, void *); uam->u.uam_login.logout = va_arg(ap, void *); break; case UAM_SERVER_CHANGEPW: /* one argument */ uam->u.uam_changepw = va_arg(ap, void *); break; case UAM_SERVER_PRINTAUTH: /* x arguments */ default: break; } va_end(ap); /* attach to other uams */ ret = auth_register(type, uam); if ( ret) { free(uam->uam_path); free(uam); } return ret; } void uam_unregister(const int type, const char *name) { struct uam_obj *uam; if (!name) return; uam = auth_uamfind(type, name, strlen(name)); if (!uam || --uam->uam_count > 0) return; auth_unregister(uam); free(uam->uam_path); free(uam); } /* --- helper functions for plugin uams --- * name: user name * len: size of name buffer. */ struct passwd *uam_getname(void *private, char *name, const int len) { AFPObj *obj = private; struct passwd *pwent; static char username[256]; static char user[256]; static char pwname[256]; char *p; size_t namelen, gecoslen = 0, pwnamelen = 0; if ((pwent = getpwnam(name))) return pwent; /* if we have a NT domain name try with it */ if (obj->options.ntdomain && obj->options.ntseparator) { /* FIXME What about charset ? */ size_t ulen = strlen(obj->options.ntdomain) + strlen(obj->options.ntseparator) + strlen(name); if ((p = malloc(ulen +1))) { strcpy(p, obj->options.ntdomain); strcat(p, obj->options.ntseparator); strcat(p, name); pwent = getpwnam(p); free(p); if (pwent) { int len = strlen(pwent->pw_name); if (len < MAXUSERLEN) { strncpy(name,pwent->pw_name, MAXUSERLEN); }else{ LOG(log_error, logtype_uams, "MAJOR:The name %s is longer than %d",pwent->pw_name,MAXUSERLEN); } return pwent; } } } #ifndef NO_REAL_USER_NAME if ( (size_t) -1 == (namelen = convert_string((utf8_encoding())?CH_UTF8_MAC:obj->options.maccharset, CH_UCS2, name, -1, username, sizeof(username)))) return NULL; setpwent(); while ((pwent = getpwent())) { if ((p = strchr(pwent->pw_gecos, ','))) *p = '\0'; gecoslen = convert_string(obj->options.unixcharset, CH_UCS2, pwent->pw_gecos, -1, user, sizeof(username)); pwnamelen = convert_string(obj->options.unixcharset, CH_UCS2, pwent->pw_name, -1, pwname, sizeof(username)); if ((size_t)-1 == gecoslen && (size_t)-1 == pwnamelen) continue; /* check against both the gecos and the name fields. the user * might have just used a different capitalization. */ if ( (namelen == gecoslen && strncasecmp_w((ucs2_t*)user, (ucs2_t*)username, len) == 0) || ( namelen == pwnamelen && strncasecmp_w ( (ucs2_t*) pwname, (ucs2_t*) username, len) == 0)) { strlcpy(name, pwent->pw_name, len); break; } } endpwent(); #endif /* ! NO_REAL_USER_NAME */ /* os x server doesn't keep anything useful if we do getpwent */ return pwent ? getpwnam(name) : NULL; } int uam_checkuser(const struct passwd *pwd) { const char *p; if (!pwd) return -1; #ifndef DISABLE_SHELLCHECK if (!pwd->pw_shell || (*pwd->pw_shell == '\0')) { LOG(log_info, logtype_afpd, "uam_checkuser: User %s does not have a shell", pwd->pw_name); return -1; } while ((p = getusershell())) { if ( strcmp( p, pwd->pw_shell ) == 0 ) break; } endusershell(); if (!p) { LOG(log_info, logtype_afpd, "illegal shell %s for %s", pwd->pw_shell, pwd->pw_name); return -1; } #endif /* DISABLE_SHELLCHECK */ return 0; } int uam_random_string (AFPObj *obj, char *buf, int len) { u_int32_t result; int ret; int fd; if ( (len <= 0) || (len % sizeof(result))) return -1; /* construct a random number */ if ((fd = open("/dev/urandom", O_RDONLY)) < 0) { struct timeval tv; struct timezone tz; int i; if (gettimeofday(&tv, &tz) < 0) return -1; srandom(tv.tv_sec + (unsigned long) obj + (unsigned long) obj->handle); for (i = 0; i < len; i += sizeof(result)) { result = random(); memcpy(buf + i, &result, sizeof(result)); } } else { ret = read(fd, buf, len); close(fd); if (ret <= 0) return -1; } return 0; } /* afp-specific functions */ int uam_afpserver_option(void *private, const int what, void *option, size_t *len) { AFPObj *obj = private; const char **buf = (const char **) option; /* most of the options are this */ struct session_info **sinfo = (struct session_info **) option; if (!obj || !option) return -1; switch (what) { case UAM_OPTION_USERNAME: *buf = obj->username; if (len) *len = sizeof(obj->username) - 1; break; case UAM_OPTION_GUEST: *buf = obj->options.guest; if (len) *len = strlen(obj->options.guest); break; case UAM_OPTION_PASSWDOPT: if (!len) return -1; switch (*len) { case UAM_PASSWD_FILENAME: *buf = obj->options.passwdfile; *len = strlen(obj->options.passwdfile); break; case UAM_PASSWD_MINLENGTH: *((int *) option) = obj->options.passwdminlen; *len = sizeof(obj->options.passwdminlen); break; case UAM_PASSWD_MAXFAIL: *((int *) option) = obj->options.loginmaxfail; *len = sizeof(obj->options.loginmaxfail); break; case UAM_PASSWD_EXPIRETIME: /* not implemented */ default: return -1; break; } break; case UAM_OPTION_SIGNATURE: *buf = (void *) (((AFPConfig *)obj->config)->signature); if (len) *len = 16; break; case UAM_OPTION_RANDNUM: /* returns a random number in 4-byte units. */ if (!len) return -1; return uam_random_string(obj, option, *len); break; case UAM_OPTION_HOSTNAME: *buf = obj->options.hostname; if (len) *len = strlen(obj->options.hostname); break; case UAM_OPTION_PROTOCOL: *((int *) option) = obj->proto; break; case UAM_OPTION_CLIENTNAME: { struct DSI *dsi = obj->handle; const struct sockaddr *sa; static char hbuf[NI_MAXHOST]; sa = (struct sockaddr *)&dsi->client; if (getnameinfo(sa, sizeof(dsi->client), hbuf, sizeof(hbuf), NULL, 0, 0) == 0) *buf = hbuf; else *buf = getip_string((struct sockaddr *)&dsi->client); break; } case UAM_OPTION_COOKIE: /* it's up to the uam to actually store something useful here. * this just passes back a handle to the cookie. the uam side * needs to do something like **buf = (void *) cookie to store * the cookie. */ *buf = (void *) &obj->uam_cookie; break; case UAM_OPTION_KRB5SERVICE: *buf = obj->options.k5service; if (len) *len = (*buf)?strlen(*buf):0; break; case UAM_OPTION_KRB5REALM: *buf = obj->options.k5realm; if (len) *len = (*buf)?strlen(*buf):0; break; case UAM_OPTION_FQDN: *buf = obj->options.fqdn; if (len) *len = (*buf)?strlen(*buf):0; break; case UAM_OPTION_MACCHARSET: *((int *) option) = obj->options.maccharset; *len = sizeof(obj->options.maccharset); break; case UAM_OPTION_UNIXCHARSET: *((int *) option) = obj->options.unixcharset; *len = sizeof(obj->options.unixcharset); break; case UAM_OPTION_SESSIONINFO: *sinfo = &(obj->sinfo); break; default: return -1; break; } return 0; } /* if we need to maintain a connection, this is how we do it. * because an action pointer gets passed in, we can stream * DSI connections */ int uam_afp_read(void *handle, char *buf, size_t *buflen, int (*action)(void *, void *, const int)) { AFPObj *obj = handle; int len; if (!obj) return AFPERR_PARAM; switch (obj->proto) { #ifndef NO_DDP case AFPPROTO_ASP: if ((len = asp_wrtcont(obj->handle, buf, buflen )) < 0) goto uam_afp_read_err; return action(handle, buf, *buflen); break; #endif case AFPPROTO_DSI: len = dsi_writeinit(obj->handle, buf, *buflen); if (!len || ((len = action(handle, buf, len)) < 0)) { dsi_writeflush(obj->handle); goto uam_afp_read_err; } while ((len = (dsi_write(obj->handle, buf, *buflen)))) { if ((len = action(handle, buf, len)) < 0) { dsi_writeflush(obj->handle); goto uam_afp_read_err; } } break; default: return -1; } return 0; uam_afp_read_err: *buflen = 0; return len; } #ifdef TRU64 void uam_afp_getcmdline( int *ac, char ***av ) { afp_get_cmdline( ac, av ); } int uam_sia_validate_user(sia_collect_func_t * collect, int argc, char **argv, char *hostname, char *username, char *tty, int colinput, char *gssapi, char *passphrase) /* A clone of the Tru64 system function sia_validate_user() that calls * sia_ses_authent() rather than sia_ses_reauthent() * Added extra code to take into account suspected SIA bug whereby it clobbers * the signal handler on SIGALRM (tickle) installed by Netatalk/afpd */ { SIAENTITY *entity = NULL; struct sigaction act; int rc; if ((rc=sia_ses_init(&entity, argc, argv, hostname, username, tty, colinput, gssapi)) != SIASUCCESS) { LOG(log_error, logtype_afpd, "cannot initialise SIA"); return SIAFAIL; } /* save old action for restoration later */ if (sigaction(SIGALRM, NULL, &act)) LOG(log_error, logtype_afpd, "cannot save SIGALRM handler"); if ((rc=sia_ses_authent(collect, passphrase, entity)) != SIASUCCESS) { /* restore old action after clobbering by sia_ses_authent() */ if (sigaction(SIGALRM, &act, NULL)) LOG(log_error, logtype_afpd, "cannot restore SIGALRM handler"); LOG(log_info, logtype_afpd, "unsuccessful login for %s", (hostname?hostname:"(null)")); return SIAFAIL; } LOG(log_info, logtype_afpd, "successful login for %s", (hostname?hostname:"(null)")); /* restore old action after clobbering by sia_ses_authent() */ if (sigaction(SIGALRM, &act, NULL)) LOG(log_error, logtype_afpd, "cannot restore SIGALRM handler"); sia_ses_release(&entity); return SIASUCCESS; } #endif /* TRU64 */ /* --- papd-specific functions (just placeholders) --- */ struct papfile; UAM_MODULE_EXPORT void append(struct papfile *pf _U_, const char *data _U_, int len _U_) { return; } netatalk-2.2.2/etc/afpd/switch.h0000644000175200017500000000233011655731126013407 00000000000000/* * $Id: switch.h,v 1.4 2009-10-15 10:43:13 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #ifndef AFPD_SWITCH_H #define AFPD_SWITCH_H 1 extern AFPCmd *afp_switch; extern AFPCmd postauth_switch[]; /* switch.c */ #define UAM_AFPSERVER_PREAUTH (0) #define UAM_AFPSERVER_POSTAUTH (1 << 0) extern int uam_afpserver_action (const int /*id*/, const int /*switch*/, AFPCmd new_table, AFPCmd *old); #endif netatalk-2.2.2/etc/afpd/icon.h0000644000175200017500000003023311655731126013041 00000000000000/* * $Id: icon.h,v 1.5 2009-10-16 00:11:42 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifndef AFPD_ICON_H #define AFPD_ICON_H 1 #include #include static const unsigned char apple_atalk_icon[] = { /* default appletalk icon */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x9F, 0xE0, 0x00, 0x04, 0x50, 0x30, 0x00, 0x08, 0x30, 0x28, 0x00, 0x10, 0x10, 0x3C, 0x07, 0xA0, 0x08, 0x04, 0x18, 0x7F, 0x04, 0x04, 0x10, 0x00, 0x82, 0x04, 0x10, 0x00, 0x81, 0x04, 0x10, 0x00, 0x82, 0x04, 0x10, 0x00, 0x84, 0x04, 0x10, 0x00, 0x88, 0x04, 0x10, 0x00, 0x90, 0x04, 0x10, 0x00, 0xB0, 0x04, 0x10, 0x00, 0xD0, 0x04, 0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x00, 0x00, 0x02, 0x3F, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0F, 0x80, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x0F, 0x80, 0x00, 0x00, 0x0A, 0x80, 0xBF, 0xFF, 0xF2, 0x74, 0x00, 0x00, 0x05, 0x00, 0xBF, 0xFF, 0xF8, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x9F, 0xE0, 0x00, 0x07, 0xDF, 0xF0, 0x00, 0x0F, 0xFF, 0xF8, 0x00, 0x1F, 0xFF, 0xFC, 0x07, 0xBF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFE, 0x3F, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0F, 0x80, 0x00, 0x00, 0x0F, 0x80, 0x00, 0x00, 0x0F, 0x80, 0x00, 0x00, 0x0F, 0x80, 0x00, 0x00, 0x0F, 0x80, 0xBF, 0xFF, 0xFF, 0xF4, 0xBF, 0xFF, 0xFD, 0xF4, 0xBF, 0xFF, 0xF8, 0xF4 }; static const unsigned char apple_tcp_icon[] = { /* default asip icon */ 0x30, 0x00, 0x8f, 0xf8, 0xcc, 0x01, 0x48, 0x0c, 0xb3, 0x32, 0x28, 0x0a, 0x8c, 0xcc, 0x7c, 0x0f, 0x83, 0x02, 0xff, 0x01, 0x80, 0xc3, 0xc3, 0x81, 0x80, 0x33, 0xe3, 0xc1, 0x80, 0x0b, 0xd3, 0xc1, 0x80, 0x0b, 0xb1, 0x61, 0x80, 0x0b, 0xe0, 0xe1, 0x80, 0x0b, 0xe1, 0xe1, 0x80, 0x0b, 0xd1, 0xe1, 0xc0, 0x0a, 0xc0, 0xe1, 0x70, 0x0b, 0x78, 0xc1, 0x1c, 0x0b, 0x79, 0xc1, 0x17, 0x0b, 0x33, 0xff, 0x21, 0xcb, 0xff, 0xc4, 0x40, 0x7f, 0xff, 0x02, 0x80, 0x1e, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0x00, 0x02, 0x80, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x05, 0x40, 0x00, 0x0f, 0xf9, 0x3f, 0xfc, 0x00, 0x02, 0x80, 0x00, 0x0f, 0xfc, 0x7f, 0xfc, 0x30, 0x00, 0x8f, 0xf8, 0xfc, 0x01, 0xcf, 0xfc, 0xff, 0x33, 0xef, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x03, 0x80, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x07, 0xc0, 0x00, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0xff, 0xfc, 0x7f, 0xff }; #if defined( ultrix ) static const unsigned char icon[] = { /* declogo */ 0x0, 0x80, 0x0, 0x0, 0x1, 0xC0, 0x0, 0x0, 0x3, 0xE0, 0x0, 0x0, 0x7, 0xF0, 0x0, 0x0, 0xF, 0xB0, 0x0, 0x0, 0x13, 0x6C, 0x0, 0x0, 0x2C, 0xDE, 0x0, 0x0, 0x6D, 0xBB, 0x0, 0x0, 0xF3, 0x7F, 0x80, 0x0, 0x7E, 0xEF, 0x40, 0x0, 0x3D, 0xDE, 0xE0, 0x0, 0x1B, 0xBD, 0xF0, 0x0, 0x7, 0x7B, 0xF8, 0x0, 0x7, 0xF7, 0xF8, 0x0, 0x3, 0xEC, 0xF6, 0x0, 0x1, 0xDB, 0x6F, 0x0, 0x0, 0xBB, 0x5D, 0x80, 0x0, 0x6C, 0xBF, 0xC0, 0x0, 0x2D, 0x77, 0xA0, 0x0, 0x12, 0xEF, 0x70, 0x0, 0xD, 0xDE, 0xF8, 0x7F, 0xFF, 0xFF, 0xFE, 0x20, 0x0, 0x0, 0x4, 0x1F, 0xFF, 0xFF, 0xF8, 0x0, 0x4, 0x40, 0x0, 0x0, 0x4, 0x40, 0x0, 0x0, 0x3, 0x80, 0x0, 0x0, 0x4, 0x40, 0x0, 0xAF, 0xF9, 0x3F, 0xF5, 0x0, 0x2, 0x80, 0x0, 0xAF, 0xFC, 0x7F, 0xF5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0, 0x1, 0xC0, 0x0, 0x0, 0x3, 0xE0, 0x0, 0x0, 0x7, 0xF0, 0x0, 0x0, 0xF, 0xF8, 0x0, 0x0, 0x1F, 0xFC, 0x0, 0x0, 0x3F, 0xFE, 0x0, 0x0, 0x7F, 0xFF, 0x0, 0x0, 0xFF, 0xFF, 0x80, 0x0, 0x7F, 0xFF, 0xC0, 0x0, 0x3F, 0xFF, 0xE0, 0x0, 0x1F, 0xFF, 0xF0, 0x0, 0xF, 0xFF, 0xF8, 0x0, 0x7, 0xFF, 0xFC, 0x0, 0x3, 0xFF, 0xFE, 0x0, 0x1, 0xFF, 0xFF, 0x0, 0x0, 0xFF, 0xFF, 0x80, 0x0, 0x7F, 0xFF, 0xC0, 0x0, 0x3F, 0xFF, 0xE0, 0x0, 0x1F, 0xFF, 0xF0, 0x0, 0xF, 0xFF, 0xF8, 0x7F, 0xFF, 0xFF, 0xFE, 0x3F, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xF8, 0x0, 0x7, 0xC0, 0x0, 0x0, 0x7, 0xC0, 0x0, 0x0, 0x3, 0x80, 0x0, 0x0, 0x7, 0xC0, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFC, 0x7F, 0xFF, 0x0, 0x0, 0x0, 0x0 }; #else #if defined( vax ) static const unsigned char icon[] = { /* daemon */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x2, 0x0, 0x1, 0x80, 0x3, 0x0, 0x2, 0x80, 0x2, 0x80, 0x2, 0x80, 0x2, 0x80, 0x4, 0x80, 0x2, 0x40, 0x4, 0x87, 0xC2, 0x40, 0x4, 0x58, 0x34, 0x40, 0x4, 0x20, 0x8, 0x40, 0x2, 0x16, 0xD0, 0x80, 0x1, 0x1, 0x1, 0x0, 0x2, 0x80, 0x2, 0x80, 0x2, 0x9C, 0x72, 0x80, 0x4, 0x22, 0x88, 0x40, 0x4, 0x41, 0x4, 0x40, 0x4, 0x41, 0x4, 0x40, 0x4, 0x41, 0x4, 0x40, 0x4, 0x49, 0x24, 0x40, 0xE, 0x55, 0x54, 0xE0, 0x10, 0x5D, 0x74, 0x10, 0x10, 0x3E, 0xF8, 0x10, 0x7F, 0xFC, 0x7F, 0xFE, 0x20, 0x4, 0x40, 0x4, 0x1F, 0xFC, 0x7F, 0xF8, 0x0, 0x7, 0xC0, 0x0, 0x0, 0x4, 0x40, 0x0, 0x0, 0x3, 0x80, 0x0, 0x0, 0x4, 0x40, 0x0, 0xAF, 0xF9, 0x3F, 0xF5, 0x0, 0x2, 0x80, 0x0, 0xAF, 0xFC, 0x7F, 0xF5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x2, 0x0, 0x1, 0x80, 0x3, 0x0, 0x3, 0x80, 0x3, 0x80, 0x3, 0x80, 0x3, 0x80, 0x7, 0x80, 0x3, 0xC0, 0x7, 0x87, 0xC3, 0xC0, 0x7, 0xDF, 0xF7, 0xC0, 0x7, 0xFF, 0xFF, 0xC0, 0x3, 0xFF, 0xFF, 0x80, 0x1, 0xFF, 0xFF, 0x0, 0x3, 0xFF, 0xFF, 0x80, 0x3, 0xFF, 0xFF, 0x80, 0x7, 0xFF, 0xFF, 0xC0, 0x7, 0xFF, 0xFF, 0xC0, 0x7, 0xFF, 0xFF, 0xC0, 0x7, 0xFF, 0xFF, 0xC0, 0x7, 0xFF, 0xFF, 0xC0, 0xF, 0xFF, 0xFF, 0xE0, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x7F, 0xFF, 0xFF, 0xFE, 0x3F, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xF8, 0x0, 0x7, 0xC0, 0x0, 0x0, 0x7, 0xC0, 0x0, 0x0, 0x3, 0x80, 0x0, 0x0, 0x4, 0x40, 0x0, 0xAF, 0xF9, 0x3F, 0xF5, 0x0, 0x2, 0x80, 0x0, 0xAF, 0xFC, 0x7F, 0xF5, 0x0, 0x0, 0x0, 0x0 }; #else #if defined( sun ) static const unsigned char icon[] = { /* sunlogo */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x80, 0x0, 0x0, 0x2, 0x40, 0x0, 0x0, 0x2, 0x20, 0x0, 0x0, 0x9, 0x10, 0x0, 0x0, 0x4, 0x88, 0x0, 0x0, 0x22, 0x44, 0x0, 0x0, 0x11, 0x20, 0x0, 0x0, 0x88, 0x91, 0x0, 0x1, 0x4, 0x42, 0x0, 0x2, 0x22, 0x44, 0x40, 0x4, 0x41, 0x88, 0x80, 0x8, 0x98, 0x11, 0x30, 0x11, 0x24, 0x22, 0x48, 0x12, 0x44, 0x24, 0x88, 0xC, 0x88, 0x19, 0x10, 0x1, 0x11, 0x82, 0x20, 0x2, 0x22, 0x44, 0x40, 0x0, 0x42, 0x20, 0x80, 0x0, 0x89, 0x11, 0x0, 0x0, 0x4, 0x88, 0x0, 0x7F, 0xFF, 0xFF, 0xFE, 0x20, 0x0, 0x0, 0x4, 0x1F, 0xFF, 0xFF, 0xF8, 0x0, 0x4, 0x40, 0x0, 0x0, 0x4, 0x40, 0x0, 0x0, 0x3, 0x80, 0x0, 0x0, 0x4, 0x40, 0x0, 0xAF, 0xF9, 0x3F, 0xF5, 0x0, 0x2, 0x80, 0x0, 0xAF, 0xFC, 0x7F, 0xF5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x80, 0x0, 0x0, 0x3, 0xC0, 0x0, 0x0, 0x7, 0xE0, 0x0, 0x0, 0xF, 0xF0, 0x0, 0x0, 0x1F, 0xF8, 0x0, 0x0, 0x3F, 0xFC, 0x0, 0x0, 0x7F, 0xFE, 0x0, 0x0, 0xFF, 0xFF, 0x0, 0x1, 0xFF, 0xFF, 0x80, 0x3, 0xFF, 0xFF, 0xC0, 0x7, 0xFF, 0xFF, 0xE0, 0xF, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF8, 0x3F, 0xFF, 0xFF, 0xFC, 0x3F, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xF8, 0xF, 0xFF, 0xFF, 0xF0, 0x7, 0xFF, 0xFF, 0xE0, 0x3, 0xFF, 0xFF, 0xC0, 0x1, 0xFF, 0xFF, 0x80, 0x0, 0xFF, 0xFF, 0x0, 0x7F, 0xFF, 0xFF, 0xFE, 0x3F, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xF8, 0x0, 0x7, 0xC0, 0x0, 0x0, 0x7, 0xC0, 0x0, 0x0, 0x3, 0x80, 0x0, 0x0, 0x7, 0xC0, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x7F, 0xFF, 0x0, 0x0, 0x0, 0x0 }; #else #if defined( _IBMR2 ) static const unsigned char icon[] = { /* hagar */ 0x0, 0x0, 0x0, 0x0, 0x18, 0x0, 0x0, 0x18, 0x24, 0x0, 0x0, 0x24, 0x44, 0x3, 0xC0, 0x22, 0x44, 0xC, 0x30, 0x22, 0x42, 0x30, 0xC, 0x42, 0x41, 0x40, 0x2, 0x82, 0x41, 0x80, 0x1, 0x82, 0x21, 0x0, 0x0, 0x84, 0x11, 0x41, 0x2, 0x88, 0xE, 0xA2, 0x85, 0x70, 0x4, 0x41, 0x2, 0x20, 0x4, 0x0, 0x0, 0x20, 0x3, 0xFF, 0xFF, 0xC0, 0x3, 0xC0, 0x3, 0xC0, 0x3, 0x82, 0x41, 0xC0, 0x7, 0x81, 0x81, 0xE0, 0x7, 0xC2, 0x43, 0xE0, 0x7, 0xFC, 0x3F, 0xE0, 0x7, 0xFC, 0x3F, 0xE0, 0x7F, 0xFC, 0x3F, 0xFE, 0x20, 0x3, 0xC0, 0x4, 0x1F, 0xFF, 0xFF, 0xF8, 0x0, 0x2, 0x40, 0x0, 0x0, 0x2, 0x40, 0x0, 0x0, 0x3, 0xC0, 0x0, 0x0, 0x4, 0x20, 0x0, 0xAF, 0xF9, 0x9F, 0xF5, 0x0, 0x2, 0x40, 0x0, 0xAF, 0xFC, 0x3F, 0xF5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18, 0x0, 0x0, 0x18, 0x3C, 0x0, 0x0, 0x3C, 0x7C, 0x3, 0xC0, 0x3E, 0x7C, 0xF, 0xF0, 0x3E, 0x7E, 0x3F, 0xFC, 0x7E, 0x7F, 0x7F, 0xFE, 0xFE, 0x7F, 0xFF, 0xFF, 0xFE, 0x3F, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xF8, 0xF, 0xFF, 0xFF, 0xF0, 0x7, 0xFF, 0xFF, 0xE0, 0x7, 0xFF, 0xFF, 0xE0, 0x3, 0xFF, 0xFF, 0xC0, 0x3, 0xFF, 0xFF, 0xC0, 0x3, 0xFF, 0xFF, 0xC0, 0x7, 0xFF, 0xFF, 0xE0, 0x7, 0xFF, 0xFF, 0xE0, 0x7, 0xFF, 0xFF, 0xE0, 0x7, 0xFF, 0xFF, 0xE0, 0x7F, 0xFF, 0xFF, 0xFE, 0x3F, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xF8, 0x0, 0x3, 0xC0, 0x0, 0x0, 0x3, 0xC0, 0x0, 0x0, 0x3, 0xC0, 0x0, 0x0, 0x7, 0xE0, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x7F, 0xFF, 0xFF, 0xFC, 0x3F, 0xFF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; #else static const unsigned char icon[] = { /* globe */ 0x0, 0x0, 0x0, 0x0, 0x0, 0xF, 0xF0, 0x0, 0x0, 0x30, 0xC, 0x0, 0x0, 0xC0, 0x3, 0x0, 0x1, 0x80, 0x3, 0x80, 0x3, 0xE2, 0x1F, 0xC0, 0x7, 0xC0, 0x1D, 0xE0, 0xF, 0x80, 0x87, 0xF0, 0xF, 0x1, 0x8F, 0xF0, 0xE, 0x0, 0x7F, 0x30, 0x1E, 0x0, 0xFD, 0x78, 0x12, 0x0, 0xE4, 0xF8, 0x10, 0x0, 0x40, 0xF8, 0x10, 0x0, 0x3E, 0x78, 0x1F, 0x0, 0x7F, 0xF8, 0x1F, 0x80, 0x7F, 0xF8, 0xF, 0x80, 0x3F, 0x30, 0xF, 0x80, 0xF, 0x30, 0xF, 0x80, 0xE, 0x90, 0x7, 0x80, 0xE, 0xA0, 0x3, 0xC0, 0xE, 0x40, 0x7F, 0xFF, 0xFF, 0xFE, 0x20, 0x0, 0x0, 0x4, 0x1F, 0xFF, 0xFF, 0xF8, 0x0, 0x4, 0x40, 0x0, 0x0, 0x4, 0x40, 0x0, 0x0, 0x3, 0x80, 0x0, 0x0, 0x4, 0x40, 0x0, 0xAF, 0xF9, 0x3F, 0xF5, 0x0, 0x2, 0x80, 0x0, 0xAF, 0xFC, 0x7F, 0xF5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xF, 0xF0, 0x0, 0x0, 0x3F, 0xFC, 0x0, 0x0, 0xFF, 0xFF, 0x0, 0x1, 0xFF, 0xFF, 0x80, 0x3, 0xFF, 0xFF, 0xC0, 0x7, 0xFF, 0xFF, 0xE0, 0xF, 0xFF, 0xFF, 0xF0, 0xF, 0xFF, 0xFF, 0xF0, 0xF, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF8, 0x1F, 0xFF, 0xFF, 0xF8, 0x1F, 0xFF, 0xFF, 0xF8, 0x1F, 0xFF, 0xFF, 0xF8, 0x1F, 0xFF, 0xFF, 0xF8, 0x1F, 0xFF, 0xFF, 0xF8, 0xF, 0xFF, 0xFF, 0xF0, 0xF, 0xFF, 0xFF, 0xF0, 0xF, 0xFF, 0xFF, 0xF0, 0x7, 0xFF, 0xFF, 0xE0, 0x3, 0xFF, 0xFF, 0xC0, 0x7F, 0xFF, 0xFF, 0xFE, 0x3F, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xF8, 0x0, 0x7, 0xC0, 0x0, 0x0, 0x7, 0xC0, 0x0, 0x0, 0x3, 0x80, 0x0, 0x0, 0x7, 0xC0, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFC, 0x7F, 0xFF, 0x0, 0x0, 0x0, 0x0 }; #endif /*_IBMR2*/ #endif /*sun*/ #endif /*vax*/ #endif /*ultrix*/ #endif netatalk-2.2.2/etc/afpd/enumerate.c0000644000175200017500000003246411655731126014101 00000000000000/* * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "desktop.h" #include "directory.h" #include "dircache.h" #include "volume.h" #include "file.h" #include "fork.h" #include "filedir.h" #define min(a,b) ((a)<(b)?(a):(b)) /* * Struct to save directory reading context in. Used to prevent * O(n^2) searches on a directory. */ struct savedir { u_short sd_vid; u_int32_t sd_did; int sd_buflen; char *sd_buf; char *sd_last; unsigned int sd_sindex; }; #define SDBUFBRK 2048 static int enumerate_loop(struct dirent *de, char *mname _U_, void *data) { struct savedir *sd = data; char *start, *end; int len,lenm; end = sd->sd_buf + sd->sd_buflen; len = strlen(de->d_name); *(sd->sd_last)++ = len; lenm = 0; /* strlen(mname);*/ if ( sd->sd_last + len +lenm + 4 > end ) { char *buf; start = sd->sd_buf; if (!(buf = realloc( sd->sd_buf, sd->sd_buflen +SDBUFBRK )) ) { LOG(log_error, logtype_afpd, "afp_enumerate: realloc: %s", strerror(errno) ); errno = ENOMEM; return -1; } sd->sd_buf = buf; sd->sd_buflen += SDBUFBRK; sd->sd_last = ( sd->sd_last - start ) + sd->sd_buf; end = sd->sd_buf + sd->sd_buflen; } memcpy( sd->sd_last, de->d_name, len + 1 ); sd->sd_last += len + 1; #if 0 *(sd->sd_last)++ = lenm; memcpy( sd->sd_last, mname, lenm + 1 ); sd->sd_last += lenm + 1; #endif return 0; } /* ----------------------------- * FIXME: * Doesn't work with dangling symlink * ie: * - Move a folder with a dangling symlink in the trash * - empty the trash * afp_enumerate return an empty listing but offspring count != 0 in afp_getdirparams * and the Mac doesn't try to call afp_delete! * * Another option for symlink * cf: * http://sourceforge.net/tracker/index.php?func=detail&aid=461938&group_id=8642&atid=108642 * */ char *check_dirent(const struct vol *vol, char *name) { if (!strcmp(name, "..") || !strcmp(name, ".")) return NULL; if (!vol->vfs->vfs_validupath(vol, name)) return NULL; /* check for vetoed filenames */ if (veto_file(vol->v_veto, name)) return NULL; #if 0 char *m_name = NULL; if (NULL == (m_name = utompath(vol, name, 0, utf8_encoding()))) return NULL; /* now check against too big a file */ if (strlen(m_name) > vol->max_filename) return NULL; #endif return name; } /* ----------------------------- */ int for_each_dirent(const struct vol *vol, char *name, dir_loop fn, void *data) { DIR *dp; struct dirent *de; char *m_name; int ret; if (NULL == ( dp = opendir( name)) ) { return -1; } ret = 0; for ( de = readdir( dp ); de != NULL; de = readdir( dp )) { if (!(m_name = check_dirent(vol, de->d_name))) continue; ret++; if (fn && fn(de,m_name, data) < 0) { closedir(dp); return -1; } } closedir(dp); return ret; } /* This is the maximal length of a single entry for a file/dir in the reply block if all bits in the file/dir bitmap are set: header(4) + params(104) + macnamelength(1) + macname(31) + utf8(4) + utf8namelen(2) + utf8name(255) + oddpadding(1) */ #define REPLY_PARAM_MAXLEN (4 + 104 + 1 + MACFILELEN + 4 + 2 + UTF8FILELEN_EARLY + 1) /* ----------------------------- */ static int enumerate(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen, int ext) { static struct savedir sd = { 0, 0, 0, NULL, NULL, 0 }; struct vol *vol; struct dir *dir; int did, ret, len, first = 1; size_t esz; char *data, *start; u_int16_t vid, fbitmap, dbitmap, reqcnt, actcnt = 0; u_int16_t temp16; u_int32_t sindex, maxsz, sz = 0; struct path *o_path; struct path s_path; int header; if ( sd.sd_buflen == 0 ) { if (( sd.sd_buf = (char *)malloc( SDBUFBRK )) == NULL ) { LOG(log_error, logtype_afpd, "afp_enumerate: malloc: %s", strerror(errno) ); *rbuflen = 0; return AFPERR_MISC; } sd.sd_buflen = SDBUFBRK; } ibuf += 2; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); if (NULL == ( vol = getvolbyvid( vid )) ) { *rbuflen = 0; return( AFPERR_PARAM ); } memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); if (NULL == ( dir = dirlookup( vol, did )) ) { *rbuflen = 0; return (afp_errno == AFPERR_NOOBJ)?AFPERR_NODIR:afp_errno; } memcpy( &fbitmap, ibuf, sizeof( fbitmap )); fbitmap = ntohs( fbitmap ); ibuf += sizeof( fbitmap ); memcpy( &dbitmap, ibuf, sizeof( dbitmap )); dbitmap = ntohs( dbitmap ); ibuf += sizeof( dbitmap ); /* check for proper bitmaps -- the stuff in comments is for * variable directory ids. */ if (!(fbitmap || dbitmap) /*|| (fbitmap & (1 << FILPBIT_PDID)) || (dbitmap & (1 << DIRPBIT_PDID))*/) { *rbuflen = 0; return AFPERR_BITMAP; } memcpy( &reqcnt, ibuf, sizeof( reqcnt )); reqcnt = ntohs( reqcnt ); ibuf += sizeof( reqcnt ); if (ext == 2) { memcpy( &sindex, ibuf, sizeof( sindex )); sindex = ntohl( sindex ); ibuf += sizeof( sindex ); } else { memcpy( &temp16, ibuf, sizeof( temp16 )); sindex = ntohs( temp16 ); ibuf += sizeof( temp16 ); } if (!sindex) { *rbuflen = 0; return AFPERR_PARAM ; } if (ext == 2) { memcpy( &maxsz, ibuf, sizeof( maxsz )); maxsz = ntohl( maxsz ); ibuf += sizeof( maxsz ); } else { memcpy( &temp16, ibuf, sizeof( temp16 )); maxsz = ntohs( temp16 ); ibuf += sizeof( temp16 ); } header = (ext)?4:2; header *=sizeof( u_char ); maxsz = min(maxsz, *rbuflen - REPLY_PARAM_MAXLEN); o_path = cname( vol, dir, &ibuf ); if (afp_errno == AFPERR_NOOBJ) afp_errno = AFPERR_NODIR; *rbuflen = 0; if (NULL == o_path ) { return get_afp_errno(AFPERR_NOOBJ); } if ( *o_path->m_name != '\0') { /* it's a file or it's a dir and extendir() was unable to chdir in it */ return path_error(o_path, AFPERR_NODIR ); } LOG(log_debug, logtype_afpd, "enumerate(\"%s/%s\", f/d:%04x/%04x, rc:%u, i:%u, max:%u)", getcwdpath(), o_path->u_name, fbitmap, dbitmap, reqcnt, sindex, maxsz); data = rbuf + 3 * sizeof( u_int16_t ); sz = 3 * sizeof( u_int16_t ); /* fbitmap, dbitmap, reqcount */ /* * Read the directory into a pre-malloced buffer, stored * len \0 * The end is indicated by a len of 0. */ if ( sindex == 1 || curdir->d_did != sd.sd_did || vid != sd.sd_vid ) { sd.sd_last = sd.sd_buf; /* if dir was in the cache we don't have the inode */ if (( !o_path->st_valid && lstat( ".", &o_path->st ) < 0 ) || (ret = for_each_dirent(vol, ".", enumerate_loop, (void *)&sd)) < 0) { LOG(log_error, logtype_afpd, "enumerate: loop error: %s (%d)", strerror(errno), errno); switch (errno) { case EACCES: return AFPERR_ACCESS; case ENOTDIR: return AFPERR_BADTYPE; case ENOMEM: return AFPERR_MISC; default: return AFPERR_NODIR; } } setdiroffcnt(curdir, &o_path->st, ret); *sd.sd_last = 0; sd.sd_last = sd.sd_buf; sd.sd_sindex = 1; sd.sd_vid = vid; sd.sd_did = curdir->d_did; } /* * Position sd_last as dictated by sindex. */ if ( sindex < sd.sd_sindex ) { sd.sd_sindex = 1; sd.sd_last = sd.sd_buf; } while ( sd.sd_sindex < sindex ) { len = (unsigned char)*(sd.sd_last)++; if ( len == 0 ) { sd.sd_did = 0; /* invalidate sd struct to force re-read */ return( AFPERR_NOOBJ ); } sd.sd_last += len + 1; sd.sd_sindex++; } while (( len = (unsigned char)*(sd.sd_last)) != 0 ) { /* * If we've got all we need, send it. */ if ( actcnt == reqcnt ) { break; } /* * Save the start position, in case we exceed the buffer * limitation, and have to back up one. */ start = sd.sd_last; sd.sd_last++; if (*sd.sd_last == 0) { /* stat() already failed on this one */ sd.sd_last += len + 1; continue; } memset(&s_path, 0, sizeof(s_path)); s_path.u_name = sd.sd_last; if (of_stat( &s_path) < 0 ) { /* * Somebody else plays with the dir, well it can be us with * "Empty Trash..." */ /* so the next time it won't try to stat it again * another solution would be to invalidate the cache with * sd.sd_did = 0 but if it's not ENOENT error it will start again */ *sd.sd_last = 0; sd.sd_last += len + 1; curdir->d_offcnt--; /* a little lie */ continue; } sd.sd_last += len + 1; s_path.m_name = NULL; /* * If a fil/dir is not a dir, it's a file. This is slightly * inaccurate, since that means /dev/null is a file, /dev/printer * is a file, etc. */ if ( S_ISDIR(s_path.st.st_mode)) { if ( dbitmap == 0 ) { continue; } int len = strlen(s_path.u_name); if ((dir = dircache_search_by_name(vol, curdir, s_path.u_name, len)) == NULL) { if ((dir = dir_add(vol, curdir, &s_path, len)) == NULL) { LOG(log_error, logtype_afpd, "enumerate(vid:%u, did:%u, name:'%s'): error adding dir: '%s'", ntohs(vid), ntohl(did), o_path->u_name, s_path.u_name); return AFPERR_MISC; } } if ((ret = getdirparams(vol, dbitmap, &s_path, dir, data + header , &esz)) != AFP_OK) return( ret ); } else { if ( fbitmap == 0 ) { continue; } /* files are added to the dircache in getfilparams() -> getmetadata() */ if (AFP_OK != ( ret = getfilparams(vol, fbitmap, &s_path, curdir, data + header , &esz )) ) { return( ret ); } } /* * Make sure entry is an even length, possibly with a null * byte on the end. */ if ( (esz + header) & 1 ) { *(data + header + esz ) = '\0'; esz++; } /* * Check if we've exceeded the size limit. */ if ( maxsz < sz + esz + header) { if (first) { /* maxsz can't hold a single reply */ return AFPERR_PARAM; } sd.sd_last = start; break; } if (first) first = 0; sz += esz + header; if (ext) { temp16 = htons( esz + header ); memcpy( data, &temp16, sizeof( temp16 )); data += sizeof(temp16); } else { *data++ = esz + header; } *data++ = S_ISDIR(s_path.st.st_mode) ? FILDIRBIT_ISDIR : FILDIRBIT_ISFILE; if (ext) { *data++ = 0; } data += esz; actcnt++; /* FIXME if we rollover 16 bits and it's not FPEnumerateExt2 */ } if ( actcnt == 0 ) { sd.sd_did = 0; /* invalidate sd struct to force re-read */ return( AFPERR_NOOBJ ); } sd.sd_sindex = sindex + actcnt; /* * All done, fill in misc junk in rbuf */ fbitmap = htons( fbitmap ); memcpy( rbuf, &fbitmap, sizeof( fbitmap )); rbuf += sizeof( fbitmap ); dbitmap = htons( dbitmap ); memcpy( rbuf, &dbitmap, sizeof( dbitmap )); rbuf += sizeof( dbitmap ); actcnt = htons( actcnt ); memcpy( rbuf, &actcnt, sizeof( actcnt )); rbuf += sizeof( actcnt ); *rbuflen = sz; return( AFP_OK ); } /* ----------------------------- */ int afp_enumerate(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { return enumerate(obj, ibuf,ibuflen ,rbuf,rbuflen , 0); } /* ----------------------------- */ int afp_enumerate_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { return enumerate(obj, ibuf,ibuflen ,rbuf,rbuflen , 1); } /* ----------------------------- */ int afp_enumerate_ext2(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { return enumerate(obj, ibuf,ibuflen ,rbuf,rbuflen , 2); } netatalk-2.2.2/etc/atalkd/0000777000175200017500000000000011704770430012345 500000000000000netatalk-2.2.2/etc/atalkd/route.c0000644000175200017500000000411611655731126013571 00000000000000/* * $Id: route.c,v 1.8 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1996 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include #include #include #include "rtmp.h" #include "route.h" #ifndef BSD4_4 int route( int message, struct sockaddr *dst, struct sockaddr *gate, int flags) { #ifdef TRU64 struct ortentry rtent; #else /* TRU64 */ struct rtentry rtent; #endif /* TRU64 */ memset( &rtent, 0, sizeof( struct rtentry )); rtent.rt_dst = *dst; rtent.rt_gateway = *gate; rtent.rt_flags = flags; return( ioctl( rtfd, message, &rtent )); } #else /* BSD4_4 */ struct sockaddr_m { u_char sam_len; u_char sam_family; u_short sam_pad; u_short sam_mask; u_short sam_pad2; } mask = { sizeof( struct sockaddr_m ), 0, 0, 0xffff, 0 }; struct rt_msg_at { struct rt_msghdr rtma_rtm; struct sockaddr_at rtma_dst; struct sockaddr_at rtma_gate; struct sockaddr_m rtma_mask; } rtma; route( int message, struct sockaddr_at *dst, struct sockaddr_at *gate, int flags) { int rc; memset( &rtma, 0, sizeof( struct rt_msg_at )); rtma.rtma_rtm.rtm_msglen = sizeof( struct rt_msg_at ); rtma.rtma_rtm.rtm_version = RTM_VERSION; rtma.rtma_rtm.rtm_type = message; rtma.rtma_rtm.rtm_pid = getpid(); rtma.rtma_rtm.rtm_addrs = RTA_DST|RTA_GATEWAY; if ( flags & RTF_HOST ) { rtma.rtma_rtm.rtm_msglen = sizeof( struct rt_msg_at ) - sizeof( struct sockaddr_m ); } else { rtma.rtma_rtm.rtm_msglen = sizeof( struct rt_msg_at ); rtma.rtma_rtm.rtm_addrs |= RTA_NETMASK; rtma.rtma_mask = mask; } rtma.rtma_rtm.rtm_flags = flags; rtma.rtma_dst = *dst; rtma.rtma_gate = *gate; if (( rc = write( rtfd, &rtma, rtma.rtma_rtm.rtm_msglen )) != rtma.rtma_rtm.rtm_msglen ) { return( -1 ); } return( 0 ); } #endif /* BSD4_4 */ netatalk-2.2.2/etc/atalkd/Makefile.am0000644000175200017500000000063211655731126014322 00000000000000# Makefile.am for etc/atalkd/ pkgconfdir = @PKGCONFDIR@ sbin_PROGRAMS = atalkd atalkd_SOURCES = aep.c config.c main.c multicast.c nbp.c route.c rtmp.c zip.c atalkd_LDADD = $(top_builddir)/libatalk/libatalk.la noinst_HEADERS = \ atserv.h \ gate.h \ interface.h \ list.h \ main.h \ multicast.h \ nbp.h \ route.h \ rtmp.h \ zip.h AM_CFLAGS = -D_PATH_ATALKDCONF=\"$(pkgconfdir)/atalkd.conf\" netatalk-2.2.2/etc/atalkd/Makefile.in0000644000175200017500000004274711703521725014344 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for etc/atalkd/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ sbin_PROGRAMS = atalkd$(EXEEXT) subdir = etc/atalkd DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(sbin_PROGRAMS) am_atalkd_OBJECTS = aep.$(OBJEXT) config.$(OBJEXT) main.$(OBJEXT) \ multicast.$(OBJEXT) nbp.$(OBJEXT) route.$(OBJEXT) \ rtmp.$(OBJEXT) zip.$(OBJEXT) atalkd_OBJECTS = $(am_atalkd_OBJECTS) atalkd_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(atalkd_SOURCES) DIST_SOURCES = $(atalkd_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgconfdir = @PKGCONFDIR@ atalkd_SOURCES = aep.c config.c main.c multicast.c nbp.c route.c rtmp.c zip.c atalkd_LDADD = $(top_builddir)/libatalk/libatalk.la noinst_HEADERS = \ atserv.h \ gate.h \ interface.h \ list.h \ main.h \ multicast.h \ nbp.h \ route.h \ rtmp.h \ zip.h AM_CFLAGS = -D_PATH_ATALKDCONF=\"$(pkgconfdir)/atalkd.conf\" all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign etc/atalkd/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign etc/atalkd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done atalkd$(EXEEXT): $(atalkd_OBJECTS) $(atalkd_DEPENDENCIES) @rm -f atalkd$(EXEEXT) $(LINK) $(atalkd_OBJECTS) $(atalkd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aep.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multicast.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/route.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zip.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-sbinPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-sbinPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-sbinPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/etc/atalkd/gate.h0000644000175200017500000000052211655731126013355 00000000000000/* * $Id: gate.h,v 1.2 2001-06-25 20:13:45 rufustfirefly Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ struct gate { struct gate *g_next, *g_prev; int g_state; struct interface *g_iface; struct rtmptab *g_rt; struct sockaddr_at g_sat; }; netatalk-2.2.2/etc/atalkd/list.h0000644000175200017500000000037011655731126013411 00000000000000/* * $Id: list.h,v 1.2 2001-06-25 20:13:45 rufustfirefly Exp $ * * Copyright (c) 1990,1992 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ struct list { void *l_data; struct list *l_next, *l_prev; }; netatalk-2.2.2/etc/atalkd/atserv.h0000644000175200017500000000114211655731126013740 00000000000000/* * $Id: atserv.h,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1992 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifndef ATALKD_ATSERV_H #define ATALKD_ATSERV_H 1 struct atport { int ap_fd; struct atport *ap_next; struct interface *ap_iface; u_char ap_port; int (*ap_packet)(struct atport *ap, struct sockaddr_at *from, char *data, int len); }; struct atserv { char *as_name; u_char as_port; /* Used as a fall back */ int (*as_packet)(struct atport *ap, struct sockaddr_at *from, char *data, int len); }; #endif netatalk-2.2.2/etc/atalkd/main.h0000644000175200017500000000103711655731126013363 00000000000000/* * $Id: main.h,v 1.6 2009-10-14 01:38:28 didg Exp $ */ #ifndef ATALKD_MAIN_H #define ATALKD_MAIN_H #include #include "config.h" extern int transition; extern int stabletimer, newrtmpdata; int ifconfig ( const char *, unsigned long, struct sockaddr_at * ); void setaddr ( struct interface *, u_int8_t, u_int16_t, u_int8_t, u_int16_t, u_int16_t ); void bootaddr ( struct interface * ); void dumpconfig ( struct interface * ); #ifdef linux int ifsetallmulti ( const char *, int); #endif #endif /* ATALKD_MAIN_H */ netatalk-2.2.2/etc/atalkd/multicast.h0000644000175200017500000000060611655731126014445 00000000000000/* * $Id: multicast.h,v 1.5 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1997 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifndef ATALKD_MULTICAST_H #define ATALKD_MULTICAST_H 1 #include #include "zip.h" int addmulti (const char *, const unsigned char *); int zone_bcast (struct ziptab *); #endif /* atalkd/multicast.h */ netatalk-2.2.2/etc/atalkd/nbp.c0000644000175200017500000005401511655731126013215 00000000000000/* * $Id: nbp.c,v 1.13 2009-10-14 02:24:05 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #ifdef TRU64 #include #include #endif /* TRU64 */ #include #include #include #include #include #include #ifdef __svr4__ #include #endif /* __svr4__ */ #include "atserv.h" #include "interface.h" #include "list.h" #include "rtmp.h" #include "gate.h" #include "zip.h" #include "nbp.h" #include "multicast.h" extern int transition; struct nbptab *nbptab = NULL; static void nbp_ack( int fd, int nh_op, int nh_id, struct sockaddr_at *to) { struct nbphdr nh; char *data, packet[ SZ_NBPHDR + 1 ]; nh.nh_op = nh_op; nh.nh_cnt = 0; nh.nh_id = nh_id; data = packet; *data++ = DDPTYPE_NBP; memcpy( data, &nh, SZ_NBPHDR ); data += SZ_NBPHDR; if ( sendto( fd, packet, data - packet, 0, (struct sockaddr *)to, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "sendto: %s", strerror(errno) ); } } int nbp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len) { struct nbphdr nh; struct nbptuple nt; struct nbpnve nn; struct sockaddr_at sat; struct nbptab *ntab; struct ziptab *zt=NULL; struct interface *iface; struct list *l; struct rtmptab *rtmp; char *end, *nbpop, *zonep, packet[ ATP_BUFSIZ ]; int n, i, cc, locallkup; u_char tmplen; end = data + len; if ( data >= end ) { LOG(log_info, logtype_atalkd, "nbp_packet malformed packet" ); return 1; } if ( *data++ != DDPTYPE_NBP ) { LOG(log_info, logtype_atalkd, "nbp_packet bad ddp type" ); return 1; } if ( data + SZ_NBPHDR + SZ_NBPTUPLE > end ) { LOG(log_info, logtype_atalkd, "nbp_packet: malformed packet" ); return 1; } memcpy( &nh, data, SZ_NBPHDR ); nbpop = data; /* remember for fwd and brrq */ data += SZ_NBPHDR; if ( nh.nh_cnt != 1 ) { LOG(log_info, logtype_atalkd, "nbp_packet: bad tuple count (%d/%d)", nh.nh_cnt, nh.nh_op ); return 1; } memcpy( &nt, data, SZ_NBPTUPLE ); data += SZ_NBPTUPLE; memset( &nn.nn_sat, 0, sizeof( struct sockaddr_at )); #ifdef BSD4_4 nn.nn_sat.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ nn.nn_sat.sat_family = AF_APPLETALK; nn.nn_sat.sat_addr.s_net = nt.nt_net; nn.nn_sat.sat_addr.s_node = nt.nt_node; nn.nn_sat.sat_port = nt.nt_port; /* object */ tmplen = (u_char) *data; if ( data >= end || tmplen > 32 || data + tmplen > end ) { LOG(log_info, logtype_atalkd, "nbp_packet: malformed packet" ); return 1; } nn.nn_objlen = tmplen; data++; memcpy( nn.nn_obj, data, nn.nn_objlen ); data += nn.nn_objlen; /* type */ tmplen = (u_char) *data; if ( data >= end || tmplen > 32 || data + tmplen > end ) { LOG(log_info, logtype_atalkd, "nbp_packet: malformed packet" ); return 1; } nn.nn_typelen = tmplen; data++; memcpy( nn.nn_type, data, nn.nn_typelen ); data += nn.nn_typelen; /* zone */ tmplen = (u_char) *data; if ( data >= end || tmplen > 32 || data + tmplen > end ) { LOG(log_info, logtype_atalkd, "nbp_packet: malformed packet" ); return 1; } zonep = data; /* remember for fwd */ nn.nn_zonelen = tmplen; data++; memcpy( nn.nn_zone, data, nn.nn_zonelen ); data += nn.nn_zonelen; if ( data != end ) { LOG(log_info, logtype_atalkd, "nbp_packet: malformed packet" ); return 1; } locallkup = 0; switch ( nh.nh_op ) { case NBPOP_RGSTR : /* * Find the ziptab entry for the zone we're trying to register in. */ if ( nn.nn_zonelen == 0 || ( nn.nn_zonelen == 1 && *nn.nn_zone == '*' )) { if ( interfaces->i_next->i_rt->rt_zt ) { zt = (struct ziptab *)interfaces->i_next->i_rt->rt_zt->l_data; } else { zt = NULL; } } else { for ( zt = ziptab; zt; zt = zt->zt_next ) { if ( zt->zt_len == nn.nn_zonelen && strndiacasecmp( zt->zt_name, nn.nn_zone, zt->zt_len ) == 0 ) { break; } } if ( zt == NULL ) { nbp_ack( ap->ap_fd, NBPOP_ERROR, (int)nh.nh_id, from ); return 0; } } /* * Observe that we don't have to do any local-zone verification * if the zone aleady has a multicast address set. */ if ( zt != NULL && zt->zt_bcast == NULL ) { /* * Check if zone is associated with any of our local interfaces. */ for ( iface = interfaces; iface; iface = iface->i_next ) { for ( l = iface->i_rt->rt_zt; l; l = l->l_next ) { if ( zt == (struct ziptab *)l->l_data ) { break; } } if ( l != NULL ) { break; } } if ( iface == NULL ) { nbp_ack( ap->ap_fd, NBPOP_ERROR, (int)nh.nh_id, from ); return 0; } /* calculate and save multicast address */ if (zone_bcast(zt) < 0) { LOG(log_error, logtype_atalkd, "nbp_packet: zone_bcast"); return -1; } for ( iface = interfaces; iface; iface = iface->i_next ) { if (( iface->i_flags & IFACE_PHASE2 ) == 0 ) { continue; } for ( l = iface->i_rt->rt_zt; l; l = l->l_next ) { if ( zt == (struct ziptab *)l->l_data ) { /* add multicast */ if (addmulti(iface->i_name, zt->zt_bcast) < 0) { LOG(log_error, logtype_atalkd, "nbp_packet: addmulti: %s", strerror(errno) ); return -1; } } } } } if (( ntab = (struct nbptab *)malloc( sizeof( struct nbptab ))) == NULL ) { LOG(log_error, logtype_atalkd, "nbp_packet: malloc: %s", strerror(errno) ); return -1; } memcpy( &ntab->nt_nve, &nn, sizeof( struct nbpnve )); ntab->nt_iface = ap->ap_iface; ntab->nt_next = nbptab; ntab->nt_prev = NULL; if ( nbptab ) { nbptab->nt_prev = ntab; } nbptab = ntab; nbp_ack( ap->ap_fd, NBPOP_OK, (int)nh.nh_id, from ); break; case NBPOP_UNRGSTR : /* deal with local zone info */ if (( nn.nn_zonelen == 1 && *nn.nn_zone == '*' ) || ( nn.nn_zonelen == 0 )) { locallkup = 1; if ( interfaces->i_next->i_rt->rt_zt ) { zt = (struct ziptab *)interfaces->i_next->i_rt->rt_zt->l_data; } else { zt = NULL; } } /* remove from our data, perhaps removing a multicast address */ for ( ntab = nbptab; ntab; ntab = ntab->nt_next ) { if ( ntab->nt_nve.nn_objlen != nn.nn_objlen || strndiacasecmp( ntab->nt_nve.nn_obj, nn.nn_obj, nn.nn_objlen )) { continue; } if ( ntab->nt_nve.nn_typelen != nn.nn_typelen || strndiacasecmp( ntab->nt_nve.nn_type, nn.nn_type, nn.nn_typelen )) { continue; } /* * I *think* we really do check the zone, here. * * i changed it to better handle local zone cases as well. * -- asun */ /* match local zones */ if (locallkup) { /* ntab is also local zone */ if (( ntab->nt_nve.nn_zonelen == 1 && *ntab->nt_nve.nn_zone == '*' ) || (ntab->nt_nve.nn_zonelen == 0)) break; /* ntab is default zone */ if (zt && (zt->zt_len == ntab->nt_nve.nn_zonelen) && (strndiacasecmp(ntab->nt_nve.nn_zone, zt->zt_name, zt->zt_len) == 0)) { break; } } /* match particular zone */ if ((ntab->nt_nve.nn_zonelen == nn.nn_zonelen) && (strndiacasecmp( ntab->nt_nve.nn_zone, nn.nn_zone, nn.nn_zonelen ) == 0)) { break; } } if ( ntab == NULL ) { nbp_ack( ap->ap_fd, NBPOP_ERROR, (int)nh.nh_id, from ); return 0; } if ( ntab->nt_next != NULL ) { ntab->nt_next->nt_prev = ntab->nt_prev; } if ( ntab->nt_prev != NULL ) { ntab->nt_prev->nt_next = ntab->nt_next; } if ( ntab == nbptab ) { nbptab = ntab->nt_next; } /* * Check for another nbptab entry with the same zone. If * there isn't one, find the ziptab entry for the zone and * remove the multicast address from the appropriate interfaces. * XXX */ nbp_ack( ap->ap_fd, NBPOP_OK, (int)nh.nh_id, from ); break; case NBPOP_BRRQ : /* * Couple of things: 1. Unless we have the -t flag (which is sort * of a misnomer, since you need it if you're doing any phase 1 * work), always send NBPOP_FWD. 2. If we get a zone of '*', * and we know what the sender meant by '*', we copy the real * zone into the packet. */ if ( nn.nn_zonelen == 0 || ( nn.nn_zonelen == 1 && *nn.nn_zone == '*' )) { iface = ap->ap_iface; if ( iface && iface->i_rt->rt_zt ) { zt = (struct ziptab *)iface->i_rt->rt_zt->l_data; } else if ( interfaces->i_next->i_rt->rt_zt ) { zt = (struct ziptab *)interfaces->i_next->i_rt->rt_zt->l_data; } else { zt = NULL; } /* * Copy zone into packet. Note that we're changing len, data, and * nbpop. Later, we'll use ( data - len ) to mean the beginning * of this packet. */ if ( zt ) { memcpy( packet, data - len, len ); nbpop = packet + ( len - ( data - nbpop )); data = packet + ( len - ( data - zonep )); *data++ = zt->zt_len; memcpy( data, zt->zt_name, zt->zt_len ); data += zt->zt_len; len = data - packet; } } else { for ( zt = ziptab; zt; zt = zt->zt_next ) { if ( zt->zt_len == nn.nn_zonelen && strndiacasecmp( zt->zt_name, nn.nn_zone, zt->zt_len ) == 0 ) { break; } } if ( zt == NULL ) { nbp_ack( ap->ap_fd, NBPOP_ERROR, (int)nh.nh_id, from ); return 0; } } /* * If we've got no zones, send out LKUP on the local net. * Otherwise, look through the zone table. */ if ( zt == NULL ) { #ifdef BSD4_4 sat.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ sat.sat_family = AF_APPLETALK; sat.sat_port = ap->ap_port; nh.nh_op = NBPOP_LKUP; memcpy( nbpop, &nh, SZ_NBPHDR ); sat.sat_addr.s_net = 0; /* XXX */ sat.sat_addr.s_node = ATADDR_BCAST; /* Find the first non-loopback ap */ for ( iface = interfaces; iface; iface = iface->i_next ) { if ((( iface->i_flags & IFACE_LOOPBACK ) == 0) && (iface == ap->ap_iface || (iface->i_flags & IFACE_ISROUTER))) { break; } } if ( iface == NULL ) { return 0; } for ( ap = iface->i_ports; ap; ap = ap->ap_next ) { if ( ap->ap_packet == nbp_packet ) { break; } } if (ap == NULL) return 0; if ( sendto( ap->ap_fd, data - len, len, 0, (struct sockaddr *)&sat, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "nbp brrq sendto: %s", strerror(errno) ); } locallkup = 1; } else { #ifdef BSD4_4 sat.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ sat.sat_family = AF_APPLETALK; sat.sat_port = ap->ap_port; for ( l = zt->zt_rt; l; l = l->l_next ) { rtmp = (struct rtmptab *)l->l_data; if ( rtmp->rt_gate == NULL ) { for ( iface = interfaces; iface; iface = iface->i_next ) { if ( iface->i_rt == rtmp ) { break; } } if ( !iface ) { LOG(log_error, logtype_atalkd, "nbp_packet: \ Can't find route's interface!" ); return -1; } ap = iface->i_ports; } else { ap = rtmp->rt_gate->g_iface->i_ports; } for ( ; ap; ap = ap->ap_next ) { if ( ap->ap_packet == nbp_packet ) { break; } } if ( !ap ) { LOG(log_error, logtype_atalkd, "nbp_packet: Can't find port!" ); return -1; } if ( transition && ( rtmp->rt_flags & RTMPTAB_EXTENDED ) == 0 ) { if ( rtmp->rt_gate == NULL ) { locallkup = 1; } nh.nh_op = NBPOP_LKUP; memcpy( nbpop, &nh, SZ_NBPHDR ); sat.sat_addr.s_net = rtmp->rt_firstnet; sat.sat_addr.s_node = ATADDR_BCAST; } else { if ( rtmp->rt_gate == NULL ) { nh.nh_op = NBPOP_LKUP; memcpy( nbpop, &nh, SZ_NBPHDR ); sat.sat_addr.s_net = 0; sat.sat_addr.s_node = ATADDR_BCAST; locallkup = 1; } else { nh.nh_op = NBPOP_FWD; memcpy( nbpop, &nh, SZ_NBPHDR ); sat.sat_addr.s_net = rtmp->rt_firstnet; sat.sat_addr.s_node = 0; } } if ( sendto( ap->ap_fd, data - len, len, 0, (struct sockaddr *)&sat, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "nbp brrq sendto %u.%u: %s", ntohs( sat.sat_addr.s_net ), sat.sat_addr.s_node, strerror(errno) ); continue; } } } if ( !locallkup ) { break; } /*FALL THROUGH*/ case NBPOP_FWD : /* send lkup on net. we need to make sure we're a router. */ if ( !locallkup && (ap->ap_iface->i_flags & IFACE_ISROUTER)) { nh.nh_op = NBPOP_LKUP; memcpy( nbpop, &nh, SZ_NBPHDR ); from->sat_addr.s_net = 0; from->sat_addr.s_node = ATADDR_BCAST; if ( sendto( ap->ap_fd, data - len, len, 0, (struct sockaddr *)from, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "nbp fwd sendto %u.%u: %s", ntohs( from->sat_addr.s_net ), from->sat_addr.s_node, strerror(errno) ); return 0; } } /*FALL THROUGH*/ case NBPOP_LKUP : /* search our data */ n = i = 0; data = packet + 1 + SZ_NBPHDR; end = packet + sizeof( packet ); for ( ntab = nbptab; ntab; ntab = ntab->nt_next ) { /* don't send out entries if we don't want to route. */ if ((ap->ap_iface != ntab->nt_iface) && (ntab->nt_iface->i_flags & IFACE_ISROUTER) == 0) { continue; } if ( nn.nn_objlen != 1 || *nn.nn_obj != '=' ) { if ( ntab->nt_nve.nn_objlen != nn.nn_objlen || strndiacasecmp( ntab->nt_nve.nn_obj, nn.nn_obj, nn.nn_objlen )) { continue; } } if ( nn.nn_typelen != 1 || *nn.nn_type != '=' ) { if ( ntab->nt_nve.nn_typelen != nn.nn_typelen || strndiacasecmp( ntab->nt_nve.nn_type, nn.nn_type, nn.nn_typelen )) { continue; } } if ( nn.nn_zonelen != 0 && ( nn.nn_zonelen != 1 || *nn.nn_zone != '*' )) { if ( ntab->nt_nve.nn_zonelen == 0 || ( ntab->nt_nve.nn_zonelen == 1 && *ntab->nt_nve.nn_zone == '*' )) { if ( interfaces->i_next->i_rt->rt_zt ) { zt = (struct ziptab *)interfaces->i_next->i_rt-> rt_zt->l_data; if ( zt->zt_len != nn.nn_zonelen || strndiacasecmp( zt->zt_name, nn.nn_zone, zt->zt_len )) { continue; } } } else { if ( ntab->nt_nve.nn_zonelen != nn.nn_zonelen || strndiacasecmp( ntab->nt_nve.nn_zone, nn.nn_zone, nn.nn_zonelen )) { continue; } } } /* * Another tuple won't fit. Send what we've already * got, and start the next packet. */ if ( n > 14 || data + SZ_NBPTUPLE + 3 + ntab->nt_nve.nn_objlen + ntab->nt_nve.nn_typelen + ntab->nt_nve.nn_zonelen > end ) { nh.nh_op = NBPOP_LKUPREPLY; nh.nh_cnt = n; cc = data - packet; data = packet; *data++ = DDPTYPE_NBP; memcpy( data, &nh, SZ_NBPHDR ); if ( sendto( ap->ap_fd, packet, cc, 0, (struct sockaddr *)&nn.nn_sat, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "nbp lkup sendto %u.%u: %s", ntohs( nn.nn_sat.sat_addr.s_net ), nn.nn_sat.sat_addr.s_node, strerror(errno) ); return 0; } n = 0; data = packet + 1 + SZ_NBPHDR; end = packet + sizeof( packet ); } nt.nt_net = ntab->nt_nve.nn_sat.sat_addr.s_net; nt.nt_node = ntab->nt_nve.nn_sat.sat_addr.s_node; nt.nt_port = ntab->nt_nve.nn_sat.sat_port; /* * Right now, we'll just give each name a unique enum. In * the future, we might need to actually assign and save * an enum, based on the associated address. For the moment, * the enums will be unique and constant, since the order * is fixed. */ nt.nt_enum = i++; memcpy( data, &nt, SZ_NBPTUPLE ); data += SZ_NBPTUPLE; *data++ = ntab->nt_nve.nn_objlen; memcpy( data, ntab->nt_nve.nn_obj, ntab->nt_nve.nn_objlen ); data += ntab->nt_nve.nn_objlen; *data++ = ntab->nt_nve.nn_typelen; memcpy(data, ntab->nt_nve.nn_type, ntab->nt_nve.nn_typelen ); data += ntab->nt_nve.nn_typelen; /* * Macs won't see something with a zone of 0 length. We * will always return '*' instead. Perhaps we should * unconditionally return the real zone? */ if ( ntab->nt_nve.nn_zonelen ) { *data++ = ntab->nt_nve.nn_zonelen; memcpy( data, ntab->nt_nve.nn_zone, ntab->nt_nve.nn_zonelen ); data += ntab->nt_nve.nn_zonelen; } else { *data++ = 1; *data++ = '*'; } n++; } if ( n != 0 ) { nh.nh_op = NBPOP_LKUPREPLY; nh.nh_cnt = n; cc = data - packet; data = packet; *data++ = DDPTYPE_NBP; memcpy( data, &nh, SZ_NBPHDR ); if ( sendto( ap->ap_fd, packet, cc, 0, (struct sockaddr *)&nn.nn_sat, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "nbp lkup sendto %u.%u: %s", ntohs( nn.nn_sat.sat_addr.s_net ), nn.nn_sat.sat_addr.s_node, strerror(errno) ); return 0; } } break; default : LOG(log_info, logtype_atalkd, "nbp_packet: bad op (%d)", nh.nh_op ); return 1; } return 0; } netatalk-2.2.2/etc/atalkd/nbp.h0000644000175200017500000000070411655731126013216 00000000000000/* * $Id: nbp.h,v 1.3 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifndef ATALKD_NBP_H #define ATALKD_NBP_H 1 struct nbptab { struct nbptab *nt_prev, *nt_next; struct nbpnve nt_nve; struct interface *nt_iface; }; extern struct nbptab *nbptab; int nbp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len); #endif netatalk-2.2.2/etc/atalkd/rtmp.c0000644000175200017500000006443711655731126013431 00000000000000/* * $Id: rtmp.c,v 1.17 2009-12-08 03:21:16 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #ifdef TRU64 #include #include #endif /* TRU64 */ #include #include #include #include #ifdef __svr4__ #include #endif /* __svr4__ */ #include #include #include #include "interface.h" #include "gate.h" #include "rtmp.h" #include "zip.h" #include "list.h" #include "atserv.h" #include "route.h" #include "main.h" void rtmp_delzonemap(struct rtmptab *rtmp) { struct list *lz, *flz, *lr, *flr; struct ziptab *zt; lz = rtmp->rt_zt; while ( lz ) { /* for each zone */ zt = (struct ziptab *)lz->l_data; lr = zt->zt_rt; while ( lr ) { /* for each route */ if ( (struct rtmptab *)lr->l_data == rtmp ) { if ( lr->l_prev == NULL ) { /* head */ if ( lr->l_next == NULL ) { /* last route in zone */ if ( zt->zt_prev == NULL ) { ziptab = zt->zt_next; } else { zt->zt_prev->zt_next = zt->zt_next; } if ( zt->zt_next == NULL ) { ziplast = zt->zt_prev; } else { zt->zt_next->zt_prev = zt->zt_prev; } free( zt->zt_bcast ); free( zt->zt_name ); free( zt ); } else { zt->zt_rt = lr->l_next; } } else { lr->l_prev->l_next = lr->l_next; } if ( lr->l_next != NULL ) { lr->l_next->l_prev = lr->l_prev; } flr = lr; lr = lr->l_next; free( flr ); } else { lr = lr->l_next; } } flz = lz; lz = lz->l_next; free( flz ); } rtmp->rt_zt = NULL; } /* * Complete configuration for phase 1 interface using RTMP information. */ static int rtmp_config( struct rtmp_head *rh, struct interface *iface) { extern int stabletimer; int cc; /* * If we're configuring a phase 2 interface, don't complete * configuration with RTMP. */ if ( iface->i_flags & IFACE_PHASE2 ) { LOG(log_info, logtype_atalkd, "rtmp_config ignoring data" ); return 0; } /* * Check our seed information, and reconfigure. */ if ( rh->rh_net != iface->i_addr.sat_addr.s_net ) { if (( iface->i_flags & IFACE_SEED ) && rh->rh_net != iface->i_caddr.sat_addr.s_net) { LOG(log_error, logtype_atalkd, "rtmp_config net mismatch %u != %u", ntohs( rh->rh_net ), ntohs( iface->i_addr.sat_addr.s_net )); return 1; } iface->i_addr.sat_addr.s_net = rh->rh_net; /* * It is possible that we will corrupt our route database * by just forcing this change. XXX */ iface->i_rt->rt_firstnet = iface->i_rt->rt_lastnet = rh->rh_net; setaddr( iface, IFACE_PHASE1, iface->i_addr.sat_addr.s_net, iface->i_addr.sat_addr.s_node, rh->rh_net, rh->rh_net ); stabletimer = UNSTABLE; } /* add addr to loopback route */ if ((cc = looproute( iface, RTMP_ADD )) < 0 ) return -1; if (cc) { LOG(log_error, logtype_atalkd, "rtmp_config: can't route %u.%u to loopback: %s", ntohs( iface->i_addr.sat_addr.s_net ), iface->i_addr.sat_addr.s_node, strerror(errno) ); } LOG(log_info, logtype_atalkd, "rtmp_config configured %s", iface->i_name ); iface->i_flags |= IFACE_CONFIG; if ( iface == ciface ) { ciface = ciface->i_next; bootaddr( ciface ); } return 0; } /* * Delete rtmp from the per-interface in-use table, remove all * zone references, and remove the route from the kernel. */ static void rtmp_delinuse(struct rtmptab *rtmp) { struct rtmptab *irt; irt = rtmp->rt_gate->g_iface->i_rt; if ( irt->rt_inext == rtmp ) { /* first */ if ( rtmp->rt_iprev == rtmp ) { /* only */ irt->rt_inext = NULL; } else { irt->rt_inext = rtmp->rt_inext; rtmp->rt_inext->rt_iprev = rtmp->rt_iprev; } } else { if ( rtmp->rt_inext == NULL ) { /* last */ rtmp->rt_iprev->rt_inext = NULL; irt->rt_inext->rt_iprev = rtmp->rt_iprev; } else { rtmp->rt_iprev->rt_inext = rtmp->rt_inext; rtmp->rt_inext->rt_iprev = rtmp->rt_iprev; } } rtmp->rt_iprev = NULL; rtmp->rt_inext = NULL; /* remove zone map */ rtmp_delzonemap(rtmp); /* remove old route */ gateroute( RTMP_DEL, rtmp ); } /* * Add rtmp to the per-interface in-use table. No verification is done... */ static void rtmp_addinuse( struct rtmptab *rtmp) { struct rtmptab *irt; gateroute( RTMP_ADD, rtmp ); irt = rtmp->rt_gate->g_iface->i_rt; if ( irt->rt_inext == NULL ) { /* empty list */ rtmp->rt_inext = NULL; rtmp->rt_iprev = rtmp; irt->rt_inext = rtmp; } else { rtmp->rt_inext = irt->rt_inext; rtmp->rt_iprev = irt->rt_inext->rt_iprev; irt->rt_inext->rt_iprev = rtmp; irt->rt_inext = rtmp; } } /* * Change the zone mapping to replace "from" with "to". This code assumes * the consistency of both the route -> zone map and the zone -> route map. * This is probably a bad idea. How can we insure that the data is good * at this point? What do we do if we get several copies of a route in * an RTMP packet? */ static int rtmp_copyzones( struct rtmptab *to,struct rtmptab *from) { struct list *lz, *lr; to->rt_zt = from->rt_zt; from->rt_zt = NULL; if ( from->rt_flags & RTMPTAB_HASZONES ) { to->rt_flags |= RTMPTAB_HASZONES; } for ( lz = to->rt_zt; lz; lz = lz->l_next ) { for ( lr = ((struct ziptab *)lz->l_data)->zt_rt; lr; lr = lr->l_next ) { if ( (struct rtmptab *)lr->l_data == from ) { lr->l_data = (void *)to; /* cast BS */ break; } } if ( lr == NULL ) { LOG(log_error, logtype_atalkd, "rtmp_copyzones z -> r without r -> z, abort" ); return -1; } } return 0; } /* * Remove rtmp from the in-use table and the per-gate table. * Free any associated space. */ void rtmp_free( struct rtmptab *rtmp) { struct gate *gate; LOG(log_info, logtype_atalkd, "rtmp_free: %u-%u", ntohs(rtmp->rt_firstnet), ntohs(rtmp->rt_lastnet)); if ( rtmp->rt_iprev ) { rtmp_delinuse( rtmp ); } /* remove from per-gate */ gate = rtmp->rt_gate; if ( gate->g_rt == rtmp ) { /* first */ if ( rtmp->rt_prev == rtmp ) { /* only */ gate->g_rt = NULL; } else { gate->g_rt = rtmp->rt_next; rtmp->rt_next->rt_prev = rtmp->rt_prev; } } else { if ( rtmp->rt_next == NULL ) { /* last */ rtmp->rt_prev->rt_next = NULL; gate->g_rt->rt_prev = rtmp->rt_prev; } else { rtmp->rt_prev->rt_next = rtmp->rt_next; rtmp->rt_next->rt_prev = rtmp->rt_prev; } } free( rtmp ); } /* * Find a replacement for "replace". If we can't find a replacement, * return 1. If we do find a replacement, return 0. -1 on error. */ int rtmp_replace(struct rtmptab *replace) { struct interface *iface; struct gate *gate; struct rtmptab *rtmp, *found = NULL; LOG(log_info, logtype_atalkd, "rtmp_replace %u-%u", ntohs(replace->rt_firstnet), ntohs(replace->rt_lastnet)); for ( iface = interfaces; iface; iface = iface->i_next ) { if ((replace->rt_iface != iface) && ((iface->i_flags & IFACE_ISROUTER) == 0)) continue; for ( gate = iface->i_gate; gate; gate = gate->g_next ) { for ( rtmp = gate->g_rt; rtmp; rtmp = rtmp->rt_next ) { if ( rtmp->rt_firstnet == replace->rt_firstnet && rtmp->rt_lastnet == replace->rt_lastnet ) { if ( found == NULL || rtmp->rt_hops < found->rt_hops ) { found = rtmp; } break; } } } } if ( found != replace ) { if (rtmp_copyzones( found, replace ) < 0) return -1; rtmp_delinuse( replace ); rtmp_addinuse( found ); if ( replace->rt_state == RTMPTAB_BAD ) { rtmp_free( replace ); } return( 0 ); } else { if ( replace->rt_hops == RTMPHOPS_POISON ) { gateroute( RTMP_DEL, replace ); } return( 1 ); } } static int rtmp_new(struct rtmptab *rtmp) { struct interface *i; struct rtmptab *r; extern int newrtmpdata; newrtmpdata = 1; /* * Do we already have a gateway for this route? */ for ( i = interfaces; i; i = i->i_next ) { if ((rtmp->rt_iface != i) && ((i->i_flags & IFACE_ISROUTER) == 0)) continue; for ( r = i->i_rt; r; r = r->rt_inext ) { /* Should check RTMPTAB_EXTENDED here. XXX */ if (( ntohs( r->rt_firstnet ) <= ntohs( rtmp->rt_firstnet ) && ntohs( r->rt_lastnet ) >= ntohs( rtmp->rt_firstnet )) || ( ntohs( r->rt_firstnet ) <= ntohs( rtmp->rt_lastnet ) && ntohs( r->rt_lastnet ) >= ntohs( rtmp->rt_lastnet ))) { break; } } if ( r ) { break; } } /* * This part of this routine is almost never run. */ if ( i ) { /* can we get here without r being set? */ if ( r->rt_firstnet != rtmp->rt_firstnet || r->rt_lastnet != rtmp->rt_lastnet ) { LOG(log_info, logtype_atalkd, "rtmp_new netrange mismatch %u-%u != %u-%u", ntohs( r->rt_firstnet ), ntohs( r->rt_lastnet ), ntohs( rtmp->rt_firstnet ), ntohs( rtmp->rt_lastnet )); return 1; } /* * Note that our whole methodology is wrong, if we want to do * route "load balancing." This entails changing our route * each time we receive a tuple of equal value. In fact, we can't * do this, using our method, since we only check against in-use * routes when a tuple is new from a router. */ if ( r->rt_hops < rtmp->rt_hops ) { return 1; } if (rtmp_copyzones( rtmp, r ) < 0) return -1; rtmp_delinuse( r ); } rtmp_addinuse( rtmp ); return 0; } int rtmp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len) { struct rtmp_head rh; struct rtmp_tuple rt, xrt; struct gate *gate; struct interface *iface; struct interface *iface2; struct rtmptab *rtmp; char *end, packet[ ATP_BUFSIZ ]; int cc; end = data + len; if ( data >= end ) { LOG(log_info, logtype_atalkd, "rtmp_packet no data" ); return 1; } iface = ap->ap_iface; /* linux 2.6 sends broadcast queries to the first available socket (in our case the last configured) try to find the right one. Note: now a misconfigured or plugged router can broadcast a wrong route */ for ( iface2 = interfaces; iface2; iface2 = iface2->i_next ) { if ( iface2->i_rt && from->sat_addr.s_net >= iface2->i_rt->rt_firstnet && from->sat_addr.s_net <= iface2->i_rt->rt_lastnet) { iface = iface2; } } /* end of linux 2.6 workaround */ /* ignore our own packets */ if ( from->sat_addr.s_net == iface->i_addr.sat_addr.s_net && from->sat_addr.s_node == iface->i_addr.sat_addr.s_node ) { return 0; } switch( *data++ ) { case DDPTYPE_RTMPRD : /* * Response and Data. */ if ( data + sizeof( struct rtmprdhdr ) > end ) { LOG(log_info, logtype_atalkd, "rtmp_packet no data header" ); return 1; } memcpy( &rh, data, sizeof( struct rtmprdhdr )); data += sizeof( struct rtmprdhdr ); /* check rh address against from address */ if ( rh.rh_nodelen != 8 ) { LOG(log_info, logtype_atalkd, "rtmp_packet bad node len (%d)", rh.rh_nodelen ); return 1; } if (( from->sat_addr.s_net != 0 && from->sat_addr.s_net != rh.rh_net ) || from->sat_addr.s_node != rh.rh_node ) { LOG(log_info, logtype_atalkd, "rtmp_packet address mismatch" ); return 1; } if (( iface->i_flags & ( IFACE_ADDR|IFACE_CONFIG )) == IFACE_ADDR ) { if ( iface->i_flags & IFACE_NOROUTER ) { /* remove addr to loopback route */ if ((cc = looproute( iface, RTMP_DEL )) < 0) { LOG(log_error, logtype_atalkd, "rtmp_packet: looproute"); return -1; } if (cc) LOG(log_error, logtype_atalkd, "rtmp_packet: can't remove loopback: %s", strerror(errno) ); iface->i_flags &= ~IFACE_NOROUTER; iface->i_time = 0; LOG(log_info, logtype_atalkd, "rtmp_packet router has become available" ); } if ( iface->i_flags & IFACE_PHASE1 ) { if (rtmp_config( &rh, iface ) < 0) { LOG(log_error, logtype_atalkd, "rtmp_packet: rtmp_config"); return -1; } } else if (zip_getnetinfo( iface ) < 0) { LOG(log_error, logtype_atalkd, "rtmp_packet: zip_getnetinfo"); return -1; } return 0; } if (( iface->i_flags & IFACE_CONFIG ) == 0 ) { return 0; } /* * Parse first tuple. For phase 2, verify that net is correct. */ if ( data + SZ_RTMPTUPLE > end ) { LOG(log_info, logtype_atalkd, "rtmp_packet missing first tuple" ); return 1; } memcpy( &rt, data, SZ_RTMPTUPLE ); data += SZ_RTMPTUPLE; if ( rt.rt_net == 0 ) { if ( rt.rt_dist != 0x82 ) { LOG(log_info, logtype_atalkd, "rtmp_packet bad phase 1 version" ); return 1; } /* * Grab the next tuple, since we don't want to pass the version * number to the parsing code. We're assuming that there are * no extended tuples in this packet. */ if ( data + SZ_RTMPTUPLE > end ) { LOG(log_info, logtype_atalkd, "rtmp_packet missing second tuple" ); return 1; } memcpy( &rt, data, SZ_RTMPTUPLE ); data += SZ_RTMPTUPLE; } else if ( rt.rt_dist & 0x80 ) { if ( data + SZ_RTMPTUPLE > end ) { LOG(log_info, logtype_atalkd, "rtmp_packet missing first range-end" ); return 1; } memcpy( &xrt, data, SZ_RTMPTUPLE ); data += SZ_RTMPTUPLE; if ( xrt.rt_dist != 0x82 ) { LOG(log_info, logtype_atalkd, "rtmp_packet bad phase 2 version" ); return 1; } /* * Check for net range conflict. */ if ( rt.rt_net != iface->i_rt->rt_firstnet || xrt.rt_net != iface->i_rt->rt_lastnet ) { LOG(log_info, logtype_atalkd, "rtmp_packet interface mismatch" ); return 1; } } else { #ifdef PHASE1NET /* * Gatorboxes put a net number in the first tuple, even on * phase 1 nets. This is wrong, but since we've got it, we * might just as well check it. if ( rt.rt_net != iface->i_rt->rt_firstnet || rt.rt_net != iface->i_rt->rt_lastnet ) { LOG(log_info, logtype_atalkd, "rtmp_packet phase 1 interface mismatch" ); return 1; } */ #else /* PHASE1NET */ LOG(log_info, logtype_atalkd, "rtmp_packet bad first tuple" ); return 1; #endif /* PHASE1NET */ } /* * Find gateway. */ for ( gate = iface->i_gate; gate; gate = gate->g_next ) { if ( gate->g_sat.sat_addr.s_net == from->sat_addr.s_net && gate->g_sat.sat_addr.s_node == from->sat_addr.s_node ) { break; } } if ( !gate ) { /* new gateway */ if (( gate = (struct gate *)malloc( sizeof( struct gate ))) == NULL ) { LOG(log_error, logtype_atalkd, "rtmp_packet: malloc: %s", strerror(errno) ); return -1; } gate->g_next = iface->i_gate; gate->g_prev = NULL; gate->g_rt = NULL; gate->g_iface = iface; /* need this? */ gate->g_sat = *from; if ( iface->i_gate ) { iface->i_gate->g_prev = gate; } iface->i_gate = gate; LOG(log_info, logtype_atalkd, "rtmp_packet gateway %u.%u up", ntohs( gate->g_sat.sat_addr.s_net ), gate->g_sat.sat_addr.s_node ); } /* * Reset the timeout on this gateway. We'll remove the gateway * entry, if the timeout gets to RTMPTAB_BAD. */ gate->g_state = RTMPTAB_GOOD; /* * Parse remaining tuples. */ for (;;) { /* * Is route on this gateway? */ for ( rtmp = gate->g_rt; rtmp; rtmp = rtmp->rt_next ) { if ( ntohs( rtmp->rt_firstnet ) <= ntohs( rt.rt_net ) && ntohs( rtmp->rt_lastnet ) >= ntohs( rt.rt_net )) { break; } if (( rt.rt_dist & 0x80 ) && ntohs( rtmp->rt_firstnet ) <= ntohs( xrt.rt_net ) && ntohs( rtmp->rt_lastnet ) >= ntohs( xrt.rt_net )) { break; } } if ( rtmp ) { /* found it */ /* * Check for range conflicts. (This is getting a little * ugly.) */ if ( rtmp->rt_firstnet != rt.rt_net ) { LOG(log_info, logtype_atalkd, "rtmp_packet firstnet mismatch %u!=%u", ntohs( rtmp->rt_firstnet ), ntohs( rt.rt_net )); return 1; } if ( rt.rt_dist & 0x80 ) { if (( rtmp->rt_flags & RTMPTAB_EXTENDED ) == 0 ) { LOG(log_info, logtype_atalkd, "rtmp_packet extended mismatch %u", ntohs( rtmp->rt_firstnet )); return 1; } if ( rtmp->rt_lastnet != xrt.rt_net ) { LOG(log_info, logtype_atalkd, "rtmp_packet lastnet mismatch %u!=%u", ntohs( rtmp->rt_lastnet ), ntohs( xrt.rt_net )); return 1; } } else { if ( rtmp->rt_flags & RTMPTAB_EXTENDED ) { LOG(log_info, logtype_atalkd, "rtmp_packet !extended mismatch %u", ntohs( rtmp->rt_firstnet )); return 1; } if ( rtmp->rt_lastnet != rt.rt_net ) { LOG(log_info, logtype_atalkd, "rtmp_packet lastnet mismatch %u!=%u", ntohs( rtmp->rt_lastnet ), ntohs( rt.rt_net )); return 1; } } rtmp->rt_state = RTMPTAB_GOOD; /* * Check hop count. If the count has changed, update * the routing database. */ if (( rtmp->rt_hops != ( rt.rt_dist & 0x7f ) + 1 ) && ( rtmp->rt_hops != RTMPHOPS_POISON || ( rt.rt_dist & 0x7f ) + 1 <= RTMPHOPS_MAX )) { if ( rtmp->rt_iprev ) { /* route is in use */ if ( rtmp->rt_hops > ( rt.rt_dist & 0x7f ) + 1 ) { /* * If this was POISON, we've deleted it from * the kernel. Add it back in. */ if ( rtmp->rt_hops == RTMPHOPS_POISON ) { gateroute( RTMP_ADD, rtmp ); } rtmp->rt_hops = ( rt.rt_dist & 0x7f ) + 1; } else { /* * Hop count has gone up for this route. * Search for a new best route. If we can't * find one, just keep this route. "poison" * route are deleted in as_timer(). */ if (( rt.rt_dist & 0x7f ) + 1 > RTMPHOPS_MAX ) { rtmp->rt_hops = RTMPHOPS_POISON; } else { rtmp->rt_hops = ( rt.rt_dist & 0x7f ) + 1; } if (rtmp_replace( rtmp ) < 0) { LOG(log_error, logtype_atalkd, "rtmp_packet: rtmp_replace"); return -1; } } } else { /* route not in use */ rtmp->rt_hops = ( rt.rt_dist & 0x7f ) + 1; if ( rtmp->rt_hops > ( rt.rt_dist & 0x7f ) + 1 ) { if (rtmp_new( rtmp ) < 0) { LOG(log_error, logtype_atalkd, "rtmp_packet: rtmp_new"); return -1; } } } } /* * Make the *next* node the head, since * we're not likely to be asked for the same tuple twice * in a row. */ if ( rtmp->rt_next != NULL ) { gate->g_rt->rt_prev->rt_next = gate->g_rt; gate->g_rt = rtmp->rt_next; rtmp->rt_next = NULL; } } else if (( rt.rt_dist & 0x7f ) + 1 > RTMPHOPS_MAX ) { LOG(log_info, logtype_atalkd, "rtmp_packet bad hop count from %u.%u for %u", ntohs( from->sat_addr.s_net ), from->sat_addr.s_node, ntohs( rt.rt_net )); } else { /* new for router */ if (( rtmp = newrt(iface)) == NULL ) { LOG(log_error, logtype_atalkd, "rtmp_packet: newrt: %s", strerror(errno) ); return -1; } rtmp->rt_firstnet = rt.rt_net; if ( rt.rt_dist & 0x80 ) { rtmp->rt_lastnet = xrt.rt_net; rtmp->rt_flags = RTMPTAB_EXTENDED; } else { rtmp->rt_lastnet = rt.rt_net; } rtmp->rt_hops = ( rt.rt_dist & 0x7f ) + 1; rtmp->rt_state = RTMPTAB_GOOD; rtmp->rt_gate = gate; /* * Add rtmptab entry to end of list (leave head alone). */ if ( gate->g_rt == NULL ) { rtmp->rt_prev = rtmp; gate->g_rt = rtmp; } else { rtmp->rt_prev = gate->g_rt->rt_prev; gate->g_rt->rt_prev->rt_next = rtmp; gate->g_rt->rt_prev = rtmp; } if (rtmp_new( rtmp ) < 0) { LOG(log_error, logtype_atalkd, "rtmp_packet: rtmp_new"); return -1; } } if ( data + SZ_RTMPTUPLE > end ) { break; } memcpy( &rt, data, SZ_RTMPTUPLE ); data += SZ_RTMPTUPLE; if ( rt.rt_dist & 0x80 ) { if ( data + SZ_RTMPTUPLE > end ) { LOG(log_info, logtype_atalkd, "rtmp_packet missing range-end" ); return 1; } memcpy( &xrt, data, SZ_RTMPTUPLE ); data += SZ_RTMPTUPLE; } } /* * Make sure we've processed the whole packet. */ if ( data != end ) { LOG(log_info, logtype_atalkd, "rtmp_packet length and count mismatch" ); } break; case DDPTYPE_RTMPR : /* * Request and RDR. */ if (((iface->i_flags & IFACE_ISROUTER) == 0) || iface->i_rt->rt_zt == NULL || ( iface->i_flags & IFACE_CONFIG ) == 0 ) { return 0; } if ( *data == 1 ) { data = packet; *data++ = DDPTYPE_RTMPRD; rh.rh_net = iface->i_addr.sat_addr.s_net; rh.rh_nodelen = 8; rh.rh_node = iface->i_addr.sat_addr.s_node; memcpy( data, &rh, sizeof( struct rtmp_head )); data += sizeof( struct rtmp_head ); if ( iface->i_flags & IFACE_PHASE2 ) { rt.rt_net = iface->i_rt->rt_firstnet; rt.rt_dist = 0x80; memcpy( data, &rt, SZ_RTMPTUPLE ); data += SZ_RTMPTUPLE; rt.rt_net = iface->i_rt->rt_lastnet; rt.rt_dist = 0x82; memcpy( data, &rt, SZ_RTMPTUPLE ); data += SZ_RTMPTUPLE; } if ( sendto( ap->ap_fd, packet, data - packet, 0, (struct sockaddr *)from, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "as_timer sendto: %s", strerror(errno) ); } } else if ( *data == 2 || *data == 3 ) { #ifdef DEBUG printf( "rtmp_packet rdr (%d) from %u.%u\n", *data, ntohs( from->sat_addr.s_net ), from->sat_addr.s_node ); #endif /* DEBUG */ } else { LOG(log_info, logtype_atalkd, "rtmp_packet unknown request from %u.%u", ntohs( from->sat_addr.s_net ), from->sat_addr.s_node ); } break; default : LOG(log_info, logtype_atalkd, "rtmp_packet bad ddp type from %u.%u", ntohs( from->sat_addr.s_net ), from->sat_addr.s_node ); return 0; } return 0; } int rtmp_request( struct interface *iface) { struct sockaddr_at sat; struct atport *ap; char *data, packet[ 2 ]; LOG(log_info, logtype_atalkd, "rtmp_request for %s", iface->i_name ); for ( ap = iface->i_ports; ap; ap = ap->ap_next ) { if ( ap->ap_packet == rtmp_packet ) { break; } } if ( ap == NULL ) { LOG(log_error, logtype_atalkd, "rtmp_request can't find rtmp socket!" ); return -1; } data = packet; *data++ = DDPTYPE_RTMPR; *data++ = RTMPROP_REQUEST; /* * There is a problem with the net zero "hint" hack. */ memset( &sat, 0, sizeof( struct sockaddr_at )); #ifdef BSD4_4 sat.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ sat.sat_family = AF_APPLETALK; sat.sat_addr.s_net = iface->i_addr.sat_addr.s_net; sat.sat_addr.s_node = ATADDR_BCAST; sat.sat_port = ap->ap_port; if ( sendto( ap->ap_fd, packet, data - packet, 0, (struct sockaddr *)&sat, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "rtmp_request sendto: %s", strerror(errno) ); return -1; } return 0; } int looproute(struct interface *iface, unsigned int cmd) { struct sockaddr_at dst, loop; if ( cmd == RTMP_DEL && ( iface->i_flags & IFACE_LOOP ) == 0 ) { LOG(log_error, logtype_atalkd, "looproute panic no route" ); return -1; } if ( cmd == RTMP_ADD && ( iface->i_flags & IFACE_LOOP )) { LOG(log_error, logtype_atalkd, "looproute panic two routes" ); return -1; } memset( &dst, 0, sizeof( struct sockaddr_at )); #ifdef BSD4_4 dst.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ dst.sat_family = AF_APPLETALK; dst.sat_addr.s_net = iface->i_addr.sat_addr.s_net; dst.sat_addr.s_node = iface->i_addr.sat_addr.s_node; memset( &loop, 0, sizeof( struct sockaddr_at )); #ifdef BSD4_4 loop.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ loop.sat_family = AF_APPLETALK; loop.sat_addr.s_net = htons( ATADDR_ANYNET ); loop.sat_addr.s_node = ATADDR_ANYNODE; #ifndef BSD4_4 if ( route( cmd, (struct sockaddr *) &dst, (struct sockaddr *) &loop, RTF_UP | RTF_HOST ) ) { return( 1 ); } #else /* ! BSD4_4 */ if ( route( cmd, (struct sockaddr_at *) &dst, (struct sockaddr_at *) &loop, RTF_UP | RTF_HOST ) ) { return ( 1); } #endif /* BSD4_4 */ if ( cmd == RTMP_ADD ) { iface->i_flags |= IFACE_LOOP; } if ( cmd == RTMP_DEL ) { iface->i_flags &= ~IFACE_LOOP; } return( 0 ); } int gateroute(unsigned int command, struct rtmptab *rtmp) { struct sockaddr_at dst, gate; unsigned short net; if ( command == RTMP_DEL && ( rtmp->rt_flags & RTMPTAB_ROUTE ) == 0 ) { return( -1 ); } if ( command == RTMP_ADD && ( rtmp->rt_flags & RTMPTAB_ROUTE )) { return( -1 ); } net = ntohs( rtmp->rt_firstnet ); /* * Since we will accept routes from gateways who advertise their * address as 0.YY, we must munge the gateway address we give to * the kernel. Otherwise, we'll get a bunch of routes to the loop * back interface, and who wants that? */ memset( &gate, 0, sizeof( struct sockaddr_at )); #ifdef BSD4_4 gate.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ gate.sat_family = AF_APPLETALK; gate.sat_addr.s_net = rtmp->rt_gate->g_sat.sat_addr.s_net; gate.sat_addr.s_node = rtmp->rt_gate->g_sat.sat_addr.s_node; if ( gate.sat_addr.s_net == 0 ) { gate.sat_addr.s_net = net; } memset( &dst, 0, sizeof( struct sockaddr_at )); #ifdef BSD4_4 dst.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ dst.sat_family = AF_APPLETALK; dst.sat_addr.s_node = ATADDR_ANYNODE; do { dst.sat_addr.s_net = htons( net ); #ifndef BSD4_4 if ( route( command, (struct sockaddr *) &dst, (struct sockaddr *) &gate, RTF_UP | RTF_GATEWAY )) { LOG(log_error, logtype_atalkd, "route: %u -> %u.%u: %s", net, ntohs( gate.sat_addr.s_net ), gate.sat_addr.s_node, strerror(errno) ); continue; } #else /* ! BSD4_4 */ if ( route( command, (struct sockaddr_at *) &dst, (struct sockaddr_at *) &gate, RTF_UP | RTF_GATEWAY )) { LOG(log_error, logtype_atalkd, "route: %u -> %u.%u: %s", net, ntohs( gate.sat_addr.s_net ), gate.sat_addr.s_node, strerror(errno) ); continue; } #endif /* ! BSD4_4 */ } while ( net++ < ntohs( rtmp->rt_lastnet )); if ( command == RTMP_ADD ) { rtmp->rt_flags |= RTMPTAB_ROUTE; } if ( command == RTMP_DEL ) { rtmp->rt_flags &= ~RTMPTAB_ROUTE; } return( 0 ); } struct rtmptab * newrt(const struct interface *iface) { struct rtmptab *rtmp; if (( rtmp = (struct rtmptab *)calloc(1, sizeof(struct rtmptab))) == NULL ) { return( NULL ); } rtmp->rt_iface = iface; return( rtmp ); } netatalk-2.2.2/etc/atalkd/aep.c0000644000175200017500000000175311655731126013204 00000000000000/* * $Id: aep.c,v 1.9 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include "atserv.h" int aep_packet( struct atport *ap, struct sockaddr_at *from, char *data, int len) { char *end; end = data + len; if ( data + 2 > end || *data != DDPTYPE_AEP || *( data + 1 ) != AEPOP_REQUEST ) { LOG(log_info, logtype_atalkd, "aep_packet malformed packet" ); return 1; } *( data + 1 ) = AEPOP_REPLY; if ( sendto( ap->ap_fd, data, len, 0, (struct sockaddr *)from, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "aep sendto: %s", strerror(errno) ); return 1; } return 0; } netatalk-2.2.2/etc/atalkd/main.c0000644000175200017500000012360511655731126013364 00000000000000/* * $Id: main.c,v 1.25 2009-12-13 02:21:47 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include /* POSIX.1 check */ #include #ifdef HAVE_SYS_WAIT_H #include #endif /* HAVE_SYS_WAIT_H */ #ifndef WEXITSTATUS #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif /* ! WEXITSTATUS */ #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif /* ! WIFEXITED */ #ifndef WIFSTOPPED #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) #endif #include #ifdef TRU64 #include #include #endif /* TRU64 */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef __svr4__ #include #include #endif /* __svr4__ */ #include "interface.h" #include "gate.h" #include "list.h" #include "rtmp.h" #include "zip.h" #include "nbp.h" #include "atserv.h" #include "main.h" /* Forward Declarations */ int ifconfig(const char *iname, unsigned long cmd, struct sockaddr_at *sa); /* FIXME/SOCKLEN_T: socklen_t is a unix98 feature */ #ifndef SOCKLEN_T #define SOCKLEN_T unsigned int #endif /* SOCKLEN_T */ #ifndef WEXITSTATUS #define WEXITSTATUS(x) ((x).w_retcode) #endif /* WEXITSTATUS */ /* linux has a special ioctl for appletalk device destruction. as of * 2.1.57, SIOCDIFADDR works w/ linux. okay, we need to deal with the * fact that SIOCDIFADDR may be defined on linux despite the fact that * it doesn't work. */ #if !defined(SIOCDIFADDR) && defined(SIOCATALKDIFADDR) #define SIOCDIFADDR SIOCATALKDIFADDR #endif #define elements(a) (sizeof(a)/sizeof((a)[0])) #define PKTSZ 1024 extern int aep_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len); int rtfd; int transition = 0; int stabletimer, newrtmpdata = 0; static struct atserv atserv[] = { { "rtmp", 1, rtmp_packet }, /* 0 */ { "nbp", 2, nbp_packet }, /* 1 */ { "echo", 4, aep_packet }, /* 2 */ { "zip", 6, zip_packet }, /* 3 */ }; static int atservNATSERV = elements( atserv ); struct interface *interfaces = NULL, *ciface = NULL; static int debug = 0, quiet = 0, chatty = 0; static char *configfile = NULL; static int ziptimeout = 0; static int stable = 0, noparent = 0; static int ninterfaces; static int defphase = IFACE_PHASE2; static int nfds = 0; static fd_set fds; static char Packet[ PKTSZ ]; static char *version = VERSION; static char *pidfile = _PATH_ATALKDLOCK; /* from config.c */ int readconf( char * ); int getifconf( void ); int writeconf( char * ); /* this is the messiest of the bunch as atalkd can exit pretty much * everywhere. we delete interfaces here instead of in as_down. */ static void atalkd_exit(const int i) { #ifdef SIOCDIFADDR struct interface *iface; for (iface = interfaces; iface; iface = iface->i_next) { if (ifconfig( iface->i_name, SIOCDIFADDR, &iface->i_addr)) { #ifdef SIOCATALKDIFADDR #if (SIOCDIFADDR != SIOCATALKDIFADDR) if (!ifconfig(iface->i_name, SIOCATALKDIFADDR, &iface->i_addr)) continue; #endif /* SIOCDIFADDR != SIOCATALKDIFADDR */ #endif /* SIOCATALKIFADDR */ LOG(log_error, logtype_atalkd, "difaddr(%u.%u): %s", ntohs(iface->i_addr.sat_addr.s_net), iface->i_addr.sat_addr.s_node, strerror(errno)); } #ifdef linux if (!(iface->i_flags & IFACE_WASALLMULTI) && (iface->i_flags & IFACE_ALLMULTI)) ifsetallmulti(iface->i_name, 0); #endif /* linux */ } #endif /* SOPCDOFADDR */ server_unlock(pidfile); exit(i); } /* XXX need better error handling for gone interfaces, delete routes and so on * moreover there's no way to put an interface back short of restarting atalkd * thus after the first time, silently fail */ static ssize_t sendto_iface(struct interface *iface, int sockfd, const void *buf, size_t len, const struct sockaddr_at *dest_addr) { ssize_t ret = sendto( sockfd, buf, len, 0, (struct sockaddr *)dest_addr, sizeof( struct sockaddr_at )); if (ret < 0 ) { if (!(iface->i_flags & IFACE_ERROR)) { LOG(log_error, logtype_atalkd, "as_timer sendto %u.%u (%u): %s", ntohs( dest_addr->sat_addr.s_net ), dest_addr->sat_addr.s_node, ntohs( iface->i_rt->rt_firstnet ), strerror(errno) ); } iface->i_flags |= IFACE_ERROR; } else { iface->i_flags &= ~IFACE_ERROR; } return ret; } static void as_timer(int sig _U_) { struct sockaddr_at sat; struct ziphdr zh; struct rtmp_head rh; struct rtmp_tuple rt; struct atport *ap, *zap, *rap; struct interface *iface, *iface2; struct gate *gate, *fgate = NULL; struct rtmptab *rtmp, *frtmp; struct ziptab *zt; char *data, *end, packet[ ATP_BUFSIZ ]; int sentzipq = 0; int n, cc; ap=zap=rap=NULL; memset(&sat, 0, sizeof( struct sockaddr_at )); for ( iface = interfaces; iface; iface = iface->i_next ) { if ( iface->i_flags & IFACE_LOOPBACK ) { continue; } for ( ap = iface->i_ports; ap; ap = ap->ap_next ) { if ( ap->ap_packet == zip_packet ) { zap = ap; } if ( ap->ap_packet == rtmp_packet ) { rap = ap; } } if (( iface->i_flags & ( IFACE_ADDR|IFACE_CONFIG|IFACE_NOROUTER )) == IFACE_ADDR ) { if ( iface->i_time < 3 ) { if ( iface->i_flags & IFACE_PHASE1 ) { if (rtmp_request( iface ) < 0) { LOG(log_error, logtype_atalkd, "rtmp_request: %s", strerror(errno)); atalkd_exit(1); } newrtmpdata = 1; } else { if (zip_getnetinfo( iface ) < 0) { LOG(log_error, logtype_atalkd, "zip_getnetinfo: %s", strerror(errno)); atalkd_exit(1); } sentzipq = 1; } iface->i_time++; } else { iface->i_flags |= IFACE_NOROUTER; if ((iface->i_flags & IFACE_ISROUTER)) { if (( iface->i_flags & IFACE_SEED ) == 0 ) { /* * No seed info, and we've got multiple interfaces. * Wait forever. */ LOG(log_info, logtype_atalkd, "as_timer multiple interfaces, no seed" ); LOG(log_info, logtype_atalkd, "as_timer can't configure %s", iface->i_name ); LOG(log_info, logtype_atalkd, "as_timer waiting for router" ); iface->i_time = 0; continue; } else { /* * Complete configuration for iface, and boot next * interface. */ iface->i_flags |= IFACE_CONFIG; for ( zt = iface->i_czt; zt; zt = zt->zt_next ) { if (addzone( iface->i_rt, zt->zt_len, zt->zt_name) < 0) { LOG(log_error, logtype_atalkd, "addzone: %s", strerror(errno)); atalkd_exit(1); } } if ( iface->i_rt->rt_zt ) { iface->i_rt->rt_flags &= ~RTMPTAB_ZIPQUERY; iface->i_rt->rt_flags |= RTMPTAB_HASZONES; } if ( iface->i_flags & IFACE_PHASE1 ) { LOG(log_info, logtype_atalkd, "as_timer configured %s phase 1 from seed", iface->i_name ); setaddr( iface, IFACE_PHASE1, iface->i_caddr.sat_addr.s_net, iface->i_addr.sat_addr.s_node, iface->i_caddr.sat_addr.s_net, iface->i_caddr.sat_addr.s_net ); } else { LOG(log_info, logtype_atalkd, "as_timer configured %s phase 2 from seed", iface->i_name ); } if ( looproute( iface, RTMP_ADD )) { /* -1 or 1 */ LOG(log_error, logtype_atalkd, "as_timer: can't route %u.%u to loop: %s", ntohs( iface->i_addr.sat_addr.s_net ), iface->i_addr.sat_addr.s_node, strerror(errno) ); atalkd_exit( 1 ); } if ( iface == ciface ) { ciface = ciface->i_next; bootaddr( ciface ); } } } else { /* * Configure for no router operation. Wait for a route * to become available in rtmp_packet(). */ LOG(log_info, logtype_atalkd, "config for no router" ); if ( iface->i_flags & IFACE_PHASE2 ) { iface->i_rt->rt_firstnet = 0; iface->i_rt->rt_lastnet = htons( STARTUP_LASTNET ); setaddr( iface, IFACE_PHASE2, iface->i_addr.sat_addr.s_net, iface->i_addr.sat_addr.s_node, 0, htons( STARTUP_LASTNET )); } if ( looproute( iface, RTMP_ADD ) ) { /* -1 or 1 */ LOG(log_error, logtype_atalkd, "as_timer: can't route %u.%u to loopback: %s", ntohs( iface->i_addr.sat_addr.s_net ), iface->i_addr.sat_addr.s_node, strerror(errno) ); atalkd_exit( 1 ); } if ( iface == ciface ) { ciface = ciface->i_next; bootaddr( ciface ); } } } } for ( gate = iface->i_gate; gate; gate = gate->g_next ) { if ( fgate ) { free( (caddr_t)fgate ); fgate = NULL; } n = 0; data = packet + 1 + sizeof( struct ziphdr ); end = packet + sizeof( packet ); sat = gate->g_sat; sat.sat_port = zap->ap_port; /* * Perform timeouts on routers. If we've only got one * interface, we'll use these timeouts to decide that * our zone has gone away. */ if ( ++gate->g_state >= RTMPTAB_BAD ) { LOG(log_info, logtype_atalkd, "as_timer gateway %u.%u down", ntohs( gate->g_sat.sat_addr.s_net ), gate->g_sat.sat_addr.s_node ); rtmp = gate->g_rt; while ( rtmp ) { frtmp = rtmp->rt_next; if ( rtmp->rt_hops == RTMPHOPS_POISON || rtmp->rt_iprev == NULL ) { rtmp_free( rtmp ); } else { rtmp->rt_hops = RTMPHOPS_POISON; if ((cc = rtmp_replace( rtmp )) < 0) { LOG(log_error, logtype_atalkd, "rtmp_replace: %s", strerror(errno)); atalkd_exit(1); } if (cc) { gate->g_state = rtmp->rt_state = RTMPTAB_GOOD; } } rtmp = frtmp; } if ( gate->g_rt == NULL ) { if ( gate->g_prev == NULL ) { gate->g_iface->i_gate = gate->g_next; } else { gate->g_prev->g_next = gate->g_next; } if ( gate->g_next != NULL ) { gate->g_next->g_prev = gate->g_prev; } fgate = gate; /* can't free here, just mark it */ } /* * If this is the last router on the only interface, * reconfigure our netrange. By marking the interface * as having no router, we will notice when a router * comes back up. * * XXX: actually, we always reconfigure an interface * if we're not a seed router. */ if ( gate->g_iface->i_gate == NULL && ((iface->i_flags & IFACE_SEED) == 0)) { gate->g_iface->i_flags |= IFACE_NOROUTER; gate->g_iface->i_flags &= ~IFACE_CONFIG; /* get rid of any zones associated with this iface */ if (gate->g_iface->i_rt->rt_zt) { rtmp_delzonemap(gate->g_iface->i_rt); gate->g_iface->i_rt->rt_flags &= ~RTMPTAB_HASZONES; } LOG(log_info, logtype_atalkd, "as_timer last gateway down" ); /* Set netrange to 0-fffe. */ if ( gate->g_iface->i_flags & IFACE_PHASE2 ) { gate->g_iface->i_rt->rt_firstnet = 0; gate->g_iface->i_rt->rt_lastnet = htons( STARTUP_LASTNET ); setaddr( iface, IFACE_PHASE2, iface->i_addr.sat_addr.s_net, iface->i_addr.sat_addr.s_node, 0, htons( STARTUP_LASTNET )); } } continue; } /* * If we don't have a zone for our interface yet, ask for * it from any router (all routers) on the interface. */ if (( iface->i_rt->rt_flags & RTMPTAB_HASZONES ) == 0 ) { iface->i_rt->rt_flags |= RTMPTAB_ZIPQUERY; memcpy( data, &iface->i_rt->rt_firstnet, sizeof( u_short )); data += sizeof( u_short ); n++; } rtmp = gate->g_rt; while ( rtmp ) { /* * Delete old routing tuples. */ if ( rtmp->rt_state != RTMPTAB_PERM ) { rtmp->rt_state++; } /* * We've not been updated for this route in a while. If * it's not in use, go ahead and remove it. If it is in * use, mark the route as down (POISON), and look for a * better route. If one is found, delete this route and use * the new one. If it's not found, mark the route as GOOD * (so we'll propogate our poison) and delete it the next * time it becomes BAD. */ if ( rtmp->rt_state >= RTMPTAB_BAD ) { frtmp = rtmp->rt_next; if ( rtmp->rt_iprev == NULL ) { /* not in use */ rtmp_free( rtmp ); } else { /* in use */ if ( rtmp->rt_hops == RTMPHOPS_POISON ) { rtmp_free( rtmp ); } else { rtmp->rt_hops = RTMPHOPS_POISON; if ((cc = rtmp_replace( rtmp )) < 0) { LOG(log_error, logtype_atalkd, "rtmp_replace: %s", strerror(errno)); atalkd_exit(1); } if (cc) rtmp->rt_state = RTMPTAB_GOOD; } } rtmp = frtmp; continue; } /* * Do ZIP lookups. */ if ( rtmp->rt_iprev && ( rtmp->rt_flags & RTMPTAB_HASZONES ) == 0 ) { if ( data + sizeof( u_short ) > end || n == 255 ) { /* send what we've got */ zh.zh_op = ZIPOP_QUERY; zh.zh_count = n; cc = data - packet; data = packet; *data++ = DDPTYPE_ZIP; memcpy( data, &zh, sizeof( struct ziphdr )); sendto_iface(iface, zap->ap_fd, packet, cc, &sat); sentzipq = 1; n = 0; data = packet + 1 + sizeof( struct ziphdr ); end = packet + sizeof( packet ); } /* * rt_nzq is number of ZIP Queries we've issued for a * given netrange. If we've got ziptimeout on, we * will only ask 3 times for any given netrange. * Interestingly enough, since rt_nzq is a u_char, * it will overflow after a while. This means we will * periodically ask for nets that we've decided not to * ask about, and warn that we can't get it's zone. */ if ( rtmp->rt_nzq++ == 3 ) { LOG(log_info, logtype_atalkd, "as_timer can't get zone for %u", ntohs( rtmp->rt_firstnet )); } if ( rtmp->rt_nzq > 3 ) { if ( ziptimeout ) { rtmp = rtmp->rt_next; continue; } } else { sentzipq = 1; } rtmp->rt_flags |= RTMPTAB_ZIPQUERY; memcpy( data, &rtmp->rt_firstnet, sizeof( u_short )); data += sizeof( u_short ); n++; } rtmp = rtmp->rt_next; } /* send what we've got */ if ( n > 0 ) { zh.zh_op = ZIPOP_QUERY; zh.zh_count = n; cc = data - packet; data = packet; *data++ = DDPTYPE_ZIP; memcpy( data, &zh, sizeof( struct ziphdr )); sendto_iface( iface, zap->ap_fd, packet, cc, &sat); } } if ( fgate ) { free( (caddr_t)fgate ); fgate = NULL; } /* * Send RTMP broadcasts if we have multiple interfaces or our * interface is configured as a router. */ if ((iface->i_flags & IFACE_ISROUTER)) { #ifdef BSD4_4 sat.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ sat.sat_family = AF_APPLETALK; sat.sat_addr.s_net = ATADDR_ANYNET; sat.sat_addr.s_node = ATADDR_BCAST; sat.sat_port = rap->ap_port; data = packet; end = data + sizeof( packet ); *data++ = DDPTYPE_RTMPRD; rh.rh_net = iface->i_addr.sat_addr.s_net; rh.rh_nodelen = 8; rh.rh_node = iface->i_addr.sat_addr.s_node; memcpy( data, &rh, sizeof( struct rtmp_head )); data += sizeof( struct rtmp_head ); n = 0; if ( iface->i_flags & IFACE_PHASE1 ) { rt.rt_net = 0; rt.rt_dist = 0x82; memcpy( data, &rt, SZ_RTMPTUPLE ); data += SZ_RTMPTUPLE; } else { rt.rt_net = iface->i_rt->rt_firstnet; rt.rt_dist = 0x80; memcpy( data, &rt, SZ_RTMPTUPLE ); data += SZ_RTMPTUPLE; rt.rt_net = iface->i_rt->rt_lastnet; rt.rt_dist = 0x82; memcpy( data, &rt, SZ_RTMPTUPLE ); data += SZ_RTMPTUPLE; } for ( iface2 = interfaces; iface2; iface2 = iface2->i_next ) { /* XXX: there used to be a bit checking against iface == iface2. also, we don't want to send an rtmp broadcast to an interface that doesn't want it. */ if ((( iface2->i_flags & IFACE_CONFIG ) == 0) || ((iface2->i_flags & IFACE_ISROUTER) == 0)) { continue; } /* * Fill in tuples. Always send the same thing, regardless * of the phase of the destination. Routers who don't * understand extended rtmp packets will toss extended * tuples because their distance will have the high bit set. */ for ( rtmp = iface2->i_rt; rtmp; rtmp = rtmp->rt_inext ) { /* don't broadcast routes we have no zone for */ if ( rtmp->rt_zt == NULL || ( rtmp->rt_flags & RTMPTAB_ZIPQUERY ) || ( rtmp->rt_flags & RTMPTAB_HASZONES ) == 0 ) { continue; } /* split horizon */ if (rtmp->rt_iface == iface) { continue; } if ((( rtmp->rt_flags & RTMPTAB_EXTENDED ) && data + 2 * SZ_RTMPTUPLE > end ) || data + SZ_RTMPTUPLE > end ) { sendto_iface(iface,rap->ap_fd, packet, data - packet, &sat); if ( iface->i_flags & IFACE_PHASE2 ) { data = packet + 1 + sizeof( struct rtmp_head ) + 2 * SZ_RTMPTUPLE; } else { data = packet + 1 + sizeof( struct rtmp_head ) + SZ_RTMPTUPLE; } n = 0; } rt.rt_net = rtmp->rt_firstnet; rt.rt_dist = rtmp->rt_hops; if ( rtmp->rt_flags & RTMPTAB_EXTENDED ) { rt.rt_dist |= 0x80; } memcpy( data, &rt, SZ_RTMPTUPLE ); data += SZ_RTMPTUPLE; if ( rtmp->rt_flags & RTMPTAB_EXTENDED ) { rt.rt_net = rtmp->rt_lastnet; rt.rt_dist = 0x82; memcpy( data, &rt, SZ_RTMPTUPLE ); data += SZ_RTMPTUPLE; } n++; } } /* send rest */ if ( n ) { sendto_iface(iface, rap->ap_fd, packet, data - packet, &sat); } } } /* * Check if we're stable. Each time we configure an interface, we * sent stabletimer to UNSTABLE. If stabletimer ever gets to * STABLEANYWAY, we give up and decide to "be" stable anyway. * Normally, we wait for stabletimer get <= STABLE with no new rtmp * data and all zip data complete. */ if ( !stable ) { if ( stabletimer <= STABLE && !newrtmpdata && !sentzipq ) { /* write out config file */ stable = 1; writeconf( configfile ); } else { if ( stabletimer-- <= STABLEANYWAY ) { stable = 1; } } newrtmpdata = 0; if ( stable && !noparent ) { noparent = 1; LOG(log_info, logtype_atalkd, "ready %d/%d/%d", stabletimer, newrtmpdata, sentzipq ); if ( !debug ) { /* * Seems like we could get here more than once... */ if ( kill( getpid(), SIGSTOP ) < 0 ) { LOG(log_error, logtype_atalkd, "as_timer: kill-self failed!" ); atalkd_exit( 1 ); } } } } #ifdef DEBUG consistency(); #endif /* DEBUG */ } #ifdef DEBUG /* * Consistency check... */ consistency() { struct rtmptab *rtmp; struct list *lr, *lz; struct ziptab *zt; for ( zt = ziptab; zt; zt = zt->zt_next ) { for ( lr = zt->zt_rt; lr; lr = lr->l_next ) { rtmp = (struct rtmptab *)lr->l_data; if ( rtmp->rt_iprev == 0 && rtmp->rt_gate != 0 ) { LOG(log_error, logtype_atalkd, "%.*s has %u-%u (unused)", zt->zt_len, zt->zt_name, ntohs( rtmp->rt_firstnet ), ntohs( rtmp->rt_lastnet )); atalkd_exit(1); } for ( lz = rtmp->rt_zt; lz; lz = lz->l_next ) { if ( zt == (struct ziptab *)lz->l_data ) { break; } } if ( lz == 0 ) { LOG(log_error, logtype_atalkd, "no map from %u-%u to %.*s", ntohs( rtmp->rt_firstnet ), ntohs( rtmp->rt_lastnet ), zt->zt_len, zt->zt_name ); atalkd_exit(1); } } } } #endif /* DEBUG */ static void as_debug(int sig _U_) { struct interface *iface; struct list *l; struct ziptab *zt; struct gate *gate; struct rtmptab *rt; FILE *rtmpdebug; if (( rtmpdebug = fopen( _PATH_ATALKDEBUG, "w" )) == NULL ) { LOG(log_error, logtype_atalkd, "rtmp: %s", strerror(errno) ); } for ( iface = interfaces; iface; iface = iface->i_next ) { fprintf( rtmpdebug, "interface %s %u.%u ", iface->i_name, ntohs( iface->i_addr.sat_addr.s_net ), iface->i_addr.sat_addr.s_node ); if ( iface->i_flags & IFACE_PHASE1 ) { putc( '1', rtmpdebug ); } if ( iface->i_flags & IFACE_PHASE2 ) { putc( '2', rtmpdebug ); } if ( iface->i_flags & IFACE_RSEED ) { putc( 'R', rtmpdebug ); } if ( iface->i_flags & IFACE_SEED ) { putc( 'S', rtmpdebug ); } if ( iface->i_flags & IFACE_DONTROUTE ) { putc( 'D', rtmpdebug ); } if ( iface->i_flags & IFACE_ADDR ) { putc( 'A', rtmpdebug ); } if ( iface->i_flags & IFACE_CONFIG ) { putc( 'C', rtmpdebug ); } if ( iface->i_flags & IFACE_NOROUTER ) { putc( 'N', rtmpdebug ); } if ( iface->i_flags & IFACE_LOOP ) { putc( 'L', rtmpdebug ); } putc( '\n', rtmpdebug ); if ( iface->i_rt ) { fprintf( rtmpdebug, "\t%u-%u ", ntohs( iface->i_rt->rt_firstnet ), ntohs( iface->i_rt->rt_lastnet )); if ( iface->i_rt->rt_flags & RTMPTAB_ZIPQUERY ) { putc( 'q', rtmpdebug ); } if ( iface->i_rt->rt_flags & RTMPTAB_HASZONES ) { putc( 'z', rtmpdebug ); } if ( iface->i_rt->rt_flags & RTMPTAB_EXTENDED ) { putc( 'x', rtmpdebug ); } putc( 'i', rtmpdebug ); for ( l = iface->i_rt->rt_zt; l; l = l->l_next ) { zt = (struct ziptab *)l->l_data; fprintf( rtmpdebug, " '%.*s'", zt->zt_len, zt->zt_name ); } fprintf( rtmpdebug, "\n" ); } for ( gate = iface->i_gate; gate; gate = gate->g_next ) { fprintf( rtmpdebug, "gate %u.%u %X\n", ntohs( gate->g_sat.sat_addr.s_net ), gate->g_sat.sat_addr.s_node, gate->g_state ); for ( rt = gate->g_rt; rt; rt = rt->rt_next ) { fprintf( rtmpdebug, "\t%u-%u ", ntohs( rt->rt_firstnet ), ntohs( rt->rt_lastnet )); if ( rt->rt_flags & RTMPTAB_ZIPQUERY ) { putc( 'q', rtmpdebug ); } if ( rt->rt_flags & RTMPTAB_HASZONES ) { putc( 'z', rtmpdebug ); } if ( rt->rt_flags & RTMPTAB_EXTENDED ) { putc( 'x', rtmpdebug ); } if ( rt->rt_iprev ) { putc( 'i', rtmpdebug ); } for ( l = rt->rt_zt; l; l = l->l_next ) { zt = (struct ziptab *)l->l_data; fprintf( rtmpdebug, " '%.*s'", zt->zt_len, zt->zt_name ); } fprintf( rtmpdebug, "\n" ); } } } fclose( rtmpdebug ); } /* * Called when SIGTERM is recieved. Remove all routes and then exit. */ static void as_down(int sig _U_) { struct interface *iface; struct gate *gate; struct rtmptab *rt; for ( iface = interfaces; iface; iface = iface->i_next ) { for ( gate = iface->i_gate; gate; gate = gate->g_next ) { for ( rt = gate->g_rt; rt; rt = rt->rt_next ) { if ( rt->rt_iprev ) { if ( gateroute( RTMP_DEL, rt ) < 0 ) { LOG(log_error, logtype_atalkd, "as_down remove %u-%u failed: %s", ntohs( rt->rt_firstnet ), ntohs( rt->rt_lastnet ), strerror(errno) ); } } } } if ( iface->i_flags & IFACE_LOOP ) { if (looproute( iface, RTMP_DEL )) { LOG(log_error, logtype_atalkd, "as_down remove %s %u.%u failed: %s", iface->i_name, ntohs( iface->i_addr.sat_addr.s_net ), iface->i_addr.sat_addr.s_node, strerror(errno) ); } } } LOG(log_info, logtype_atalkd, "done" ); atalkd_exit( 0 ); } int main( int ac, char **av) { extern char *optarg; extern int optind; struct sockaddr_at sat; struct sigaction sv; struct itimerval it; sigset_t signal_set, old_set; struct interface *iface; int status; struct atport *ap; fd_set readfds; int i, c; SOCKLEN_T fromlen; char *prog; while (( c = getopt( ac, av, "12qsdtf:P:v" )) != EOF ) { switch ( c ) { case '1' : defphase = IFACE_PHASE1; break; case '2' : defphase = IFACE_PHASE2; break; case 'd' : debug++; break; case 'f' : configfile = optarg; break; case 'q' : /* don't seed */ quiet++; break; case 's' : /* seed */ chatty++; break; case 't' : /* transition */ transition++; break; case 'P' : /* pid file */ pidfile = optarg; break; case 'v' : /* version */ printf( "atalkd (version %s)\n", version ); exit ( 1 ); break; default : fprintf( stderr, "Unknown option -- '%c'\n", c ); exit( 1 ); } } if ( optind != ac ) { fprintf( stderr, "Too many arguments.\n" ); exit( 1 ); } if (( prog = strrchr( av[ 0 ], '/' )) == NULL ) { prog = av[ 0 ]; } else { prog++; } /* * Configure loop back address first, so appearances of "lo0" in * the config file fail. Also insures that lo0 gets configured, * even if there's some hangup during configuration of some * other interface. */ if (( interfaces = newiface( LOOPIFACE )) == NULL ) { perror( "newiface" ); exit( 1 ); } interfaces->i_flags |= IFACE_PHASE2 | IFACE_LOOPBACK; /* * Check our initial configuration before we fork. This way we can * complain about syntax errors on stdout. * * Basically, if we're going to read our config file, we should read * it and initialize our data structures. If we're not going to read * our config file, use GIFCONF to initialize our data structures. */ if ( readconf( configfile ) < 0 && getifconf() < 0 ) { fprintf( stderr, "%s: can't get interfaces, exiting.\n", prog ); exit( 1 ); } /* we need to count up our interfaces so that we can simplify things * later. we also need to figure out if we have more than one interface * that is routing. */ for (i = 0, ninterfaces = 0, iface = interfaces; iface; iface=iface->i_next) { if (iface->i_flags & IFACE_DONTROUTE) i++; ninterfaces++; } i = ninterfaces - i; /* number of routable interfaces */ /* * At this point, we have (at least partially) initialized data * structures. Fill in what we can and verify that nothing is obviously * broken. */ for (iface = interfaces; iface; iface = iface->i_next) { /* Apply the default phase */ if (( iface->i_flags & IFACE_PHASE1 ) == 0 && ( iface->i_flags & IFACE_PHASE2 ) == 0 ) { iface->i_flags |= defphase; } /* set up router flag information. if we have multiple interfaces * and DONTROUTE isn't set, set up ROUTER. i is the number of * interfaces that don't have the DONTROUTE flag set. */ if ((i > IFBASE) && ((iface->i_flags & IFACE_DONTROUTE) == 0)) { iface->i_flags |= IFACE_ISROUTER; } /* Set default addresses */ if ( iface->i_rt == NULL ) { if (( iface->i_rt = newrt(iface)) == NULL ) { perror( "newrt" ); exit( 1 ); } if ( iface->i_flags & IFACE_PHASE1 ) { iface->i_rt->rt_firstnet = iface->i_rt->rt_lastnet = iface->i_caddr.sat_addr.s_net; } else { if ( iface->i_caddr.sat_addr.s_net != ATADDR_ANYNET || ( iface->i_flags & IFACE_LOOPBACK )) { iface->i_rt->rt_firstnet = iface->i_rt->rt_lastnet = iface->i_caddr.sat_addr.s_net; } else { iface->i_rt->rt_firstnet = htons( STARTUP_FIRSTNET ); iface->i_rt->rt_lastnet = htons( STARTUP_LASTNET ); } } } if (( iface->i_flags & IFACE_PHASE1 ) == 0 ) { iface->i_rt->rt_flags |= RTMPTAB_EXTENDED; } if ( iface->i_caddr.sat_addr.s_net == ATADDR_ANYNET ) { iface->i_caddr.sat_addr.s_net = iface->i_rt->rt_firstnet; } if ( debug ) { dumpconfig( iface ); /* probably needs args */ } } /* * A little consistency check... */ if ( ninterfaces < IFBASE ) { fprintf( stderr, "%s: zero interfaces, exiting.\n", prog ); exit( 1 ); } /* * Set process name for logging */ set_processname("atalkd"); /* do this here so that we can use ifconfig */ #ifdef __svr4__ if ( plumb() < 0 ) { fprintf(stderr, "can't establish STREAMS plumbing, exiting.\n" ); atalkd_exit( 1 ); } #endif /* __svr4__ */ /* delete pre-existing interface addresses. */ #ifdef SIOCDIFADDR for (iface = interfaces; iface; iface = iface->i_next) { if (ifconfig(iface->i_name, SIOCDIFADDR, &iface->i_addr)) { #ifdef SIOCATALKDIFADDR #if (SIOCDIFADDR != SIOCATALKDIFADDR) ifconfig(iface->i_name, SIOCATALKDIFADDR, &iface->i_addr); #endif /* SIOCDIFADDR != SIOCATALKDIFADDR */ #endif /* SIOCATALKDIFADDR */ } } #endif /* SIOCDIFADDR */ /* * Disassociate. The child will send itself a signal when it is * stable. This indicates that other processes may begin using * AppleTalk. */ switch (i = server_lock("atalkd", pidfile, debug)) { case -1: exit(1); case 0: /* child */ break; default: /* parent */ /* * Wait for the child to send itself a SIGSTOP, after which * we send it a SIGCONT and exit ourself. */ if ( wait3( &status, WUNTRACED, (struct rusage *)0 ) != i) { perror( "wait3" ); /* Child died? */ atalkd_exit( 1 ); } if ( !WIFSTOPPED( status )) { fprintf( stderr, "AppleTalk not up! Check your syslog for the reason." ); if ( WIFEXITED( status )) { fprintf( stderr, " Child exited with %d.\n", WEXITSTATUS( status )); } else { fprintf( stderr, " Child died.\n" ); } atalkd_exit( 1 ); } if ( kill(i, SIGCONT ) < 0 ) { perror( "kill" ); atalkd_exit( 1 ); } exit( 0 ); } #ifdef ultrix openlog( prog, LOG_PID ); #else /* ultrix */ set_processname(prog); syslog_setup(log_debug, logtype_default, logoption_pid, logfacility_daemon ); #endif /* ultrix */ LOG(log_info, logtype_atalkd, "restart (%s)", version ); /* * Socket for use in routing ioctl()s. Can't add routes to our * interfaces until we have our routing socket. */ #ifdef BSD4_4 if (( rtfd = socket( PF_ROUTE, SOCK_RAW, AF_APPLETALK )) < 0 ) { LOG(log_error, logtype_atalkd, "route socket: %s", strerror(errno) ); atalkd_exit( 1 ); } if ( shutdown( rtfd, 0 ) < 0 ) { LOG(log_error, logtype_atalkd, "route shutdown: %s", strerror(errno) ); atalkd_exit( 1 ); } #else /* BSD4_4 */ if (( rtfd = socket( AF_APPLETALK, SOCK_DGRAM, 0 )) < 0 ) { LOG(log_error, logtype_atalkd, "route socket: %s", strerror(errno) ); atalkd_exit( 1 ); } #endif /* BSD4_4 */ ciface = interfaces; bootaddr( ciface ); memset(&sv, 0, sizeof(sv)); sv.sa_handler = as_down; sigemptyset( &sv.sa_mask ); sigaddset( &sv.sa_mask, SIGUSR1 ); sigaddset( &sv.sa_mask, SIGALRM ); sigaddset( &sv.sa_mask, SIGTERM ); sv.sa_flags = SA_RESTART; if ( sigaction( SIGTERM, &sv, NULL) < 0 ) { LOG(log_error, logtype_atalkd, "sigterm: %s", strerror(errno) ); atalkd_exit( 1 ); } sv.sa_handler = as_debug; sigemptyset( &sv.sa_mask ); sigaddset( &sv.sa_mask, SIGUSR1 ); sigaddset( &sv.sa_mask, SIGALRM ); sigaddset( &sv.sa_mask, SIGTERM ); sv.sa_flags = SA_RESTART; if ( sigaction( SIGUSR1, &sv, NULL) < 0 ) { LOG(log_error, logtype_atalkd, "sigusr1: %s", strerror(errno) ); atalkd_exit( 1 ); } sv.sa_handler = as_timer; sigemptyset( &sv.sa_mask ); sigaddset( &sv.sa_mask, SIGUSR1 ); sigaddset( &sv.sa_mask, SIGALRM ); sigaddset( &sv.sa_mask, SIGTERM ); sv.sa_flags = SA_RESTART; if ( sigaction( SIGALRM, &sv, NULL) < 0 ) { LOG(log_error, logtype_atalkd, "sigalrm: %s", strerror(errno) ); atalkd_exit( 1 ); } it.it_interval.tv_sec = 10L; it.it_interval.tv_usec = 0L; it.it_value.tv_sec = 10L; it.it_value.tv_usec = 0L; if ( setitimer( ITIMER_REAL, &it, NULL) < 0 ) { LOG(log_error, logtype_atalkd, "setitimer: %s", strerror(errno) ); atalkd_exit( 1 ); } sigemptyset( &signal_set ); sigaddset(&signal_set, SIGALRM); #if 0 /* don't block SIGTERM */ sigaddset(&signal_set, SIGTERM); #endif sigaddset(&signal_set, SIGUSR1); for (;;) { readfds = fds; if ( select( nfds, &readfds, NULL, NULL, NULL) < 0 ) { if ( errno == EINTR ) { errno = 0; continue; } else { LOG(log_error, logtype_atalkd, "select: %s", strerror(errno) ); atalkd_exit( 1 ); } } for ( iface = interfaces; iface; iface = iface->i_next ) { for ( ap = iface->i_ports; ap; ap = ap->ap_next ) { if ( FD_ISSET( ap->ap_fd, &readfds )) { if ( ap->ap_packet ) { fromlen = sizeof( struct sockaddr_at ); if (( c = recvfrom( ap->ap_fd, Packet, sizeof( Packet ), 0, (struct sockaddr *)&sat, &fromlen )) < 0 ) { LOG(log_error, logtype_atalkd, "recvfrom: %s", strerror(errno) ); continue; } #ifdef DEBUG1 if ( debug ) { printf( "packet from %u.%u on %s (%x) %d (%d)\n", ntohs( sat.sat_addr.s_net ), sat.sat_addr.s_node, iface->i_name, iface->i_flags, ap->ap_port, ap->ap_fd ); bprint( Packet, c ); } #endif if (sigprocmask(SIG_BLOCK, &signal_set, &old_set) < 0) { LOG(log_error, logtype_atalkd, "sigprocmask: %s", strerror(errno) ); atalkd_exit( 1 ); } if (( *ap->ap_packet )( ap, &sat, Packet, c ) < 0) { LOG(log_error, logtype_atalkd, "ap->ap_packet: %s", strerror(errno)); atalkd_exit(1); } #ifdef DEBUG consistency(); #endif if (sigprocmask(SIG_SETMASK, &old_set, NULL) < 0) { LOG(log_error, logtype_atalkd, "sigprocmask old set: %s", strerror(errno) ); atalkd_exit( 1 ); } } } } } } } /* * This code is called (from main(), as_timer(), zip_packet(), * and rtmp_packet()) to set the initial "bootstrapping" address * on an interface. */ void bootaddr(struct interface *iface) { if ( iface == NULL ) { return; } /* consistency */ if ( iface->i_flags & IFACE_ADDR ) { LOG(log_error, logtype_atalkd, "bootaddr OOPS!" ); atalkd_exit(1); } if ( iface->i_flags & IFACE_PHASE1 ) { setaddr( iface, IFACE_PHASE1, 0, iface->i_caddr.sat_addr.s_node, 0, 0 ); if ( iface->i_flags & IFACE_LOOPBACK ) { iface->i_flags |= IFACE_CONFIG | IFACE_ADDR; if ( ciface == iface ) { ciface = ciface->i_next; bootaddr( ciface ); } } else if (rtmp_request( iface ) < 0) { LOG(log_error, logtype_atalkd, "bootaddr (rtmp_request): %s", strerror(errno)); atalkd_exit(1); } } else { setaddr( iface, IFACE_PHASE2, iface->i_caddr.sat_addr.s_net, iface->i_caddr.sat_addr.s_node, iface->i_rt->rt_firstnet, iface->i_rt->rt_lastnet ); if ( iface->i_flags & IFACE_LOOPBACK ) { iface->i_flags |= IFACE_CONFIG | IFACE_ADDR; if ( ciface == iface ) { ciface = ciface->i_next; bootaddr( ciface ); } } else if (zip_getnetinfo( iface ) < 0) { LOG(log_error, logtype_atalkd, "bootaddr (zip_getnetinfo): %s", strerror(errno)); atalkd_exit(1); } } ++iface->i_time; iface->i_flags |= IFACE_ADDR; stabletimer = UNSTABLE; } /* * Change setaddr() * to manage the i_ports field and the fds for select(). */ void setaddr(struct interface *iface, u_int8_t phase, u_int16_t net, u_int8_t node, u_int16_t first, u_int16_t last) { int i; struct atserv *as; struct atport *ap; struct servent *se; struct sockaddr_at sat; struct netrange nr; if ( iface->i_ports == NULL ) { /* allocate port structures */ for ( i = 0, as = atserv; i < atservNATSERV; i++, as++ ) { if (( se = getservbyname( as->as_name, "ddp" )) == NULL ) { LOG(log_info, logtype_atalkd, "%s: service unknown", as->as_name ); } else { as->as_port = ntohs( se->s_port ); } if (( ap = (struct atport *)malloc( sizeof( struct atport ))) == NULL ) { LOG(log_error, logtype_atalkd, "malloc: %s", strerror(errno) ); atalkd_exit( 1 ); } ap->ap_fd = 0; ap->ap_next = iface->i_ports; ap->ap_iface = iface; ap->ap_port = as->as_port; ap->ap_packet = as->as_packet; iface->i_ports = ap; } } else { /* close ports */ for ( ap = iface->i_ports; ap; ap = ap->ap_next ) { (void)close( ap->ap_fd ); } } #ifdef BSD4_4 iface->i_addr.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ iface->i_addr.sat_family = AF_APPLETALK; iface->i_addr.sat_addr.s_net = net; iface->i_addr.sat_addr.s_node = node; nr.nr_phase = phase; nr.nr_firstnet = first; nr.nr_lastnet = last; memcpy( iface->i_addr.sat_zero, &nr, sizeof( struct netrange )); if ( ifconfig( iface->i_name, SIOCSIFADDR, &iface->i_addr )) { LOG(log_error, logtype_atalkd, "setifaddr: %s (%u-%u): %s. try specifying a \ smaller net range.", iface->i_name, ntohs(first), ntohs(last), strerror(errno)); atalkd_exit( 1 ); } if ( ifconfig( iface->i_name, SIOCGIFADDR, &iface->i_addr )) { LOG(log_error, logtype_atalkd, "getifaddr: %s: %s", iface->i_name, strerror(errno) ); atalkd_exit( 1 ); } /* open ports */ i = 1; /* enable broadcasts */ #if 0 /* useless message, no? */ LOG(log_info, logtype_atalkd, "setsockopt incompatible w/ Solaris STREAMS module."); #endif /* __svr4__ */ for ( ap = iface->i_ports; ap; ap = ap->ap_next ) { if (( ap->ap_fd = socket( AF_APPLETALK, SOCK_DGRAM, 0 )) < 0 ) { LOG(log_error, logtype_atalkd, "socket: %s", strerror(errno) ); atalkd_exit( 1 ); } #ifndef __svr4__ setsockopt(ap->ap_fd, SOL_SOCKET, SO_BROADCAST, &i, sizeof(i)); #endif /* ! __svr4 */ memset( &sat, 0, sizeof( struct sockaddr_at )); #ifdef BSD4_4 sat.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ sat.sat_family = AF_APPLETALK; sat.sat_addr.s_net = iface->i_addr.sat_addr.s_net; sat.sat_addr.s_node = iface->i_addr.sat_addr.s_node; sat.sat_port = ap->ap_port; if ( bind( ap->ap_fd, (struct sockaddr *)&sat, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "bind %u.%u:%u: %s", ntohs( sat.sat_addr.s_net ), sat.sat_addr.s_node, sat.sat_port, strerror(errno) ); #ifdef SIOCDIFADDR /* remove all interfaces if we have a problem with bind */ for (iface = interfaces; iface; iface = iface->i_next) { if (ifconfig( iface->i_name, SIOCDIFADDR, &iface->i_addr )) { #ifdef SIOCATALKDIFADDR #if (SIOCDIFADDR != SIOCATALKDIFADDR) ifconfig( iface->i_name, SIOCATALKDIFADDR, &iface->i_addr ); #endif /* SIOCDIFADDR != SIOCATALKDIFADDR */ #endif /* SIOCATALKDIFADDR */ } } #endif /* SIOCDIFADDR */ atalkd_exit( 1 ); } } /* recalculate nfds and fds */ FD_ZERO( &fds ); for ( nfds = 0, iface = interfaces; iface; iface = iface->i_next ) { for ( ap = iface->i_ports; ap; ap = ap->ap_next ) { FD_SET( ap->ap_fd, &fds ); if ( ap->ap_fd > nfds ) { nfds = ap->ap_fd; } } } nfds++; } int ifsetallmulti (const char *iname, int set) { int sock; struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); if (( sock = socket( AF_APPLETALK, SOCK_DGRAM, 0 )) < 0 ) { return( -1 ); } /* get interface config */ strlcpy(ifr.ifr_name, iname, sizeof(ifr.ifr_name)); if (ioctl(sock, SIOCGIFFLAGS, &ifr) < 0) { close(sock); return (-1); } /* should we set or unset IFF_ALLMULTI */ if (set) ifr.ifr_flags |= IFF_ALLMULTI; else ifr.ifr_flags &= ~IFF_ALLMULTI; /* set interface config */ strlcpy(ifr.ifr_name, iname, sizeof(ifr.ifr_name)); if (ioctl(sock, SIOCSIFFLAGS, &ifr) < 0) { close(sock); return -1; } close(sock); return (0); } int ifconfig( const char *iname, unsigned long cmd, struct sockaddr_at *sa) { struct ifreq ifr; int s; memset(&ifr, 0, sizeof(ifr)); strcpy( ifr.ifr_name, iname ); ifr.ifr_addr = *(struct sockaddr *)sa; if (( s = socket( AF_APPLETALK, SOCK_DGRAM, 0 )) < 0 ) { return( 1 ); } if ( ioctl( s, cmd, &ifr ) < 0 ) { close(s); return( 1 ); } close( s ); if ( cmd == SIOCGIFADDR ) { *(struct sockaddr *)sa = ifr.ifr_addr; } return( 0 ); } void dumpconfig( struct interface *iface) { struct list *l; printf( "%s", iface->i_name ); if ( iface->i_flags & IFACE_RSEED ) { printf( " -router" ); } else if ( iface->i_flags & IFACE_SEED ) { printf( " -seed" ); } if ( iface->i_flags & IFACE_DONTROUTE) printf( " -dontroute"); printf( " -phase" ); if ( iface->i_flags & IFACE_PHASE1 ) { printf( " 1" ); } else { printf( " 2" ); } printf( " -net %d", ntohs( iface->i_rt->rt_firstnet )); if ( iface->i_rt->rt_lastnet != iface->i_rt->rt_firstnet ) { printf( "-%d", ntohs( iface->i_rt->rt_lastnet )); } printf( " -addr %u.%u", ntohs( iface->i_addr.sat_addr.s_net ), iface->i_addr.sat_addr.s_node ); printf( " -caddr %u.%u", ntohs( iface->i_caddr.sat_addr.s_net ), iface->i_caddr.sat_addr.s_node ); for ( l = iface->i_rt->rt_zt; l; l = l->l_next ) { printf( " -zone %.*s", ((struct ziptab *)l->l_data)->zt_len, ((struct ziptab *)l->l_data)->zt_name ); } printf( "\n" ); } #ifdef DEBUG void dumproutes(void) { struct interface *iface; struct rtmptab *rtmp; struct list *l; struct ziptab *zt; for ( iface = interfaces; iface; iface = iface->i_next ) { for ( rtmp = iface->i_rt; rtmp; rtmp = rtmp->rt_inext ) { if ( rtmp->rt_gate == 0 ) { if ( rtmp->rt_flags & RTMPTAB_EXTENDED ) { printf( "%u-%u", ntohs( rtmp->rt_firstnet ), ntohs( rtmp->rt_lastnet )); } else { printf( "%u", ntohs( rtmp->rt_firstnet )); } } else { if ( rtmp->rt_flags & RTMPTAB_EXTENDED ) { printf( "%u.%u for %u-%u", ntohs( rtmp->rt_gate->g_sat.sat_addr.s_net ), rtmp->rt_gate->g_sat.sat_addr.s_node, ntohs( rtmp->rt_firstnet ), ntohs( rtmp->rt_lastnet )); } else { printf( "%u.%u for %u", ntohs( rtmp->rt_gate->g_sat.sat_addr.s_net ), rtmp->rt_gate->g_sat.sat_addr.s_node, ntohs( rtmp->rt_firstnet )); } } if ( rtmp->rt_iprev == 0 && rtmp != iface->i_rt ) { printf( " *" ); } for ( l = rtmp->rt_zt; l; l = l->l_next ) { zt = (struct ziptab *)l->l_data; printf( " %.*s", zt->zt_len, zt->zt_name ); } printf( "\n" ); } } printf( "\n" ); fflush( stdout ); } void dumpzones(void) { struct interface *iface; struct rtmptab *rtmp; struct list *l; struct ziptab *zt; for ( zt = ziptab; zt; zt = zt->zt_next ) { printf( "%.*s", zt->zt_len, zt->zt_name ); for ( l = zt->zt_rt; l; l = l->l_next ) { rtmp = (struct rtmptab *)l->l_data; if ( rtmp->rt_flags & RTMPTAB_EXTENDED ) { printf( " %u-%u", ntohs( rtmp->rt_firstnet ), ntohs( rtmp->rt_lastnet )); } else { printf( " %u", ntohs( rtmp->rt_firstnet )); } if ( rtmp->rt_iprev == 0 && rtmp->rt_gate != 0 ) { printf( "*" ); } } printf( "\n" ); } printf( "\n" ); fflush( stdout ); } #endif /* DEBUG */ netatalk-2.2.2/etc/atalkd/zip.h0000644000175200017500000000124011655731126013235 00000000000000/* * $Id: zip.h,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifndef ATALKD_ZIP_H #define ATALKD_ZIP_H 1 #include struct ziptab { struct ziptab *zt_next, *zt_prev; u_char zt_len; char *zt_name; u_char *zt_bcast; struct list *zt_rt; }; extern struct ziptab *ziptab, *ziplast; struct ziptab *newzt (const int, const char *); int addzone ( struct rtmptab *, int, char * ); int zip_getnetinfo ( struct interface * ); int zip_packet(struct atport *ap,struct sockaddr_at *from, char *data, int len); #endif /* atalkd/zip.h */ netatalk-2.2.2/etc/atalkd/route.h0000644000175200017500000000053211655731126013574 00000000000000/* * $Id: route.h,v 1.3 2009-10-13 22:55:37 didg Exp $ */ #ifndef ATALKD_ROUTE_H #define ATALKD_ROUTE_H 1 #include #ifndef BSD4_4 int route ( int, struct sockaddr *, struct sockaddr *, int ); #else /* BSD4_4 */ int route ( int, struct sockaddr_at *, struct sockaddr_at *, int); #endif /* BSD4_4 */ #endif /* ATALKD_ROUTE_H */ netatalk-2.2.2/etc/atalkd/multicast.c0000644000175200017500000003415611655731126014447 00000000000000/* * $Id: multicast.c,v 1.13 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #ifdef TRU64 #include #include #endif /* TRU64 */ #include #include /* work around for FreeBSD */ #if defined(__FreeBSD__) && (__FreeBSD__ >= 2) #include #if __FreeBSD_version >= 300000 #include #define NO_DATA_LINK_PASSTHROUGH #endif /* __FreeBSD_version >= 300000 */ #endif /* __FreeBSD__ */ #ifdef __svr4__ #include #endif /* __svr4__ */ #include #include #include "rtmp.h" #include "zip.h" #include "main.h" #include "multicast.h" static const unsigned char ethermulti[ 6 ] = { 0x09, 0x00, 0x07, 0xff, 0xff, 0xff, }; static const unsigned char ethermultitab[ 253 ][ 6 ] = { { 0x09, 0x00, 0x07, 0x00, 0x00, 0x00, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x01, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x02, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x03, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x04, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x05, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x06, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x07, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x08, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x09, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x0a, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x0b, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x0c, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x0d, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x0e, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x0f, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x10, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x11, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x12, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x13, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x14, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x15, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x16, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x17, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x18, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x19, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x1a, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x1b, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x1c, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x1d, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x1e, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x1f, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x20, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x21, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x22, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x23, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x24, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x25, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x26, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x27, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x28, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x29, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x2a, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x2b, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x2c, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x2d, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x2e, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x2f, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x30, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x31, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x32, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x33, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x34, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x35, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x36, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x37, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x38, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x39, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x3a, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x3b, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x3c, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x3d, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x3e, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x3f, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x40, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x41, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x42, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x43, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x44, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x45, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x46, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x47, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x48, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x49, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x4a, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x4b, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x4c, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x4d, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x4e, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x4f, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x50, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x51, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x52, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x53, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x54, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x55, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x56, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x57, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x58, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x59, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x5a, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x5b, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x5c, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x5d, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x5e, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x5f, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x60, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x61, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x62, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x63, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x64, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x65, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x66, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x67, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x68, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x69, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x6a, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x6b, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x6c, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x6d, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x6e, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x6f, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x70, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x71, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x72, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x73, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x74, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x75, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x76, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x77, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x78, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x79, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x7a, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x7b, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x7c, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x7d, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x7e, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x7f, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x80, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x81, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x82, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x83, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x84, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x85, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x86, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x87, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x88, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x89, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x8a, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x8b, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x8c, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x8d, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x8e, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x8f, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x90, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x91, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x92, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x93, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x94, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x95, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x96, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x97, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x98, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x99, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x9a, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x9b, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x9c, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x9d, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x9e, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0x9f, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xa0, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xa1, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xa2, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xa3, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xa4, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xa5, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xa6, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xa7, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xa8, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xa9, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xaa, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xab, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xac, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xad, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xae, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xaf, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xb0, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xb1, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xb2, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xb3, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xb4, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xb5, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xb6, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xb7, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xb8, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xb9, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xba, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xbb, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xbc, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xbd, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xbe, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xbf, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xc0, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xc1, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xc2, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xc3, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xc4, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xc5, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xc6, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xc7, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xc8, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xc9, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xca, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xcb, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xcc, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xcd, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xce, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xcf, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xd0, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xd1, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xd2, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xd3, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xd4, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xd5, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xd6, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xd7, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xd8, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xd9, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xda, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xdb, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xdc, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xdd, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xde, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xdf, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xe0, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xe1, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xe2, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xe3, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xe4, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xe5, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xe6, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xe7, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xe8, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xe9, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xea, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xeb, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xec, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xed, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xee, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xef, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xf0, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xf1, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xf2, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xf3, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xf4, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xf5, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xf6, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xf7, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xf8, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xf9, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xfa, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xfb, }, { 0x09, 0x00, 0x07, 0x00, 0x00, 0xfc, }, }; /* configure multicast for a given named interface */ int addmulti(const char *name, const unsigned char *data) { #ifdef NO_DATA_LINK_PASSTHROUGH struct sockaddr_dl sa; #else /* NO_DATA_LINK_PASSTHROUGH */ struct sockaddr sa; #endif /* NO_DATA_LINK_PASSTHROUGH */ memset(&sa, 0, sizeof(sa)); #ifdef NO_DATA_LINK_PASSTHROUGH sa.sdl_family = AF_LINK; memcpy(LLADDR(&sa), data ? data : ethermulti, sizeof(ethermulti)); sa.sdl_alen = sizeof(ethermulti); sa.sdl_len = sizeof(sa); #else /* NO_DATA_LINK_PASSTHROUGH */ memcpy(sa.sa_data, data ? data : ethermulti, sizeof(ethermulti)); #endif /* NO_DATA_LINK_PASSTHROUGH */ if (ifconfig(name, SIOCADDMULTI, (struct sockaddr_at *)&sa)) return -1; return 0; } static u_int16_t atalk_cksum( u_char *data, int len) { u_char *end; u_int32_t cksum = 0; for ( end = data + len; data < end; data++ ) { cksum = ( cksum + *data ) << 1; if ( cksum & 0x00010000 ) { cksum++; } cksum &= 0x0000ffff; } if ( cksum == 0 ) { cksum = 0x0000ffff; } return( (u_int16_t) cksum ); } /* * Fill in multicast for zone. There is a general issue here: how can * we tell the type of interface we're configuring for? E.g. Is it * ethernet, tokenring, or FDDI? (Of course, FDDI and Ethernet look just * alike.) */ int zone_bcast( struct ziptab *zt) { u_char uname[ 32 ]; u_int16_t cksum; int i; if (!zt->zt_bcast && (zt->zt_bcast = (u_char *) malloc(sizeof( ethermulti ))) == NULL) { LOG(log_error, logtype_atalkd, "zone_bcast malloc: %s", strerror(errno) ); return -1; } for ( i = 0; i < zt->zt_len; i++ ) { uname[ i ] = diatoupper((int) zt->zt_name[ i ]); } cksum = atalk_cksum( uname, zt->zt_len ); #define elements(a) (sizeof(a)/sizeof((a)[0])) memcpy(zt->zt_bcast, ethermultitab[ cksum % elements( ethermultitab ) ], sizeof( ethermulti )); return 0; } netatalk-2.2.2/etc/atalkd/rtmp.h0000644000175200017500000000552011655731126013422 00000000000000/* * $Id: rtmp.h,v 1.5 2009-10-13 22:55:37 didg Exp $ * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * * We have an rtmptab circular linked list for each gateway. Entries * are inserted in the order we get them. The expectation is that * we will get a complexity of N for the stable case. If we have N * existing entries, and M new entries, we'll have on the order of * N + ( M * N ) complexity (really it will be something more than * that, maybe N + ( M * ( N + 1/2 M )). Note that having a list to * search is superior to a hash table if you are expecting bad data: * you have the opportunity to range-check the incoming data. * * We keep several ZIP related flags and counters here. For ZIP Extended * Replies, we must keep a flag indicating that the zone is up or down. * This flag is necessary for ZIP Extended Replies which cross packet * boundaries: even tho the rtmptab entry has data, it is not yet * complete. For ZIP in general, we keep a flag indicating that we've * asked for a ZIP (E)Reply. If this flag is not set, we won't process * ZIP Reply data for given rtmptab entries. Lastly, we keep a count of * the number of times we've asked for ZIP Reply data. When this value * reaches some value (3?), we can optionally stop asking. */ #ifndef ATALKD_RTMP_H #define ATALKD_RTMP_H 1 #include struct rtmptab { struct rtmptab *rt_next, *rt_prev; struct rtmptab *rt_inext, *rt_iprev; u_short rt_firstnet, rt_lastnet; u_char rt_hops; u_char rt_state; u_char rt_flags; u_char rt_nzq; /* number of zip queries issued */ struct gate *rt_gate; /* gate is NULL for interfaces */ struct list *rt_zt; const struct interface *rt_iface; }; struct rtmp_head { u_short rh_net; u_char rh_nodelen; u_char rh_node; }; struct rtmp_tuple { u_short rt_net; u_char rt_dist; }; #define SZ_RTMPTUPLE 3 #define RTMPTAB_PERM 0 #define RTMPTAB_GOOD 1 #define RTMPTAB_SUSP1 2 #define RTMPTAB_SUSP2 3 #define RTMPTAB_BAD 4 #define RTMPTAB_ZIPQUERY 0x01 #define RTMPTAB_HASZONES 0x02 #define RTMPTAB_EXTENDED 0x04 #define RTMPTAB_ROUTE 0x08 #ifndef BSD4_4 #define RTMP_ADD SIOCADDRT #define RTMP_DEL SIOCDELRT #else /* BSD4_4 */ #define RTMP_ADD RTM_ADD #define RTMP_DEL RTM_DELETE #endif /* BSD4_4 */ #define STARTUP_FIRSTNET 0xff00 #define STARTUP_LASTNET 0xfffe extern int rtfd; struct rtmptab *newrt (const struct interface *); void rtmp_delzonemap (struct rtmptab *); int rtmp_request ( struct interface * ); void rtmp_free ( struct rtmptab * ); int rtmp_replace ( struct rtmptab * ); int looproute ( struct interface *, unsigned int ); int gateroute ( unsigned int, struct rtmptab * ); struct atport; int rtmp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len); #endif /* atalkd/rtmp.h */ netatalk-2.2.2/etc/atalkd/interface.h0000644000175200017500000000350111655731126014375 00000000000000/* * $Id: interface.h,v 1.6 2009-12-13 02:21:47 didg Exp $ * Copyright (c) 1990,1992 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifndef ATALKD_INTERFACE_H #define ATALKD_INTERFACE_H 1 #include struct interface { struct interface *i_next; char i_name[ IFNAMSIZ ]; int i_flags; int i_time; int i_group; /* for isolated appletalk domains */ struct sockaddr_at i_addr; struct sockaddr_at i_caddr; struct ziptab *i_czt; struct rtmptab *i_rt; struct gate *i_gate; struct atport *i_ports; }; #define IFACE_PHASE1 0x001 #define IFACE_PHASE2 0x002 #define IFACE_LOOPBACK 0x004 /* is the loopback interface */ #define IFACE_SEED 0x008 /* act as seed */ #define IFACE_ADDR 0x010 /* has an address set */ #define IFACE_CONFIG 0x020 /* has been configured */ #define IFACE_NOROUTER 0x040 /* no router on interface */ #define IFACE_LOOP 0x080 /* has a loopback route */ #define IFACE_RSEED 0x100 /* almost the same as seed. RSEED says that we should try to do routing. */ #define IFACE_DONTROUTE 0x200 /* don't route this interface */ #define IFACE_ISROUTER 0x400 /* act as a router. */ #define IFACE_ALLMULTI 0x800 /* set allmulti on this interface, linux only */ #define IFACE_WASALLMULTI 0x1000 /* don't unset allmulti on this interface on shutdown, linux only */ #define IFACE_ERROR 0x2000 /* sendto returned an error */ #define UNSTABLE 2 #define STABLE 0 #define STABLEANYWAY -2 #define IFBASE 2 /* base number of interfaces */ #ifdef linux #define LOOPIFACE "lo" #else /* !linux */ #define LOOPIFACE "lo0" #endif /* linux */ extern struct interface *interfaces; extern struct interface *ciface; struct interface *newiface (const char *); #endif /* ATALKD_INTERFACE_H */ netatalk-2.2.2/etc/atalkd/config.c0000644000175200017500000005267611665651044013717 00000000000000/* * $Id: config.c,v 1.20 2009-10-29 11:35:58 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #ifdef TRU64 #include #include #endif /* TRU64 */ #include #include #include #include #include #include #include #include #include #include #include /* STDC check */ #if STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR #define strchr index #define strrchr index #endif /* HAVE_STRCHR */ char *strchr (), *strrchr (); #ifndef HAVE_MEMCPY #define memcpy(d,s,n) bcopy ((s), (d), (n)) #define memmove(d,s,n) bcopy ((s), (d), (n)) #endif /* ! HAVE_MEMCPY */ #endif /* STDC_HEADERS */ #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #ifdef __svr4__ #include #include #endif /* __svr4__ */ #include #include "interface.h" #include "multicast.h" #include "rtmp.h" #include "zip.h" #include "list.h" #include "main.h" #ifndef IFF_SLAVE /* a little backward compatibility */ #define IFF_SLAVE 0 #endif /* IFF_SLAVE */ int router(struct interface *iface, char **av); int dontroute(struct interface *iface, char **av); int seed(struct interface *iface, char **av); int phase(struct interface *iface, char **av); int net(struct interface *iface, char **av); int addr(struct interface *iface, char **av); int zone(struct interface *iface, char **av); int noallmulti(struct interface *iface, char **av); static const struct param { char *p_name; int (*p_func)(struct interface *iface, char **av); } params[] = { { "router", router }, { "dontroute", dontroute }, { "seed", seed }, { "phase", phase }, { "net", net }, { "addr", addr }, { "zone", zone }, { "noallmulti", noallmulti } }; #define ARGV_CHUNK_SIZE 128 #define MAXLINELEN 2048 static char **parseline(const char *line) { const char *p; int argc = 0; char *buffer, *tmpbuf; char **argv; /* Ignore empty lines and lines with leading hash marks. */ p = line; while ( isspace( *p ) ) { p++; } if ( *p == '#' || *p == '\0' ) { return NULL; } buffer = (char *) malloc( strlen( p ) + 1 ); if ( !buffer ) { /* FIXME: error handling */ return NULL; } strcpy( buffer, p ); tmpbuf = buffer; argv = (char **) malloc( ARGV_CHUNK_SIZE * sizeof( char * ) ); if ( !argv ) { /* FIXME: error handling */ free( buffer ); return NULL; } /* * This parser should be made more powerful -- it should * handle various escapes, e.g. \" and \031. */ do { if ( *tmpbuf == '"' ) { argv[ argc++ ] = ++tmpbuf; while ( *tmpbuf != '\0' && *tmpbuf != '"' ) { tmpbuf++; } if ( *tmpbuf == '"' ) { /* FIXME: error handling */ } } else { argv[ argc++ ] = tmpbuf; while ( *tmpbuf != '\0' && !isspace( *tmpbuf )) { tmpbuf++; } } *tmpbuf++ = '\0'; /* Make room for a NULL pointer and our special pointer (s.b.) */ if ( (argc + 1) % ARGV_CHUNK_SIZE == 0 ) { char **tmp; tmp = (char **) realloc( argv, argc + 1 + ARGV_CHUNK_SIZE * sizeof( char * ) ); if ( !tmp ) { /* FIXME: error handling */ free( argv ); free( buffer ); return NULL; } argv = tmp; } /* Skip white spaces. */ while ( isspace( *tmpbuf ) ) { tmpbuf++; } } while ( *tmpbuf != '\0' ); argv[ argc++ ] = NULL; /* We store our buffer pointer in argv, too, so we can free it later. * (But don't tell anyone.) */ argv[ argc ] = buffer; return argv; } static void freeline( char **argv ) { char **tmp = argv; if ( argv ) { while ( *tmp ) { tmp++; } free( *++tmp ); free( argv ); } } int writeconf(char *cf) { struct stat st; char *path, *p, newpath[ MAXPATHLEN ], line[ MAXLINELEN ]; char **argv; FILE *conf, *newconf; struct interface *iface; struct list *l; int mode = 0644, fd; size_t len; char *zonename; if ( cf == NULL ) { path = _PATH_ATALKDCONF; } else { path = cf; } /* check if old conf is writable */ if ( stat( path, &st ) == 0 ) { if (( st.st_mode & S_IWUSR ) == 0 ) { LOG(log_info, logtype_atalkd, "%s not writable, won't rewrite", path ); return( -1 ); } mode = st.st_mode; } if (( p = strrchr( path, '/' )) == NULL ) { strcpy( newpath, _PATH_ATALKDTMP ); } else { sprintf( newpath, "%.*s/%s", (int)(p - path), path, _PATH_ATALKDTMP ); } if (( fd = open( newpath, O_WRONLY|O_CREAT|O_TRUNC, mode )) < 0 ) { LOG(log_error, logtype_atalkd, "%s: %s", newpath, strerror(errno) ); return( -1 ); } if (( newconf = fdopen( fd, "w" )) == NULL ) { LOG(log_error, logtype_atalkd, "fdreopen %s: %s", newpath, strerror(errno) ); return( -1 ); } if (( conf = fopen( path, "r" )) == NULL && cf ) { LOG(log_error, logtype_atalkd, "%s: %s", path, strerror(errno) ); return( -1 ); } iface = interfaces->i_next; while ( conf == NULL || fgets( line, sizeof( line ), conf ) != NULL ) { if ( conf != NULL && ( argv = parseline( line )) == NULL ) { if ( fputs( line, newconf ) == EOF ) { LOG(log_error, logtype_atalkd, "fputs: %s", strerror(errno) ); return( -1 ); } freeline( argv ); continue; } /* write real lines */ if ( iface ) { fprintf( newconf, "%s", iface->i_name ); if ( iface->i_flags & IFACE_RSEED ) { fprintf( newconf, " -router" ); } else if ( iface->i_flags & IFACE_SEED ) { fprintf( newconf, " -seed" ); } if ( iface->i_flags & IFACE_DONTROUTE) { fprintf( newconf, " -dontroute"); } #ifdef linux if ( !(iface->i_flags & IFACE_ALLMULTI)) { fprintf( newconf, " -noallmulti"); } #endif fprintf( newconf, " -phase %d", ( iface->i_flags & IFACE_PHASE1 ) ? 1 : 2 ); fprintf( newconf, " -net %d", ntohs( iface->i_rt->rt_firstnet )); if ( iface->i_rt->rt_lastnet != iface->i_rt->rt_firstnet ) { fprintf( newconf, "-%d", ntohs( iface->i_rt->rt_lastnet )); } fprintf( newconf, " -addr %u.%u", ntohs( iface->i_addr.sat_addr.s_net ), iface->i_addr.sat_addr.s_node ); for ( l = iface->i_rt->rt_zt; l; l = l->l_next ) { /* codepage conversion */ if ((size_t)(-1) == (len = convert_string_allocate(CH_MAC, CH_UNIX, ((struct ziptab *)l->l_data)->zt_name, ((struct ziptab *)l->l_data)->zt_len, &zonename)) ) { if ( NULL == (zonename = strdup(((struct ziptab *)l->l_data)->zt_name))) { LOG(log_error, logtype_atalkd, "malloc: %s", strerror(errno) ); return( -1 ); } len = ((struct ziptab *)l->l_data)->zt_len; } fprintf( newconf, " -zone \"%.*s\"", (int)len, zonename); free(zonename); } fprintf( newconf, "\n" ); iface = iface->i_next; if ( conf == NULL && iface == NULL ) { break; } } } if ( conf != NULL ) { fclose( conf ); } fclose( newconf ); if ( rename( newpath, path ) < 0 ) { LOG(log_error, logtype_atalkd, "rename %s to %s: %s", newpath, path, strerror(errno) ); return( -1 ); } return( 0 ); } /* * Read our config file. If it's not there, return -1. If it is there, * but has syntax errors, exit. Format of the file is as follows: * * interface [ -seed ] [ -phase number ] [ -net net-range ] * [ -addr net.node ] [ -zone zonename ]... * e.g. * le0 -phase 1 -net 7938 -zone Argus * or * le0 -phase 2 -net 8043-8044 -zone Argus -zone "Research Systems" * le0 -phase 1 -net 7938 -zone Argus * * Pretty much everything is optional. Anything that is unspecified is * searched for on the network. If -seed is not specified, the * configuration is assumed to be soft, i.e. it can be overridden by * another router. If -seed is specified, atalkd will exit if another * router disagrees. If the phase is unspecified, it defaults to phase * 2 (the default can be overridden on the command line). -addr can * replace -net, if the network in question isn't a range. The default * zone for an interface is the first zone encountered for that * interface. */ int readconf(char *cf) { struct ifreq ifr; struct interface *iface, *niface; char line[ MAXLINELEN ], **argv, *p; unsigned int i, j; int s, cc = 0; FILE *conf; if ( cf == NULL ) { p = _PATH_ATALKDCONF; } else { p = cf; } if (( conf = fopen( p, "r" )) == NULL ) { return( -1 ); } #ifndef __svr4__ if (( s = socket( AF_APPLETALK, SOCK_DGRAM, 0 )) < 0 ) { perror( "socket" ); fclose(conf); return -1; } #endif /* __svr4__ */ while ( fgets( line, sizeof( line ), conf ) != NULL ) { if (( argv = parseline( line )) == NULL ) { continue; } #ifndef __svr4__ /* * Check that av[ 0 ] is a valid interface. * Not possible under sysV. */ strlcpy( ifr.ifr_name, argv[ 0 ], sizeof(ifr.ifr_name) ); /* for devices that don't support appletalk */ if ((ioctl(s, SIOCGIFADDR, &ifr) < 0) && (errno == ENODEV)) { perror(argv[0]); goto read_conf_err; } if ( ioctl( s, SIOCGIFFLAGS, &ifr ) < 0 ) { perror( argv[ 0 ] ); goto read_conf_err; } if (ifr.ifr_flags & (IFF_LOOPBACK | IFF_POINTOPOINT |IFF_SLAVE)) { fprintf( stderr, "%s: can't configure.\n", ifr.ifr_name ); goto read_conf_err; } #ifdef IFF_MULTICAST if ((ifr.ifr_flags & IFF_MULTICAST) == 0) fprintf(stderr, "%s: multicast may not work properly.\n", ifr.ifr_name); #endif /* IFF_MULTICAST */ /* configure hw multicast for this interface. */ if (addmulti(ifr.ifr_name, NULL) < 0) { perror(ifr.ifr_name); fprintf(stderr, "Can't configure multicast.\n"); goto read_conf_err; } #endif /* __svr4__ */ if (( niface = newiface( argv[ 0 ] )) == NULL ) { perror( "newiface" ); goto read_conf_err; } for ( i = 1; argv[ i ]; i += cc ) { if ( argv[ i ][ 0 ] == '-' ) { argv[ i ]++; } for ( j = 0; j < sizeof( params ) / sizeof( params[ 0 ] ); j++ ) { if ( strcmp( argv[ i ], params[ j ].p_name ) == 0 ) { if ( params[ j ].p_func != NULL ) { cc = (*params[ j ].p_func)( niface, &argv[ i + 1 ] ); if (cc < 0) goto read_conf_err; break; } } } if ( j >= sizeof( params ) / sizeof( params[ 0 ] )) { fprintf( stderr, "%s: attribute not found.\n", argv[ i ] ); goto read_conf_err; } } for ( iface = interfaces; iface; iface = iface->i_next ) { if ( strcmp( niface->i_name, iface->i_name ) == 0 && ((( niface->i_flags & iface->i_flags & ( IFACE_PHASE1|IFACE_PHASE2 )) != 0 ) || niface->i_flags == 0 || iface->i_flags == 0 )) { break; } } if ( iface ) { /* Already have this interface and phase */ fprintf( stderr, "%s already configured!\n", niface->i_name ); goto read_conf_err; } #ifdef linux /* Don't set interface to allmulti if it already is, or -noallmulti was given */ if ((ifr.ifr_flags & IFF_ALLMULTI)) niface->i_flags |= IFACE_WASALLMULTI; if ((niface->i_flags & IFACE_ALLMULTI) && !(niface->i_flags & IFACE_WASALLMULTI)) ifsetallmulti(ifr.ifr_name, 1); #endif if ( interfaces == NULL ) { interfaces = niface; } else { for ( iface = interfaces; iface->i_next; iface = iface->i_next ) ; iface->i_next = niface; } niface->i_next = NULL; } #ifndef __svr4__ close( s ); #endif /* __svr4__ */ fclose( conf ); /* * Note: we've added lo0 to the interface list previously, so we must * have configured more than one interface... */ for ( iface = interfaces, cc = 0; iface; iface = iface->i_next, cc++ ) ; if ( cc >= IFBASE ) { return( 0 ); } else { return( -1 ); } read_conf_err: #ifndef __svr4__ close(s); #endif /* __svr4__ */ fclose(conf); return -1; } int noallmulti( struct interface *iface, char **av _U_) { /* Linux specific, no effect on other platforms */ iface->i_flags &= !IFACE_ALLMULTI; return (1); } /*ARGSUSED*/ int router(struct interface *iface, char **av _U_) { /* make sure "-router" and "-dontroute" aren't both on the same line. */ if (iface->i_flags & IFACE_DONTROUTE) { fprintf( stderr, "Can't specify both -router and -dontroute.\n"); return -1; } /* * Check to be sure "-router" is before "-zone". */ if ( iface->i_czt ) { fprintf( stderr, "Must specify -router before -zone.\n"); return -1; } /* -router also implies -seed */ iface->i_flags |= IFACE_RSEED | IFACE_SEED | IFACE_ISROUTER; return( 1 ); } /*ARGSUSED*/ int dontroute(struct interface *iface, char **av _U_) { /* make sure "-router" and "-dontroute" aren't both on the same line. */ if (iface->i_flags & IFACE_RSEED) { fprintf( stderr, "Can't specify both -router and -dontroute.\n"); return -1; } iface->i_flags |= IFACE_DONTROUTE; return( 1 ); } /*ARGSUSED*/ int seed( struct interface *iface, char **av _U_) { /* * Check to be sure "-seed" is before "-zone". we keep the old * semantics of just ignoring this in a routerless world. */ if ( iface->i_czt ) { fprintf( stderr, "Must specify -seed before -zone(%s).\n", iface->i_czt->zt_name); return -1; } iface->i_flags |= IFACE_SEED; return( 1 ); } int phase(struct interface *iface, char **av) { int n; char *pnum; if (( pnum = av[ 0 ] ) == NULL ) { fprintf( stderr, "No phase.\n" ); return -1; } switch ( n = atoi( pnum )) { case 1 : iface->i_flags |= IFACE_PHASE1; break; case 2 : iface->i_flags |= IFACE_PHASE2; break; default : fprintf( stderr, "No phase %d.\n", n ); return -1; } return( 2 ); } int net(struct interface *iface, char **av) { char *nrange; char *stop; int net; if (( nrange = av[ 0 ] ) == NULL ) { fprintf( stderr, "No network.\n" ); return -1; } if (( stop = strchr( nrange, '-' )) != NULL ) { stop++; } net = atoi( nrange ); if ( net < 0 || net >= 0xffff ) { fprintf( stderr, "Bad network: %d\n", net ); return -1; } if ( iface->i_rt == NULL && ( iface->i_rt = newrt(iface)) == NULL ) { perror( "newrt" ); return -1; } if ( iface->i_flags & IFACE_PHASE1 ) { if ( stop != NULL ) { fprintf( stderr, "Phase 1 doesn't use an address range.\n" ); return -1; } if ( iface->i_caddr.sat_addr.s_net != ATADDR_ANYNET && ntohs( iface->i_caddr.sat_addr.s_net ) != net ) { fprintf( stderr, "Net-range (%u) doesn't match net %u.\n", net, ntohs( iface->i_caddr.sat_addr.s_net )); return -1; } iface->i_rt->rt_firstnet = iface->i_rt->rt_lastnet = htons( net ); } else if ( iface->i_flags & IFACE_PHASE2 ) { iface->i_rt->rt_firstnet = htons( net ); if ( stop != NULL ) { net = atoi( stop ); if ( net < 0 || net >= 0xffff ) { fprintf( stderr, "Bad network: %d\n", net ); return -1; } } iface->i_rt->rt_lastnet = htons( net ); if ( iface->i_caddr.sat_addr.s_net != ATADDR_ANYNET && ( ntohs( iface->i_rt->rt_firstnet ) > ntohs( iface->i_caddr.sat_addr.s_net ) || ntohs( iface->i_rt->rt_lastnet ) < ntohs( iface->i_caddr.sat_addr.s_net ))) { fprintf( stderr, "Net-range (%u-%u) doesn't contain net (%u).\n", ntohs( iface->i_rt->rt_firstnet ), ntohs( iface->i_rt->rt_lastnet ), ntohs( iface->i_caddr.sat_addr.s_net )); return -1; } if ( iface->i_rt->rt_firstnet != iface->i_rt->rt_lastnet ) { iface->i_rt->rt_flags |= RTMPTAB_EXTENDED; } } else { fprintf( stderr, "Must specify phase before networks.\n" ); return -1; } return( 2 ); } int addr(struct interface *iface, char **av) { if ( av[ 0 ] == NULL ) { fprintf( stderr, "No address.\n" ); return -1; } if ( atalk_aton( av[ 0 ], &iface->i_caddr.sat_addr ) == 0 ) { fprintf( stderr, "Bad address, %s\n", av[ 0 ] ); return -1; } if ( iface->i_rt ) { if ( ntohs( iface->i_rt->rt_firstnet ) > ntohs( iface->i_caddr.sat_addr.s_net ) || ntohs( iface->i_rt->rt_lastnet ) < ntohs( iface->i_caddr.sat_addr.s_net )) { fprintf( stderr, "Net (%u) not in net-range (%u-%u).\n", ntohs( iface->i_caddr.sat_addr.s_net ), ntohs( iface->i_rt->rt_firstnet ), ntohs( iface->i_rt->rt_lastnet )); return -1; } } else { if (( iface->i_rt = newrt(iface)) == NULL ) { perror( "newrt" ); return -1; } iface->i_rt->rt_firstnet = iface->i_rt->rt_lastnet = iface->i_caddr.sat_addr.s_net; } return( 2 ); } int zone(struct interface *iface, char **av) { struct ziptab *zt; char *zname; if ( av[ 0 ] == NULL ) { fprintf( stderr, "No zone.\n" ); return -1; } /* codepage conversion */ if ((size_t)(-1) == convert_string_allocate(CH_UNIX, CH_MAC, av[0], -1, &zname)) { zname = strdup(av[0]); } /* * Only process "-zone" if this interface has "-seed". We keep our * list of configured zones in the interface structure. Then we can * check that the network has given us good zones. */ if ( iface->i_flags & IFACE_SEED ) { if ( iface->i_rt == NULL ) { fprintf( stderr, "Must specify net-range before zones.\n" ); return -1; } if (( zt = newzt( strlen( zname ), zname )) == NULL ) { perror( "newzt" ); return -1; } if ( iface->i_czt == NULL ) { iface->i_czt = zt; } else { zt->zt_next = iface->i_czt->zt_next; iface->i_czt->zt_next = zt; } } free(zname); return( 2 ); } /* * Get the configuration from the kernel. Only called if there's no * configuration. */ int getifconf(void) { struct interface *iface, *niface; struct ifreq ifr; char **start, **list; int s; if (( s = socket( AF_APPLETALK, SOCK_DGRAM, 0 )) < 0 ) { perror( "socket" ); return -1; } start = list = getifacelist(); while (list && *list) { strlcpy(ifr.ifr_name, *list, sizeof(ifr.ifr_name)); list++; if (ioctl(s, SIOCGIFFLAGS, &ifr) < 0) continue; if (ifr.ifr_flags & (IFF_LOOPBACK | IFF_POINTOPOINT | IFF_SLAVE)) continue; if ((ifr.ifr_flags & IFF_UP) == 0) continue; /* for devices that don't support appletalk */ if (ioctl(s, SIOCGIFADDR, &ifr) < 0 && (errno == ENODEV)) continue; for ( iface = interfaces; iface; iface = iface->i_next ) { if ( strcmp( iface->i_name, ifr.ifr_name ) == 0 ) { break; } } if ( iface ) { /* Already have this interface name */ continue; } #ifdef IFF_MULTICAST if ((ifr.ifr_flags & IFF_MULTICAST) == 0) fprintf(stderr, "%s: multicast may not work correctly.\n", ifr.ifr_name); #endif /* IFF_MULTICAST */ if (addmulti(ifr.ifr_name, NULL) < 0) { fprintf(stderr, "%s: disabled.\n", ifr.ifr_name); continue; } if (( niface = newiface( ifr.ifr_name )) == NULL ) { perror( "newiface" ); close(s); freeifacelist(start); return -1; } /* * Could try to get the address from the kernel... */ if ( interfaces == NULL ) { interfaces = niface; } else { for ( iface = interfaces; iface->i_next; iface = iface->i_next ) ; iface->i_next = niface; } niface->i_next = NULL; } freeifacelist(start); (void)close( s ); return( 0 ); } /* * Allocate a new interface structure. Centralized here so we can change * the interface structure and have it updated nicely. */ struct interface *newiface( const char *name) { struct interface *niface; if (( niface = (struct interface *)calloc(1, sizeof( struct interface ))) == NULL ) { return( NULL ); } strlcpy( niface->i_name, name, sizeof(niface->i_name)); #ifdef BSD4_4 niface->i_addr.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ niface->i_addr.sat_family = AF_APPLETALK; #ifdef BSD4_4 niface->i_caddr.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ niface->i_caddr.sat_family = AF_APPLETALK; #ifdef linux niface->i_flags = IFACE_ALLMULTI; #endif return( niface ); } #ifdef __svr4__ int plumb(void) { struct interface *iface; char device[ MAXPATHLEN + 1], *p, *t; int fd, ppa; int digits = 0; for ( iface = interfaces; iface != NULL; iface = iface->i_next ) { if ( strcmp( iface->i_name, LOOPIFACE ) == 0 ) { continue; } strcpy( device, "/dev/" ); strcat( device, iface->i_name ); for (t = device; *t != '\0' ; ++t) { if (isdigit(*t) == 0) { p = t + 1; } else { digits++; } } if (digits == 0) { LOG(log_error, logtype_atalkd, "plumb: invalid device: %s", device ); return -1; } ppa = atoi( p ); *p = '\0'; if (( fd = open( device, O_RDWR, 0 )) < 0 ) { LOG(log_error, logtype_atalkd, "%s: %s", device, strerror(errno) ); return -1; } if ( ioctl( fd, I_PUSH, "ddp" ) < 0 ) { LOG(log_error, logtype_atalkd, "I_PUSH: %s", strerror(errno) ); close(fd); return -1; } if ( ioctl( fd, IF_UNITSEL, ppa ) < 0 ) { LOG(log_error, logtype_atalkd, "IF_UNITSEL: %s", strerror(errno) ); close(fd); return -1; } /* configure multicast. */ if (addmulti(iface->i_name, NULL) < 0) { perror(iface->i_name); fprintf(stderr,"Can't configure multicast.\n"); close(fd); return -1; } LOG(log_info, logtype_atalkd, "plumbed %s%d", device, ppa ); close(fd); } return( 0 ); } #endif /* __svr4__ */ netatalk-2.2.2/etc/atalkd/zip.c0000644000175200017500000006762711655731126013255 00000000000000/* * $Id: zip.c,v 1.15 2009-12-13 00:31:50 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #ifdef TRU64 #include #include #endif /* TRU64 */ #include #include #include #include #ifdef __svr4__ #include #endif /* __svr4__ */ #include #include #include #include #include "atserv.h" #include "interface.h" #include "gate.h" #include "zip.h" #include "rtmp.h" #include "list.h" #include "multicast.h" #include "main.h" struct ziptab *ziptab = NULL, *ziplast = NULL; static int zonecheck(struct rtmptab *rtmp, struct interface *iface) { struct list *l; struct ziptab *czt, *zt; int cztcnt, ztcnt; if (( iface->i_flags & IFACE_SEED ) == 0 ) { return( 0 ); } for ( cztcnt = 0, czt = iface->i_czt; czt; czt = czt->zt_next, cztcnt++ ) { for ( l = rtmp->rt_zt; l; l = l->l_next ) { zt = (struct ziptab *)l->l_data; if ( czt->zt_len == zt->zt_len && !strndiacasecmp( czt->zt_name, zt->zt_name, czt->zt_len )) { break; } } if ( l == NULL ) { LOG(log_error, logtype_atalkd, "zonecheck: %.*s not in zone list", czt->zt_len, czt->zt_name ); return( -1 ); /* configured zone not found in net zones */ } } for ( ztcnt = 0, l = rtmp->rt_zt; l; l = l->l_next, ztcnt++ ) ; if ( cztcnt != ztcnt ) { LOG(log_error, logtype_atalkd, "zonecheck: %d configured zones, %d zones found", cztcnt, ztcnt ); return( -1 ); /* more net zones than configured zones */ } return( 0 ); } int zip_packet(struct atport *ap,struct sockaddr_at *from, char *data, int len) { struct ziphdr zh; struct atphdr ah; struct interface *iface; struct gate *gate; struct rtmptab *rtmp = NULL; struct list *l; struct ziptab *zt; u_short firstnet, lastnet, index, nz; char *end, zname[ 32 ], packet[ ATP_BUFSIZ ], *nzones, *lastflag; char *reply, *rend, *ziphdr; int zlen, n, zipop, rcnt, qcnt, zcnt, zsz; extern int stabletimer; end = data + len; if ( data >= end ) { LOG(log_info, logtype_atalkd, "zip_packet malformed packet" ); return 1; } /* get interface */ iface = ap->ap_iface; switch( *data++ ) { case DDPTYPE_ZIP : if ( data + sizeof( struct ziphdr ) > end ) { LOG(log_info, logtype_atalkd, "zip_packet malformed packet" ); return 1; } memcpy( &zh, data, sizeof( struct ziphdr )); data += sizeof( struct ziphdr ); switch ( zh.zh_op ) { case ZIPOP_QUERY : /* set up reply */ reply = packet; rend = packet + sizeof( packet ); *reply++ = DDPTYPE_ZIP; ziphdr = reply; reply += 2; rcnt = 0; qcnt = zh.zh_count; while ( data + sizeof( u_short ) <= end && qcnt-- > 0 ) { memcpy( &firstnet, data, sizeof( u_short )); data += sizeof( u_short ); /* * Look for the given network number (firstnet). * Perhaps we could do better than brute force? */ for ( iface = interfaces; iface; iface = iface->i_next ) { for ( rtmp = iface->i_rt; rtmp; rtmp = rtmp->rt_inext ) { if ( firstnet == rtmp->rt_firstnet ) { break; } } if ( rtmp ) { break; } } if ( rtmp == NULL ) { continue; } /* * Count the number of zones in this list, and the * number of byte it will consume in a reply. */ for ( zsz = 0, zcnt = 0, l = rtmp->rt_zt; l; l = l->l_next ) { zcnt++; zt = (struct ziptab *)l->l_data; zsz += sizeof( u_short ) + 1 + zt->zt_len; } /* * We might send this list in the current reply, as the * first thing in the next reply, or as an extended packet. */ if ( reply + zsz > rend ) { if ( rcnt > 0 ) { zh.zh_op = ZIPOP_REPLY; zh.zh_cnt = rcnt; memcpy( ziphdr, &zh, sizeof( struct ziphdr )); if ( sendto( ap->ap_fd, packet, reply - packet, 0, (struct sockaddr *)from, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "zip reply sendto: %s", strerror(errno) ); } reply = packet + 3; rcnt = 0; } if ( reply + zsz > rend ) { /* ereply */ for ( l = rtmp->rt_zt; l; l = l->l_next, rcnt++ ) { zt = (struct ziptab *)l->l_data; if ( reply + sizeof( u_short ) + 1 + zt->zt_len > rend ) { zh.zh_op = ZIPOP_EREPLY; zh.zh_cnt = zcnt; memcpy( ziphdr, &zh, sizeof( struct ziphdr )); if ( sendto( ap->ap_fd, packet, reply - packet, 0, (struct sockaddr *)from, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "zip reply sendto: %s", strerror(errno) ); } reply = packet + 3; rcnt = 0; } memcpy( reply, &firstnet, sizeof( u_short )); reply += sizeof( u_short ); *reply++ = zt->zt_len; memcpy( reply, zt->zt_name, zt->zt_len ); reply += zt->zt_len; } if ( rcnt > 0 ) { zh.zh_op = ZIPOP_EREPLY; zh.zh_cnt = zcnt; memcpy( ziphdr, &zh, sizeof( struct ziphdr )); if ( sendto( ap->ap_fd, packet, reply - packet, 0, (struct sockaddr *)from, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "zip reply sendto: %s", strerror(errno) ); } reply = packet + 3; rcnt = 0; } continue; } } for ( l = rtmp->rt_zt; l; l = l->l_next, rcnt++ ) { zt = (struct ziptab *)l->l_data; memcpy( reply, &firstnet, sizeof( u_short )); reply += sizeof( u_short ); *reply++ = zt->zt_len; memcpy( reply, zt->zt_name, zt->zt_len ); reply += zt->zt_len; } } if ( rcnt > 0 ) { zh.zh_op = ZIPOP_REPLY; zh.zh_cnt = rcnt; memcpy( ziphdr, &zh, sizeof( struct ziphdr )); if ( sendto( ap->ap_fd, packet, reply - packet, 0, (struct sockaddr *)from, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "zip reply sendto: %s", strerror(errno) ); } } break; case ZIPOP_REPLY : for ( gate = iface->i_gate; gate; gate = gate->g_next ) { if (( from->sat_addr.s_net == 0 || gate->g_sat.sat_addr.s_net == from->sat_addr.s_net ) && gate->g_sat.sat_addr.s_node == from->sat_addr.s_node ) { break; } } if ( gate == NULL ) { LOG(log_info, logtype_atalkd, "zip reply from non-gateway %u.%u", ntohs( from->sat_addr.s_net ), from->sat_addr.s_node ); return 1; } rtmp = NULL; do { if ( data + sizeof( u_short ) + 1 > end ) { /* + strlen */ LOG(log_info, logtype_atalkd, "zip reply short (%d)", len ); return 1; } memcpy( &firstnet, data, sizeof( u_short )); data += sizeof( u_short ); if ( rtmp && rtmp->rt_firstnet != firstnet ) { /* XXX */ if ( rtmp->rt_gate == NULL && zonecheck( rtmp, gate->g_iface ) != 0 ) { LOG(log_error, logtype_atalkd, "zip_packet seed zonelist mismatch" ); return -1; } rtmp->rt_flags &= ~RTMPTAB_ZIPQUERY; } /* Check if this is the interface's route. */ if ( firstnet == gate->g_iface->i_rt->rt_firstnet ) { rtmp = gate->g_iface->i_rt; } else { for ( rtmp = gate->g_rt; rtmp; rtmp = rtmp->rt_next ) { if ( rtmp->rt_firstnet == firstnet ) { break; } } /* * Update head to this rtmp entry. */ if ( rtmp != NULL && gate->g_rt != rtmp ) { gate->g_rt->rt_prev->rt_next = gate->g_rt; gate->g_rt = rtmp; rtmp->rt_prev->rt_next = NULL; } } zlen = *data++; if ( zlen > 32 || zlen <= 0 ) { LOG(log_info, logtype_atalkd, "zip reply bad packet" ); return 1; } if ( data + zlen > end ) { LOG(log_info, logtype_atalkd, "zip reply short (%d)", len ); return 1; } memcpy( zname, data, zlen ); data += zlen; /* * We won't find any rtmp entry if the gateway is no longer * telling us about the entry. */ if ( rtmp == NULL ) { LOG(log_info, logtype_atalkd, "zip skip reply %u from %u.%u (no rtmp)", ntohs( firstnet ), ntohs( from->sat_addr.s_net ), from->sat_addr.s_node ); /* * Check if the route is still in use (the iprev check is * no good if rtmp is the interface's route). */ } else if ( rtmp->rt_iprev == NULL && rtmp->rt_prev != NULL ) { LOG(log_info, logtype_atalkd, "zip skip reply %u-%u from %u.%u (rtmp not in use)", ntohs( rtmp->rt_firstnet ), ntohs( rtmp->rt_lastnet ), ntohs( from->sat_addr.s_net ), from->sat_addr.s_node ); /* * Check if we've got an outstanding query for this route. * We will often get this, since we ask every router on a * net to verify our interface's zone(s). */ } else if (( rtmp->rt_flags & RTMPTAB_ZIPQUERY ) == 0 ) { LOG(log_info, logtype_atalkd, "zip skip reply %u-%u from %u.%u (no query)", ntohs( rtmp->rt_firstnet ), ntohs( rtmp->rt_lastnet ), ntohs( from->sat_addr.s_net ), from->sat_addr.s_node ); } else { if (addzone( rtmp, zlen, zname ) < 0) { LOG(log_error, logtype_atalkd, "zip_packet: addzone"); return -1; } rtmp->rt_flags |= RTMPTAB_HASZONES; } } while ( data < end ); if ( rtmp && rtmp->rt_flags & RTMPTAB_HASZONES ) { /* XXX */ if ( rtmp->rt_gate == NULL && zonecheck( rtmp, gate->g_iface ) != 0 ) { LOG(log_error, logtype_atalkd, "zip_packet seed zonelist mismatch" ); return -1; } rtmp->rt_flags &= ~RTMPTAB_ZIPQUERY; } break; case ZIPOP_EREPLY : for ( gate = iface->i_gate; gate; gate = gate->g_next ) { if (( from->sat_addr.s_net == 0 || gate->g_sat.sat_addr.s_net == from->sat_addr.s_net ) && gate->g_sat.sat_addr.s_node == from->sat_addr.s_node ) { break; } } if ( gate == NULL ) { LOG(log_info, logtype_atalkd, "zip ereply from non-gateway %u.%u", ntohs( from->sat_addr.s_net ), from->sat_addr.s_node ); return 1; } /* * Note that we're not advancing "data" here. We do that * at the top of the do-while loop, below. */ if ( data + sizeof( u_short ) + 1 > end ) { /* + strlen */ LOG(log_info, logtype_atalkd, "zip ereply short (%d)", len ); return 1; } memcpy( &firstnet, data, sizeof( u_short )); /* Check if this is the interface's route. */ if ( firstnet == gate->g_iface->i_rt->rt_firstnet ) { rtmp = gate->g_iface->i_rt; } else { for ( rtmp = gate->g_rt; rtmp; rtmp = rtmp->rt_next ) { if ( rtmp->rt_firstnet == firstnet ) { break; } } if ( rtmp == NULL ) { LOG(log_info, logtype_atalkd, "zip ereply %u from %u.%u (no rtmp)", ntohs( firstnet ), ntohs( from->sat_addr.s_net ), from->sat_addr.s_node ); return 1; } if ( rtmp->rt_iprev == NULL ) { LOG(log_info, logtype_atalkd, "zip ereply %u-%u from %u.%u (rtmp not in use)", ntohs( rtmp->rt_firstnet ), ntohs( rtmp->rt_lastnet ), ntohs( from->sat_addr.s_net ), from->sat_addr.s_node ); } /* update head to *next* rtmp entry */ if ( rtmp->rt_next != NULL ) { gate->g_rt->rt_prev->rt_next = gate->g_rt; gate->g_rt = rtmp->rt_next; rtmp->rt_next = NULL; } } if (( rtmp->rt_flags & RTMPTAB_ZIPQUERY ) == 0 ) { LOG(log_info, logtype_atalkd, "zip ereply %u-%u from %u.%u (no query)", ntohs( rtmp->rt_firstnet ), ntohs( rtmp->rt_lastnet ), ntohs( from->sat_addr.s_net ), from->sat_addr.s_node ); return 0; } do { /* * We copy out firstnet, twice (see above). Not * a big deal, and it makes the end condition cleaner. */ if ( data + sizeof( u_short ) + 1 > end ) { /* + strlen */ LOG(log_info, logtype_atalkd, "zip ereply short (%d)", len ); return 1; } memcpy( &firstnet, data, sizeof( u_short )); data += sizeof( u_short ); /* check route */ if ( firstnet != rtmp->rt_firstnet ) { LOG(log_info, logtype_atalkd, "zip ereply with multiple nets" ); return 1; } zlen = *data++; if ( zlen > 32 || zlen <= 0 ) { LOG(log_info, logtype_atalkd, "zip ereply bad zone length (%d)", zlen ); return 1; } if ( data + zlen > end ) { LOG(log_info, logtype_atalkd, "zip ereply short (%d)", len ); return 1; } memcpy( zname, data, zlen ); data += zlen; if (addzone( rtmp, zlen, zname ) < 0) { LOG(log_error, logtype_atalkd, "zip_packet: addzone"); return -1; } } while ( data < end ); if ( rtmp ) { /* * Count zones for rtmptab entry. */ for ( n = 0, l = rtmp->rt_zt; l; l = l->l_next, n++ ) ; if ( n == zh.zh_count ) { rtmp->rt_flags |= RTMPTAB_HASZONES; /* XXX */ if ( rtmp->rt_gate == NULL && zonecheck( rtmp, gate->g_iface ) != 0 ) { LOG(log_error, logtype_atalkd, "zip_packet seed zonelist mismatch" ); return -1; } rtmp->rt_flags &= ~RTMPTAB_ZIPQUERY; } } break; case ZIPOP_GNI : /* * Don't answer with bogus information. */ if (((iface->i_flags & IFACE_ISROUTER) == 0) || iface->i_rt->rt_zt == NULL || ( iface->i_flags & IFACE_CONFIG ) == 0 ) { return 0; } if ( zh.zh_zero != 0 || data + 2 * sizeof( u_short ) > end ) { LOG(log_info, logtype_atalkd, "zip_packet malformed packet" ); return 1; } memcpy( &firstnet, data, sizeof( u_short )); data += sizeof( u_short ); memcpy( &lastnet, data, sizeof( u_short )); data += sizeof( u_short ); if ( firstnet != 0 || lastnet != 0 || data >= end ) { LOG(log_info, logtype_atalkd, "zip_packet malformed packet" ); return 1; } zlen = *data++; if ( zlen < 0 || zlen > 32 ) { LOG(log_info, logtype_atalkd, "zip_packet malformed packet" ); return 1; } memcpy( zname, data, zlen ); data = packet; end = data + sizeof( packet ); zh.zh_op = ZIPOP_GNIREPLY; zh.zh_flags = 0; /* * Skip to the nets. Fill in header when we're done. */ data += 1 + sizeof( struct ziphdr ); memcpy( data, &iface->i_rt->rt_firstnet, sizeof( u_short )); data += sizeof( u_short ); memcpy( data, &iface->i_rt->rt_lastnet, sizeof( u_short )); data += sizeof( u_short ); *data++ = zlen; memcpy( data, zname, zlen ); data += zlen; /* * Check if the given zone is valid. If it's valid, just fill in * the multicast address. If it's not, fill the multicast address * in with the default zone and return the default zone. */ for ( l = iface->i_rt->rt_zt; l; l = l->l_next ) { zt = (struct ziptab *)l->l_data; if ( zt->zt_len == zlen && strndiacasecmp( zname, zt->zt_name, zlen ) == 0 ) { break; } } if ( l == NULL ) { zt = (struct ziptab *)iface->i_rt->rt_zt->l_data; zh.zh_flags |= ZIPGNI_INVALID; } for ( n = 0, l = iface->i_rt->rt_zt; l; l = l->l_next, n++ ) ; if ( n == 1 ) { zh.zh_flags |= ZIPGNI_ONEZONE; } /* multicast */ *data++ = 6; /* sizeof ??? */ if (zone_bcast(zt) < 0) { LOG(log_error, logtype_atalkd, "zip_packet: zone_bcast"); return -1; } memcpy(data, zt->zt_bcast, 6); data += 6; /* * Add default zone. */ if ( zh.zh_flags & ZIPGNI_INVALID ) { *data++ = zt->zt_len; memcpy( data, zt->zt_name, zt->zt_len ); data += zt->zt_len; } /* fill in header */ *packet = DDPTYPE_ZIP; memcpy( packet + 1, &zh, sizeof( struct ziphdr )); /* * If the address we received this request from isn't correct * for the net we received it on, send a broadcast. */ if ( ntohs( from->sat_addr.s_net ) < ntohs( iface->i_rt->rt_firstnet ) || ntohs( from->sat_addr.s_net ) > ntohs( iface->i_rt->rt_lastnet )) { from->sat_addr.s_net = 0; from->sat_addr.s_node = ATADDR_BCAST; } if ( sendto( ap->ap_fd, packet, data - packet, 0, (struct sockaddr *)from, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "zip gni sendto %u.%u: %s", ntohs( from->sat_addr.s_net ), from->sat_addr.s_node, strerror(errno) ); return 1; } break; case ZIPOP_GNIREPLY : /* * Ignore ZIP GNIReplys which are either late or unsolicited. */ LOG(log_debug, logtype_atalkd, "zip gnireply from %u.%u (%s %x)", ntohs( from->sat_addr.s_net ), from->sat_addr.s_node, iface->i_name, iface->i_flags ); if (( iface->i_flags & ( IFACE_CONFIG|IFACE_PHASE1 )) || ( iface->i_flags & IFACE_ADDR ) == 0 ) { LOG(log_debug, logtype_atalkd, "zip ignoring gnireply" ); return 1; } if ( data + 2 * sizeof( u_short ) > end ) { LOG(log_info, logtype_atalkd, "zip_packet malformed packet" ); return 1; } memcpy( &firstnet, data, sizeof( u_short )); data += sizeof( u_short ); memcpy( &lastnet, data, sizeof( u_short )); data += sizeof( u_short ); /* * We never ask for a zone, so we can get back what the * default zone is. */ if ( data >= end || data + *data > end ) { LOG(log_info, logtype_atalkd, "zip_packet malformed packet" ); return 1; } if ( *data++ != 0 ) { LOG(log_info, logtype_atalkd, "zip_packet unsolicited zone" ); return 1; } /* skip multicast (should really check it) */ if ( data >= end || data + *data > end ) { LOG(log_info, logtype_atalkd, "zip_packet malformed packet" ); return 1; } data += *data + 1; if ( data >= end || data + *data > end ) { LOG(log_info, logtype_atalkd, "zip_packet malformed packet" ); return 1; } /* * First, if we're not seed, we always get our zone information * from the net -- we don't even save what was in the file. * Second, if we are seed, we keep our zone list in the * interface structure, not in the zone table. This allows us * to check that the net is giving us good zones. */ if ( (iface->i_flags & IFACE_SEED) && iface->i_czt) { if ( iface->i_czt->zt_len != *data || strndiacasecmp( iface->i_czt->zt_name, data + 1, *data ) != 0 ) { LOG(log_error, logtype_atalkd, "default zone mismatch on %s", iface->i_name ); LOG(log_error, logtype_atalkd, "%.*s != %.*s", iface->i_czt->zt_len, iface->i_czt->zt_name, *data, data + 1 ); LOG(log_error, logtype_atalkd, "Seed error! Exiting!" ); return -1; } } if (addzone( iface->i_rt, *data, data + 1 ) < 0) { LOG(log_error, logtype_atalkd, "zip_packet: addzone"); return -1; } /* * The netrange we received from the router doesn't match the * range we have locally. This is not a problem, unless we * have seed information. */ if ( firstnet != iface->i_rt->rt_firstnet || lastnet != iface->i_rt->rt_lastnet ) { if ( iface->i_flags & IFACE_SEED ) { LOG(log_error, logtype_atalkd, "netrange mismatch on %s", iface->i_name ); LOG(log_error, logtype_atalkd, "%u-%u != %u-%u", ntohs( firstnet ), ntohs( lastnet ), ntohs( iface->i_rt->rt_firstnet ), ntohs( iface->i_rt->rt_lastnet )); LOG(log_error, logtype_atalkd, "Seed error! Exiting!" ); return -1; } /* * It is possible that we will corrupt our route database * by just forcing this change. A better solution would * be to search all of our current routes, looking for * this new route, and delete any old versions. Also, we * would call rtmp_delete() on the old net range, in case * there is some other net which actually had that range. XXX */ iface->i_rt->rt_firstnet = firstnet; iface->i_rt->rt_lastnet = lastnet; if ( ntohs( iface->i_addr.sat_addr.s_net ) < ntohs( firstnet ) || ntohs( iface->i_addr.sat_addr.s_net ) > ntohs( lastnet )) { iface->i_addr.sat_addr.s_net = 0; /* ATADDR_ANYNET? */ } setaddr( iface, IFACE_PHASE2, iface->i_addr.sat_addr.s_net, iface->i_addr.sat_addr.s_node, firstnet, lastnet ); stabletimer = UNSTABLE; } /* add addr to loopback route */ if ( looproute( iface, RTMP_ADD )) { /* -1 or 1 */ LOG(log_error, logtype_atalkd, "zip_packet: can't route %u.%u to loopback: %s", ntohs( iface->i_addr.sat_addr.s_net ), iface->i_addr.sat_addr.s_node, strerror(errno) ); return -1; } LOG(log_info, logtype_atalkd, "zip_packet configured %s from %u.%u", iface->i_name, ntohs( from->sat_addr.s_net ), from->sat_addr.s_node ); iface->i_flags |= IFACE_CONFIG; if ( iface == ciface ) { ciface = ciface->i_next; bootaddr( ciface ); } break; case ZIPOP_NOTIFY : #ifdef DEBUG printf( "zip notify from %u.%u\n", ntohs( from->sat_addr.s_net ), from->sat_addr.s_node ); #endif /* DEBUG */ break; default : LOG(log_info, logtype_atalkd, "zip_packet bad zip op from %u.%u", ntohs( from->sat_addr.s_net ), from->sat_addr.s_node ); } break; case DDPTYPE_ATP : if ( data + sizeof( struct atphdr ) > end ) { LOG(log_info, logtype_atalkd, "zip atp malformed packet" ); return 1; } memcpy( &ah, data, sizeof( struct atphdr )); data += sizeof( struct atphdr ); if ( ah.atphd_ctrlinfo != ATP_TREQ ) { LOG(log_info, logtype_atalkd, "zip atp bad control" ); return 1; } ah.atphd_ctrlinfo = ATP_TRESP | ATP_EOM; if ( ah.atphd_bitmap != 1 ) { LOG(log_error, logtype_atalkd, "zip atp bad bitmap" ); return 1; } ah.atphd_bitmap = 0; zipop = *data++; data++; memcpy( &index, data, sizeof( u_short )); data += sizeof( u_short ); index = ntohs( index ); if ( data != end ) { LOG(log_info, logtype_atalkd, "zip atp malformed packet" ); return 1; } data = packet; end = data + sizeof( packet ); *data++ = DDPTYPE_ATP; memcpy( data, &ah, sizeof( struct atphdr )); data += sizeof( struct atphdr ); lastflag = data++; /* mark and space for last flag */ *data++ = 0; nzones = data; /* mark and space for zone count */ data += sizeof( u_short ); switch ( zipop ) { case ZIPOP_GETMYZONE : if ( index != 0 ) { LOG(log_info, logtype_atalkd, "zip atp gmz bad index" ); return 1; } if ( iface->i_flags & IFACE_LOOPBACK ) { iface = interfaces->i_next; /* first interface */ } else if ( ntohs( iface->i_rt->rt_firstnet ) > ntohs( from->sat_addr.s_net ) || ntohs( iface->i_rt->rt_lastnet ) < ntohs( from->sat_addr.s_net )) { return 0; } if ( iface->i_rt->rt_zt == NULL ) { return 0; } zt = (struct ziptab *)iface->i_rt->rt_zt->l_data; if ( data + 1 + zt->zt_len > end ) { LOG(log_info, logtype_atalkd, "zip atp gmz reply too long" ); return 1; } *data++ = zt->zt_len; memcpy( data, zt->zt_name, zt->zt_len ); data += zt->zt_len; *lastflag = 0; nz = 1; break; case ZIPOP_GETZONELIST : for ( zt = ziptab; zt && ( index > 1 ); zt = zt->zt_next, index-- ) ; for ( nz = 0; zt; zt = zt->zt_next, nz++ ) { if ( data + 1 + zt->zt_len > end ) { break; } *data++ = zt->zt_len; memcpy( data, zt->zt_name, zt->zt_len ); data += zt->zt_len; } *lastflag = ( zt == NULL ); /* Too clever? */ break; case ZIPOP_GETLOCALZONES : if ( iface->i_flags & IFACE_LOOPBACK ) { iface = interfaces->i_next; /* first interface */ } else if ( ntohs( iface->i_rt->rt_firstnet ) > ntohs( from->sat_addr.s_net ) || ntohs( iface->i_rt->rt_lastnet ) < ntohs( from->sat_addr.s_net )) { return 0; } for ( l = iface->i_rt->rt_zt; l && ( index > 1 ); l = l->l_next, index-- ) ; for ( nz = 0; l; l = l->l_next, nz++ ) { zt = (struct ziptab *)l->l_data; if ( data + 1 + zt->zt_len > end ) { break; } *data++ = zt->zt_len; memcpy( data, zt->zt_name, zt->zt_len ); data += zt->zt_len; } *lastflag = ( l == NULL ); break; default : LOG(log_info, logtype_atalkd, "zip atp bad option" ); return 1; } /* send reply */ if ( nz > 0 ) { nz = htons( nz ); memcpy( nzones, &nz, sizeof( u_short )); if ( sendto( ap->ap_fd, packet, data - packet, 0, (struct sockaddr *)from, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "zip atp sendto %u.%u: %s", ntohs( from->sat_addr.s_net ), from->sat_addr.s_node, strerror(errno) ); return 1; } } break; default : LOG(log_info, logtype_atalkd, "zip_packet bad ddp type from %u.%u", ntohs( from->sat_addr.s_net ), from->sat_addr.s_node ); return 1; } return 0; } int zip_getnetinfo(struct interface *iface) { struct atport *ap; struct ziphdr zh; struct sockaddr_at sat; char *data, packet[ 40 ]; u_short net; LOG(log_info, logtype_atalkd, "zip_getnetinfo for %s", iface->i_name ); for ( ap = iface->i_ports; ap; ap = ap->ap_next ) { if ( ap->ap_packet == zip_packet ) { break; } } if ( ap == NULL ) { LOG(log_error, logtype_atalkd, "zip_getnetinfo can't find zip socket!" ); return -1; } data = packet; *data++ = DDPTYPE_ZIP; zh.zh_op = ZIPOP_GNI; zh.zh_zero = 0; memcpy( data, &zh, sizeof( struct ziphdr )); data += sizeof( struct ziphdr ); net = 0; memcpy( data, &net, sizeof( u_short )); data += sizeof( u_short ); memcpy( data, &net, sizeof( u_short )); data += sizeof( u_short ); /* * Set our requesting zone to NULL, so the response will contain * the default zone. */ *data++ = 0; #ifdef BSD4_4 sat.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ sat.sat_family = AF_APPLETALK; sat.sat_addr.s_net = 0; sat.sat_addr.s_node = ATADDR_BCAST; sat.sat_port = ap->ap_port; if ( sendto( ap->ap_fd, packet, data - packet, 0, (struct sockaddr *)&sat, sizeof( struct sockaddr_at )) < 0 ) { LOG(log_error, logtype_atalkd, "zip_getnetinfo sendto: %s", strerror(errno) ); return -1; } return 0; } struct ziptab *newzt(const int len, const char *name) { struct ziptab *zt; if (( zt = (struct ziptab *)calloc(1, sizeof( struct ziptab ))) == NULL ) { return( NULL ); } zt->zt_len = len; if (( zt->zt_name = (char *)malloc( len )) == NULL ) { free(zt); return( NULL ); } memcpy( zt->zt_name, name, len ); return( zt ); } /* * Insert at the end. Return 1 if a mapping already exists, 0 otherwise. * -1 on error. */ static int add_list(struct list **head, void *data) { struct list *l, *l2; for ( l = *head; l; l = l->l_next ) { if ( l->l_data == data ) { return( 1 ); } } if (( l = (struct list *)malloc( sizeof( struct list ))) == NULL ) { LOG(log_error, logtype_atalkd, "add_list malloc: %s", strerror(errno) ); return -1; } l->l_data = data; l->l_next = NULL; if ( *head == NULL ) { l->l_prev = NULL; *head = l; } else { /* find end of list */ for ( l2 = *head; l2->l_next; l2 = l2->l_next ) ; l->l_prev = l2; l2->l_next = l; } return( 0 ); } int addzone(struct rtmptab *rt, int len, char *zone) { struct ziptab *zt; int cc, exists = 0; for ( zt = ziptab; zt; zt = zt->zt_next ) { if ( zt->zt_len == len && strndiacasecmp( zt->zt_name, zone, len ) == 0 ) { break; } } if ( zt == NULL ) { if (( zt = newzt( len, zone )) == NULL ) { LOG(log_error, logtype_atalkd, "addzone newzt: %s", strerror(errno) ); return -1; } if ( ziptab == NULL ) { zt->zt_prev = NULL; ziptab = zt; } else { zt->zt_prev = ziplast; ziplast->zt_next = zt; } ziplast = zt; } if ((cc = add_list( &zt->zt_rt, rt )) < 0) return -1; if (cc) exists++; if ((cc = add_list( &rt->rt_zt, zt )) < 0 ) return -1; if (cc) { if ( !exists ) { LOG(log_error, logtype_atalkd, "addzone corrupted route/zone mapping" ); return -1; } /* * We get the repeat for local nets which have zone information * already: we ask anyway, just to make sure. */ return 0; } if ( exists ) { LOG(log_error, logtype_atalkd, "addzone corrupted zone/route mapping" ); return -1; } return 0; } netatalk-2.2.2/doc/0000777000175200017500000000000011704770433011102 500000000000000netatalk-2.2.2/doc/Makefile.am0000644000175200017500000000010411655731126013046 00000000000000# Makefile.am for INSTALL/ EXTRA_DIST = DEVELOPER README.AppleTalk netatalk-2.2.2/doc/Makefile.in0000644000175200017500000002625711703521725013074 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for INSTALL/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = DEVELOPER README.AppleTalk all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/doc/DEVELOPER0000644000175200017500000002060311655731126012270 00000000000000Information for Netatalk Developers =================================== For basic installation instructions, see the INSTALL file. Netatalk is an implementation of "AFP over TCP". Netatalk also support the AppleTalk Protocol Suite for legacy Macs. The current release contains support for EtherTalk Phase I and II, DDP, RTMP, NBP, ZIP, AEP, ATP, PAP, ASP, AFP and DSI. The complete stack looks like this on a BSD-derived system: AFP AFP | | ASP PAP DSI \ / | ATP RTMP NBP ZIP AEP | | | | | | | -+---------------------------------------------------+- (kernel boundary) | Socket | +-----------------------+------------+--------------+ | | TCP | UDP | | DDP +------------+--------------+ | | IP | +-----------------------+---------------------------+ | Network-Interface | +---------------------------------------------------+ DSI is a session layer used to carry AFP over TCP. DDP is in the kernel. "atalkd" implements RTMP, NBP, ZIP, and AEP. It is the AppleTalk equivalent of Unix "routed". There is also a client-stub library for NBP. ATP and ASP are implemented as libraries. "papd" allows Macs to spool to "lpd", and "pap" allows Unix machines to print to AppleTalk connected printers. "psf" is a PostScript printer filter for "lpd", designed to use "pap". "psorder" is a PostScript reverser, called by "psf" to reverse pages printed to face-up stacking printers. "afpd" provides Macs with an interface to the Unix file system. Refer to the appropriate man pages for operational information. Compilation =========== The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. Tools for Developers ==================== 1. Libtool Libtool encapsulates the platform specific dependencies for the creation of libraries. It determines if the local platform can support shared libraries or if it only supports static libraries. Netatalk currently requires libtool 1.4 or higher (1.4b for OpenBSD). If you are using Tru64 you must apply the following patch to the file acinclude.m4 (normally found in /usr/share/libtool/libltdl). --- acinclude.m4.old Tue Nov 20 15:30:23 2001 +++ acinclude.m4 Tue Nov 20 15:31:54 2001 @@ -2226,6 +2226,7 @@ osf3* | osf4* | osf5*) version_type=osf + need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' Documentation: http://www.gnu.org/software/libtool/ Program: (see the GNU mirrors) /gnu/libtool/libtool-1.4.tar.gz 2. GNU m4 GNU m4 is an implementation of the Unix macro processor. It reads stdin and copies to stdout expanding defined macros as it processes the text. Documentation: http://www.gnu.org/software/m4/ Program: (see the GNU mirrors) /gnu/m4/m4-1.4.tar.gz 3. Autoconf Autoconf is a package of m4 macros that produce shell scripts to configure source code packages. Documentation: http://www.gnu.org/software/autoconf/ Program: (see the GNU mirrors) /gnu/autoconf/autoconf-2.52.tar.gz 4. Automake Automake is a tool that generates 'Makefile.in' files. Documentation: http://www.gnu.org/software/automake/ Program: (see the GNU mirrors) /gnu/automake/automake-1.5.tar.gz Optional ======== 5. OpenSSL and/or Libgcrypt The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a full-strength general purpose cryptography library. This is required to enable DHX login support. Get everything at http://www.openssl.org/ The Libgcrypt is a general purpose cryptographic library based on the code from GnuPG. This is required to enable DHX2 login support. Get everything at http://directory.fsf.org/project/libgcrypt/ 6. TCP Wrappers Wietse Venema's network logger, also known as TCPD or LOG_TCP. These programs log the client host name of incoming telnet, ftp, rsh, rlogin, finger etc. requests. Security options are: access control per host, domain and/or service; detection of host name spoofing or host address spoofing; booby traps to implement an early-warning system. TCP Wrappers can be gotten at ftp://ftp.porcupine.org/pub/security/ Netatalk uses TCP Wrappers to authorize host access when using afpovertcp. It should be noted that if DDP is in use, the connection will still be allowed as TCP Wrappers do not impact DDP connections. 7. PAM (Pluggable Authentication Modules) PAM provides a flexible mechanism for authenticating users. PAM was invented by SUN Microsystems. Author: Andrew Morgan Linux-PAM is a suite of shared libraries that enable the local system administrator to choose how applications authenticate users. You can get the Linux PAM documentation and sources from http://www.kernel.org/pub/linux/libs/pam/ Netatalk also supports other standard PAM implementations such as OpenPAM. 8. Berkeley DB Berkeley DB is a programmatic toolkit that provides fast, reliable, scalable, and mission-critical database support to software developers. BDB can downloaded from http://www.oracle.com/database/berkeley-db/index.html Netatalk's CNID database uses the library and header files from BDB. Currently, Netatalk supports BDB 4.6 and later. Error checking and logging ========================== We wan't rigid error checking and concise log messages. This often leads to signifant code bloat where the relevant function call is buried in error checking and logging statements. In order to alleviate error checking and code readability, we provide a set of error checking macros in . These macros compare the return value of statements againt 0, NULL, -1 (and maybe more, check it out). Every macro comes in four flavours: EC_CHECK, EC_CHECK_LOG, EC_CHECK_LOG_ERR and EC_CHECK_CUSTOM: - EC_CHECK just checks the CHECK - EC_CHECK_LOG additionally logs the stringified function call. - EC_CHECK_LOG_ERR allows specifying the return value - EC_CHECK_CUSTOM allows custom actions The macros EC_CHECK* unconditionally jump to a cleanup label where the neccessary cleanup can be done alongside controlling the return value. EC_CHECK_CUSTOM doesn't do that, so an extra "goto EC_CLEANUP" may be performed as appropiate. Example: - stat() without EC macro: static int func(const char *name) { int ret = 0; ... if ((ret = stat(name, &some_struct_stat)) != 0) { LOG(...); ret = -1; /* often needed to explicitly set the error indicating return value */ goto cleanup; } return ret; cleanup: ... return ret; } - stat() with EC macro: static int func(const char *name) { EC_INIT; /* expands to int ret = 0; */ char *uppername = NULL EC_NULL(uppername = strdup(name)); EC_ZERO(strtoupper(uppername)); EC_ZERO(stat(uppername, &some_struct_stat)); /* expands to complete if block from above */ EC_STATUS(0); EC_CLEANUP: if (uppername) free(uppername); EC_EXIT; } A boileplate function template is: int func(void) { EC_INIT; ...your code here... EC_STATUS(0); EC_CLEANUP: EC_EXIT; } netatalk-2.2.2/doc/README.AppleTalk0000644000175200017500000003112311655731126013553 00000000000000This is a README for the major platforms where Netatalk is in use. Platforms Covered: A. Linux B. Tru64 C. Solaris D.I OpenBSD D.II Other BSDs E. SunOS F. Generic ---------------------------------------------------------------- A. Linux We no longer include linux kernel code with netatalk, since Linux now includes AppleTalk support. 1. MAKE CONFIG. Configure your kernel with "make config". Answer yes to "AppleTalk DDP" support. 2. INSTALL KERNEL. Make and install your kernel. Be sure to update your boot blocks! 3. Linux 2.2.x provides the sendfile() call. This reduces overhead when sending/copying files. This option will be autoconfigured on compile. NOTE: you might run into problems if you have this option compiled in and you switch to a machine running an os < 2.2.x. Netatalk supplies two different types of Appletalk servers and both can run at the same time. Classic Appletalk requires afpd and atalkd. Appletalk over IP only requires afpd. Classic Appletalk on GNU/Linux requires that CONFIG_ATALK is compiled into the kernel or as a kernel module. To check to see if the kernel has Appletalk installed: $> dmesg | grep Apple This just parses the boot messages for any line containing 'Apple'. To see all the loaded modules (as root): $> lsmod If you don't find it, you may have to compile a kernel and turn on Appletalk in Networking options -> Appletalk DDP. You have an option to install as a module or directly into the kernel. Some default distribution kernels have already compiled Appletalk DDP as a module, you may have to edit your /etc/modules.conf to include: "alias net-pf-5 appletalk ". Note: check your distribution documentation about editing /etc/modules.conf. For more complete information about the Linux kernel see the Kernel-HOWTO: http://www.linuxdoc.org/HOWTO/Kernel-HOWTO.html A note for RedHat users: You may need to install the glibc-devel package to be able to compile Netatalk correctly. ---------------------------------------------------------------- B. TRU64 This is the Tru64 README file for netatalk. 1. Unfortunately, AppleTalk is not available for Digital Unix or Tru64. The reason for this is the kernel patches which Netatalk requires cannot be ported to Tru64. If anyone has the kernel source of Tru64 they are welcomed to port the AppleTalk modules themselves. As a result, only AppleShare over IP (ASIP) works with Tru64. That is, the program afpd. papd and atalkd compile, but doesn't really work. Anything that requires AppleTalk doesn't work. 2. Netatalk compiles on Tru64 V4.0D or higher using either the built-in DEC C compiler or GCC V2.95.3. Also, either the Tru64 make command or GNU make can be used. Netatalk supports Tru64's Security Integration Architecture (SIA) and runs on machines configured for Base (BSD) or Enhanced (OSFC2) Security without recompilation. 3. A peculiar bug in Netatalk has been noticed on a single Tru64 machine. However, because other Tru64 machines have not affected, a patch will not be forthcoming until the circumstances where the bug hits is isolated and a more elegant and appropriate patch can be found. In the meantime, there is a description of the bug below. Any users affected can attempt the workarounds provided. The user is urged to report this to the mailing list so that this bug can be isolated and removed. HAVE_GCC_MEMCPY_BUG Description - It appears that memcpy() under Tru64 can fail under some circumstances. This maybe due to the fact that Netatalk is compiled with gcc, but since only gcc can compile Netatalk, this is a mute point. Symptoms - The symptoms of this bug is that a 18432 byte file uploaded to the server would upload correctly, but a 18433 byte file would result in a sparse file many megabytes big (16MB+). However, due to the low-level nature of memcpy(), there is no reason why other symptoms could not occur. Workarounds - There are two known workarounds at this stage. - The first is to #define the macro HAVE_GCC_MEMCPY_BUG. This forces netatalk to use bcopy() in a few (but not all) cases within the code and is enough to stop the bug from occurring. This is the easiest workaround and would merely alter the standard compilation steps to CFLAGS="-DHAVE_GCC_MEMCPY_BUG" ./configure [...] make make install - The second workaround is to manually remove the optimisation flag "-O2" from within configure and/or configure.in. Although, this isn't the preferred workaround, it shows that the compiler is (at least) partially at fault. ---------------------------------------------------------------- C. SOLARIS 1. SELECT COMPILER. This distribution is configured to build with gcc. It should also work with cc. At the present time only cc v5.0 and gcc 3.1 and above can build the 64-bit kernel module. 1a. SELECT KERNEL TYPE. Edit sys/solaris/Makefile.kernel and set KCFLAGS to include sparcv9 support if you run a 64-bit kernel, or leave it commented out for a 32-bit kernel. Only UltraSPARC systems running Solaris 7 and above support a 64-bit kernel. If you're not sure what kernel you use, run "isainfo -v". You're running a 64-bit kernel if the result includes 64-bit (sparcv9), otherwize it's 32-bit. NOTE: If you want both the 32-bit and 64-bit kernel modules to be installed, first compile and install the version appropriate to the kernel that you're currently running, then make clean, compile and install the other version. 2. EDIT NETCONFIG. Add the following line to /etc/netconfig: ddp tpi_clts - appletalk ddp /dev/ddp - This makes the socket library aware of the AppleTalk protocol family. 3. INSTALL DRIVER. Since the STREAMS ddp driver must be installed as root, we've separated that portion of the build. Type make -f Makefile.kernel kinstall to install the driver. This copies the driver and its config file into /usr/kernel/drv and /usr/kernel/strmod, runs "add_drv ddp" to make the kernel aware of the new driver, and adds an rc file to /etc/rc?.d. Watch out for error messages after it runs add_drv. If you see something like devfsadm: driver failed to attach: ddp Warning: Driver (ddp) successfully added to system but failed to attach then recheck sys/solaris/Makefile.kernel and/or try a different compiler. 4. ATALKD.CONF. Under Solaris, you must create atalkd.conf, since Solaris provides no method for determining the names of the available interfaces. It is sufficent to name the available interfaces in atalkd.conf, one per line. E.g. le0 on a line by itself on many Suns. hme0 on Ultras. See atalkd(8). 5. PRINTING. Netatalk can use any postscript printer that has been set up for use by Solaris. If you haven't already set up a printer, type admintool then select Browse --> Printers, and then Edit --> Add and fill in the form for either a local or remote printer. If adding a local printer, set the Printer Type to PostScript. Then find a postscript file and test your printer from the command line. For example if you created a printer called "fred" your print command would be something like: lp -d fred some_file.ps Once you have a printer that works under Solaris, you need to create a papd.conf file. For example MacLaserjet:\ :pr=|/usr/bin/lp -d fred:\ :op=nobody:\ :pd=/usr/local/etc/HPLJ_4M.PPD: See doc/CONFIGURE for more information on papd.conf. Once you have this set up, and assuming netatalk starts up after /etc/rc2.d/S79atalk start you should be able to see the printer from the Macintosh Chooser. ---------------------------------------------------------------- D.I OpenBSD 1. KERNEL SUPPORT. Note that kernel support for netatalk appears in OpenBSD 2.2, or openbsd-current dated after Aug 1, 1997. But the 'comment out' character must be removed and the kernel must be recompiled. The kernel file that needs to be edited is usually located in: /usr/src/sys/conf Remove the first comment (#) from this line: # option NETATALK # AppleTalk Generally this is the GENERIC kernal. If you decide to rename the kernel, don't forget to go to /usr/src/sys/arch//conf/NEWNAME, and change the ../../../conf/GENERIC line to your NEWNAME. See http://www.openbsd.org/faq/faq5.html for more information on compiling a new kernel. 2. STARTING NETATALK. The rc scripts that come with openbsd to start netatalk are specific to an older version of netatalk. So, if you use the initscript provided in a current netatalk's distrib/initscripts directory, you must either add the lines from rc.atalk.bsd by hand into /etc/rc.local (or wherever you want to launch the daemons from) or modify your /etc/rc.local file to read: (currently says) # Netatalk stuff if [ -f /etc/netatalk/rc.atalk ]; then . /etc/netatlk/rc.atalk fi (change to) # Netatalk stuff if [ -f /etc/rc.atalk ]; then . /etc/rc.atalk fi and copy netatalk/distrib/initscripts/rc.atalk.bsd to /etc/rc.atalk. D.II Other BSDs 1. KERNEL SUPPORT. Note that kernel support for netatalk appears in FreeBSD 2.2-current dated after 12 September 1996. Add the line options NETATALK to the config file for your kernel. Rebuild and install your kernel. Reboot. ---------------------------------------------------------------- E. SunOS 1. KERNEL MODULE. This version of netatalk requires that your kernel be configured with options VDDRV The loadable kernel module is made and installed during the normal make and make install. NOTE: Unloading the kernel module may not work correctly and may cause your kernel to panic, hang, or do other nasty things. ---------------------------------------------------------------- F. Generic (It's unknown how applicable this is compared to the current codebase) The generic system profile is for use on systems that don't have native appletalk support. For those systems, it should still be possible to get the AFP/tcp portion of netatalk to still work. To do that, you will need the following information: 1) Endian order: If your machine does not specify the byte-order in netinet/in.h, you may need to modify netatalk/endian.h. 2) Integer sizes: If your machine does not define intX_t and u_intX_t, you will need to define them in netatalk/endian.h. To ease matters, you can specify _ISOC9X_SOURCE if you have inttypes.h, HAVE_64BIT_LONGS for 64 bit machines, or HAVE_32BIT_LONGS for 32 bit machines. NOTE: you should only use HAVE_32/64BIT_LONGS on machines that don't have a header file somewhere with the integer sizes. If you have a file with all the relevant bits, modify netatalk/endian.h to include it. 3) Quota/statfs information: You may be able to get away with either BSD4_4 or __svr4__, but that's unlikely if your os is some bizarre hybrid. If you don't have quota support, just specify NO_QUOTA_SUPPORT. In addition, if you'll need to specify the include file that gets statfs() (usually either USE_VFS_H or USE_STATFS_H although BSD4_4 and __svr4__ bring in a set of include files for that). Look at etc/afpd/quota.c, unix.c, and unix.h for more information. Finally, if you have a really old version of rquota, you can define USE_OLD_RQUOTA as well. 4) path information for lock/spool/printer files. you'll need to specify -D_PATH_LOCKDIR if include/atalk/paths.h doesn't have the correct paths specified for printer info and lock files. Beyond that, you should make sure that your operating system looks and smells like a Un*x POSIXy operating system. The only operating systems that netatalk supports that don't quite fit that description are sunos 4 and ultrix. If your operating system is peculiar, you may need to add in compatibility routines (libatalk/compat, include/atalk/compat.h) to make it look more like the others. If you would like native AppleTalk support, you will need kernel support for your operating system. Look at the Solaris STREAMS module if your operating system supports that framework. Otherwise, look at the ddp code in FreeBSD, NetBSD, or OpenBSD if your operating system is BSDish in nature. If your operating system looks different than these two cases, you'll have to roll your own implementation. netatalk-2.2.2/config.guess0000755000175200017500000012706110707444443012601 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-07-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa:Linux:*:*) echo xtensa-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: netatalk-2.2.2/sys/0000777000175200017500000000000011704770433011153 500000000000000netatalk-2.2.2/sys/Makefile.am0000644000175200017500000000011711655731130013116 00000000000000# Makefile.am for sys/ SUBDIRS = netatalk generic solaris netbsd sunos ultrix netatalk-2.2.2/sys/Makefile.in0000644000175200017500000004130511703521731013131 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for sys/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = sys DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = netatalk generic solaris netbsd sunos ultrix all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sys/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign sys/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/sys/generic/0000777000175200017500000000000011704770432012566 500000000000000netatalk-2.2.2/sys/generic/Makefile.am0000644000175200017500000000001611655731130014530 00000000000000SUBDIRS = sys netatalk-2.2.2/sys/generic/Makefile.in0000644000175200017500000004123411703521731014546 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = sys/generic DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = sys all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sys/generic/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign sys/generic/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/sys/generic/sys/0000777000175200017500000000000011704770433013405 500000000000000netatalk-2.2.2/sys/generic/sys/Makefile.am0000644000175200017500000000002511655731130015346 00000000000000EXTRA_DIST = cdefs.h netatalk-2.2.2/sys/generic/sys/Makefile.in0000644000175200017500000002624411703521731015370 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = sys/generic/sys DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = cdefs.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sys/generic/sys/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign sys/generic/sys/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/sys/generic/sys/cdefs.h0000644000175200017500000000056211655731130014555 00000000000000/* * $Id: cdefs.h,v 1.4 2001-08-15 15:29:14 srittau Exp $ */ #ifndef _SYS_CDEFS_H #define _SYS_CDEFS_H 1 #if defined(__STDC__) || defined(__DECC) /* Note that there must be exactly one space between __P(args) and args, * otherwise DEC C chokes. */ #define __P(args) args #else /* __STDC__ */ #define __P(args) () #endif /* __STDC__ */ #endif /* sys/cdefs.h */ netatalk-2.2.2/sys/sunos/0000777000175200017500000000000011704770433012322 500000000000000netatalk-2.2.2/sys/sunos/Makefile.am0000644000175200017500000000004611655731130014266 00000000000000EXTRA_DIST = Makefile.kernel at_sun.c netatalk-2.2.2/sys/sunos/Makefile.in0000644000175200017500000002624311703521731014304 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = sys/sunos DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = Makefile.kernel at_sun.c all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sys/sunos/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign sys/sunos/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/sys/sunos/at_sun.c0000644000175200017500000002304211655731130013670 00000000000000/* * $Id: at_sun.c,v 1.2 2001-08-06 13:39:30 rufustfirefly Exp $ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #undef s_net #include #include #include #include #include struct vdlat { int vda_magic; char *vda_name; } atvdl = { VDMAGIC_USER, "netatalk" }; struct ifqueue *atef_input(); int atef_output(); extern int atintr(); extern u_char aarp_org_code[ 3 ]; extern u_char at_org_code[ 3 ]; /* * Entries in this table are inserted into the ether_families linked * list at the beginnning. As such, they will be searched by the input * and output routines opposite to the order here. * * In order to do both phase 1 and phase 2 during output, we have a * special entry (the AF_APPLETALK entry) whose ethertype field is * changed by the output function, to reflect the actual link layer * to be used. This ether_family entry is never seen during Ethernet * input, since the earlier entry captures all packets (it is seen * during loopback input, in that the input function is called directly * on loopback output). */ struct ether_family ether_atalk[] = { { AF_APPLETALK, 0, /* Changed by atef_output() */ atef_input, atef_output, atintr, }, { 0, ETHERTYPE_AARP, atef_input, 0, 0, }, { 0, ETHERTYPE_AT, atef_input, 0, atintr, }, { 0, EF_8023_TYPE, atef_input, 0, atintr, }, }; int ether_atalkN = sizeof( ether_atalk ) / sizeof( ether_atalk[ 0 ] ); extern struct ether_family *ether_families; extern int atalk_hash(), atalk_netmatch(); extern int null_hash(), null_netmatch(); xxxinit( cmd, vdd, vdi, vds ) unsigned int cmd; struct vddrv *vdd; addr_t vdi; struct vdstat *vds; { struct ether_family *ef; struct domain *dom; struct protosw *pr; int i; switch( cmd ) { case VDLOAD : vdd->vdd_vdtab = (struct vdlinkage *)&atvdl; /* * Register with the network-interface layer (ethernet). */ for ( i = 0; i < ether_atalkN; i++ ) { ether_register( ðer_atalk[ i ] ); } /* * Register with the socket layer. */ atalkdomain.dom_next = domains; domains = &atalkdomain; if ( atalkdomain.dom_init ) { (*atalkdomain.dom_init)(); } for ( pr = atalkdomain.dom_protosw; pr < atalkdomain.dom_protoswNPROTOSW; pr++ ) { if ( pr->pr_init ) { (*pr->pr_init)(); } } /* * Cobble ourselves into the routing table. */ afswitch[ AF_APPLETALK ].af_hash = atalk_hash; afswitch[ AF_APPLETALK ].af_netmatch = atalk_netmatch; return( 0 ); case VDUNLOAD : /* * Make sure that there are no open appletalk sockets. */ if ( ddpcb != NULL ) { return( EMFILE ); } /* * There is no ether_unregister(), so we'll have to do it * our selves... */ for ( i = 0; i < ether_atalkN; i++ ) { if ( ether_families == ðer_atalk[ i ] ) { ether_families = ether_families->ef_next; continue; } else { for ( ef = ether_families; ef->ef_next; ef = ef->ef_next ) { if ( ef->ef_next == ðer_atalk[ i ] ) { ef->ef_next = ef->ef_next->ef_next; break; } } } } /* * Remove aarp timers and held packets. */ aarp_clean(); /* * Remove AppleTalk interface addresses. */ aa_clean(); /* * Remove our routines from the routing table. */ afswitch[ AF_APPLETALK ].af_hash = null_hash; afswitch[ AF_APPLETALK ].af_netmatch = null_netmatch; /* * Remove atalkdomain from the domains list. * Unlikely, but someone may have registered after us. */ if ( domains == &atalkdomain ) { domains = domains->dom_next; } else { for ( dom = domains; dom->dom_next; dom = dom->dom_next ) { if ( dom->dom_next == &atalkdomain ) { dom->dom_next = dom->dom_next->dom_next; break; } } } return( 0 ); case VDSTAT : return( 0 ); default : return( EIO ); } } /* * Input routine for netatalk on suns. There are five possible * packets. First, packets received on the loopback interface * are immediately sent to the phase 1 interrupt queue (this will * have to change if we ever do a phase 2 only version). Second, * IEEE802 packet are sent to either the aarpinput() routine or * the phase 2 interrupt queue. Finally, DIX packets are sent * to either aarpinput() or the phase 1 interrupt queue. */ struct ifqueue * atef_input( ifp, m, header ) struct ifnet *ifp; struct mbuf *m; struct ether_header *header; { struct llc llc; struct mbuf *n = 0; /* * Check first for LOOPBACK flag, since loopback code passes NULL for * the header. */ if ( ifp->if_flags & IFF_LOOPBACK ) { return( &atintrq2 ); } /* * Before SunOS 4.1, the ether_type was passed as is from the * packet. After SunOS 4.1, the ether_type is swapped in * do_protocol(), before the ether_family routines are called. */ #if defined( sun ) && defined( i386 ) header->ether_type = ntohs( header->ether_type ); #endif /* sun i386 */ if ( header->ether_type <= ETHERMTU ) { /* IEEE802 */ /* * We need to remove the interface pointer from the beginning of this * packet. We can't always use IF_ADJ(), since it can (and will, * very often) MFREE() the first mbuf in our chain. If IF_ADJ() * would free the first mbuf, we just advance our pointer to the * next mbuf. Since our calling routine passes m by value, we're * not actually losing m. Later, we don't need to put the interface * pointer back on, since the caller still has it in its copy of m. */ if ( m->m_len == sizeof( struct ifnet * )) { n = m; m = m->m_next; } else { IF_ADJ( m ); } /* * We can't call m_pullup(), since we need to preserve * the value of m. */ if ( m->m_len < sizeof( struct llc )) { printf( "atef_input size llc\n" ); ( n ) ? m_freem( n ) : m_freem( m ); return( 0 ); } bcopy( mtod( m, caddr_t ), &llc, sizeof( struct llc )); if ( llc.llc_dsap != LLC_SNAP_LSAP || llc.llc_ssap != LLC_SNAP_LSAP || llc.llc_control != LLC_UI ) { ( n ) ? m_freem( n ) : m_freem( m ); return( 0 ); } /* * See IF_ADJ() above. Here we prepend ifp to the mbuf chain. If we * didn't remove it earlier, we don't replace it here. */ if ( n ) { m_adj( m, sizeof( struct llc )); } else { m_adj( m, sizeof( struct llc ) - sizeof( struct ifnet *)); if ( m->m_len < sizeof( struct ifnet * )) { printf( "atef_input too small!\n" ); m_freem( m ); return( 0 ); } *mtod( m, struct ifnet ** ) = ifp; } if ( ntohs( llc.llc_ether_type ) == ETHERTYPE_AT && bcmp( llc.llc_org_code, at_org_code, sizeof( at_org_code )) == 0 ) { return( &atintrq2 ); } /* do we really want to pass m, here? what happened to n? XXX */ if ( ntohs( llc.llc_ether_type ) == ETHERTYPE_AARP && bcmp( llc.llc_org_code, aarp_org_code, sizeof( aarp_org_code )) == 0 ) { aarpinput( ifp, n ? n : m ); return( 0 ); } } else { /* DIX */ switch ( header->ether_type ) { case ETHERTYPE_AT : return( &atintrq1 ); case ETHERTYPE_AARP : aarpinput( ifp, m ); return( 0 ); } } ( n ) ? m_freem( n ) : m_freem( m ); return( 0 ); } /* * If the destination is on a 802.3 wire, do phase 2 encapsulation, * adding the 802.2 and SNAP headers. Always fill in the edst with the * ethernet address of the destination. */ atef_output( dst, m, ifp, edst ) struct sockaddr_at *dst; struct mbuf *m; struct ifnet *ifp; struct ether_addr *edst; { struct at_ifaddr *aa; struct mbuf *m0; struct llc llc; int s; s = splimp(); if ( !aarpresolve( ifp, m, dst, edst )) { (void) splx( s ); return( 1 ); } (void) splx( s ); /* * ifaddr is the first thing in at_ifaddr */ if (( aa = (struct at_ifaddr *)at_ifawithnet( dst, ifp->if_addrlist )) == 0 ) { m_freem( m ); return( 1 ); } /* * In the phase 2 case, we need to prepend an mbuf for the llc header. * Since we must preserve the value of m, which is passed to us by * value, we m_copy() the first mbuf, and use it for our llc header. * * We could worry about leaving space for the ether header, but * since we'll have to go through all sorts of hoops, including a * possibly large copy, there's really no sense. */ if ( aa->aa_flags & AFA_PHASE2 ) { if ( M_HASCL( m ) || m->m_off - MMINOFF < sizeof( struct llc )) { if (( m0 = m_copy( m, 0, m->m_len )) == 0 ) { m_freem( m ); return( 1 ); } if ( M_HASCL( m )) { /* m is a cluster */ int s = splimp(); mclput( m ); splx( s ); } m0->m_next = m->m_next; m->m_next = m0; m->m_off = MMAXOFF - sizeof( struct llc ); m->m_len = sizeof( struct llc ); } else { m->m_off -= sizeof( struct llc ); m->m_len += sizeof( struct llc ); } llc.llc_dsap = llc.llc_ssap = LLC_SNAP_LSAP; llc.llc_control = LLC_UI; bcopy( at_org_code, llc.llc_org_code, sizeof( at_org_code )); llc.llc_ether_type = htons( ETHERTYPE_AT ); bcopy( &llc, mtod( m, caddr_t ), sizeof( struct llc )); ether_atalk[ 0 ].ef_ethertype = EF_8023_TYPE; return( 0 ); } else { ether_atalk[ 0 ].ef_ethertype = ETHERTYPE_AT; return( 0 ); } } netatalk-2.2.2/sys/sunos/Makefile.kernel0000644000175200017500000001070711655731130015156 00000000000000# Sun specific defines, passed to subdirectories. DEFS= -DBSD4_3 -DUSE_OLD_RQUOTA -DUSE_UFS_QUOTA_H -DUSE_MNTENT_H \ -DDLSYM_PREPEND_UNDERSCORE OPTOPTS= -O CC= gcc INSTALL= install # use -lbind instead of -lresolv if you're using BIND >= 8.x AFPLIBS=-lresolv ADDLIBS= #CSHAREDFLAGS= -pic CSHAREDFLAGS= -fPIC #LDFLAGS_EXPORT= LDSHARED= ld LDSHAREDFLAGS= -assert pure-text LIBSHARED= -ldl # source for kernel module SRC= at_sun.c aarp.c at_control.c at_proto.c ddp_input.c ddp_output.c \ ddp_usrreq.c OBJ= at_sun.o aarp.o at_control.o at_proto.o ddp_input.o ddp_output.o \ ddp_usrreq.o INCPATH = -I../../include -I../netatalk CFLAGS= ${DEFS} ${OPTOPTS} ${INCPATH} ALL= ../../libatalk ../../include ../../bin ../../etc ../../man all: kernel ${ALL} kernel : netatalk.o netatalk.o: ${OBJ} ${LD} -r -o netatalk.o ${OBJ} at_sun.o: at_sun.c ${CC} ${CFLAGS} -DKERNEL -D`arch -k` -c at_sun.c aarp.o: ../netatalk/aarp.c ${CC} ${CFLAGS} -DKERNEL -D`arch -k` -c ../netatalk/aarp.c at_control.o: ../netatalk/at_control.c ${CC} ${CFLAGS} -DKERNEL -D`arch -k` -c ../netatalk/at_control.c at_proto.o: ../netatalk/at_proto.c ${CC} ${CFLAGS} -DKERNEL -D`arch -k` -c ../netatalk/at_proto.c ddp_input.o: ../netatalk/ddp_input.c ${CC} ${CFLAGS} -DKERNEL -D`arch -k` -c ../netatalk/ddp_input.c ddp_output.o: ../netatalk/ddp_output.c ${CC} ${CFLAGS} -DKERNEL -D`arch -k` -c ../netatalk/ddp_output.c ddp_usrreq.o: ../netatalk/ddp_usrreq.c ${CC} ${CFLAGS} -DKERNEL -D`arch -k` -c ../netatalk/ddp_usrreq.c ../../bin ../../etc: ../../libatalk ${ALL}: FRC cd $@; ${MAKE} ${MFLAGS} CC="${CC}" \ ADDLIBS="${ADDLIBS}" DEFS="${DEFS}" OPTOPTS="${OPTOPTS}" \ SBINDIR="${SBINDIR}" BINDIR="${BINDIR}" RESDIR="${RESDIR}" \ ETCDIR="${ETCDIR}" LIBDIR="${LIBDIR}" INCDIR="${INCDIR}" \ AFPLIBS="${AFPLIBS}" LDSHARED="${LDSHARED}" \ LDFLAGS_EXPORT="${LDFLAGS_EXPORT}" \ LDSHAREDFLAGS="${LDSHAREDFLAGS}" CSHAREDFLAGS="${CSHAREDFLAGS}" \ LIBSHARED="${LIBSHARED}" \ all FRC: kinstall : kernel -mkdir ${DESTDIR} -mkdir ${ETCDIR} ${INSTALL} -c netatalk.o ${ETCDIR} install : kinstall -mkdir ${DESTDIR} -mkdir ${SBINDIR} -mkdir ${BINDIR} -mkdir ${ETCDIR} -mkdir ${LIBDIR} for i in ${ALL}; \ do (cd $$i; ${MAKE} ${MFLAGS} CC="${CC}" \ ADDLIBS="${ADDLIBS}" DEFS="${DEFS}" OPTOPTS="${OPTOPTS}" \ SBINDIR="${SBINDIR}" BINDIR="${BINDIR}" RESDIR="${RESDIR}" \ ETCDIR="${ETCDIR}" LIBDIR="${LIBDIR}" INCDIR="${INCDIR}" \ DESTDIR="${DESTDIR}" MANDIR="${MANDIR}" AFPLIBS="${AFPLIBS}" \ AFSDIR="${AFSDIR}" KRBDIR="${KRBDIR}" \ LDSHARED="${LDSHARED}" LDFLAGS_EXPORT="${LDFLAGS_EXPORT}" \ LDSHAREDFLAGS="${LDSHAREDFLAGS}" \ CSHAREDFLAGS="${CSHAREDFLAGS}" LIBSHARED="${LIBSHARED}" \ INSTALL="${INSTALL}" $@); \ done rm -f ${ETCDIR}/rc.atalk sed -e s@:DESTDIR:@${DESTDIR}@ -e s@:SBINDIR:@${SBINDIR}@ \ -e s@:BINDIR:@${BINDIR}@ -e s@:RESDIR:@${RESDIR}@ \ -e s@:ETCDIR:@${ETCDIR}@ -e s@:LIBDIR:@${LIBDIR}@ \ -e s@:INCDIR:@${INCDIR}@ -e 's@^##@@' \ < ../../distrib/initscripts/rc.atalk.bsd > ${ETCDIR}/rc.atalk if [ -f ${ETCDIR}/afpd.conf ]; then \ echo "Retaining old afpd.conf file."; \ else \ sed -e s@:DESTDIR:@${DESTDIR}@ -e s@:SBINDIR:@${SBINDIR}@ \ -e s@:BINDIR:@${BINDIR}@ -e s@:RESDIR:@${RESDIR}@ \ -e s@:ETCDIR:@${ETCDIR}@ -e s@:LIBDIR:@${LIBDIR}@ \ -e s@:INCDIR:@${INCDIR}@ \ < ../../config/afpd.conf > ${ETCDIR}/afpd.conf; \ fi @echo @echo "Install is done. Don't forget to add lines from" @echo "services.atalk to /etc/services and to call rc.atalk" @echo "in /etc/rc. See README and README.SUN for more" @echo "information." clean : sysclean for i in ${ALL}; \ do (cd $$i; ${MAKE} ${MFLAGS} clean); \ done sysclean : rm -f a.out core* *.o *.bak *[Ee]rrs tags rm -f netatalk.o depend : for i in ${ALL}; \ do (cd $$i; ${MAKE} ${MFLAGS} DEFS=${DEFS} depend); \ done for i in ${SRC} ; do \ ${CC} -M ${DEFS} ${INCPATH} $$i | \ awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ else rec = rec " " $$2 } } \ END { print rec } ' >> makedep; done sed -n '1,/^# DO NOT DELETE THIS LINE/p' Makefile > Makefile.tmp cat makedep >> Makefile.tmp rm makedep echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile.tmp echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile.tmp echo '# see make depend above' >> Makefile.tmp rm -f Makefile.bak cp Makefile Makefile.bak mv Makefile.tmp Makefile # DO NOT DELETE THIS LINE netatalk-2.2.2/sys/netbsd/0000777000175200017500000000000011704770433012432 500000000000000netatalk-2.2.2/sys/netbsd/Makefile.am0000644000175200017500000000002311655731130014371 00000000000000SUBDIRS = netatalk netatalk-2.2.2/sys/netbsd/Makefile.in0000644000175200017500000004123611703521731014413 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = sys/netbsd DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = netatalk all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sys/netbsd/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign sys/netbsd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/sys/netbsd/netatalk/0000777000175200017500000000000011704770433014235 500000000000000netatalk-2.2.2/sys/netbsd/netatalk/Makefile.am0000644000175200017500000000002611655731130016177 00000000000000EXTRA_DIST = endian.h netatalk-2.2.2/sys/netbsd/netatalk/Makefile.in0000644000175200017500000002626111703521731016217 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = sys/netbsd/netatalk DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = endian.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sys/netbsd/netatalk/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign sys/netbsd/netatalk/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/sys/netbsd/netatalk/endian.h0000644000175200017500000000041711655731130015556 00000000000000 /* * netatalk/endian.h * * This file is a dummy replacement for endian.h. NetBSD includes * machine/endian.h in sys/types.h, and it was decided that a * second include file was not needed. This file is included to * make all the source code compile correctly. */ netatalk-2.2.2/sys/solaris/0000777000175200017500000000000011704770433012627 500000000000000netatalk-2.2.2/sys/solaris/ioc.c0000644000175200017500000000562111655731130013461 00000000000000/* $Id: ioc.c,v 1.3 2005-04-28 20:50:07 bfernhomberg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #ifdef STDC_HEADERS #include #else #include #endif #include "ioc.h" void ioc_ok_ack( queue_t *q, mblk_t *m, int rval ) { struct iocblk *ioc; mblk_t *m0; if (( m0 = unlinkb( m )) != NULL ) { freemsg( m0 ); } if ( m->b_wptr - m->b_rptr < sizeof( struct iocblk )) { cmn_err( CE_CONT, "ioc_ok_ack too small\n" ); freemsg( m ); return; } m->b_datap->db_type = M_IOCACK; m->b_wptr = m->b_rptr + sizeof( struct iocblk ); ioc = (struct iocblk *)m->b_rptr; ioc->ioc_error = 0; ioc->ioc_count = 0; ioc->ioc_rval = rval; qreply( q, m ); return; } void ioc_error_ack( queue_t *q, mblk_t *m, int errno ) { struct iocblk *ioc; mblk_t *m0; if (( m0 = unlinkb( m )) != NULL ) { freemsg( m0 ); } if ( m->b_wptr - m->b_rptr < sizeof( struct iocblk )) { cmn_err( CE_CONT, "ioc_error_ack too small\n" ); freemsg( m ); return; } m->b_datap->db_type = M_IOCNAK; m->b_wptr = m->b_rptr + sizeof( struct iocblk ); ioc = (struct iocblk *)m->b_rptr; ioc->ioc_error = errno; ioc->ioc_count = 0; ioc->ioc_rval = -1; qreply( q, m ); return; } void ioc_copyin( queue_t *q, mblk_t *m, mblk_t *private, caddr_t addr, uint size ) { struct copyreq *cq; mblk_t *m0; if (( m0 = unlinkb( m )) != NULL ) { freemsg( m0 ); } #ifdef notdef /* supposedly this will fit anyway */ if ( m->b_wptr - m->b_rptr < sizeof( struct copyreq )) { cmn_err( CE_CONT, "ioc_copyin too small\n" ); freemsg( m ); return; } #endif /* notdef */ m->b_datap->db_type = M_COPYIN; m->b_wptr = m->b_rptr + sizeof( struct copyreq ); cq = (struct copyreq *)m->b_rptr; cq->cq_addr = addr; cq->cq_size = size; cq->cq_flag = 0; cq->cq_private = private; qreply( q, m ); return; } void ioc_copyout( queue_t *q, mblk_t *m, mblk_t *private, caddr_t data, caddr_t addr, uint size ) { struct copyreq *cq; mblk_t *m0; if (( m0 = unlinkb( m )) != NULL ) { freemsg( m0 ); } #ifdef notdef /* supposedly this will fit anyway */ if ( m->b_wptr - m->b_rptr < sizeof( struct copyreq )) { cmn_err( CE_CONT, "ioc_copyout too small\n" ); freemsg( m ); return; } #endif /* notdef */ if (( m0 = allocb( size, BPRI_MED )) == NULL ) { cmn_err( CE_CONT, "ioc_copyout nomem\n" ); freemsg( m ); return; } m0->b_wptr = m0->b_rptr + size; bcopy( data, m0->b_rptr, size ); linkb( m, m0 ); m->b_datap->db_type = M_COPYOUT; m->b_wptr = m->b_rptr + sizeof( struct copyreq ); cq = (struct copyreq *)m->b_rptr; cq->cq_addr = addr; cq->cq_size = size; cq->cq_flag = 0; cq->cq_private = private; qreply( q, m ); return; } netatalk-2.2.2/sys/solaris/Makefile.in0000644000175200017500000001231511655731130014606 00000000000000# Solaris specific defines, passed to subdirectories. # To use Sun CC, uncomment the CC and KFLAGS variables. # # $Id: Makefile.in,v 1.6 2009-11-25 14:58:26 franklahm Exp $ # This Makefile.in is not automake generated # copy and paste from automake Makefile.in srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ # end copy and paste CC = @CC@ # LD hardcoded to sun ld, GNU ld has been reported to cause some trouble with 64 bit LD = /usr/ccs/bin/ld INSTALL = @INSTALL@ GREP=@GREP@ # -D_ISOC9X_SOURCE is handled by OSVERSION. basically, it's not needed # with 2.5.1. DEFS= -D__svr4__ -DSOLARIS -I../../sys/generic \ -I.. @DEFS@ # Variables KCFLAGS=@KCFLAGS@ KLDFLAGS=@KLDFLAGS@ COMPILE_KERNEL_GCC=@COMPILE_KERNEL_GCC@ SPARC64=@COMPILE_64BIT_KMODULE@ SOLARIS_MODULE_FALSE=@SOLARIS_MODULE_FALSE@ SOLARIS_MODULE_TRUE=@SOLARIS_MODULE_TRUE@ USE_SOLARIS_TRUE=@USE_SOLARIS_TRUE@ USE_SOLARIS_FALSE=@USE_SOLARIS_FALSE@ OPTOPTS= # Local build stuff. SRC= linkage.c tpi.c dlpi.c ioc.c if.c aarp.c ddp.c sock.c rt.c OBJ= linkage.o tpi.o dlpi.o ioc.o if.o aarp.o ddp.o sock.o rt.o HEADERS= if.h ioc.h rt.h sock.h EXTRA_DIST= ddp.conf Makefile.in $(SRC) $(HEADERS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) INCPATH= -I../../include -I../netatalk -I../.. CFLAGS= ${DEFS} ${OPTOPTS} ${INCPATH} ${KCFLAGS} # Not building on Solaris @USE_SOLARIS_FALSE@all: # No Solaris kernel module build @USE_SOLARIS_TRUE@@SOLARIS_MODULE_FALSE@all: @USE_SOLARIS_TRUE@@SOLARIS_MODULE_FALSE@ @echo @USE_SOLARIS_TRUE@@SOLARIS_MODULE_FALSE@ @echo "Solaris kernel module cannot be build" @SOLARIS_MODULE_FALSE@install: @SOLARIS_MODULE_FALSE@ @SOLARIS_MODULE_FALSE@uninstall: # Build Solaris kernel module @SOLARIS_MODULE_TRUE@all : kernel @SOLARIS_MODULE_TRUE@kernel: ddp @SOLARIS_MODULE_TRUE@FRC: @SOLARIS_MODULE_TRUE@ddp : ${OBJ} @SOLARIS_MODULE_TRUE@ ${LD} ${KLDFLAGS} -r -o ddp ${OBJ} @SOLARIS_MODULE_TRUE@linkage.o : linkage.c @SOLARIS_MODULE_TRUE@ ${CC} ${CFLAGS} -DVERSION=\"`cat ../../VERSION`\" -c linkage.c @SOLARIS_MODULE_TRUE@kuninstall : FRC @SOLARIS_MODULE_TRUE@ @if [ x"${SPARC64}" = x"yes" ] ; then \ @SOLARIS_MODULE_TRUE@ ${RM} /usr/kernel/drv/sparcv9/ddp; \ @SOLARIS_MODULE_TRUE@ ${RM} /usr/kernel/strmod/sparcv9/ddp; \ @SOLARIS_MODULE_TRUE@ else \ @SOLARIS_MODULE_TRUE@ ${RM} /usr/kernel/drv/ddp; \ @SOLARIS_MODULE_TRUE@ ${RM} /usr/kernel/strmod/ddp; \ @SOLARIS_MODULE_TRUE@ fi @SOLARIS_MODULE_TRUE@ ${RM} /usr/kernel/drv/ddp.conf @SOLARIS_MODULE_TRUE@ -rem_drv ddp @SOLARIS_MODULE_TRUE@ sync;sync;sync @SOLARIS_MODULE_TRUE@kinstall : kernel kuninstall @SOLARIS_MODULE_TRUE@ @if [ x"${SPARC64}" = x"yes" ]; then \ @SOLARIS_MODULE_TRUE@ ${INSTALL} -o root -g sys -c ddp /usr/kernel/drv/sparcv9/ddp; \ @SOLARIS_MODULE_TRUE@ ln /usr/kernel/drv/sparcv9/ddp /usr/kernel/strmod/sparcv9/ddp; \ @SOLARIS_MODULE_TRUE@ else \ @SOLARIS_MODULE_TRUE@ ${INSTALL} -o root -g sys -c ddp /usr/kernel/drv/ddp; \ @SOLARIS_MODULE_TRUE@ ln /usr/kernel/drv/ddp /usr/kernel/strmod/ddp; \ @SOLARIS_MODULE_TRUE@ fi @SOLARIS_MODULE_TRUE@ ${INSTALL} -o root -g sys -c ddp.conf /usr/kernel/drv/ddp.conf @SOLARIS_MODULE_TRUE@ add_drv -m '* 0666 root sys' ddp @SOLARIS_MODULE_TRUE@ sync;sync;sync @SOLARIS_MODULE_TRUE@ @if ${GREP} 'ddp' /etc/netconfig; then \ @SOLARIS_MODULE_TRUE@ echo "netconfig already contains a ddp module, skipping"; \ @SOLARIS_MODULE_TRUE@ else \ @SOLARIS_MODULE_TRUE@ echo "adding ddp module to netconfig"; \ @SOLARIS_MODULE_TRUE@ echo "ddp tpi_clts - appletalk ddp /dev/ddp -" >> /etc/netconfig; \ @SOLARIS_MODULE_TRUE@ fi @SOLARIS_MODULE_TRUE@ @echo "Installed Solaris kernel module" @SOLARIS_MODULE_TRUE@install: @SOLARIS_MODULE_TRUE@ @echo @SOLARIS_MODULE_TRUE@ @echo "To install the Solaris kernel module type 'make kinstall' as root user" @SOLARIS_MODULE_TRUE@uninstall: @SOLARIS_MODULE_TRUE@ @echo @SOLARIS_MODULE_TRUE@ @echo "To uninstall the Solaris kernel module type 'make kuninstall' as root user" # copy and paste from automake Makefile.in distdir : $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done # end copy and paste clean : sysclean klean sysclean : rm -f a.out core* *.o *.bak *[Ee]rrs tags rm -f ddp distclean: clean -rm -f Makefile maintainer-clean: distclean depend : check: tags: dvi: installcheck: install-exec: # DO NOT DELETE THIS LINE netatalk-2.2.2/sys/solaris/ioc.h0000644000175200017500000000035111655731130013461 00000000000000void ioc_ok_ack( queue_t *, mblk_t *, int ); void ioc_error_ack( queue_t *, mblk_t *, int ); void ioc_copyin( queue_t *, mblk_t *, mblk_t *, caddr_t, uint ); void ioc_copyout( queue_t *, mblk_t *, mblk_t *, caddr_t, caddr_t, uint ); netatalk-2.2.2/sys/solaris/ddp.c0000644000175200017500000000317611655731130013461 00000000000000/* * $Id: ddp.c,v 1.3 2002-01-17 06:13:02 srittau Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #ifdef STDC_HEADERS #include #else #include #endif #include #include #include #include "if.h" #include "sock.h" int ddp_rput( struct atif_data *aid, mblk_t *m ) { struct atif_data *daid; struct ddpehdr *deh; struct sockaddr_at sat; struct sock_data *sd; if ( m->b_wptr - m->b_rptr < sizeof( struct ddpehdr )) { cmn_err( CE_NOTE, "ddp_rput short packet\n" ); freemsg( m ); return( EINVAL ); } deh = (struct ddpehdr *)m->b_rptr; sat.sat_addr.s_net = deh->deh_dnet; sat.sat_addr.s_node = deh->deh_dnode; sat.sat_port = deh->deh_dport; if (( daid = if_dest( aid, &sat )) != NULL ) { if (( sd = sock_dest( daid, &sat )) != NULL ) { if ( sd->sd_state != TS_IDLE ) { freemsg( m ); return( EHOSTDOWN ); } bzero( (caddr_t)&sat, sizeof( struct sockaddr_at )); sat.sat_family = AF_APPLETALK; sat.sat_addr.s_net = deh->deh_snet; sat.sat_addr.s_node = deh->deh_snode; sat.sat_port = deh->deh_sport; adjmsg( m, sizeof( struct ddpehdr )); t_unitdata_ind( WR( sd->sd_q ), m, &sat ); } else { /* toss it */ freemsg( m ); return( EHOSTDOWN ); } } else { /* route it */ freemsg( m ); return( ENETUNREACH ); } return( 0 ); } netatalk-2.2.2/sys/solaris/ddp.conf0000644000175200017500000000012311655731130014151 00000000000000# # Netatalk driver's configuration file # name="ddp" parent="pseudo" instance=0; netatalk-2.2.2/sys/solaris/dlpi.c0000644000175200017500000002670611655731130013646 00000000000000/* $Id: dlpi.c,v 1.2 2002-01-17 06:13:02 srittau Exp $ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ioc.h" #include "if.h" u_char at_multicastaddr[ ETHERADDRL ] = { 0x09, 0x00, 0x07, 0xff, 0xff, 0xff, }; u_char at_org_code[ 3 ] = { 0x08, 0x00, 0x07, }; u_char aarp_org_code[ 3 ] = { 0x00, 0x00, 0x00, }; static int dlpi_open( queue_t *q, dev_t *dev, int oflag, int sflag, cred_t *cred ) { struct atif_data *aid; int err = 0; if (( err = drv_priv( cred )) != 0 ) { return( err ); } if (( aid = if_alloc( q )) == NULL ) { return( ENOMEM ); } q->q_ptr = (void *)aid; qprocson( q ); return( err ); } static int dlpi_close( queue_t *q, int oflag, cred_t *cred ) { struct atif_data *aid = (struct atif_data *)q->q_ptr; qprocsoff( q ); if_free( aid ); return( 0 ); } static int dl_bind_req( queue_t *q, ulong sap ) { union DL_primitives *dl; mblk_t *m; if (( m = allocb( DL_BIND_REQ_SIZE, BPRI_HI )) == NULL ) { return( ENOMEM ); } m->b_wptr = m->b_rptr + DL_BIND_REQ_SIZE; m->b_datap->db_type = M_PROTO; dl = (union DL_primitives *)m->b_rptr; dl->dl_primitive = DL_BIND_REQ; dl->bind_req.dl_sap = sap; dl->bind_req.dl_max_conind = 0; dl->bind_req.dl_service_mode = DL_CLDLS; dl->bind_req.dl_conn_mgmt = 0; dl->bind_req.dl_xidtest_flg = 0; /* XXX */ putnext( q, m ); return( 0 ); } static int dl_attach_req( queue_t *q, ulong ppa ) { union DL_primitives *dl; mblk_t *m; if (( m = allocb( DL_ATTACH_REQ_SIZE, BPRI_HI )) == NULL ) { return( ENOMEM ); } m->b_wptr = m->b_rptr + DL_ATTACH_REQ_SIZE; m->b_datap->db_type = M_PROTO; dl = (union DL_primitives *)m->b_rptr; dl->dl_primitive = DL_ATTACH_REQ; dl->attach_req.dl_ppa = ppa; putnext( q, m ); return( 0 ); } int dl_enabmulti_req( queue_t *q, caddr_t addr ) { union DL_primitives *dl; mblk_t *m; if (( m = allocb( DL_ENABMULTI_REQ_SIZE + ETHERADDRL, BPRI_HI )) == NULL ) { return( ENOMEM ); } m->b_wptr = m->b_rptr + DL_ENABMULTI_REQ_SIZE; m->b_datap->db_type = M_PROTO; dl = (union DL_primitives *)m->b_rptr; dl->dl_primitive = DL_ENABMULTI_REQ; dl->enabmulti_req.dl_addr_length = ETHERADDRL; dl->enabmulti_req.dl_addr_offset = m->b_wptr - m->b_rptr; bcopy( addr, m->b_wptr, ETHERADDRL ); m->b_wptr += ETHERADDRL; putnext( q, m ); return( 0 ); } int dl_unitdata_req( queue_t *q, mblk_t *m0, ushort type, caddr_t addr ) { union DL_primitives *dl; struct llc *llc; mblk_t *m1, *m; ushort len; /* len = msgdsize( m0 ) + sizeof( struct llc ); */ if (( m1 = allocb( sizeof( struct llc ), BPRI_HI )) == NULL ) { cmn_err( CE_NOTE, "dl_unitdate_req NOMEM 1\n" ); return( ENOMEM ); } m1->b_wptr = m1->b_rptr + sizeof( struct llc ); m1->b_datap->db_type = M_DATA; llc = (struct llc *)m1->b_rptr; llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP; llc->llc_control = LLC_UI; if ( type == ETHERTYPE_AARP ) { bcopy( aarp_org_code, llc->llc_org_code, sizeof( aarp_org_code )); } else if ( type == ETHERTYPE_AT ) { bcopy( at_org_code, llc->llc_org_code, sizeof( aarp_org_code )); } else { cmn_err( CE_NOTE, "dl_unitdate_req type %X\n", type ); return( EINVAL ); } llc->llc_ether_type = htons( type ); linkb( m1, m0 ); if (( m = allocb( DL_UNITDATA_REQ_SIZE + ETHERADDRL + sizeof( ushort ), BPRI_HI )) == NULL ) { cmn_err( CE_NOTE, "dl_unitdate_req NOMEM 2\n" ); return( ENOMEM ); } m->b_wptr = m->b_rptr + DL_UNITDATA_REQ_SIZE; m->b_datap->db_type = M_PROTO; linkb( m, m1 ); dl = (union DL_primitives *)m->b_rptr; dl->dl_primitive = DL_UNITDATA_REQ; dl->unitdata_req.dl_dest_addr_length = ETHERADDRL + sizeof ( ushort ); dl->unitdata_req.dl_dest_addr_offset = m->b_wptr - m->b_rptr; bcopy(addr, m->b_wptr, ETHERADDRL ); m->b_wptr += ETHERADDRL; len = 0; bcopy( &len, m->b_wptr, sizeof( ushort )); m->b_wptr += sizeof( ushort ); putnext( q, m ); return( 0 ); } static int dlpi_rput( queue_t *q, mblk_t *m ) { struct atif_data *aid = (struct atif_data *)q->q_ptr; union DL_primitives *dl; mblk_t *m0; struct llc *llc; switch ( m->b_datap->db_type ) { case M_IOCNAK : putnext( q, m ); return( 0 ); case M_PCPROTO : case M_PROTO : if ( m->b_wptr - m->b_rptr < sizeof( dl->dl_primitive )) { break; } dl = (union DL_primitives *)m->b_rptr; switch ( dl->dl_primitive ) { case DL_UNITDATA_IND : if ( m->b_wptr - m->b_rptr < sizeof( DL_UNITDATA_IND_SIZE )) { break; } if (( m0 = unlinkb( m )) == NULL ) { break; } if ( m0->b_wptr - m0->b_rptr < sizeof( struct llc )) { freemsg( m0 ); break; } llc = (struct llc *)m0->b_rptr; if ( llc->llc_dsap != LLC_SNAP_LSAP || llc->llc_ssap != LLC_SNAP_LSAP || llc->llc_control != LLC_UI ) { freemsg( m0 ); break; } if ( bcmp( llc->llc_org_code, at_org_code, sizeof( at_org_code )) == 0 && ntohs( llc->llc_ether_type ) == ETHERTYPE_AT ) { adjmsg( m0, sizeof( struct llc )); ddp_rput( aid, m0 ); } else if ( bcmp( llc->llc_org_code, aarp_org_code, sizeof( aarp_org_code )) == 0 && ntohs( llc->llc_ether_type ) == ETHERTYPE_AARP ) { adjmsg( m0, sizeof( struct llc )); aarp_rput( q, m0 ); } else { freemsg( m0 ); } break; case DL_OK_ACK : if ( m->b_wptr - m->b_rptr < sizeof( DL_OK_ACK_SIZE )) { break; } switch ( dl->ok_ack.dl_correct_primitive ) { case DL_ATTACH_REQ : if ( aid->aid_state != DL_ATTACH_PENDING ) { cmn_err( CE_NOTE, "dlpi_rput DL_OK_ACK attach state %d\n", aid->aid_state ); break; } if ( aid->aid_c.c_type != IF_UNITSEL ) { cmn_err( CE_NOTE, "dlpi_rput DL_OK_ACK attach context %x\n", aid->aid_c.c_type ); break; } if ( WR(q)->q_next == NULL || WR(q)->q_next->q_qinfo == NULL || WR(q)->q_next->q_qinfo->qi_minfo == NULL || WR(q)->q_next->q_qinfo->qi_minfo->mi_idname == NULL ) { cmn_err( CE_NOTE, "dlpi_rput can't get interface name\n" ); break; } if_name( aid, WR(q)->q_next->q_qinfo->qi_minfo->mi_idname, aid->aid_c.c_u.u_unit.uu_ppa ); aid->aid_state = DL_BIND_PENDING; #ifdef i386 /* * As of Solaris 7 (nice name), the i386 arch needs to be * bound as 0 to receive 802 frames. However, in the same * OS, Sparcs must be bound as ETHERMTU (or at least not 0) * to receive the same frames. A bug? In the Solaris 7 * (nice name) kernel? */ dl_bind_req( WR( q ), 0 ); #else /* i386 */ dl_bind_req( WR( q ), ETHERMTU ); #endif /* i386 */ break; case DL_ENABMULTI_REQ : if ( aid->aid_c.c_type != SIOCADDMULTI ) { cmn_err( CE_NOTE, "dlpi_rput DL_OK_ACK enabmulti context %x\n", aid->aid_c.c_type ); break; } ioc_ok_ack( aid->aid_c.c_u.u_multi.um_q, aid->aid_c.c_u.u_multi.um_m, 0 ); aid->aid_c.c_type = 0; aid->aid_c.c_u.u_multi.um_q = NULL; aid->aid_c.c_u.u_multi.um_m = 0; break; default : cmn_err( CE_CONT, "!dlpi_rput DL_OK_ACK unhandled %d\n", dl->ok_ack.dl_correct_primitive ); break; } break; case DL_BIND_ACK : if ( m->b_wptr - m->b_rptr < sizeof( DL_BIND_ACK_SIZE )) { break; } if ( aid->aid_state != DL_BIND_PENDING ) { break; } if ( aid->aid_c.c_type != IF_UNITSEL ) { break; } bcopy( m->b_rptr + dl->bind_ack.dl_addr_offset, aid->aid_hwaddr, dl->bind_ack.dl_addr_length ); aid->aid_state = DL_IDLE; ioc_ok_ack( WR(q), aid->aid_c.c_u.u_unit.uu_m, 0 ); aid->aid_c.c_type = 0; aid->aid_c.c_u.u_unit.uu_m = NULL; aid->aid_c.c_u.u_unit.uu_ppa = 0; break; case DL_ERROR_ACK : if ( m->b_wptr - m->b_rptr < sizeof( DL_ERROR_ACK_SIZE )) { break; } switch ( aid->aid_c.c_type ) { case IF_UNITSEL : if ( dl->error_ack.dl_errno == DL_SYSERR ) { ioc_error_ack( WR(q), aid->aid_c.c_u.u_unit.uu_m, dl->error_ack.dl_unix_errno ); } else { cmn_err( CE_CONT, "dlpi_rput DL_ERROR_ACK 0x%x\n", dl->error_ack.dl_errno ); ioc_error_ack( WR(q), aid->aid_c.c_u.u_unit.uu_m, EINVAL ); } aid->aid_c.c_type = 0; aid->aid_c.c_u.u_unit.uu_m = NULL; aid->aid_c.c_u.u_unit.uu_ppa = 0; break; default : cmn_err( CE_NOTE, "dlpi_rput DL_ERROR_ACK unhandled %d %d %d\n", dl->error_ack.dl_error_primitive, dl->error_ack.dl_errno, dl->error_ack.dl_unix_errno ); break; } break; default : cmn_err( CE_NOTE, "dlpi_rput M_PCPROTO 0x%x\n", dl->dl_primitive ); break; } break; default : cmn_err( CE_NOTE, "dlpi_rput 0x%X\n", m->b_datap->db_type ); break; } freemsg( m ); return( 0 ); } static int dlpi_wput( queue_t *q, mblk_t *m ) { struct atif_data *aid = (struct atif_data *)RD(q)->q_ptr; struct iocblk *ioc; int rc; switch ( m->b_datap->db_type ) { case M_IOCTL : if ( m->b_wptr - m->b_rptr < sizeof( struct iocblk )) { freemsg( m ); break; } ioc = (struct iocblk *)m->b_rptr; switch ( ioc->ioc_cmd ) { case IF_UNITSEL : if ( ioc->ioc_count != TRANSPARENT ) { cmn_err( CE_NOTE, "dlpi_wput IF_UNITSEL non-TRANSPARENT\n" ); ioc_error_ack( q, m, EINVAL ); break; } if ( m->b_cont == NULL ) { cmn_err( CE_NOTE, "dlpi_wput IF_UNITSEL no arg\n" ); ioc_error_ack( q, m, EINVAL ); break; } if ( aid->aid_state != DL_UNATTACHED ) { cmn_err( CE_NOTE, "dlpi_wput IF_UNITSEL already attached\n" ); ioc_error_ack( q, m, EINVAL ); break; } if ( aid->aid_c.c_type != 0 ) { cmn_err( CE_NOTE, "dlpi_wput IF_UNITSEL context %x\n", aid->aid_c.c_type ); ioc_error_ack( q, m, EINVAL ); break; } aid->aid_state = DL_ATTACH_PENDING; aid->aid_c.c_type = IF_UNITSEL; aid->aid_c.c_u.u_unit.uu_m = m; aid->aid_c.c_u.u_unit.uu_ppa = *(ulong *)m->b_cont->b_rptr; if (( rc = dl_attach_req( q, aid->aid_c.c_u.u_unit.uu_ppa )) < 0 ) { ioc_error_ack( q, m, rc ); break; } break; default : cmn_err( CE_NOTE, "dlpi_wput M_IOCTL 0x%X\n", ioc->ioc_cmd ); putnext( q, m ); break; } break; default : cmn_err( CE_NOTE, "dlpi_wput 0x%X\n", m->b_datap->db_type ); freemsg( m ); break; } return( 0 ); } static struct module_info dlpi_info = { 0, "ddp", 0, 1500, 3000, 64 }; static struct qinit dlpi_rinit = { dlpi_rput, /* qi_putp */ NULL, /* qi_srvp */ dlpi_open, /* qi_qopen */ dlpi_close, /* qi_qclose */ NULL, &dlpi_info, /* qi_minfo */ NULL, }; static struct qinit dlpi_winit = { dlpi_wput, /* qi_putp */ NULL, /* qi_srvp */ NULL, /* qi_qopen */ NULL, /* qi_qclose */ NULL, &dlpi_info, /* qi_minfo */ NULL, }; static struct streamtab dlpi_stream = { &dlpi_rinit, &dlpi_winit, NULL, NULL }; static struct fmodsw dlpi_fmodsw = { "ddp", &dlpi_stream, D_NEW | D_MP | D_MTPERMOD }; /* * DDP Streams module. This module is pushed on DLPI drivers by atalkd. */ struct modlstrmod dlpi_lstrmod = { &mod_strmodops, "DDP Streams module", &dlpi_fmodsw, }; netatalk-2.2.2/sys/solaris/if.h0000644000175200017500000000476211655731130013317 00000000000000struct atif_data { struct atif_data *aid_next, *aid_prev; char aid_name[ IFNAMSIZ ]; unchar aid_hwaddr[ ETHERADDRL ]; queue_t *aid_q; /* RD() side */ int aid_state; int aid_flags; struct sockaddr_at aid_sat; struct netrange aid_nr; struct aarplist *aid_aarplist, *aid_aarpflist; /* solaris 7 wants timeout_id_t, but solaris 2.6 doesn't have that. * so, we compromise with an unsigned long as we know that's big * enough to hold a pointer. */ #ifdef HAVE_TIMEOUT_ID_T timeout_id_t aid_aarptimeo; #else unsigned long aid_aarptimeo; #endif /* * A little bit of cleverness, to overcome the inability of * streams to sleep. The type of context must be checked before * the data is accessed. The atif_data can't be freed if the * type is non-zero. */ struct { int c_type; /* ioctl command */ union { struct { /* unit select */ mblk_t *uu_m; ulong uu_ppa; } u_unit; struct { /* set addr */ mblk_t *ua_m; queue_t *ua_q; int ua_probecnt; int ua_netcnt; int ua_nodecnt; } u_addr; struct { /* add multi */ mblk_t *um_m; queue_t *um_q; } u_multi; } c_u; } aid_c; }; #define AIDF_LOOPBACK (1<<0) #define AIDF_PROBING (1<<1) #define AIDF_PROBEFAILED (1<<2) extern u_char at_multicastaddr[ ETHERADDRL ]; extern u_char at_org_code[ 3 ]; extern u_char aarp_org_code[ 3 ]; int if_setaddr( queue_t *, mblk_t *, char *, struct sockaddr_at * ); int if_getaddr( char *, struct sockaddr_at * ); int if_addmulti( queue_t *, mblk_t *, char *, struct sockaddr * ); struct atif_data *if_alloc( queue_t * ); void if_free( struct atif_data * ); int if_name( struct atif_data *, char *, ulong ); int if_attach( struct atif_data *, char * ); struct atif_data *if_primary( void ); struct atif_data *if_dest( struct atif_data *, struct sockaddr_at * ); struct atif_data *if_withaddr( struct sockaddr_at * ); struct atif_data *if_withnet( struct sockaddr_at * ); int if_route( struct atif_data *, mblk_t *, struct sockaddr_at * ); int dl_unitdata_req( queue_t *, mblk_t *, ushort, caddr_t ); int dl_enabmulti_req( queue_t *, caddr_t ); void aarp_send( struct atif_data *, int, caddr_t, ushort, unchar ); int aarp_rput( queue_t *, mblk_t * ); int aarp_resolve( struct atif_data *, mblk_t *, struct sockaddr_at *); void aarp_init( struct atif_data * ); void aarp_clean( struct atif_data * ); int ddp_rput( struct atif_data *, mblk_t * ); netatalk-2.2.2/sys/solaris/sock.c0000644000175200017500000000576111655731130013653 00000000000000/* $Id: sock.c,v 1.2 2002-01-17 07:11:13 srittau Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #ifdef STDC_HEADERS #include #else #include #endif #include #include "if.h" #include "sock.h" static struct sock_data *sockets = NULL; struct sock_data * sock_alloc( queue_t *q ) { struct sock_data *sd; if (( sd = kmem_alloc( sizeof( struct sock_data ), KM_SLEEP )) == NULL ) { return( NULL ); } sd->sd_state = TS_UNBND; sd->sd_q = q; sd->sd_next = sd->sd_prev = NULL; bzero( (caddr_t)&sd->sd_sat, sizeof( struct sockaddr_at )); sd->sd_next = sockets; if ( sockets != NULL ) { sockets->sd_prev = sd; } sockets = sd; return( sd ); } void sock_free( struct sock_data *sd ) { if ( sd == sockets ) { sockets = sd->sd_next; } if ( sd->sd_next != NULL ) { sd->sd_next->sd_prev = sd->sd_prev; } if ( sd->sd_prev != NULL ) { sd->sd_prev->sd_next = sd->sd_next; } kmem_free( sd, sizeof( struct sock_data )); return; } struct sock_data * sock_dest( struct atif_data *aid, struct sockaddr_at *sat ) { struct sock_data *sd; for ( sd = sockets; sd != NULL; sd = sd->sd_next ) { if ( sat->sat_port == sd->sd_sat.sat_port && /* huh? */ aid->aid_sat.sat_addr.s_net == sd->sd_sat.sat_addr.s_net && ( sat->sat_addr.s_node == sd->sd_sat.sat_addr.s_node || sat->sat_addr.s_node == ATADDR_BCAST )) { break; } } return( sd ); } /* * This is a change in semantics. The port must be ATADDR_ANYPORT for * ATADDR_ANYNET/NODE to not mean the loopback. */ int sock_bind( struct sock_data *sd, struct sockaddr_at *sat ) { struct atif_data *paid; struct sock_data *psd; struct sockaddr_at psat; u_short port; psat = *sat; if ( psat.sat_family != AF_APPLETALK ) { cmn_err( CE_CONT, "sock_bind non-AppleTalk\n" ); return( EPROTOTYPE ); } if ( psat.sat_port == ATADDR_ANYPORT ) { if ( psat.sat_addr.s_net == ATADDR_ANYNET && psat.sat_addr.s_node == ATADDR_ANYNODE ) { /* chose primary interface */ if (( paid = if_primary()) == NULL ) { return( EADDRNOTAVAIL ); } psat.sat_addr.s_net = paid->aid_sat.sat_addr.s_net; psat.sat_addr.s_node = paid->aid_sat.sat_addr.s_node; } /* pick unused port */ for ( port = ATPORT_RESERVED; port < ATPORT_LAST; port++ ) { for ( psd = sockets; psd != NULL; psd = psd->sd_next ) { if ( port == psd->sd_sat.sat_port && psat.sat_addr.s_net == psd->sd_sat.sat_addr.s_net && psat.sat_addr.s_node == psd->sd_sat.sat_addr.s_node ) { break; } } if ( psd == NULL ) { break; } } if ( psd != NULL ) { return( EADDRINUSE ); } psat.sat_port = port; } sd->sd_sat = psat; sd->sd_state = TS_IDLE; return( 0 ); } netatalk-2.2.2/sys/solaris/sock.h0000644000175200017500000000064311655731130013652 00000000000000struct sock_data { struct sock_data *sd_next, *sd_prev; int sd_state; queue_t *sd_q; struct sockaddr_at sd_sat; }; struct sock_data *sock_alloc( queue_t * ); void sock_free( struct sock_data * ); struct sock_data *sock_dest( struct atif_data *, struct sockaddr_at * ); int sock_bind( struct sock_data *, struct sockaddr_at * ); void t_unitdata_ind( queue_t *, mblk_t *, struct sockaddr_at * ); netatalk-2.2.2/sys/solaris/linkage.c0000644000175200017500000000155611655731130014324 00000000000000/* * Linkage information. Mostly this is Solaris specific, but not all. * Code to do real work is in other files, this file just has the crap * to get the real code loaded and called. */ #include #include #include char *netatalk_version = VERSION; extern struct modldrv tpi_ldrv; extern struct modldrv dlpi_lstrmod; static struct modlinkage ddp_linkage = { MODREV_1, { (void *)&tpi_ldrv, (void *)&dlpi_lstrmod, NULL, } }; /* * While these are code, they're mostly related to linkage, so * we leave them here. */ int _init( void ) { cmn_err( CE_CONT, "?netatalk %s\n", netatalk_version ); return( mod_install( &ddp_linkage )); } int _info( struct modinfo *modinfop ) { return( mod_info( &ddp_linkage, modinfop )); } int _fini( void ) { return( mod_remove( &ddp_linkage )); } netatalk-2.2.2/sys/solaris/rt.c0000644000175200017500000000471511655731130013337 00000000000000#include #include #include #include #include #include #include #include #include "rt.h" struct rtab { struct rtab *r_next, *r_prev; struct sockaddr_at r_dst; struct sockaddr_at r_gate; }; static struct rtab *rt_net = NULL; static struct rtab *rt_host = NULL; int rt_add( struct sockaddr_at *dst, struct sockaddr_at *gate, int flags ) { struct rtab *r; struct rtab *rtab; if ( flags & RTF_HOST ) { rtab = rt_host; } else { rtab = rt_net; } for ( r = rtab; r != NULL; r = r->r_next ) { if (( r->r_dst.sat_addr.s_net == dst->sat_addr.s_net ) && (( flags & RTF_HOST ) ? r->r_dst.sat_addr.s_node == dst->sat_addr.s_node : 1 )) { return( EEXIST ); } } if (( r = kmem_alloc( sizeof( struct rtab ), KM_NOSLEEP )) == NULL ) { return( ENOMEM ); } r->r_dst = *dst; r->r_gate = *gate; r->r_prev = NULL; r->r_next = rtab; if ( rtab != NULL ) { rtab->r_prev = r; } if ( flags & RTF_HOST ) { rt_host = r; } else { rt_net = r; } return( 0 ); } int rt_del( struct sockaddr_at *dst, struct sockaddr_at *gate, int flags ) { struct rtab *r; struct rtab *rtab; if ( flags & RTF_HOST ) { rtab = rt_host; } else { rtab = rt_net; } for ( r = rtab; r != NULL; r = r->r_next ) { if (( r->r_dst.sat_addr.s_net == dst->sat_addr.s_net ) && (( flags & RTF_HOST ) ? r->r_dst.sat_addr.s_node == dst->sat_addr.s_node : 1 )) { break; } } if ( r == NULL ) { return( ESRCH ); } if ( r == rtab ) { if ( flags & RTF_HOST ) { rt_host = r->r_next; } else { rt_net = r->r_next; } } if ( r->r_next != NULL ) { r->r_next->r_prev = r->r_prev; } if ( r->r_prev != NULL ) { r->r_prev->r_next = r->r_next; } kmem_free( r, sizeof( struct rtab )); return( 0 ); } int rt_gate( struct sockaddr_at *dst, struct sockaddr_at *gate ) { struct rtab *r; for ( r = rt_host; r != NULL; r = r->r_next ) { if ( r->r_dst.sat_addr.s_net == dst->sat_addr.s_net && r->r_dst.sat_addr.s_node == dst->sat_addr.s_node ) { break; } } if ( r != NULL ) { *gate = r->r_gate; return( 0 ); } for ( r = rt_net; r != NULL; r = r->r_next ) { if ( r->r_dst.sat_addr.s_net == dst->sat_addr.s_net ) { break; } } if ( r == NULL ) { return( -1 ); } *gate = r->r_gate; return( 0 ); } netatalk-2.2.2/sys/solaris/aarp.c0000644000175200017500000002062311655731130013631 00000000000000/* * $Id: aarp.c,v 1.4 2005-04-28 20:50:07 bfernhomberg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #ifdef STDC_HEADERS #include #else #include #endif #include #include #include #include "if.h" struct aarplist { struct aarplist *aal_next, *aal_prev; struct at_addr aal_addr; u_char aal_hwaddr[ ETHERADDRL ]; u_char aal_age; u_char aal_flags; mblk_t *aal_m; }; struct aarplist * aarp_find( struct atif_data *aid, ushort net, unchar node ) { struct aarplist *aal; for ( aal = aid->aid_aarplist; aal != NULL; aal = aal->aal_next ) { if ( aal->aal_addr.s_net == net && aal->aal_addr.s_node == node ) { break; } } return( aal ); } struct aarplist * aarp_alloc( struct atif_data *aid, ushort net, unchar node ) { struct aarplist *aal; for ( aal = aid->aid_aarplist; aal != NULL; aal = aal->aal_next ) { if ( aal->aal_addr.s_net == net && aal->aal_addr.s_node == node ) { return( aal ); } } if ( aid->aid_aarpflist == NULL ) { if (( aal = (struct aarplist *)kmem_alloc( sizeof( struct aarplist ), KM_NOSLEEP )) == NULL ) { return( NULL ); } } else { aal = aid->aid_aarpflist; aid->aid_aarpflist = aal->aal_next; if ( aid->aid_aarpflist != NULL ) { aid->aid_aarpflist->aal_prev = NULL; } } aal->aal_addr.s_net = net; aal->aal_addr.s_node = node; bzero( aal->aal_hwaddr, sizeof( aal->aal_hwaddr )); aal->aal_age = 0; aal->aal_flags = 0; aal->aal_m = NULL; aal->aal_next = aid->aid_aarplist; aal->aal_prev = NULL; if ( aid->aid_aarplist != NULL ) { aid->aid_aarplist->aal_prev = aal; } aid->aid_aarplist = aal; return( aal ); } /* * Move entry to free list. */ void aarp_free( struct atif_data *aid, struct aarplist *aal ) { if ( aal->aal_next != NULL ) { aal->aal_next->aal_prev = aal->aal_prev; } if ( aal->aal_prev != NULL ) { aal->aal_prev->aal_next = aal->aal_next; } if ( aid->aid_aarplist == aal ) { aid->aid_aarplist = aal->aal_next; } if ( aal->aal_m != NULL ) { freemsg( aal->aal_m ); aal->aal_m = NULL; } aal->aal_prev = NULL; aal->aal_next = aid->aid_aarpflist; if ( aid->aid_aarpflist != NULL ) { aid->aid_aarpflist->aal_prev = aal; } aid->aid_aarpflist = aal; return; } void aarp_timeout( void *ptr ) { struct atif_data *aid = (struct atif_data *) ptr; struct aarplist *aal, *p; aid->aid_aarptimeo = qtimeout( aid->aid_q, aarp_timeout, (caddr_t)aid, 60 * hz ); for ( aal = aid->aid_aarplist; aal != NULL; aal = p ) { p = aal->aal_next; if ( ++aal->aal_age < (( aal->aal_flags ) ? 5 : 3 )) { continue; } aarp_free( aid, aal ); } return; } void aarp_init( struct atif_data *aid ) { aid->aid_aarptimeo = qtimeout( aid->aid_q, aarp_timeout, (caddr_t)aid, 60 * hz ); return; } void aarp_clean( struct atif_data *aid ) { struct aarplist *aal, *p; if ( aid->aid_aarptimeo != 0 ) { quntimeout( aid->aid_q, aid->aid_aarptimeo ); aid->aid_aarptimeo = 0; } for ( aal = aid->aid_aarplist; aal != NULL; aal = p ) { p = aal->aal_next; if ( aal->aal_m != NULL ) { freemsg( aal->aal_m ); aal->aal_m = NULL; } kmem_free( aal, sizeof( struct aarplist )); } aid->aid_aarplist = NULL; for ( aal = aid->aid_aarpflist; aal != NULL; aal = p ) { p = aal->aal_next; if ( aal->aal_m != NULL ) { freemsg( aal->aal_m ); aal->aal_m = NULL; } kmem_free( aal, sizeof( struct aarplist )); } aid->aid_aarpflist = NULL; return; } int aarp_rput( queue_t *q, mblk_t *m ) { struct atif_data *aid = (struct atif_data *)q->q_ptr; struct ether_aarp *ea; struct aarplist *aal; ushort tpnet, spnet, op; if ( m->b_wptr - m->b_rptr < sizeof( struct ether_aarp )) { cmn_err( CE_NOTE, "aarp_rput short packet\n" ); goto done; } ea = (struct ether_aarp *)m->b_rptr; if ( ea->aarp_hrd != htons( AARPHRD_ETHER ) || ea->aarp_pro != htons( ETHERTYPE_AT ) || ea->aarp_hln != sizeof( ea->aarp_sha ) || ea->aarp_pln != sizeof( ea->aarp_spu )) { cmn_err( CE_NOTE, "aarp_rput bad constants\n" ); goto done; } if ( bcmp( ea->aarp_sha, aid->aid_hwaddr, sizeof( ea->aarp_sha )) == 0 ) { goto done; } op = ntohs( ea->aarp_op ); bcopy( ea->aarp_tpnet, &tpnet, sizeof( tpnet )); bcopy( ea->aarp_spnet, &spnet, sizeof( spnet )); if ( aid->aid_flags & AIDF_PROBING ) { if ( tpnet == aid->aid_sat.sat_addr.s_net && ea->aarp_tpnode == aid->aid_sat.sat_addr.s_node ) { aid->aid_flags &= ~AIDF_PROBING; aid->aid_flags |= AIDF_PROBEFAILED; cmn_err( CE_NOTE, "aarp_rput probe collision %s\n", aid->aid_name ); } } else { if ( tpnet == aid->aid_sat.sat_addr.s_net && ea->aarp_tpnode == aid->aid_sat.sat_addr.s_node ) { switch ( op ) { case AARPOP_REQUEST : aal = aarp_alloc( aid, spnet, ea->aarp_spnode ); bcopy( ea->aarp_sha, aal->aal_hwaddr, sizeof( ea->aarp_sha )); aal->aal_age = 0; aal->aal_flags = 1; /* complete */ case AARPOP_PROBE : aarp_send( aid, AARPOP_RESPONSE, ea->aarp_sha, spnet, ea->aarp_spnode ); break; case AARPOP_RESPONSE : if (( aal = aarp_find( aid, spnet, ea->aarp_spnode )) == NULL ) { break; } bcopy( ea->aarp_sha, aal->aal_hwaddr, sizeof( ea->aarp_sha )); aal->aal_age = 0; aal->aal_flags = 1; /* complete */ if ( aal->aal_m != NULL ) { dl_unitdata_req( WR( q ), aal->aal_m, ETHERTYPE_AT, aal->aal_hwaddr ); aal->aal_m = NULL; } break; default : cmn_err( CE_NOTE, "aarp_rput bad op %X\n", op ); break; } } else { switch ( op ) { case AARPOP_REQUEST : break; case AARPOP_PROBE : if (( aal = aarp_find( aid, spnet, ea->aarp_spnode )) != NULL ) { aarp_free( aid, aal ); } break; case AARPOP_RESPONSE : cmn_err( CE_NOTE, "aarp_rput someone using our address\n" ); break; default : cmn_err( CE_NOTE, "aarp_rput bad op %X\n", op ); break; } } } done : freemsg( m ); return( 0 ); } void aarp_send( struct atif_data *aid, int op, caddr_t hwaddr, ushort net, unchar node ) { mblk_t *m; struct ether_aarp *ea; if (( m = allocb( sizeof( struct ether_aarp ), BPRI_HI )) == NULL ) { return; } m->b_wptr = m->b_rptr + sizeof( struct ether_aarp ); ea = (struct ether_aarp *)m->b_rptr; bzero( (caddr_t)ea, sizeof( struct ether_aarp )); ea->aarp_hrd = htons( AARPHRD_ETHER ); ea->aarp_pro = htons( ETHERTYPE_AT ); ea->aarp_hln = sizeof( ea->aarp_sha ); ea->aarp_pln = sizeof( ea->aarp_spu ); ea->aarp_op = htons( op ); bcopy( aid->aid_hwaddr, ea->aarp_sha, sizeof( ea->aarp_sha )); if ( hwaddr == NULL ) { bzero( ea->aarp_tha, sizeof( ea->aarp_tha )); } else { bcopy( hwaddr, ea->aarp_tha, sizeof( ea->aarp_tha )); } ea->aarp_tpnode = node; bcopy( &aid->aid_sat.sat_addr.s_net, ea->aarp_spnet, sizeof( ea->aarp_spnet )); bcopy( &net, ea->aarp_tpnet, sizeof( ea->aarp_tpnet )); ea->aarp_spnode = aid->aid_sat.sat_addr.s_node; ea->aarp_tpnode = node; if ( hwaddr == NULL ) { dl_unitdata_req( WR( aid->aid_q ), m, ETHERTYPE_AARP, at_multicastaddr ); } else { dl_unitdata_req( WR( aid->aid_q ), m, ETHERTYPE_AARP, hwaddr ); } return; } int aarp_resolve( struct atif_data *aid, mblk_t *m, struct sockaddr_at *sat ) { struct aarplist *aal; if ( sat->sat_addr.s_node == ATADDR_BCAST ) { dl_unitdata_req( WR( aid->aid_q ), m, ETHERTYPE_AT, at_multicastaddr ); return( 0 ); } if (( aal = aarp_alloc( aid, sat->sat_addr.s_net, sat->sat_addr.s_node )) == NULL ) { freemsg( m ); return( ENOMEM ); } aal->aal_age = 0; if ( aal->aal_flags ) { /* complete */ dl_unitdata_req( WR( aid->aid_q ), m, ETHERTYPE_AT, aal->aal_hwaddr ); } else { /* send aarp request */ if ( aal->aal_m != NULL ) { freemsg( aal->aal_m ); } /* either freed above, in timeout, or sent in aarp_rput() */ aal->aal_m = m; aarp_send( aid, AARPOP_REQUEST, NULL, sat->sat_addr.s_net, sat->sat_addr.s_node ); } return( 0 ); } netatalk-2.2.2/sys/solaris/if.c0000644000175200017500000002224511655731130013306 00000000000000/* $Id: if.c,v 1.3 2005-04-28 20:50:07 bfernhomberg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef STDC_HEADERS #include #else #include #endif #include #include #include "if.h" #include "rt.h" #include "ioc.h" static struct atif_data *interfaces = NULL; struct atif_data * if_primary() { return( interfaces ); } struct atif_data * if_alloc( queue_t *q ) { struct atif_data *aid; if (( aid = kmem_zalloc( sizeof( struct atif_data ), KM_SLEEP )) == NULL ) { return( NULL ); } aid->aid_q = q; aid->aid_state = DL_UNATTACHED; return( aid ); } /* * Name an interface, insert it in our list of interfaces. If this is the * first interface, create the loopback interface. If it's not the first * interfaces, keep the first interface the same, i.e. the first configured * interface should be the primary interface. */ int if_name( struct atif_data *aid, char *name, ulong ppa ) { sprintf( aid->aid_name, "%s%ld", name, ppa ); if ( interfaces == NULL ) { /* create fake loopback */ if (( interfaces = if_alloc( NULL )) == NULL ) { return( ENOMEM ); } strcpy( interfaces->aid_name, "lo0" ); interfaces->aid_state = DL_IDLE; bzero( interfaces->aid_hwaddr, sizeof( interfaces->aid_hwaddr )); interfaces->aid_flags = AIDF_LOOPBACK; interfaces->aid_c.c_type = 0; aid->aid_next = interfaces; aid->aid_next->aid_prev = aid; interfaces = aid; } else { aid->aid_next = interfaces->aid_next; aid->aid_prev = interfaces; aid->aid_next->aid_prev = aid; interfaces->aid_next = aid; } aarp_init( aid ); return( 0 ); } void if_free( struct atif_data *aid ) { if ( aid->aid_c.c_type != 0 ) { cmn_err( CE_NOTE, "if_free context %x\n", aid->aid_c.c_type ); return; } aarp_clean( aid ); if ( aid->aid_next != NULL ) { aid->aid_next->aid_prev = aid->aid_prev; } if ( aid->aid_prev != NULL ) { aid->aid_prev->aid_next = aid->aid_next; } if ( aid == interfaces ) { interfaces = aid->aid_next; } kmem_free( aid, sizeof( struct atif_data )); if ( interfaces != NULL && interfaces->aid_next == NULL ) { kmem_free( interfaces, sizeof( struct atif_data )); interfaces = NULL; } return; } int if_getaddr( char *name, struct sockaddr_at *sat ) { struct atif_data *aid; for ( aid = interfaces; aid != NULL; aid = aid->aid_next ) { if ( strcmp( name, aid->aid_name ) == 0 ) { break; } } if ( aid == NULL ) { return( EADDRNOTAVAIL ); } bcopy( &aid->aid_sat, sat, sizeof( struct sockaddr_at )); return( 0 ); } int if_addmulti( queue_t *q, mblk_t *m, char *name, struct sockaddr *sa ) { struct atif_data *aid; for ( aid = interfaces; aid != NULL; aid = aid->aid_next ) { if ( strcmp( name, aid->aid_name ) == 0 ) { break; } } if ( aid == NULL ) { return( EADDRNOTAVAIL ); } if ( aid->aid_c.c_type != 0 ) { cmn_err( CE_NOTE, "if_addmulti context %x\n", aid->aid_c.c_type ); return( EINVAL ); } aid->aid_c.c_type = SIOCADDMULTI; aid->aid_c.c_u.u_multi.um_q = q; aid->aid_c.c_u.u_multi.um_m = m; dl_enabmulti_req( WR( aid->aid_q ), sa->sa_data ); return( 0 ); } void if_pickaddr( void *ptr ) { struct atif_data *aid = (struct atif_data*) ptr; if ( aid->aid_c.c_type != SIOCSIFADDR ) { cmn_err( CE_NOTE, "if_pickaddr context %x\n", aid->aid_c.c_type ); return; } if ( aid->aid_flags & AIDF_PROBEFAILED ) { aid->aid_flags &= ~AIDF_PROBEFAILED; /* choose new address */ for (;;) { if ( aid->aid_c.c_u.u_addr.ua_nodecnt == 0 ) { /* if we've exausted all addresses, fail */ if ( aid->aid_c.c_u.u_addr.ua_netcnt == 0 ) { ioc_error_ack( aid->aid_c.c_u.u_addr.ua_q, aid->aid_c.c_u.u_addr.ua_m, EADDRINUSE ); aid->aid_c.c_type = 0; aid->aid_c.c_u.u_addr.ua_q = NULL; aid->aid_c.c_u.u_addr.ua_m = NULL; aid->aid_c.c_u.u_addr.ua_probecnt = 0; aid->aid_c.c_u.u_addr.ua_netcnt = 0; aid->aid_c.c_u.u_addr.ua_nodecnt = 0; } else { aid->aid_c.c_u.u_addr.ua_nodecnt = 256; aid->aid_c.c_u.u_addr.ua_netcnt--; if ( ntohs(aid->aid_sat.sat_addr.s_net) > ntohs(aid->aid_nr.nr_lastnet) ) { aid->aid_sat.sat_addr.s_net = aid->aid_nr.nr_firstnet; } else aid->aid_sat.sat_addr.s_net = htons(ntohs(aid->aid_sat.sat_addr.s_net) + 1); } } else { aid->aid_sat.sat_addr.s_node++; aid->aid_c.c_u.u_addr.ua_nodecnt--; if ( aid->aid_sat.sat_addr.s_node == 0 || aid->aid_sat.sat_addr.s_node == 255 || aid->aid_sat.sat_addr.s_node == 254 ) { continue; } break; } } } if ( aid->aid_c.c_u.u_addr.ua_probecnt-- <= 0 ) { aid->aid_flags &= ~AIDF_PROBING; /* worked, send ioctl reponse */ ioc_ok_ack( aid->aid_c.c_u.u_addr.ua_q, aid->aid_c.c_u.u_addr.ua_m, 0 ); aid->aid_c.c_type = 0; aid->aid_c.c_u.u_addr.ua_q = NULL; aid->aid_c.c_u.u_addr.ua_m = NULL; aid->aid_c.c_u.u_addr.ua_probecnt = 0; aid->aid_c.c_u.u_addr.ua_netcnt = 0; aid->aid_c.c_u.u_addr.ua_nodecnt = 0; return; } aarp_send( aid, AARPOP_PROBE, NULL, aid->aid_sat.sat_addr.s_net, aid->aid_sat.sat_addr.s_node ); qtimeout( aid->aid_q, if_pickaddr, (caddr_t)aid, hz / 5 ); } int if_setaddr( queue_t *q, mblk_t *m, char *name, struct sockaddr_at *sat ) { struct atif_data *aid; struct netrange nr; ulong time; for ( aid = interfaces; aid != NULL; aid = aid->aid_next ) { if ( strcmp( name, aid->aid_name ) == 0 ) { break; } } if ( aid == NULL ) { return( EADDRNOTAVAIL ); } if ( aid->aid_c.c_type != 0 ) { cmn_err( CE_NOTE, "if_setaddr context %x\n", aid->aid_c.c_type ); return( EINVAL ); } bcopy( sat->sat_zero, &nr, sizeof( struct netrange )); if ( aid->aid_flags & AIDF_LOOPBACK ) { aid->aid_sat = *sat; aid->aid_nr = nr; /* routes? */ ioc_ok_ack( q, m, 0 ); return( 0 ); } drv_getparm( TIME, &time ); if ( sat->sat_addr.s_net == ATADDR_ANYNET ) { if ( nr.nr_lastnet == nr.nr_firstnet ) { sat->sat_addr.s_net = nr.nr_firstnet; } else { sat->sat_addr.s_net = htons(ntohs(nr.nr_firstnet) + time % (ntohs(nr.nr_lastnet) - ntohs(nr.nr_firstnet))); } } else { if ( ntohs( sat->sat_addr.s_net ) < ntohs( nr.nr_firstnet ) || ntohs( sat->sat_addr.s_net ) > ntohs( nr.nr_lastnet )) { return( EINVAL ); } } if ( sat->sat_addr.s_node == ATADDR_ANYNODE ) { sat->sat_addr.s_node = time; } aid->aid_flags |= AIDF_PROBING; aid->aid_sat = *sat; aid->aid_nr = nr; aid->aid_c.c_type = SIOCSIFADDR; aid->aid_c.c_u.u_addr.ua_q = q; aid->aid_c.c_u.u_addr.ua_m = m; aid->aid_c.c_u.u_addr.ua_probecnt = 10; aid->aid_c.c_u.u_addr.ua_netcnt = ntohs(nr.nr_lastnet) - ntohs(nr.nr_firstnet); aid->aid_c.c_u.u_addr.ua_nodecnt = 256; qtimeout( aid->aid_q, if_pickaddr, (caddr_t)aid, 0 ); return( 0 ); } /* * These three routines are all a big mess... */ struct atif_data * if_dest( struct atif_data *aid, struct sockaddr_at *sat ) { struct atif_data *dest; for ( dest = interfaces; dest != NULL; dest = dest->aid_next ) { if ((( sat->sat_addr.s_net == 0 && aid == dest ) || ( ntohs(sat->sat_addr.s_net) >= ntohs(dest->aid_nr.nr_firstnet) && ntohs(sat->sat_addr.s_net) <= ntohs(dest->aid_nr.nr_lastnet) )) && ( sat->sat_addr.s_node == dest->aid_sat.sat_addr.s_node || sat->sat_addr.s_node == ATADDR_BCAST )) { break; } } if ( dest == NULL ) { return( NULL ); } return( dest ); } struct atif_data * if_withaddr( struct sockaddr_at *sat ) { struct atif_data *dest; for ( dest = interfaces; dest != NULL; dest = dest->aid_next ) { if ( sat->sat_addr.s_net == dest->aid_sat.sat_addr.s_net && sat->sat_addr.s_node == dest->aid_sat.sat_addr.s_node ) { break; } } return( dest ); } struct atif_data * if_withnet( struct sockaddr_at *sat ) { struct atif_data *dest; for ( dest = interfaces; dest != NULL; dest = dest->aid_next ) { if ( ntohs(sat->sat_addr.s_net) >= ntohs(dest->aid_nr.nr_firstnet) && ntohs(sat->sat_addr.s_net) <= ntohs(dest->aid_nr.nr_lastnet)) { break; } } return( dest ); } int if_route( struct atif_data *aid, mblk_t *m, struct sockaddr_at *sat ) { struct sockaddr_at gate; if ( sat->sat_addr.s_net == 0 ) { if ( sat->sat_addr.s_node == 0 ) { aid = if_withaddr( sat ); } if ( aid == NULL ) { freemsg( m ); return( ENETUNREACH ); } gate = *sat; } else { if ( rt_gate( sat, &gate ) < 0 ) { /* no route */ gate = *sat; } if (( aid = if_withaddr( &gate )) == NULL ) { if (( aid = if_withnet( &gate )) == NULL ) { freemsg( m ); return( ENETUNREACH ); } } } if ( aid->aid_flags & AIDF_LOOPBACK ) { return( ddp_rput( aid, m )); } else { /* the aarp layer is expected to send broadcast packets appropriately */ return( aarp_resolve( aid, m, &gate )); } } netatalk-2.2.2/sys/solaris/tpi.c0000644000175200017500000004116111655731130013502 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ioc.h" #include "if.h" #include "sock.h" #include "rt.h" static int tpi_getinfo( dev_info_t *dip, ddi_info_cmd_t cmd, void *arg, void **resultp ) { *resultp = NULL; return( DDI_FAILURE ); } /* Solaris 10 removed DDI_IDENTIFIED and replaced "identify" with "nulldev" */ #ifdef DDI_IDENTIFIED static int tpi_identify( dev_info_t *dip ) { char *tmp; /* don't use strcmp under Solaris 9, problem loading kernel module */ tmp = ddi_get_name( dip ); if ((tmp[0]== 'd') && (tmp[1]=='d') && (tmp[2]=='p') && tmp[3]==0) { return( DDI_IDENTIFIED ); } else { return( DDI_NOT_IDENTIFIED ); } } #endif /* DDI_IDENTIFIED */ static int tpi_attach( dev_info_t *dip, ddi_attach_cmd_t cmd ) { int rc; if ( cmd != DDI_ATTACH ) { return( DDI_FAILURE ); } if (( rc = ddi_create_minor_node( dip, "ddp", S_IFCHR, 0, DDI_PSEUDO, CLONE_DEV )) != DDI_SUCCESS ) { /* undo anything */ } return( rc ); } static int tpi_detach( dev_info_t *dip, ddi_detach_cmd_t cmd ) { if ( cmd != DDI_DETACH ) { return( DDI_FAILURE ); } ddi_remove_minor_node( dip, "ddp" ); return( DDI_SUCCESS ); } static int tpi_open( queue_t *q, dev_t *dev, int oflag, int sflag, cred_t *cred ) { static minor_t minor = 1; if ( sflag != CLONEOPEN ) { return( EINVAL ); } if (( q->q_ptr = (void *)sock_alloc( q )) == NULL ) { return( ENOMEM ); } *dev = makedevice( getmajor( *dev ), minor++ ); qprocson( q ); return( 0 ); } static int tpi_close( queue_t *q, int oflag, cred_t *cred ) { struct sock_data *sd = (struct sock_data *)q->q_ptr; qprocsoff( q ); sock_free( sd ); return( 0 ); } static int tpi_rput( queue_t *q, mblk_t *m ) { cmn_err( CE_NOTE, "tpi_rput dp_type = 0x%X\n", m->b_datap->db_type ); freemsg( m ); return( 0 ); } void t_bind_ack( queue_t *q, struct sockaddr_at *sat ) { mblk_t *m; struct T_bind_ack *t; if (( m = allocb( sizeof( struct T_bind_ack ) + sizeof( struct sockaddr_at ), BPRI_HI )) == NULL ) { return; } m->b_wptr = m->b_rptr + sizeof( struct T_bind_ack ); m->b_datap->db_type = M_PCPROTO; t = (struct T_bind_ack *)m->b_rptr; t->PRIM_type = T_BIND_ACK; t->ADDR_length = sizeof( struct sockaddr_at ); t->ADDR_offset = m->b_wptr - m->b_rptr; t->CONIND_number = 0; bcopy( (caddr_t)sat, m->b_wptr, sizeof( struct sockaddr_at )); m->b_wptr += sizeof( struct sockaddr_at ); qreply( q, m ); return; } void t_ok_ack( queue_t *q, long prim ) { mblk_t *m; struct T_ok_ack *t; if (( m = allocb( sizeof( struct T_ok_ack ), BPRI_HI )) == NULL ) { return; } m->b_wptr = m->b_rptr + sizeof( struct T_ok_ack ); m->b_datap->db_type = M_PCPROTO; t = (struct T_ok_ack *)m->b_rptr; t->PRIM_type = T_OK_ACK; t->CORRECT_prim = prim; qreply( q, m ); return; } void t_error_ack( queue_t *q, long prim, long terror, long uerror ) { mblk_t *m; struct T_error_ack *t; if (( m = allocb( sizeof( struct T_error_ack ), BPRI_HI )) == NULL ) { return; } m->b_wptr = m->b_rptr + sizeof( struct T_error_ack ); m->b_datap->db_type = M_PCPROTO; t = (struct T_error_ack *)m->b_rptr; t->PRIM_type = T_ERROR_ACK; t->ERROR_prim = prim; t->TLI_error = terror; t->UNIX_error = uerror; qreply( q, m ); return; } void t_info_ack( queue_t *q, long state ) { mblk_t *m; struct T_info_ack *t; if (( m = allocb( sizeof( struct T_info_ack ), BPRI_HI )) == NULL ) { return; } m->b_wptr = m->b_rptr + sizeof( struct T_info_ack ); m->b_datap->db_type = M_PCPROTO; t = (struct T_info_ack *)m->b_rptr; t->PRIM_type = T_INFO_ACK; t->TSDU_size = 586; t->ETSDU_size = -2; t->CDATA_size = -2; t->DDATA_size = -2; t->ADDR_size = sizeof( struct sockaddr_at ); t->OPT_size = 64; t->TIDU_size = 1024; t->SERV_type = T_CLTS; t->CURRENT_state = state; t->PROVIDER_flag = 0; qreply( q, m ); return; } void t_unitdata_ind( queue_t *q, mblk_t *m0, struct sockaddr_at *sat ) { mblk_t *m; struct T_unitdata_ind *t; if (( m = allocb( sizeof( struct T_unitdata_ind ) + sizeof( struct sockaddr_at ), BPRI_HI )) == NULL ) { return; } m->b_wptr = m->b_rptr + sizeof( struct T_unitdata_ind ); m->b_datap->db_type = M_PROTO; t = (struct T_unitdata_ind *)m->b_rptr; t->PRIM_type = T_UNITDATA_IND; t->SRC_length = sizeof( struct sockaddr_at ); t->SRC_offset = m->b_wptr - m->b_rptr; bcopy( (caddr_t)sat, m->b_wptr, sizeof( struct sockaddr_at )); m->b_wptr += sizeof( struct sockaddr_at ); t->OPT_length = 0; t->OPT_offset = 0; linkb( m, m0 ); qreply( q, m ); return; } struct ioc_state { int is_state; int is_count; caddr_t is_addr; }; static int tpi_wput( queue_t *q, mblk_t *m ) { struct sock_data *sd = (struct sock_data *)RD(q)->q_ptr; union T_primitives *tl; struct iocblk *ioc; struct copyresp *cp; struct ioc_state *is; struct ddpehdr *deh; mblk_t *m0; struct sockaddr_at sat; struct netbuf nb; struct rtentry rt; struct ifreq ifr; int err; switch ( m->b_datap->db_type ) { case M_PCPROTO : case M_PROTO : if ( m->b_wptr - m->b_rptr < sizeof( tl->type )) { freemsg( m ); break; } tl = (union T_primitives *)m->b_rptr; switch ( tl->type ) { case T_INFO_REQ : t_info_ack( q, sd->sd_state ); freemsg( m ); break; case T_UNBIND_REQ : if ( m->b_wptr - m->b_rptr < sizeof( struct T_unbind_req )) { freemsg( m ); break; } if ( sd->sd_state != TS_IDLE ) { t_error_ack( q, T_BIND_REQ, TOUTSTATE, 0 ); freemsg( m ); break; } bzero( (caddr_t)&sd->sd_sat, sizeof( struct sockaddr_at )); sd->sd_state = TS_UNBND; t_ok_ack( q, T_UNBIND_REQ ); break; case T_BIND_REQ : if ( m->b_wptr - m->b_rptr < sizeof( struct T_bind_req )) { freemsg( m ); break; } if ( sd->sd_state != TS_UNBND ) { t_error_ack( q, T_BIND_REQ, TOUTSTATE, 0 ); freemsg( m ); break; } if ( tl->bind_req.ADDR_length == 0 ) { bzero( (caddr_t)&sat, sizeof( struct sockaddr_at )); sat.sat_family = AF_APPLETALK; } else { if ( tl->bind_req.ADDR_length != sizeof( struct sockaddr ) || m->b_wptr - m->b_rptr < tl->bind_req.ADDR_offset + tl->bind_req.ADDR_length ) { cmn_err( CE_CONT, "tpi_wput T_BIND_REQ wierd\n" ); freemsg( m ); break; } sat = *(struct sockaddr_at *)(m->b_rptr + tl->bind_req.ADDR_offset ); } if (( err = sock_bind( sd, &sat )) != 0 ) { t_error_ack( q, T_BIND_REQ, TSYSERR, err ); } else { /* seems like we must return the requested address */ t_bind_ack( q, &sat ); } freemsg( m ); break; case T_UNITDATA_REQ : if ( m->b_wptr - m->b_rptr < sizeof( struct T_unitdata_req )) { freemsg( m ); break; } if ( sd->sd_state != TS_IDLE ) { cmn_err( CE_NOTE, "tpi_wput unitdata on unbound socket\n" ); t_error_ack( q, T_UNITDATA_REQ, TOUTSTATE, 0 ); freemsg( m ); break; } if ( tl->unitdata_req.DEST_length != sizeof( struct sockaddr )) { cmn_err( CE_NOTE, "tpi_wput T_UNITDATA_REQ %d\n", tl->unitdata_req.DEST_length ); freemsg( m ); break; } #ifdef notdef /* * Sometimes, the socket layer gives us crap... Sound like a bug? */ if ( m->b_rptr + tl->unitdata_req.DEST_offset + tl->unitdata_req.DEST_length > m->b_wptr ) { cmn_err( CE_CONT, "tpi_wput T_UNITDATA_REQ mblk size %X %X\n", m->b_rptr + tl->unitdata_req.DEST_offset + tl->unitdata_req.DEST_length, m->b_wptr ); freemsg( m ); break; } #endif /* notdef */ sat = *(struct sockaddr_at *)(m->b_rptr + tl->unitdata_req.DEST_offset ); if ( sat.sat_family != AF_APPLETALK ) { cmn_err( CE_CONT, "tpi_wput non-AppleTalk\n" ); freemsg( m ); break; } if ( m->b_wptr - m->b_rptr < sizeof( struct ddpehdr )) { cmn_err( CE_CONT, "tpi_wput m too short\n" ); freemsg( m ); break; } m->b_wptr = m->b_rptr + sizeof( struct ddpehdr ); m->b_datap->db_type = M_DATA; deh = (struct ddpehdr *)m->b_rptr; deh->deh_pad = 0; deh->deh_hops = 0; deh->deh_len = msgdsize( m ); deh->deh_dnet = sat.sat_addr.s_net; deh->deh_dnode = sat.sat_addr.s_node; deh->deh_dport = sat.sat_port; deh->deh_snet = sd->sd_sat.sat_addr.s_net; deh->deh_snode = sd->sd_sat.sat_addr.s_node; deh->deh_sport = sd->sd_sat.sat_port; deh->deh_sum = 0; /* XXX */ deh->deh_bytes = htonl( deh->deh_bytes ); return( if_route( if_withaddr( &sd->sd_sat ), m, &sat )); default : /* cmn_err( CE_NOTE, "tpi_wput M_PCPROTO 0x%X\n", tl->type ); */ t_error_ack( q, tl->type, TNOTSUPPORT, 0 ); freemsg( m ); break; } break; case M_IOCTL : if ( m->b_wptr - m->b_rptr < sizeof( struct iocblk )) { freemsg( m ); break; } ioc = (struct iocblk *)m->b_rptr; if ( ioc->ioc_count != TRANSPARENT ) { cmn_err( CE_CONT, "tpi_wput non-TRANSPARENT %X\n", ioc->ioc_cmd ); ioc_error_ack( q, m, EINVAL ); break; } if ( m->b_cont == NULL ) { cmn_err( CE_CONT, "tpi_wput M_IOCTL no arg\n" ); ioc_error_ack( q, m, EINVAL ); break; } /* de-allocated after M_IOCDATA processing */ if (( m0 = allocb( sizeof( struct ioc_state ), BPRI_HI )) == NULL ) { cmn_err( CE_CONT, "tpi_wput m0 no mem\n" ); ioc_error_ack( q, m, EINVAL ); break; } m0->b_wptr = m->b_rptr + sizeof( struct ioc_state ); is = (struct ioc_state *)m0->b_rptr; switch ( ioc->ioc_cmd ) { case SIOCADDRT : case SIOCDELRT : if (( err = drv_priv( ioc->ioc_cr )) != 0 ) { ioc_error_ack( q, m, err ); break; } is->is_state = M_COPYIN; is->is_addr = *(caddr_t *)m->b_cont->b_rptr; ioc_copyin( q, m, m0, is->is_addr, sizeof( struct rtentry )); break; case SIOCADDMULTI : case SIOCSIFADDR : if (( err = drv_priv( ioc->ioc_cr )) != 0 ) { ioc_error_ack( q, m, err ); break; } case SIOCGIFADDR : is->is_state = M_COPYIN; is->is_addr = *(caddr_t *)m->b_cont->b_rptr; ioc_copyin( q, m, m0, is->is_addr, sizeof( struct ifreq )); break; case TI_GETMYNAME : is->is_state = M_COPYIN; is->is_addr = *(caddr_t *)m->b_cont->b_rptr; ioc_copyin( q, m, m0, is->is_addr, sizeof( struct netbuf )); break; default : ioc_error_ack( q, m, EINVAL ); break; } break; case M_IOCDATA : if ( m->b_wptr - m->b_rptr < sizeof( struct copyresp )) { freemsg( m ); break; } cp = (struct copyresp *)m->b_rptr; if ( cp->cp_rval != 0 ) { cmn_err( CE_CONT, "tpi_wput IOCDATA failed %s\n", cp->cp_rval ); freemsg( m ); break; } if (( m0 = cp->cp_private ) == NULL ) { cmn_err( CE_CONT, "tpi_wput IOCDATA no state\n" ); ioc_error_ack( q, m, EINVAL ); break; } if ( m0->b_wptr - m0->b_rptr < sizeof( struct ioc_state )) { cmn_err( CE_CONT, "tpi_wput IOCDATA private too short\n" ); ioc_error_ack( q, m, EINVAL ); break; } is = (struct ioc_state *)m0->b_rptr; switch ( cp->cp_cmd ) { case TI_GETMYNAME : switch ( is->is_state ) { case M_COPYIN : if ( m->b_cont == NULL ) { cmn_err( CE_CONT, "tpi_wput TI_GETMYNAME COPYIN no arg\n" ); ioc_error_ack( q, m, EINVAL ); break; } nb = *(struct netbuf *)m->b_cont->b_rptr; nb.len = sizeof( struct sockaddr_at ); /* copy out netbuf */ is->is_state = M_COPYOUT; is->is_count = 1; ioc_copyout( q, m, m0, (caddr_t)&nb, is->is_addr, sizeof( struct netbuf )); is->is_addr = nb.buf; return( 0 ); case M_COPYOUT : switch ( is->is_count ) { case 1 : /* copy out address to nb.buf */ is->is_state = M_COPYOUT; is->is_count = 2; ioc_copyout( q, m, m0, (caddr_t)&sd->sd_sat, is->is_addr, sizeof( struct sockaddr_at )); return( 0 ); case 2 : ioc_ok_ack( q, m, 0 ); break; default : cmn_err( CE_NOTE, "tpi_wput TI_GETMYNAME count %d\n", is->is_count ); ioc_error_ack( q, m, EINVAL ); break; } break; default : cmn_err( CE_NOTE, "tpi_wput TI_GETMYNAME state %d\n", is->is_state ); ioc_error_ack( q, m, EINVAL ); break; } break; case SIOCADDRT : /* manipulate routing table */ case SIOCDELRT : if (( err = drv_priv( cp->cp_cr )) != 0 ) { ioc_error_ack( q, m, err ); break; } if ( is->is_state != M_COPYIN ) { cmn_err( CE_CONT, "tpi_wput SIOC(ADD|DEL)RT bad state\n" ); freemsg( m ); break; } rt = *(struct rtentry *)m->b_cont->b_rptr; if ( cp->cp_cmd == SIOCADDRT ) { err = rt_add( (struct sockaddr_at *)&rt.rt_dst, (struct sockaddr_at *)&rt.rt_gateway, rt.rt_flags ); } else if ( cp->cp_cmd == SIOCDELRT ) { err = rt_del( (struct sockaddr_at *)&rt.rt_dst, (struct sockaddr_at *)&rt.rt_gateway, rt.rt_flags ); } else { cmn_err( CE_CONT, "tpi_wput SIOC(ADD|DEL)RT bad cmd\n" ); freemsg( m ); break; } if ( err != 0 ) { ioc_error_ack( q, m, err ); } else { ioc_ok_ack( q, m, 0 ); } break; /* * These both require lower messages to be sent. */ case SIOCADDMULTI : case SIOCSIFADDR : if (( err = drv_priv( cp->cp_cr )) != 0 ) { ioc_error_ack( q, m, err ); break; } if ( is->is_state != M_COPYIN ) { cmn_err( CE_CONT, "tpi_wput SIOCSIFADDR bad state\n" ); freemsg( m ); break; } ifr = *(struct ifreq *)m->b_cont->b_rptr; /* initiate command, pass q and m (current context to be saved */ if ( cp->cp_cmd == SIOCSIFADDR ) { err = if_setaddr( q, m, ifr.ifr_name, (struct sockaddr_at *)&ifr.ifr_addr ); } else { err = if_addmulti( q, m, ifr.ifr_name, &ifr.ifr_addr ); } if ( err != 0 ) { ioc_error_ack( q, m, err ); break; } break; case SIOCGIFADDR : /* get interface address */ switch ( is->is_state ) { case M_COPYOUT : /* ack the original ioctl */ ioc_ok_ack( q, m, 0 ); break; case M_COPYIN : if ( m->b_cont == NULL ) { cmn_err( CE_CONT, "tpi_wput SIOCGIFADDR COPYIN no arg\n" ); ioc_error_ack( q, m, EINVAL ); break; } /* size??? */ ifr = *(struct ifreq *)m->b_cont->b_rptr; if (( err = if_getaddr( ifr.ifr_name, (struct sockaddr_at *)&ifr.ifr_addr )) != 0 ) { ioc_error_ack( q, m, err ); } is->is_state = M_COPYOUT; ioc_copyout( q, m, m0, (caddr_t)&ifr, is->is_addr, sizeof( struct ifreq )); return( 0 ); /* avoid freemsg( m0 ) below */ default : cmn_err( CE_CONT, "tpi_wput SIOCGIFADDR bad state\n" ); freemsg( m ); break; } break; default : cmn_err( CE_NOTE, "tpi_wput M_IOCDATA 0x%X\n", cp->cp_cmd ); ioc_error_ack( q, m, EINVAL ); break; } freemsg( m0 ); break; default : cmn_err( CE_NOTE, "!tpi_wput dp_type = 0x%X\n", m->b_datap->db_type ); freemsg( m ); break; } return( 0 ); } static struct module_info tpi_info = { 0, /* XXX */ "ddp", 0, 1500, 3000, 64 }; static struct qinit tpi_rinit = { tpi_rput, /* qi_putp */ NULL, /* qi_srvp */ tpi_open, /* qi_qopen */ tpi_close, /* qi_qclose */ NULL, &tpi_info, /* qi_minfo */ NULL, }; static struct qinit tpi_winit = { tpi_wput, /* qi_putp */ NULL, NULL, NULL, NULL, &tpi_info, NULL, }; static struct streamtab tpi_stream = { &tpi_rinit, &tpi_winit, NULL, NULL }; static struct cb_ops tpi_cbops = { nulldev, /* cb_open */ nulldev, /* cb_close */ nodev, nodev, nodev, nodev, nodev, nodev, nodev, nodev, nodev, nochpoll, ddi_prop_op, &tpi_stream, D_NEW | D_MP | D_MTPERMOD, /* cb_flag */ CB_REV, /* cb_rev */ nodev, /* cb_aread */ nodev, /* cb_awrite */ }; static struct dev_ops tpi_devops = { DEVO_REV, 0, tpi_getinfo, #ifdef DDI_IDENTIFIED tpi_identify, #else nulldev, #endif nulldev, tpi_attach, tpi_detach, nodev, &tpi_cbops, (struct bus_ops *)NULL, NULL, }; /* * DDP Streams device. This device is opened by socket(). */ struct modldrv tpi_ldrv = { &mod_driverops, "DDP Streams device", &tpi_devops, }; netatalk-2.2.2/sys/solaris/rt.h0000644000175200017500000000027111655731130013335 00000000000000int rt_add( struct sockaddr_at *, struct sockaddr_at *, int ); int rt_del( struct sockaddr_at *, struct sockaddr_at *, int ); int rt_gate( struct sockaddr_at *, struct sockaddr_at * ); netatalk-2.2.2/sys/netatalk/0000777000175200017500000000000011704770432012755 500000000000000netatalk-2.2.2/sys/netatalk/Makefile.am0000644000175200017500000000032611655731130014723 00000000000000# Makefile.am for sys/netatalk/ pkginclude_HEADERS = aarp.h at.h at_var.h ddp.h ddp_var.h endian.h phase2.h SOURCES = aarp.c at_control.c at_proto.c ddp_input.c ddp_output.c ddp_usrreq.c EXTRA_DIST = $(SOURCES) netatalk-2.2.2/sys/netatalk/Makefile.in0000644000175200017500000003432011703521731014733 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for sys/netatalk/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = sys/netatalk DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(pkgincludedir)" pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(pkginclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkginclude_HEADERS = aarp.h at.h at_var.h ddp.h ddp_var.h endian.h phase2.h SOURCES = aarp.c at_control.c at_proto.c ddp_input.c ddp_output.c ddp_usrreq.c EXTRA_DIST = $(SOURCES) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sys/netatalk/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign sys/netatalk/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" @list='$(pkginclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-pkgincludeHEADERS install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkgincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkgincludeHEADERS install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkgincludeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/sys/netatalk/ddp_output.c0000644000175200017500000001473011655731130015226 00000000000000/* * $Id: ddp_output.c,v 1.4 2002-01-04 04:45:49 sibaz Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #undef s_net #include #include "at.h" #include "at_var.h" #include "endian.h" #include "ddp.h" #include "ddp_var.h" u_short at_cksum(); int ddp_cksum = 1; ddp_output( ddp, m ) struct ddpcb *ddp; struct mbuf *m; { #ifndef BSD4_4 struct mbuf *m0; int len; #endif /* ! BSD4_4 */ struct ifnet *ifp; struct at_ifaddr *aa = NULL; struct ddpehdr *deh; u_short net; #ifdef BSD4_4 M_PREPEND( m, sizeof( struct ddpehdr ), M_WAIT ); #else /* BSD4_4 */ for ( len = 0, m0 = m; m; m = m->m_next ) { len += m->m_len; } MGET( m, M_WAIT, MT_HEADER ); if ( m == 0 ) { m_freem( m0 ); return( ENOBUFS ); } m->m_next = m0; #endif /* BSD4_4 */ #ifndef BSD4_4 # define align(a) (((a)+3)&0xfc) m->m_off = MMINOFF + align( SZ_ELAPHDR ); m->m_len = sizeof( struct ddpehdr ); #endif /* ! BSD4_4 */ deh = mtod( m, struct ddpehdr *); deh->deh_pad = 0; deh->deh_hops = 0; #ifdef BSD4_4 deh->deh_len = m->m_pkthdr.len; #else /* BSD4_4 */ deh->deh_len = len + sizeof( struct ddpehdr ); #endif /* BSD4_4 */ deh->deh_dnet = ddp->ddp_fsat.sat_addr.s_net; deh->deh_dnode = ddp->ddp_fsat.sat_addr.s_node; deh->deh_dport = ddp->ddp_fsat.sat_port; deh->deh_snet = ddp->ddp_lsat.sat_addr.s_net; deh->deh_snode = ddp->ddp_lsat.sat_addr.s_node; deh->deh_sport = ddp->ddp_lsat.sat_port; /* * The checksum calculation is done after all of the other bytes have * been filled in. */ if ( ddp_cksum ) { deh->deh_sum = at_cksum( m, sizeof( int )); } else { deh->deh_sum = 0; } deh->deh_bytes = htonl( deh->deh_bytes ); return( ddp_route( m, &ddp->ddp_route )); } u_short at_cksum( m, skip ) struct mbuf *m; int skip; { u_char *data, *end; u_int32_t cksum = 0; for (; m; m = m->m_next ) { for ( data = mtod( m, u_char * ), end = data + m->m_len; data < end; data++ ) { if ( skip ) { skip--; continue; } cksum = ( cksum + *data ) << 1; if ( cksum & 0x00010000 ) { cksum++; } cksum &= 0x0000ffff; } } if ( cksum == 0 ) { cksum = 0x0000ffff; } return( (u_short)cksum ); } ddp_route( m, ro ) struct mbuf *m; struct route *ro; { struct sockaddr_at gate; struct elaphdr *elh; struct mbuf *m0; struct at_ifaddr *aa = NULL; struct ifnet *ifp; int mlen; u_short net; if ( ro->ro_rt && ( ifp = ro->ro_rt->rt_ifp )) { #ifdef BSD4_4 net = satosat( ro->ro_rt->rt_gateway )->sat_addr.s_net; #else /* BSD4_4 */ net = satosat( &ro->ro_rt->rt_gateway )->sat_addr.s_net; #endif /* BSD4_4 */ for ( aa = at_ifaddr; aa; aa = aa->aa_next ) { if ( aa->aa_ifp == ifp && ntohs( net ) >= ntohs( aa->aa_firstnet ) && ntohs( net ) <= ntohs( aa->aa_lastnet )) { break; } } } if ( aa == NULL ) { m_freem( m ); return( EINVAL ); } /* * There are several places in the kernel where data is added to * an mbuf without ensuring that the mbuf pointer is aligned. * This is bad for transition routing, since phase 1 and phase 2 * packets end up poorly aligned due to the three byte elap header. */ if ( aa->aa_flags & AFA_PHASE2 ) { for ( mlen = 0, m0 = m; m0; m0 = m0->m_next ) { mlen += m0->m_len; } if (( m = m_pullup( m, MIN( MLEN, mlen ))) == 0 ) { return( ENOBUFS ); } } else { # ifdef notdef #ifdef BSD4_4 M_PREPEND( m, SZ_ELAPHDR, M_DONTWAIT ); if ( m == NULL ) { return( ENOBUFS ); } #else /* BSD4_4 */ m->m_off -= SZ_ELAPHDR; m->m_len += SZ_ELAPHDR; #endif /* BSD4_4 */ # endif /* notdef */ MGET( m0, M_WAIT, MT_HEADER ); if ( m0 == 0 ) { m_freem( m ); return( ENOBUFS ); } m0->m_next = m; m0->m_off = MMINOFF + align( sizeof( struct ether_header )); m0->m_len = SZ_ELAPHDR; m = m0; elh = mtod( m, struct elaphdr *); elh->el_snode = satosat( &aa->aa_addr )->sat_addr.s_node; elh->el_type = ELAP_DDPEXTEND; if ( ntohs( satosat( &ro->ro_dst )->sat_addr.s_net ) >= ntohs( aa->aa_firstnet ) && ntohs( satosat( &ro->ro_dst )->sat_addr.s_net ) <= ntohs( aa->aa_lastnet )) { elh->el_dnode = satosat( &ro->ro_dst )->sat_addr.s_node; } else { #ifdef BSD4_4 elh->el_dnode = satosat( ro->ro_rt->rt_gateway )->sat_addr.s_node; #else /* BSD4_4 */ elh->el_dnode = satosat( &ro->ro_rt->rt_gateway )->sat_addr.s_node; #endif /* BSD4_4 */ } } if ( ntohs( satosat( &ro->ro_dst )->sat_addr.s_net ) >= ntohs( aa->aa_firstnet ) && ntohs( satosat( &ro->ro_dst )->sat_addr.s_net ) <= ntohs( aa->aa_lastnet )) { gate = *satosat( &ro->ro_dst ); } else { #ifdef BSD4_4 gate = *satosat( ro->ro_rt->rt_gateway ); #else /* BSD4_4 */ gate = *satosat( &ro->ro_rt->rt_gateway ); #endif /* BSD4_4 */ } ro->ro_rt->rt_use++; #ifdef ultrix /* * SAIEW: We can't make changes to net/if_loop.c, so we don't route * further than this: if it's going to go through the lookback, * short-circuit to ddp_input(). Who needs queuing? * * Note: Passing NULL for the elaphdr is cool, since we'll only ever * try to send long form ddp throught the loopback. */ if ( ifp->if_flags & IFF_LOOPBACK ) { #ifdef notdef m->m_off += SZ_ELAPHDR; m->m_len -= SZ_ELAPHDR; #endif /* notdef */ ddp_input( m, ifp, (struct elaphdr *)NULL, 2 ); return( 0 ); } #endif /* ultrix */ #ifdef _IBMR2 /* * We can't make changes to the interface routines on RS6ks, and * they don't provide hooks for if_output, so we just resolve * our address here, and pass the packet as a raw ethernet packet. * This doesn't work particularly well, if we aren't *on* ethernet, * but it's ok for the moment. */ if ( ! ( ifp->if_flags & IFF_LOOPBACK )) { struct ether_header eh; if ( !aarpresolve(( struct arpcom *)ifp, m, &gate, eh.ether_dhost )) { return( 0 ); } eh.ether_type = htons( ETHERTYPE_AT ); gate.sat_family = AF_UNSPEC; bcopy( &eh, (*(struct sockaddr *)&gate).sa_data, sizeof( (*(struct sockaddr *)&gate).sa_data )); } #endif /* _IBMR2 */ return((*ifp->if_output)( ifp, m, &gate )); } netatalk-2.2.2/sys/netatalk/at.h0000644000175200017500000000577311655731246013467 00000000000000/* * Copyright (c) 1990,1991 Regents of The University of Michigan. * * All Rights Reserved. See COPYRIGHT. */ #ifndef __AT_HEADER__ #define __AT_HEADER__ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifndef NO_DDP #if defined(linux) /* pull in the linux header */ #include #include #include #ifdef HAVE_ATALK_ADDR #define at_addr atalk_addr #define netrange atalk_netrange #endif /* HAVE_ATALK_ADDR */ #else /* linux */ #include #include /* so that we can deal with sun's s_net #define */ #ifdef MACOSX_SERVER #include #endif /* MACOSX_SERVER */ /* * Supported protocols */ #ifdef ATPROTO_DDP #undef ATPROTO_DDP #endif /* ATPROTO_DDP */ #define ATPROTO_DDP 0 #define ATPROTO_AARP 254 /* * Ethernet types, for DIX. * These should really be in some global header file, but we can't * count on them being there, and it's annoying to patch system files. */ #ifndef ETHERTYPE_AT #define ETHERTYPE_AT 0x809B /* AppleTalk protocol */ #endif #ifndef ETHERTYPE_AARP #define ETHERTYPE_AARP 0x80F3 /* AppleTalk ARP */ #endif #define DDP_MAXSZ 587 /* * If ATPORT_FIRST <= Port < ATPORT_RESERVED, * Port was created by a privileged process. * If ATPORT_RESERVED <= Port < ATPORT_LAST, * Port was not necessarily created by a * privileged process. */ #define ATPORT_FIRST 1 #define ATPORT_RESERVED 128 #define ATPORT_LAST 254 /* 254 is reserved on ether/tokentalk networks */ /* * AppleTalk address. */ #ifndef MACOSX_SERVER struct at_addr { #ifdef s_net #undef s_net #endif /* s_net */ u_short s_net; u_char s_node; }; #endif /* MACOSX_SERVER */ #define ATADDR_ANYNET (u_short)0x0000 #define ATADDR_ANYNODE (u_char)0x00 #define ATADDR_ANYPORT (u_char)0x00 #define ATADDR_BCAST (u_char)0xff /* There is no BCAST for NET */ /* * Socket address, AppleTalk style. We keep magic information in the * zero bytes. There are three types, NONE, CONFIG which has the phase * and a net range, and IFACE which has the network address of an * interface. IFACE may be filled in by the client, and is filled in * by the kernel. */ #ifndef MACOSX_SERVER struct sockaddr_at { #ifdef BSD4_4 u_char sat_len; u_char sat_family; #else /* BSD4_4 */ short sat_family; #endif /* BSD4_4 */ u_char sat_port; struct at_addr sat_addr; #ifdef notdef struct { u_char sh_type; # define SATHINT_NONE 0 # define SATHINT_CONFIG 1 # define SATHINT_IFACE 2 union { char su_zero[ 7 ]; /* XXX check size */ struct { u_char sr_phase; u_short sr_firstnet, sr_lastnet; } su_range; u_short su_interface; } sh_un; } sat_hints; #else /* notdef */ char sat_zero[ 8 ]; #endif /* notdef */ }; #endif /* MACOSX_SERVER */ struct netrange { u_char nr_phase; u_short nr_firstnet; u_short nr_lastnet; }; #ifdef KERNEL extern struct domain atalkdomain; extern struct protosw atalksw[]; #endif /* KERNEL */ #endif /* linux */ #endif /* NO_DDP */ #endif /* __AT_HEADER__ */ netatalk-2.2.2/sys/netatalk/at_control.c0000644000175200017500000003511211655731130015200 00000000000000/* * $Id: at_control.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #ifdef ibm032 #include #endif /* ibm032 */ #include #include #include #include #include #ifndef _IBMR2 #include #endif /* ! _IBMR2 */ #include #include #include #include #include #include #undef s_net #include #ifdef _IBMR2 #include #endif /* _IBMR2 */ #include "at.h" #include "at_var.h" #include "aarp.h" #include "phase2.h" #ifdef BSD4_4 # define sateqaddr(a,b) ((a)->sat_len == (b)->sat_len && \ (a)->sat_family == (b)->sat_family && \ (a)->sat_addr.s_net == (b)->sat_addr.s_net && \ (a)->sat_addr.s_node == (b)->sat_addr.s_node ) #else /* BSD4_4 */ atalk_hash( sat, hp ) struct sockaddr_at *sat; struct afhash *hp; { hp->afh_nethash = sat->sat_addr.s_net; hp->afh_hosthash = ( sat->sat_addr.s_net << 8 ) + sat->sat_addr.s_node; } /* * Note the magic to get ifa_ifwithnet() to work without adding an * ifaddr entry for each net in our local range. */ atalk_netmatch( sat1, sat2 ) struct sockaddr_at *sat1, *sat2; { struct at_ifaddr *aa; for ( aa = at_ifaddr; aa; aa = aa->aa_next ) { if ( AA_SAT( aa ) == sat1 ) { break; } } if ( aa ) { return( ntohs( aa->aa_firstnet ) <= ntohs( sat2->sat_addr.s_net ) && ntohs( aa->aa_lastnet ) >= ntohs( sat2->sat_addr.s_net )); } return( sat1->sat_addr.s_net == sat2->sat_addr.s_net ); } #endif /* BSD4_4 */ at_control( cmd, data, ifp ) int cmd; caddr_t data; struct ifnet *ifp; { struct ifreq *ifr = (struct ifreq *)data; struct sockaddr_at *sat; struct netrange *nr; #ifdef BSD4_4 struct at_aliasreq *ifra = (struct at_aliasreq *)data; struct at_ifaddr *aa0; #endif /* BSD4_4 */ struct at_ifaddr *aa = 0; struct mbuf *m; struct ifaddr *ifa; if ( ifp ) { for ( aa = at_ifaddr; aa; aa = aa->aa_next ) { if ( aa->aa_ifp == ifp ) break; } } switch ( cmd ) { #ifdef BSD4_4 case SIOCAIFADDR: case SIOCDIFADDR: if ( ifra->ifra_addr.sat_family == AF_APPLETALK ) { for ( ; aa; aa = aa->aa_next ) { if ( aa->aa_ifp == ifp && sateqaddr( &aa->aa_addr, &ifra->ifra_addr )) { break; } } } if ( cmd == SIOCDIFADDR && aa == 0 ) { return( EADDRNOTAVAIL ); } /*FALLTHROUGH*/ #endif /* BSD4_4 */ case SIOCSIFADDR: #ifdef BSD4_4 /* * What a great idea this is: Let's reverse the meaning of * the return... */ if ( suser( u.u_cred, &u.u_acflag )) { return( EPERM ); } #else /* BSD4_4 */ if ( !suser()) { return( EPERM ); } #endif /* BSD4_4 */ sat = satosat( &ifr->ifr_addr ); nr = (struct netrange *)sat->sat_zero; if ( nr->nr_phase == 1 ) { for ( ; aa; aa = aa->aa_next ) { if ( aa->aa_ifp == ifp && ( aa->aa_flags & AFA_PHASE2 ) == 0 ) { break; } } } else { /* default to phase 2 */ for ( ; aa; aa = aa->aa_next ) { if ( aa->aa_ifp == ifp && ( aa->aa_flags & AFA_PHASE2 )) { break; } } } if ( ifp == 0 ) panic( "at_control" ); if ( aa == (struct at_ifaddr *) 0 ) { m = m_getclr( M_WAIT, MT_IFADDR ); if ( m == (struct mbuf *)NULL ) { return( ENOBUFS ); } if (( aa = at_ifaddr ) != NULL ) { /* * Don't let the loopback be first, since the first * address is the machine's default address for * binding. */ if ( at_ifaddr->aa_ifp->if_flags & IFF_LOOPBACK ) { aa = mtod( m, struct at_ifaddr *); aa->aa_next = at_ifaddr; at_ifaddr = aa; } else { for ( ; aa->aa_next; aa = aa->aa_next ) ; aa->aa_next = mtod( m, struct at_ifaddr *); } } else { at_ifaddr = mtod( m, struct at_ifaddr *); } aa = mtod( m, struct at_ifaddr *); if (( ifa = ifp->if_addrlist ) != NULL ) { for ( ; ifa->ifa_next; ifa = ifa->ifa_next ) ; ifa->ifa_next = (struct ifaddr *)aa; } else { ifp->if_addrlist = (struct ifaddr *)aa; } #ifdef BSD4_4 aa->aa_ifa.ifa_addr = (struct sockaddr *)&aa->aa_addr; aa->aa_ifa.ifa_dstaddr = (struct sockaddr *)&aa->aa_addr; aa->aa_ifa.ifa_netmask = (struct sockaddr *)&aa->aa_netmask; #endif /* BSD4_4 */ /* * Set/clear the phase 2 bit. */ if ( nr->nr_phase == 1 ) { aa->aa_flags &= ~AFA_PHASE2; } else { aa->aa_flags |= AFA_PHASE2; } aa->aa_ifp = ifp; } else { at_scrub( ifp, aa ); } break; case SIOCGIFADDR : sat = satosat( &ifr->ifr_addr ); nr = (struct netrange *)sat->sat_zero; if ( nr->nr_phase == 1 ) { for ( ; aa; aa = aa->aa_next ) { if ( aa->aa_ifp == ifp && ( aa->aa_flags & AFA_PHASE2 ) == 0 ) { break; } } } else { /* default to phase 2 */ for ( ; aa; aa = aa->aa_next ) { if ( aa->aa_ifp == ifp && ( aa->aa_flags & AFA_PHASE2 )) { break; } } } if ( aa == (struct at_ifaddr *) 0 ) return( EADDRNOTAVAIL ); break; } switch ( cmd ) { case SIOCGIFADDR: #ifdef BSD4_4 *(struct sockaddr_at *)&ifr->ifr_addr = aa->aa_addr; #else /* BSD4_4 */ ifr->ifr_addr = aa->aa_addr; #endif /* BSD4_4 */ break; case SIOCSIFADDR: return( at_ifinit( ifp, aa, (struct sockaddr_at *)&ifr->ifr_addr )); #ifdef BSD4_4 case SIOCAIFADDR: if ( sateqaddr( &ifra->ifra_addr, &aa->aa_addr )) { return( 0 ); } return( at_ifinit( ifp, aa, (struct sockaddr_at *)&ifr->ifr_addr )); case SIOCDIFADDR: at_scrub( ifp, aa ); if (( ifa = ifp->if_addrlist ) == (struct ifaddr *)aa ) { ifp->if_addrlist = ifa->ifa_next; } else { while ( ifa->ifa_next && ( ifa->ifa_next != (struct ifaddr *)aa )) { ifa = ifa->ifa_next; } if ( ifa->ifa_next ) { ifa->ifa_next = ((struct ifaddr *)aa)->ifa_next; } else { panic( "at_control" ); } } aa0 = aa; if ( aa0 == ( aa = at_ifaddr )) { at_ifaddr = aa->aa_next; } else { while ( aa->aa_next && ( aa->aa_next != aa0 )) { aa = aa->aa_next; } if ( aa->aa_next ) { aa->aa_next = aa0->aa_next; } else { panic( "at_control" ); } } m_free( dtom( aa0 )); break; #endif /* BSD4_4 */ default: if ( ifp == 0 || ifp->if_ioctl == 0 ) return( EOPNOTSUPP ); return( (*ifp->if_ioctl)( ifp, cmd, data )); } return( 0 ); } at_scrub( ifp, aa ) struct ifnet *ifp; struct at_ifaddr *aa; { #ifndef BSD4_4 struct sockaddr_at netsat; int error; u_short net; #endif /* ! BSD4_4 */ if ( aa->aa_flags & AFA_ROUTE ) { #ifdef BSD4_4 if (( error = rtinit( &(aa->aa_ifa), RTM_DELETE, ( ifp->if_flags & IFF_LOOPBACK ) ? RTF_HOST : 0 )) != 0 ) { return( error ); } aa->aa_ifa.ifa_flags &= ~IFA_ROUTE; #else /* BSD4_4 */ if ( ifp->if_flags & IFF_LOOPBACK ) { rtinit( &aa->aa_addr, &aa->aa_addr, SIOCDELRT, RTF_HOST ); } else { bzero( &netsat, sizeof( struct sockaddr_at )); netsat.sat_family = AF_APPLETALK; netsat.sat_addr.s_node = ATADDR_ANYNODE; /* * If the range is the full 0-fffe range, just use * the default route. */ if ( aa->aa_firstnet == htons( 0x0000 ) && aa->aa_lastnet == htons( 0xfffe )) { netsat.sat_addr.s_net = 0; rtinit((struct sockaddr *)&netsat, &aa->aa_addr, (int)SIOCDELRT, 0 ); } else { for ( net = ntohs( aa->aa_firstnet ); net <= ntohs( aa->aa_lastnet ); net++ ) { netsat.sat_addr.s_net = htons( net ); rtinit((struct sockaddr *)&netsat, &aa->aa_addr, (int)SIOCDELRT, 0 ); } } } #endif /* BSD4_4 */ aa->aa_flags &= ~AFA_ROUTE; } return( 0 ); } extern struct timeval time; at_ifinit( ifp, aa, sat ) struct ifnet *ifp; struct at_ifaddr *aa; struct sockaddr_at *sat; { struct netrange nr, onr; #ifdef BSD4_4 struct sockaddr_at oldaddr; #else /* BSD4_4 */ struct sockaddr oldaddr; #endif /* BSD4_4 */ struct sockaddr_at netaddr; int s = splimp(), error = 0, i, j, netinc, nodeinc, nnets; u_short net; oldaddr = aa->aa_addr; bzero( AA_SAT( aa ), sizeof( struct sockaddr_at )); bcopy( sat->sat_zero, &nr, sizeof( struct netrange )); nnets = ntohs( nr.nr_lastnet ) - ntohs( nr.nr_firstnet ) + 1; onr.nr_firstnet = aa->aa_firstnet; onr.nr_lastnet = aa->aa_lastnet; aa->aa_firstnet = nr.nr_firstnet; aa->aa_lastnet = nr.nr_lastnet; /* * We could eliminate the need for a second phase 1 probe (post * autoconf) if we check whether we're resetting the node. Note * that phase 1 probes use only nodes, not net.node pairs. Under * phase 2, both the net and node must be the same. */ if ( ifp->if_flags & IFF_LOOPBACK ) { #ifdef BSD4_4 AA_SAT( aa )->sat_len = sat->sat_len; #endif /* BSD4_4 */ AA_SAT( aa )->sat_family = AF_APPLETALK; AA_SAT( aa )->sat_addr.s_net = sat->sat_addr.s_net; AA_SAT( aa )->sat_addr.s_node = sat->sat_addr.s_node; } else { aa->aa_flags |= AFA_PROBING; AA_SAT( aa )->sat_family = AF_APPLETALK; if ( aa->aa_flags & AFA_PHASE2 ) { if ( sat->sat_addr.s_net == ATADDR_ANYNET ) { if ( nnets != 1 ) { net = ntohs( nr.nr_firstnet ) + time.tv_sec % ( nnets - 1 ); } else { net = ntohs( nr.nr_firstnet ); } } else { if ( ntohs( sat->sat_addr.s_net ) < ntohs( nr.nr_firstnet ) || ntohs( sat->sat_addr.s_net ) > ntohs( nr.nr_lastnet )) { aa->aa_addr = oldaddr; aa->aa_firstnet = onr.nr_firstnet; aa->aa_lastnet = onr.nr_lastnet; return( EINVAL ); } net = ntohs( sat->sat_addr.s_net ); } } else { net = ntohs( sat->sat_addr.s_net ); } if ( sat->sat_addr.s_node == ATADDR_ANYNODE ) { AA_SAT( aa )->sat_addr.s_node = time.tv_sec; } else { AA_SAT( aa )->sat_addr.s_node = sat->sat_addr.s_node; } for ( i = nnets, netinc = 1; i > 0; net = ntohs( nr.nr_firstnet ) + (( net - ntohs( nr.nr_firstnet ) + netinc ) % nnets ), i-- ) { AA_SAT( aa )->sat_addr.s_net = htons( net ); for ( j = 0, nodeinc = time.tv_sec | 1; j < 256; j++, AA_SAT( aa )->sat_addr.s_node += nodeinc ) { if ( AA_SAT( aa )->sat_addr.s_node > 253 || AA_SAT( aa )->sat_addr.s_node < 1 ) { continue; } aa->aa_probcnt = 10; timeout( aarpprobe, (caddr_t)ifp, hz / 5 ); splx( s ); if ( sleep( aa, PSLEP|PCATCH )) { printf( "at_ifinit why did this happen?!\n" ); aa->aa_addr = oldaddr; aa->aa_firstnet = onr.nr_firstnet; aa->aa_lastnet = onr.nr_lastnet; return( EINTR ); } s = splimp(); if (( aa->aa_flags & AFA_PROBING ) == 0 ) { break; } } if (( aa->aa_flags & AFA_PROBING ) == 0 ) { break; } /* reset node for next network */ AA_SAT( aa )->sat_addr.s_node = time.tv_sec; } if ( aa->aa_flags & AFA_PROBING ) { aa->aa_addr = oldaddr; aa->aa_firstnet = onr.nr_firstnet; aa->aa_lastnet = onr.nr_lastnet; splx( s ); return( EADDRINUSE ); } } if ( ifp->if_ioctl && ( error = (*ifp->if_ioctl)( ifp, SIOCSIFADDR, aa ))) { splx( s ); aa->aa_addr = oldaddr; aa->aa_firstnet = onr.nr_firstnet; aa->aa_lastnet = onr.nr_lastnet; return( error ); } #ifdef BSD4_4 aa->aa_netmask.sat_len = 6; aa->aa_netmask.sat_family = AF_APPLETALK; aa->aa_netmask.sat_addr.s_net = 0xffff; aa->aa_netmask.sat_addr.s_node = 0; #endif /* BSD4_4 */ if ( ifp->if_flags & IFF_LOOPBACK ) { #ifndef BSD4_4 rtinit( &aa->aa_addr, &aa->aa_addr, (int)SIOCADDRT, RTF_HOST|RTF_UP ); #else /* ! BSD4_4 */ error = rtinit( &(aa->aa_ifa), (int)RTM_ADD, RTF_HOST|RTF_UP ); #endif /* ! BSD4_4 */ } else { #ifndef BSD4_4 /* * rtrequest looks for point-to-point links first. The * broadaddr is in the same spot as the destaddr. So, if * ATADDR_ANYNET is 0, and we don't fill in the broadaddr, we * get 0.0 routed out the ether interface. So, initialize the * broadaddr, even tho we don't use it. * * We *could* use the broadaddr field to reduce some of the * sockaddr_at overloading that we've done. E.g. Just send * to INTERFACE-NET.255, and have the kernel reroute that * to broadaddr, which would be 0.255 for phase 2 interfaces, * and IFACE-NET.255 for phase 1 interfaces. */ ((struct sockaddr_at *)&aa->aa_broadaddr)->sat_addr.s_net = sat->sat_addr.s_net; ((struct sockaddr_at *)&aa->aa_broadaddr)->sat_addr.s_node = ATADDR_BCAST; bzero( &netaddr, sizeof( struct sockaddr_at )); netaddr.sat_family = AF_APPLETALK; netaddr.sat_addr.s_node = ATADDR_ANYNODE; if (( aa->aa_flags & AFA_PHASE2 ) == 0 ) { netaddr.sat_addr.s_net = AA_SAT( aa )->sat_addr.s_net; rtinit((struct sockaddr *)&netaddr, &aa->aa_addr, (int)SIOCADDRT, RTF_UP ); } else { /* * If the range is the full 0-fffe range, just use * the default route. */ if ( aa->aa_firstnet == htons( 0x0000 ) && aa->aa_lastnet == htons( 0xfffe )) { netaddr.sat_addr.s_net = 0; rtinit((struct sockaddr *)&netaddr, &aa->aa_addr, (int)SIOCADDRT, RTF_UP ); } else { for ( net = ntohs( aa->aa_firstnet ); net <= ntohs( aa->aa_lastnet ); net++ ) { netaddr.sat_addr.s_net = htons( net ); rtinit((struct sockaddr *)&netaddr, &aa->aa_addr, (int)SIOCADDRT, RTF_UP ); } } } #else /* ! BSD4_4 */ error = rtinit( &(aa->aa_ifa), (int)RTM_ADD, RTF_UP ); #endif /* ! BSD4_4 */ } if ( error ) { aa->aa_addr = oldaddr; aa->aa_firstnet = onr.nr_firstnet; aa->aa_lastnet = onr.nr_lastnet; splx( s ); return( error ); } #ifdef BSD4_4 aa->aa_ifa.ifa_flags |= IFA_ROUTE; #endif /* BSD4_4 */ aa->aa_flags |= AFA_ROUTE; splx( s ); return( 0 ); } at_broadcast( sat ) struct sockaddr_at *sat; { struct at_ifaddr *aa; if ( sat->sat_addr.s_node != ATADDR_BCAST ) { return( 0 ); } if ( sat->sat_addr.s_net == 0 ) { return( 1 ); } else { for ( aa = at_ifaddr; aa; aa = aa->aa_next ) { if (( aa->aa_ifp->if_flags & IFF_BROADCAST ) && ( ntohs( sat->sat_addr.s_net ) >= ntohs( aa->aa_firstnet ) && ntohs( sat->sat_addr.s_net ) <= ntohs( aa->aa_lastnet ))) { return( 1 ); } } } return( 0 ); } aa_clean() { struct at_ifaddr *aa; struct ifaddr *ifa; struct ifnet *ifp; while ( aa = at_ifaddr ) { ifp = aa->aa_ifp; at_scrub( ifp, aa ); at_ifaddr = aa->aa_next; if (( ifa = ifp->if_addrlist ) == (struct ifaddr *)aa ) { ifp->if_addrlist = ifa->ifa_next; } else { while ( ifa->ifa_next && ( ifa->ifa_next != (struct ifaddr *)aa )) { ifa = ifa->ifa_next; } if ( ifa->ifa_next ) { ifa->ifa_next = ((struct ifaddr *)aa)->ifa_next; } else { panic( "at_entry" ); } } } } netatalk-2.2.2/sys/netatalk/ddp_input.c0000644000175200017500000002167711655731130015035 00000000000000/* * $Id: ddp_input.c,v 1.4 2002-01-04 04:45:48 sibaz Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #ifdef _IBMR2 #include #endif /* _IBMR2 */ #include "at.h" #include "at_var.h" #include "endian.h" #include "ddp.h" #include "ddp_var.h" int ddp_forward = 1; int ddp_firewall = 0; extern int ddp_cksum; extern u_short at_cksum(); /* * Could probably merge these two code segments a little better... */ atintr() { struct elaphdr *elhp, elh; struct ifnet *ifp; struct mbuf *m; struct at_ifaddr *aa; int s; for (;;) { #ifndef _IBMR2 s = splimp(); #endif /* ! _IBMR2 */ #ifdef BSD4_4 IF_DEQUEUE( &atintrq2, m ); #else /* BSD4_4 */ IF_DEQUEUEIF( &atintrq2, m, ifp ); #endif /* BSD4_4 */ #ifndef _IBMR2 splx( s ); #endif /* ! _IBMR2 */ if ( m == 0 ) { /* no more queued packets */ break; } #ifdef BSD4_4 ifp = m->m_pkthdr.rcvif; #endif /* BSD4_4 */ for ( aa = at_ifaddr; aa; aa = aa->aa_next ) { if ( aa->aa_ifp == ifp && ( aa->aa_flags & AFA_PHASE2 )) { break; } } if ( aa == NULL ) { /* ifp not an appletalk interface */ m_freem( m ); continue; } ddp_input( m, ifp, (struct elaphdr *)NULL, 2 ); } for (;;) { #ifndef _IBMR2 s = splimp(); #endif /* ! _IBMR2 */ #ifdef BSD4_4 IF_DEQUEUE( &atintrq1, m ); #else /* BSD4_4 */ IF_DEQUEUEIF( &atintrq1, m, ifp ); #endif /* BSD4_4 */ #ifndef _IBMR2 splx( s ); #endif /* ! _IBMR2 */ if ( m == 0 ) { /* no more queued packets */ break; } #ifdef BSD4_4 ifp = m->m_pkthdr.rcvif; #endif /* BSD4_4 */ for ( aa = at_ifaddr; aa; aa = aa->aa_next ) { if ( aa->aa_ifp == ifp && ( aa->aa_flags & AFA_PHASE2 ) == 0 ) { break; } } if ( aa == NULL ) { /* ifp not an appletalk interface */ m_freem( m ); continue; } if ( m->m_len < SZ_ELAPHDR && (( m = m_pullup( m, SZ_ELAPHDR )) == 0 )) { ddpstat.ddps_tooshort++; continue; } elhp = mtod( m, struct elaphdr *); m_adj( m, SZ_ELAPHDR ); if ( elhp->el_type == ELAP_DDPEXTEND ) { ddp_input( m, ifp, (struct elaphdr *)NULL, 1 ); } else { bcopy((caddr_t)elhp, (caddr_t)&elh, SZ_ELAPHDR ); ddp_input( m, ifp, &elh, 1 ); } } return; } struct route forwro; ddp_input( m, ifp, elh, phase ) struct mbuf *m; struct ifnet *ifp; struct elaphdr *elh; int phase; { struct sockaddr_at from, to; struct ddpshdr *dsh, ddps; struct at_ifaddr *aa; struct ddpehdr *deh, ddpe; #ifndef BSD4_4 struct mbuf *mp; #endif /* BSD4_4 */ struct ddpcb *ddp; int dlen, mlen; u_short cksum; bzero( (caddr_t)&from, sizeof( struct sockaddr_at )); if ( elh ) { ddpstat.ddps_short++; if ( m->m_len < sizeof( struct ddpshdr ) && (( m = m_pullup( m, sizeof( struct ddpshdr ))) == 0 )) { ddpstat.ddps_tooshort++; return; } dsh = mtod( m, struct ddpshdr *); bcopy( (caddr_t)dsh, (caddr_t)&ddps, sizeof( struct ddpshdr )); ddps.dsh_bytes = ntohl( ddps.dsh_bytes ); dlen = ddps.dsh_len; to.sat_addr.s_net = 0; to.sat_addr.s_node = elh->el_dnode; to.sat_port = ddps.dsh_dport; from.sat_addr.s_net = 0; from.sat_addr.s_node = elh->el_snode; from.sat_port = ddps.dsh_sport; for ( aa = at_ifaddr; aa; aa = aa->aa_next ) { if ( aa->aa_ifp == ifp && ( aa->aa_flags & AFA_PHASE2 ) == 0 && ( AA_SAT( aa )->sat_addr.s_node == to.sat_addr.s_node || to.sat_addr.s_node == ATADDR_BCAST )) { break; } } if ( aa == NULL ) { m_freem( m ); return; } } else { ddpstat.ddps_long++; if ( m->m_len < sizeof( struct ddpehdr ) && (( m = m_pullup( m, sizeof( struct ddpehdr ))) == 0 )) { ddpstat.ddps_tooshort++; return; } deh = mtod( m, struct ddpehdr *); bcopy( (caddr_t)deh, (caddr_t)&ddpe, sizeof( struct ddpehdr )); ddpe.deh_bytes = ntohl( ddpe.deh_bytes ); dlen = ddpe.deh_len; if (( cksum = ddpe.deh_sum ) == 0 ) { ddpstat.ddps_nosum++; } from.sat_addr.s_net = ddpe.deh_snet; from.sat_addr.s_node = ddpe.deh_snode; from.sat_port = ddpe.deh_sport; to.sat_addr.s_net = ddpe.deh_dnet; to.sat_addr.s_node = ddpe.deh_dnode; to.sat_port = ddpe.deh_dport; if ( to.sat_addr.s_net == 0 ) { for ( aa = at_ifaddr; aa; aa = aa->aa_next ) { if ( phase == 1 && ( aa->aa_flags & AFA_PHASE2 )) { continue; } if ( phase == 2 && ( aa->aa_flags & AFA_PHASE2 ) == 0 ) { continue; } if ( aa->aa_ifp == ifp && ( AA_SAT( aa )->sat_addr.s_node == to.sat_addr.s_node || to.sat_addr.s_node == ATADDR_BCAST || ( ifp->if_flags & IFF_LOOPBACK ))) { break; } } } else { for ( aa = at_ifaddr; aa; aa = aa->aa_next ) { if ( to.sat_addr.s_net == aa->aa_firstnet && to.sat_addr.s_node == 0 ) { break; } if (( ntohs( to.sat_addr.s_net ) < ntohs( aa->aa_firstnet ) || ntohs( to.sat_addr.s_net ) > ntohs( aa->aa_lastnet )) && ( ntohs( to.sat_addr.s_net ) < 0xff00 || ntohs( to.sat_addr.s_net ) > 0xfffe)) { continue; } if ( to.sat_addr.s_node != AA_SAT( aa )->sat_addr.s_node && to.sat_addr.s_node != ATADDR_BCAST ) { continue; } break; } } } /* * Adjust the length, removing any padding that may have been added * at a link layer. We do this before we attempt to forward a packet, * possibly on a different media. */ #ifdef BSD4_4 mlen = m->m_pkthdr.len; #else /* BSD4_4 */ for ( mlen = 0, mp = m; mp; mp = mp->m_next ) { mlen += mp->m_len; } #endif /* BSD4_4 */ if ( mlen < dlen ) { ddpstat.ddps_toosmall++; m_freem( m ); return; } if ( mlen > dlen ) { m_adj( m, dlen - mlen ); } /* * XXX Should we deliver broadcasts locally, also, or rely on the * link layer to give us a copy? For the moment, the latter. */ if ( aa == NULL || ( to.sat_addr.s_node == ATADDR_BCAST && aa->aa_ifp != ifp && ( ifp->if_flags & IFF_LOOPBACK ) == 0 )) { if ( ddp_forward == 0 ) { m_freem( m ); return; } if ( forwro.ro_rt && ( satosat( &forwro.ro_dst )->sat_addr.s_net != to.sat_addr.s_net || satosat( &forwro.ro_dst )->sat_addr.s_node != to.sat_addr.s_node )) { #ifdef ultrix rtfree( forwro.ro_rt ); #else /* ultrix */ RTFREE( forwro.ro_rt ); #endif /* ultrix */ forwro.ro_rt = (struct rtentry *)0; } if ( forwro.ro_rt == (struct rtentry *)0 || forwro.ro_rt->rt_ifp == (struct ifnet *)0 ) { #ifdef BSD4_4 forwro.ro_dst.sa_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ forwro.ro_dst.sa_family = AF_APPLETALK; satosat( &forwro.ro_dst )->sat_addr.s_net = to.sat_addr.s_net; satosat( &forwro.ro_dst )->sat_addr.s_node = to.sat_addr.s_node; rtalloc( &forwro ); } if ( to.sat_addr.s_net != satosat( &forwro.ro_dst )->sat_addr.s_net && ddpe.deh_hops == DDP_MAXHOPS ) { m_freem( m ); return; } if ( ddp_firewall && ( forwro.ro_rt == NULL || ( forwro.ro_rt->rt_ifp != ifp && forwro.ro_rt->rt_ifp != at_ifaddr->aa_ifp ))) { m_freem( m ); return; } ddpe.deh_hops++; ddpe.deh_bytes = htonl( ddpe.deh_bytes ); bcopy( (caddr_t)&ddpe, (caddr_t)deh, sizeof( u_short )); if ( ddp_route( m, &forwro )) { ddpstat.ddps_cantforward++; } else { ddpstat.ddps_forward++; } return; } #ifdef BSD4_4 from.sat_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ from.sat_family = AF_APPLETALK; if ( elh ) { m_adj( m, sizeof( struct ddpshdr )); } else { if ( ddp_cksum && cksum && cksum != at_cksum( m, sizeof( int ))) { ddpstat.ddps_badsum++; m_freem( m ); return; } m_adj( m, sizeof( struct ddpehdr )); } if (( ddp = ddp_search( &from, &to, aa )) == NULL ) { m_freem( m ); return; } if ( sbappendaddr( &ddp->ddp_socket->so_rcv, (struct sockaddr *)&from, m, (struct mbuf *)0 ) == 0 ) { ddpstat.ddps_nosockspace++; m_freem( m ); return; } sorwakeup( ddp->ddp_socket ); } m_printm( m ) struct mbuf *m; { for (; m; m = m->m_next ) { bprint( mtod( m, char * ), m->m_len ); } } #define BPXLEN 48 #define BPALEN 16 #include char hexdig[] = "0123456789ABCDEF"; bprint( data, len ) char *data; int len; { char xout[ BPXLEN ], aout[ BPALEN ]; int i = 0; bzero( xout, BPXLEN ); bzero( aout, BPALEN ); for ( ;; ) { if ( len < 1 ) { if ( i != 0 ) { printf( "%s\t%s\n", xout, aout ); } printf( "%s\n", "(end)" ); break; } xout[ (i*3) ] = hexdig[ ( *data & 0xf0 ) >> 4 ]; xout[ (i*3) + 1 ] = hexdig[ *data & 0x0f ]; if ( (u_char)*data < 0x7f && (u_char)*data > 0x20 ) { aout[ i ] = *data; } else { aout[ i ] = '.'; } xout[ (i*3) + 2 ] = ' '; i++; len--; data++; if ( i > BPALEN - 2 ) { printf( "%s\t%s\n", xout, aout ); bzero( xout, BPXLEN ); bzero( aout, BPALEN ); i = 0; continue; } } } netatalk-2.2.2/sys/netatalk/at_var.h0000644000175200017500000000260411655731130014315 00000000000000/* * $Id: at_var.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * * All Rights Reserved. See COPYRIGHT. */ #ifndef _ATVAR_H #define _ATVAR_H 1 /* * For phase2, we need to keep not only our address on an interface, * but also the legal networks on the interface. */ struct at_ifaddr { struct ifaddr aa_ifa; # define aa_ifp aa_ifa.ifa_ifp #ifdef BSD4_4 struct sockaddr_at aa_addr; struct sockaddr_at aa_broadaddr; struct sockaddr_at aa_netmask; #else /* BSD4_4 */ # define aa_addr aa_ifa.ifa_addr # define aa_broadaddr aa_ifa.ifa_broadaddr # define aa_dstaddr aa_ifa.ifa_dstaddr #endif /* BSD4_4 */ int aa_flags; u_short aa_firstnet, aa_lastnet; int aa_probcnt; struct at_ifaddr *aa_next; }; #ifdef BSD4_4 struct at_aliasreq { char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */ struct sockaddr_at ifra_addr; struct sockaddr_at ifra_broadaddr; #define ifra_dstaddr ifra_broadaddr struct sockaddr_at ifra_mask; }; #endif /* BSD4_4 */ #define AA_SAT(aa) \ ((struct sockaddr_at *)&((struct at_ifaddr *)(aa))->aa_addr) #define satosat(sa) ((struct sockaddr_at *)(sa)) #define AFA_ROUTE 0x0001 #define AFA_PROBING 0x0002 #define AFA_PHASE2 0x0004 #ifdef KERNEL struct at_ifaddr *at_ifaddr; struct ifqueue atintrq1, atintrq2; int atdebug; #endif /* KERNEL */ #endif /* _ATVAR_H */ netatalk-2.2.2/sys/netatalk/ddp.h0000644000175200017500000000556711655731130013623 00000000000000/* * $Id: ddp.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * */ /* * <-1byte(8bits) -> * +---------------+ * | 0 | hopc |len| * +---------------+ * | len (cont) | * +---------------+ * | | * +- DDP csum -+ * | | * +---------------+ * | | * +- Dest NET -+ * | | * +---------------+ * | | * +- Src NET -+ * | | * +---------------+ * | Dest NODE | * +---------------+ * | Src NODE | * +---------------+ * | Dest PORT | * +---------------+ * | Src PORT | * +---------------+ * * On Apples, there is also a ddp_type field, after src_port. However, * under this unix implementation, user level processes need to be able * to set the ddp_type. In later revisions, the ddp_type may only be * available in a raw_appletalk interface. */ #ifndef _NETATALK_DDP_H #define _NETATALK_DDP_H 1 #include struct elaphdr { u_char el_dnode; u_char el_snode; u_char el_type; }; #define SZ_ELAPHDR 3 #define ELAP_DDPSHORT 0x01 #define ELAP_DDPEXTEND 0x02 /* * Extended DDP header. Includes sickness for dealing with arbitrary * bitfields on a little-endian arch. */ struct ddpehdr { union { struct { #if BYTE_ORDER == BIG_ENDIAN unsigned dub_pad:2; unsigned dub_hops:4; unsigned dub_len:10; unsigned dub_sum:16; #else /* BYTE_ORDER == BIG_ENDIAN */ #if BYTE_ORDER == LITTLE_ENDIAN unsigned dub_sum:16; unsigned dub_len:10; unsigned dub_hops:4; unsigned dub_pad:2; #else /* BYTE_ORDER == LITTLE_ENDIAN */ OOPS! #endif /* BYTE_ORDER == LITTLE_ENDIAN */ #endif /* BYTE_ORDER == BIG_ENDIAN */ } du_bits; unsigned du_bytes; } deh_u; #define deh_pad deh_u.du_bits.dub_pad #define deh_hops deh_u.du_bits.dub_hops #define deh_len deh_u.du_bits.dub_len #define deh_sum deh_u.du_bits.dub_sum #define deh_bytes deh_u.du_bytes u_short deh_dnet; u_short deh_snet; u_char deh_dnode; u_char deh_snode; u_char deh_dport; u_char deh_sport; }; #define SZ_DDPEHDR 12 #define DDP_MAXHOPS 15 struct ddpshdr { union { struct { #if BYTE_ORDER == BIG_ENDIAN unsigned dub_pad:6; unsigned dub_len:10; unsigned dub_dport:8; unsigned dub_sport:8; #endif /* BYTE_ORDER == BIG_ENDIAN */ #if BYTE_ORDER == LITTLE_ENDIAN unsigned dub_sport:8; unsigned dub_dport:8; unsigned dub_len:10; unsigned dub_pad:6; #endif /* BYTE_ORDER == LITTLE_ENDIAN */ } du_bits; unsigned du_bytes; } dsh_u; #define dsh_pad dsh_u.du_bits.dub_pad #define dsh_len dsh_u.du_bits.dub_len #define dsh_dport dsh_u.du_bits.dub_dport #define dsh_sport dsh_u.du_bits.dub_sport #define dsh_bytes dsh_u.du_bytes }; #define SZ_DDPSHDR 4 #endif /* netatalk/ddp.h */ netatalk-2.2.2/sys/netatalk/aarp.h0000644000175200017500000000306011655731130013761 00000000000000/* * $Id: aarp.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * This structure is used for both phase 1 and 2. Under phase 1 * the net is not filled in. It is in phase 2. In both cases, the * hardware address length is (for some unknown reason) 4. If * anyone at Apple could program their way out of paper bag, it * would be 1 and 3 respectively for phase 1 and 2. */ #ifndef _AARP_H #define _AARP_H 1 union aapa { u_char ap_pa[4]; struct ap_node { u_char an_zero; u_char an_net[2]; u_char an_node; } ap_node; }; struct ether_aarp { struct arphdr eaa_hdr; u_char aarp_sha[6]; union aapa aarp_spu; u_char aarp_tha[6]; union aapa aarp_tpu; }; #define aarp_hrd eaa_hdr.ar_hrd #define aarp_pro eaa_hdr.ar_pro #define aarp_hln eaa_hdr.ar_hln #define aarp_pln eaa_hdr.ar_pln #define aarp_op eaa_hdr.ar_op #define aarp_spa aarp_spu.ap_node.an_node #define aarp_tpa aarp_tpu.ap_node.an_node #define aarp_spnet aarp_spu.ap_node.an_net #define aarp_tpnet aarp_tpu.ap_node.an_net #define aarp_spnode aarp_spu.ap_node.an_node #define aarp_tpnode aarp_tpu.ap_node.an_node struct aarptab { struct at_addr aat_ataddr; u_char aat_enaddr[ 6 ]; u_char aat_timer; u_char aat_flags; struct mbuf *aat_hold; }; #define AARPHRD_ETHER 0x0001 #define AARPOP_REQUEST 0x01 #define AARPOP_RESPONSE 0x02 #define AARPOP_PROBE 0x03 #ifdef KERNEL struct aarptab *aarptnew(); int aarpprobe(); #endif /* KERNEL */ #endif /* _AARP_H */ netatalk-2.2.2/sys/netatalk/endian.h0000644000175200017500000000641311655731130014301 00000000000000/* * $Id: endian.h,v 1.9 2009-01-06 20:05:00 morgana Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * * This file handles both byte ordering and integer sizes. */ #ifndef _ATALK_ENDIAN_H_ #define _ATALK_ENDIAN_H_ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #ifdef _IBMR2 #include #endif /*_IBMR2*/ #ifdef _ISOC9X_SOURCE #include #ifndef __BIT_TYPES_DEFINED__ #define __BIT_TYPES_DEFINED__ typedef uint8_t u_int8_t; typedef uint16_t u_int16_t; typedef uint32_t u_int32_t; typedef uint64_t u_int64_t; #endif /* ! __BIT_TYPES_DEFINED__ */ #else /* handle sunos and solaris */ #ifdef sun #ifdef BSD4_3 #include #else /* BSD4_3 */ /* solaris and sunos don't consistently define u_int*_t. */ typedef unsigned char u_int8_t; typedef unsigned short u_int16_t; typedef unsigned int u_int32_t; typedef int int32_t; #endif /* BSD4_3 */ typedef unsigned long long u_int64_t; #ifndef _SSIZE_T #define _SSIZE_T typedef int ssize_t; #endif /* ssize_t */ #else /* sun */ /* luckily ultrix is dead. as a result, we know what the sizes of * various types are forever. this makes some assumptions about integer * sizes. */ #if defined (ultrix) || defined(HAVE_32BIT_LONGS) || defined(HAVE_64BIT_LONGS) #ifndef __BIT_TYPES_DEFINED__ #define __BIT_TYPES_DEFINED__ typedef unsigned char u_int8_t; typedef unsigned short u_int16_t; typedef unsigned int u_int32_t; typedef int int32_t; #endif #endif /* ultrix || HAVE_32BIT_LONGS || HAVE_64BIT_LONGS */ #ifdef ultrix typedef int ssize_t; #endif /* ultrix */ #ifdef HAVE_64BIT_LONGS typedef unsigned long u_int64_t; #else /* HAVE_64BIT_LONGS */ /* check for long long support. currently, i assume that if 64-bit * ints exist that their made available via long long */ #ifdef linux #include /* i think this is here for libc4 */ #else /* linux */ #if defined(HAVE_32BIT_LONGS) && !(defined(BSD4_4) || \ defined(NO_LARGE_VOL_SUPPORT)) typedef unsigned long long u_int64_t; #endif /* HAVE_32BIT_LONGS || !BSD4_4 || NO_LARGE_VOL_SUPPORT */ #endif /* linux */ #endif /* HAVE_64BIT_LONGS */ #endif /* sun */ #endif /* ISOC9X */ # ifndef BYTE_ORDER #define LITTLE_ENDIAN 1234 #define BIG_ENDIAN 4321 #define PDP_ENDIAN 3412 #if defined(WORDS_BIGENDIAN) || defined(_BIG_ENDIAN) #define BYTE_ORDER BIG_ENDIAN #else #define BYTE_ORDER LITTLE_ENDIAN #endif /* WORDS_BIGENDIAN */ # ifndef ntohl # if defined( sun ) || defined( ultrix ) || defined( _IBMR2 ) #if BYTE_ORDER == BIG_ENDIAN #define ntohl(x) (x) #define ntohs(x) (x) #define htonl(x) (x) #define htons(x) (x) #else /* BYTE_ORDER == BIG_ENDIAN */ #if defined( mips ) && defined( KERNEL ) #define ntohl(x) nuxi_l(x) #define ntohs(x) nuxi_s(x) #define htonl(x) nuxi_l(x) #define htons(x) nuxi_s(x) #else /* mips && KERNEL */ #if !( defined( sun ) && ( defined( i386 ) || defined(__x86_64) ) ) unsigned short ntohs(), htons(); unsigned int ntohl(), htonl(); #endif /* ! ( sun && i386 ) */ #endif /* mips && KERNEL */ #endif /* BYTE_ORDER == BIGENDIAN*/ # endif /* sun ultrix _IBMR2 */ # endif /* ntohl */ #endif /* BYTE_ORDER */ #endif /* _ATALK_ENDIAN_H_ */ netatalk-2.2.2/sys/netatalk/ddp_var.h0000644000175200017500000000242311655731130014457 00000000000000/* * $Id: ddp_var.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifndef _NETATALK_DDP_VAR_H #define _NETATALK_DDP_VAR_H 1 #include struct ddpcb { struct sockaddr_at ddp_fsat, ddp_lsat; struct route ddp_route; struct socket *ddp_socket; struct ddpcb *ddp_prev, *ddp_next; struct ddpcb *ddp_pprev, *ddp_pnext; }; #define sotoddpcb(so) ((struct ddpcb *)(so)->so_pcb) struct ddpstat { u_int32_t ddps_short; /* short header packets received */ u_int32_t ddps_long; /* long header packets received */ u_int32_t ddps_nosum; /* no checksum */ u_int32_t ddps_badsum; /* bad checksum */ u_int32_t ddps_tooshort; /* packet too short */ u_int32_t ddps_toosmall; /* not enough data */ u_int32_t ddps_forward; /* packets forwarded */ u_int32_t ddps_encap; /* packets encapsulated */ u_int32_t ddps_cantforward; /* packets rcvd for unreachable dest */ u_int32_t ddps_nosockspace; /* no space in sockbuf for packet */ }; #ifdef KERNEL struct ddpcb *ddp_ports[ ATPORT_LAST ]; struct ddpcb *ddpcb; struct ddpstat ddpstat; struct ddpcb *ddp_search(); #endif /* KERNEL */ #endif /* netatalk/ddp_var.h */ netatalk-2.2.2/sys/netatalk/ddp_usrreq.c0000644000175200017500000002727011655731130015212 00000000000000/* * $Id: ddp_usrreq.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #ifdef ibm032 #include #endif /* ibm032 */ #include #include #include #include #include #include #include #include #ifdef _IBMR2 #include #endif /* _IBMR2 */ #include "at.h" #include "at_var.h" #include "ddp_var.h" #include "endian.h" struct ddpcb *ddpcb = NULL; u_int32_t ddp_sendspace = DDP_MAXSZ; /* Max ddp size + 1 (ddp_type) */ u_int32_t ddp_recvspace = 10 * ( 587 + sizeof( struct sockaddr_at )); /*ARGSUSED*/ ddp_usrreq( so, req, m, addr, rights ) struct socket *so; int req; struct mbuf *m, *addr, *rights; { struct ddpcb *ddp; int error = 0; ddp = sotoddpcb( so ); if ( req == PRU_CONTROL ) { return( at_control( (int) m, (caddr_t) addr, (struct ifnet *) rights )); } if ( rights && rights->m_len ) { error = EINVAL; goto release; } if ( ddp == NULL && req != PRU_ATTACH ) { error = EINVAL; goto release; } switch ( req ) { case PRU_ATTACH : if ( ddp != NULL ) { error = EINVAL; break; } if (( error = at_pcballoc( so )) != 0 ) { break; } error = soreserve( so, ddp_sendspace, ddp_recvspace ); break; case PRU_DETACH : at_pcbdetach( so, ddp ); break; case PRU_BIND : error = at_pcbsetaddr( ddp, addr ); break; case PRU_SOCKADDR : at_sockaddr( ddp, addr ); break; case PRU_CONNECT: if ( ddp->ddp_fsat.sat_port != ATADDR_ANYPORT ) { error = EISCONN; break; } error = at_pcbconnect( ddp, addr ); if ( error == 0 ) soisconnected( so ); break; case PRU_DISCONNECT: if ( ddp->ddp_fsat.sat_addr.s_node == ATADDR_ANYNODE ) { error = ENOTCONN; break; } at_pcbdisconnect( ddp ); soisdisconnected( so ); break; case PRU_SHUTDOWN: socantsendmore( so ); break; case PRU_SEND: { int s; if ( addr ) { if ( ddp->ddp_fsat.sat_port != ATADDR_ANYPORT ) { error = EISCONN; break; } s = splnet(); error = at_pcbconnect( ddp, addr ); if ( error ) { splx( s ); break; } } else { if ( ddp->ddp_fsat.sat_port == ATADDR_ANYPORT ) { error = ENOTCONN; break; } } error = ddp_output( ddp, m ); m = NULL; if ( addr ) { at_pcbdisconnect( ddp ); splx( s ); } } break; case PRU_ABORT: soisdisconnected( so ); at_pcbdetach( so, ddp ); break; case PRU_LISTEN: case PRU_CONNECT2: case PRU_ACCEPT: case PRU_SENDOOB: case PRU_FASTTIMO: case PRU_SLOWTIMO: case PRU_PROTORCV: case PRU_PROTOSEND: error = EOPNOTSUPP; break; case PRU_RCVD: case PRU_RCVOOB: /* * Don't mfree. Good architecture... */ return( EOPNOTSUPP ); case PRU_SENSE: /* * 1. Don't return block size. * 2. Don't mfree. */ return( 0 ); default: error = EOPNOTSUPP; } release: if ( m != NULL ) { m_freem( m ); } return( error ); } at_sockaddr( ddp, addr ) struct ddpcb *ddp; struct mbuf *addr; { struct sockaddr_at *sat; addr->m_len = sizeof( struct sockaddr_at ); sat = mtod( addr, struct sockaddr_at *); *sat = ddp->ddp_lsat; } at_pcbsetaddr( ddp, addr ) struct ddpcb *ddp; struct mbuf *addr; { struct sockaddr_at lsat, *sat; struct at_ifaddr *aa; struct ddpcb *ddpp; if ( ddp->ddp_lsat.sat_port != ATADDR_ANYPORT ) { /* shouldn't be bound */ return( EINVAL ); } if ( addr != 0 ) { /* validate passed address */ sat = mtod( addr, struct sockaddr_at *); if ( addr->m_len != sizeof( *sat )) { return( EINVAL ); } if ( sat->sat_family != AF_APPLETALK ) { return( EAFNOSUPPORT ); } if ( sat->sat_addr.s_node != ATADDR_ANYNODE || sat->sat_addr.s_net != ATADDR_ANYNET ) { for ( aa = at_ifaddr; aa; aa = aa->aa_next ) { if (( sat->sat_addr.s_net == AA_SAT( aa )->sat_addr.s_net ) && ( sat->sat_addr.s_node == AA_SAT( aa )->sat_addr.s_node )) { break; } } if ( !aa ) { return( EADDRNOTAVAIL ); } } if ( sat->sat_port != ATADDR_ANYPORT ) { if ( sat->sat_port < ATPORT_FIRST || sat->sat_port >= ATPORT_LAST ) { return( EINVAL ); } #ifdef BSD4_4 if ( sat->sat_port < ATPORT_RESERVED && suser( u.u_cred, &u.u_acflag )) { return( EACCES ); } #else /* BSD4_4 */ if ( sat->sat_port < ATPORT_RESERVED && ( !suser())) { return( EACCES ); } #endif /* BSD4_4 */ } } else { bzero( (caddr_t)&lsat, sizeof( struct sockaddr_at )); lsat.sat_family = AF_APPLETALK; sat = &lsat; } if ( sat->sat_addr.s_node == ATADDR_ANYNODE && sat->sat_addr.s_net == ATADDR_ANYNET ) { if ( at_ifaddr == NULL ) { return( EADDRNOTAVAIL ); } sat->sat_addr = AA_SAT( at_ifaddr )->sat_addr; } ddp->ddp_lsat = *sat; /* * Choose port. */ if ( sat->sat_port == ATADDR_ANYPORT ) { for ( sat->sat_port = ATPORT_RESERVED; sat->sat_port < ATPORT_LAST; sat->sat_port++ ) { if ( ddp_ports[ sat->sat_port - 1 ] == 0 ) { break; } } if ( sat->sat_port == ATPORT_LAST ) { return( EADDRNOTAVAIL ); } ddp->ddp_lsat.sat_port = sat->sat_port; ddp_ports[ sat->sat_port - 1 ] = ddp; } else { for ( ddpp = ddp_ports[ sat->sat_port - 1 ]; ddpp; ddpp = ddpp->ddp_pnext ) { if ( ddpp->ddp_lsat.sat_addr.s_net == sat->sat_addr.s_net && ddpp->ddp_lsat.sat_addr.s_node == sat->sat_addr.s_node ) { break; } } if ( ddpp != NULL ) { return( EADDRINUSE ); } ddp->ddp_pnext = ddp_ports[ sat->sat_port - 1 ]; ddp_ports[ sat->sat_port - 1 ] = ddp; if ( ddp->ddp_pnext ) { ddp->ddp_pnext->ddp_pprev = ddp; } } return( 0 ); } at_pcbconnect( ddp, addr ) struct ddpcb *ddp; struct mbuf *addr; { struct sockaddr_at *sat = mtod( addr, struct sockaddr_at *); struct route *ro; struct at_ifaddr *aa = 0; struct ifnet *ifp; u_short hintnet = 0, net; if ( addr->m_len != sizeof( *sat )) return( EINVAL ); if ( sat->sat_family != AF_APPLETALK ) { return( EAFNOSUPPORT ); } /* * Under phase 2, network 0 means "the network". We take "the * network" to mean the network the control block is bound to. * If the control block is not bound, there is an error. */ if ( sat->sat_addr.s_net == 0 && sat->sat_addr.s_node != ATADDR_ANYNODE ) { if ( ddp->ddp_lsat.sat_port == ATADDR_ANYPORT ) { return( EADDRNOTAVAIL ); } hintnet = ddp->ddp_lsat.sat_addr.s_net; } ro = &ddp->ddp_route; /* * If we've got an old route for this pcb, check that it is valid. * If we've changed our address, we may have an old "good looking" * route here. Attempt to detect it. */ if ( ro->ro_rt ) { if ( hintnet ) { net = hintnet; } else { net = sat->sat_addr.s_net; } aa = 0; if ( ifp = ro->ro_rt->rt_ifp ) { for ( aa = at_ifaddr; aa; aa = aa->aa_next ) { if ( aa->aa_ifp == ifp && ntohs( net ) >= ntohs( aa->aa_firstnet ) && ntohs( net ) <= ntohs( aa->aa_lastnet )) { break; } } } if ( aa == NULL || ( satosat( &ro->ro_dst )->sat_addr.s_net != ( hintnet ? hintnet : sat->sat_addr.s_net ) || satosat( &ro->ro_dst )->sat_addr.s_node != sat->sat_addr.s_node )) { #ifdef ultrix rtfree( ro->ro_rt ); #else /* ultrix */ RTFREE( ro->ro_rt ); #endif /* ultrix */ ro->ro_rt = (struct rtentry *)0; } } /* * If we've got no route for this interface, try to find one. */ if ( ro->ro_rt == (struct rtentry *)0 || ro->ro_rt->rt_ifp == (struct ifnet *)0 ) { #ifdef BSD4_4 ro->ro_dst.sa_len = sizeof( struct sockaddr_at ); #endif /* BSD4_4 */ ro->ro_dst.sa_family = AF_APPLETALK; if ( hintnet != 0 ) { satosat( &ro->ro_dst )->sat_addr.s_net = hintnet; } else { satosat( &ro->ro_dst )->sat_addr.s_net = sat->sat_addr.s_net; } satosat( &ro->ro_dst )->sat_addr.s_node = sat->sat_addr.s_node; rtalloc( ro ); } /* * Make sure any route that we have has a valid interface. */ aa = 0; if ( ro->ro_rt && ( ifp = ro->ro_rt->rt_ifp )) { for ( aa = at_ifaddr; aa; aa = aa->aa_next ) { if ( aa->aa_ifp == ifp ) { break; } } } if ( aa == 0 ) { return( ENETUNREACH ); } ddp->ddp_fsat = *sat; if ( ddp->ddp_lsat.sat_port == ATADDR_ANYPORT ) { return( at_pcbsetaddr( ddp, (struct mbuf *)0 )); } return( 0 ); } at_pcbdisconnect( ddp ) struct ddpcb *ddp; { ddp->ddp_fsat.sat_addr.s_net = ATADDR_ANYNET; ddp->ddp_fsat.sat_addr.s_node = ATADDR_ANYNODE; ddp->ddp_fsat.sat_port = ATADDR_ANYPORT; } at_pcballoc( so ) struct socket *so; { struct ddpcb *ddp; struct mbuf *m; m = m_getclr( M_WAIT, MT_PCB ); ddp = mtod( m, struct ddpcb * ); ddp->ddp_lsat.sat_port = ATADDR_ANYPORT; ddp->ddp_next = ddpcb; ddp->ddp_prev = NULL; ddp->ddp_pprev = NULL; ddp->ddp_pnext = NULL; if ( ddpcb ) { ddpcb->ddp_prev = ddp; } ddpcb = ddp; ddp->ddp_socket = so; so->so_pcb = (caddr_t)ddp; return( 0 ); } at_pcbdetach( so, ddp ) struct socket *so; struct ddpcb *ddp; { soisdisconnected( so ); so->so_pcb = 0; sofree( so ); /* remove ddp from ddp_ports list */ if ( ddp->ddp_lsat.sat_port != ATADDR_ANYPORT && ddp_ports[ ddp->ddp_lsat.sat_port - 1 ] != NULL ) { if ( ddp->ddp_pprev != NULL ) { ddp->ddp_pprev->ddp_pnext = ddp->ddp_pnext; } else { ddp_ports[ ddp->ddp_lsat.sat_port - 1 ] = ddp->ddp_pnext; } if ( ddp->ddp_pnext != NULL ) { ddp->ddp_pnext->ddp_pprev = ddp->ddp_pprev; } } if ( ddp->ddp_route.ro_rt ) { rtfree( ddp->ddp_route.ro_rt ); } if ( ddp->ddp_prev ) { ddp->ddp_prev->ddp_next = ddp->ddp_next; } else { ddpcb = ddp->ddp_next; } if ( ddp->ddp_next ) { ddp->ddp_next->ddp_prev = ddp->ddp_prev; } (void) m_free( dtom( ddp )); } /* * For the moment, this just find the pcb with the correct local address. * In the future, this will actually do some real searching, so we can use * the sender's address to do de-multiplexing on a single port to many * sockets (pcbs). */ struct ddpcb * ddp_search( from, to, aa ) struct sockaddr_at *from, *to; struct at_ifaddr *aa; { struct ddpcb *ddp; /* * Check for bad ports. */ if ( to->sat_port < ATPORT_FIRST || to->sat_port >= ATPORT_LAST ) { return( NULL ); } /* * Make sure the local address matches the sent address. What about * the interface? */ for ( ddp = ddp_ports[ to->sat_port - 1 ]; ddp; ddp = ddp->ddp_pnext ) { /* XXX should we handle 0.YY? */ /* XXXX.YY to socket on destination interface */ if ( to->sat_addr.s_net == ddp->ddp_lsat.sat_addr.s_net && to->sat_addr.s_node == ddp->ddp_lsat.sat_addr.s_node ) { break; } /* 0.255 to socket on receiving interface */ if ( to->sat_addr.s_node == ATADDR_BCAST && ( to->sat_addr.s_net == 0 || to->sat_addr.s_net == ddp->ddp_lsat.sat_addr.s_net ) && ddp->ddp_lsat.sat_addr.s_net == AA_SAT( aa )->sat_addr.s_net ) { break; } /* XXXX.0 to socket on destination interface */ if ( to->sat_addr.s_net == aa->aa_firstnet && to->sat_addr.s_node == 0 && ntohs( ddp->ddp_lsat.sat_addr.s_net ) >= ntohs( aa->aa_firstnet ) && ntohs( ddp->ddp_lsat.sat_addr.s_net ) <= ntohs( aa->aa_lastnet )) { break; } } return( ddp ); } ddp_init() { atintrq1.ifq_maxlen = IFQ_MAXLEN; atintrq2.ifq_maxlen = IFQ_MAXLEN; } ddp_clean() { struct ddpcb *ddp; for ( ddp = ddpcb; ddp; ddp = ddp->ddp_next ) { at_pcbdetach( ddp->ddp_socket, ddp ); } } netatalk-2.2.2/sys/netatalk/phase2.h0000644000175200017500000000401411655731130014220 00000000000000/* * $Id: phase2.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. */ # if defined( ultrix ) || defined( BSD4_4 ) #include # else /* ultrix || BSD4_4 */ #if defined( sun ) && !defined( __svr4__ ) #include #endif /* sun && !__svr4__ */ /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. * * @(#)if_llc.h 7.2 (Berkeley) 6/28/90 */ /* * IEEE 802.2 Link Level Control headers, for use in conjunction with * 802.{3,4,5} media access control methods. * * Headers here do not use bit fields due to shortcommings in many * compilers. */ struct llc { u_char llc_dsap; u_char llc_ssap; union { struct { u_char control; u_char format_id; u_char class; u_char window_x2; } type_u; struct { u_char num_snd_x2; u_char num_rcv_x2; } type_i; struct { u_char control; u_char num_rcv_x2; } type_s; struct { u_char control; u_char org_code[3]; u_short ether_type; } type_snap; } llc_un; }; #define llc_control llc_un.type_u.control #define llc_fid llc_un.type_u.format_id #define llc_class llc_un.type_u.class #define llc_window llc_un.type_u.window_x2 #define llc_org_code llc_un.type_snap.org_code #define llc_ether_type llc_un.type_snap.ether_type #define LLC_UI 0x3 #define LLC_UI_P 0x13 #define LLC_XID 0xaf #define LLC_XID_P 0xbf #define LLC_TEST 0xe3 #define LLC_TEST_P 0xf3 #define LLC_ISO_LSAP 0xfe #define LLC_SNAP_LSAP 0xaa # endif /* ultrix && BSD4_4 */ #if defined( sun ) || defined( ibm032 ) #define SIOCPHASE1 _IOW(i, 100, struct ifreq) /* AppleTalk phase 1 */ #define SIOCPHASE2 _IOW(i, 101, struct ifreq) /* AppleTalk phase 2 */ #endif /* sun || ibm032 */ #if defined( ultrix ) || defined( BSD4_4 ) || defined( _IBMR2 ) #define SIOCPHASE1 _IOW('i', 100, struct ifreq) /* AppleTalk phase 1 */ #define SIOCPHASE2 _IOW('i', 101, struct ifreq) /* AppleTalk phase 2 */ #endif /* ultrix || BSD4_4 || _IBMR2 */ netatalk-2.2.2/sys/netatalk/aarp.c0000644000175200017500000005022511655731130013761 00000000000000/* * $Id: aarp.c,v 1.3 2002-01-03 17:49:39 sibaz Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #ifndef _IBMR2 #include #endif /* _IBMR2 */ #include #include #include #include #undef s_net #include #ifdef _IBMR2 #include #include #include #include #endif /* _IBMR2 */ #include "at.h" #include "at_var.h" #include "aarp.h" #include "ddp_var.h" #include "endian.h" #include "phase2.h" #ifdef GATEWAY #define AARPTAB_BSIZ 16 #define AARPTAB_NB 37 #else /* GATEWAY */ #define AARPTAB_BSIZ 9 #define AARPTAB_NB 19 #endif /* GATEWAY */ #define AARPTAB_SIZE (AARPTAB_BSIZ * AARPTAB_NB) struct aarptab aarptab[AARPTAB_SIZE]; int aarptab_size = AARPTAB_SIZE; #define AARPTAB_HASH(a) \ ((((a).s_net << 8 ) + (a).s_node ) % AARPTAB_NB ) #define AARPTAB_LOOK(aat,addr) { \ int n; \ aat = &aarptab[ AARPTAB_HASH(addr) * AARPTAB_BSIZ ]; \ for ( n = 0; n < AARPTAB_BSIZ; n++, aat++ ) \ if ( aat->aat_ataddr.s_net == (addr).s_net && \ aat->aat_ataddr.s_node == (addr).s_node ) \ break; \ if ( n >= AARPTAB_BSIZ ) \ aat = 0; \ } #define AARPT_AGE (60 * 1) #define AARPT_KILLC 20 #define AARPT_KILLI 3 #ifdef sun extern struct ether_addr etherbroadcastaddr; #else /* sun */ extern u_char etherbroadcastaddr[6]; #endif /* sun */ u_char atmulticastaddr[ 6 ] = { 0x09, 0x00, 0x07, 0xff, 0xff, 0xff, }; u_char at_org_code[ 3 ] = { 0x08, 0x00, 0x07, }; u_char aarp_org_code[ 3 ] = { 0x00, 0x00, 0x00, }; aarptimer() { struct aarptab *aat; int i, s; timeout( aarptimer, (caddr_t)0, AARPT_AGE * hz ); aat = aarptab; for ( i = 0; i < AARPTAB_SIZE; i++, aat++ ) { if ( aat->aat_flags == 0 || ( aat->aat_flags & ATF_PERM )) continue; if ( ++aat->aat_timer < (( aat->aat_flags & ATF_COM ) ? AARPT_KILLC : AARPT_KILLI )) continue; s = splimp(); aarptfree( aat ); splx( s ); } } struct ifaddr * at_ifawithnet( sat, ifa ) struct sockaddr_at *sat; struct ifaddr *ifa; { struct at_ifaddr *aa; for (; ifa; ifa = ifa->ifa_next ) { #ifdef BSD4_4 if ( ifa->ifa_addr->sa_family != AF_APPLETALK ) { continue; } if ( satosat( ifa->ifa_addr )->sat_addr.s_net == sat->sat_addr.s_net ) { break; } #else /* BSD4_4 */ if ( ifa->ifa_addr.sa_family != AF_APPLETALK ) { continue; } aa = (struct at_ifaddr *)ifa; if ( ntohs( sat->sat_addr.s_net ) >= ntohs( aa->aa_firstnet ) && ntohs( sat->sat_addr.s_net ) <= ntohs( aa->aa_lastnet )) { break; } #endif /* BSD4_4 */ } return( ifa ); } aarpwhohas( ac, sat ) struct arpcom *ac; struct sockaddr_at *sat; { struct mbuf *m; struct ether_header *eh; struct ether_aarp *ea; struct at_ifaddr *aa; struct llc *llc; struct sockaddr sa; #ifdef BSD4_4 if (( m = m_gethdr( M_DONTWAIT, MT_DATA )) == NULL ) { return; } m->m_len = sizeof( *ea ); m->m_pkthdr.len = sizeof( *ea ); MH_ALIGN( m, sizeof( *ea )); #else /* BSD4_4 */ if (( m = m_get( M_DONTWAIT, MT_DATA )) == NULL ) { return; } m->m_len = sizeof( *ea ); m->m_off = MMAXOFF - sizeof( *ea ); #endif /* BSD4_4 */ ea = mtod( m, struct ether_aarp *); bzero((caddr_t)ea, sizeof( *ea )); ea->aarp_hrd = htons( AARPHRD_ETHER ); ea->aarp_pro = htons( ETHERTYPE_AT ); ea->aarp_hln = sizeof( ea->aarp_sha ); ea->aarp_pln = sizeof( ea->aarp_spu ); ea->aarp_op = htons( AARPOP_REQUEST ); #ifdef sun bcopy((caddr_t)&ac->ac_enaddr, (caddr_t)ea->aarp_sha, sizeof( ea->aarp_sha )); #else /* sun */ bcopy((caddr_t)ac->ac_enaddr, (caddr_t)ea->aarp_sha, sizeof( ea->aarp_sha )); #endif /* sun */ /* * We need to check whether the output ethernet type should * be phase 1 or 2. We have the interface that we'll be sending * the aarp out. We need to find an AppleTalk network on that * interface with the same address as we're looking for. If the * net is phase 2, generate an 802.2 and SNAP header. */ if (( aa = (struct at_ifaddr *)at_ifawithnet( sat, ac->ac_if.if_addrlist )) == NULL ) { m_freem( m ); return; } eh = (struct ether_header *)sa.sa_data; if ( aa->aa_flags & AFA_PHASE2 ) { #ifdef sun bcopy((caddr_t)atmulticastaddr, (caddr_t)&eh->ether_dhost, sizeof( eh->ether_dhost )); #else /* sun */ bcopy((caddr_t)atmulticastaddr, (caddr_t)eh->ether_dhost, sizeof( eh->ether_dhost )); #endif /* sun */ #if defined( sun ) && defined( i386 ) eh->ether_type = htons( sizeof( struct llc ) + sizeof( struct ether_aarp )); #else /* sun && i386 */ eh->ether_type = sizeof( struct llc ) + sizeof( struct ether_aarp ); #endif /* sun && i386 */ #ifdef BSD4_4 M_PREPEND( m, sizeof( struct llc ), M_WAIT ); #else /* BSD4_4 */ m->m_len += sizeof( struct llc ); m->m_off -= sizeof( struct llc ); #endif /* BSD4_4 */ llc = mtod( m, struct llc *); llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP; llc->llc_control = LLC_UI; bcopy( aarp_org_code, llc->llc_org_code, sizeof( aarp_org_code )); llc->llc_ether_type = htons( ETHERTYPE_AARP ); bcopy( &AA_SAT( aa )->sat_addr.s_net, ea->aarp_spnet, sizeof( ea->aarp_spnet )); ea->aarp_spnode = AA_SAT( aa )->sat_addr.s_node; bcopy( &sat->sat_addr.s_net, ea->aarp_tpnet, sizeof( ea->aarp_tpnet )); ea->aarp_tpnode = sat->sat_addr.s_node; } else { #ifdef sun bcopy((caddr_t)ðerbroadcastaddr, (caddr_t)&eh->ether_dhost, sizeof( eh->ether_dhost )); #else /* sun */ bcopy((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost, sizeof( eh->ether_dhost )); #endif /* sun */ #if defined( sun ) && defined( i386 ) eh->ether_type = htons( ETHERTYPE_AARP ); #else /* sun && i386 */ eh->ether_type = ETHERTYPE_AARP; #endif /* sun && i386 */ ea->aarp_spa = AA_SAT( aa )->sat_addr.s_node; ea->aarp_tpa = sat->sat_addr.s_node; } #ifdef BSD4_4 sa.sa_len = sizeof( struct sockaddr ); #endif /* BSD4_4 */ sa.sa_family = AF_UNSPEC; (*ac->ac_if.if_output)(&ac->ac_if, m, &sa ); } aarpresolve( ac, m, destsat, desten ) struct arpcom *ac; struct mbuf *m; struct sockaddr_at *destsat; #ifdef sun struct ether_addr *desten; #else /* sun */ u_char *desten; #endif /* sun */ { struct at_ifaddr *aa; struct ifaddr ifa; struct aarptab *aat; int s; if ( at_broadcast( destsat )) { if (( aa = (struct at_ifaddr *)at_ifawithnet( destsat, ((struct ifnet *)ac)->if_addrlist )) == NULL ) { m_freem( m ); return( 0 ); } if ( aa->aa_flags & AFA_PHASE2 ) { bcopy( (caddr_t)atmulticastaddr, (caddr_t)desten, sizeof( atmulticastaddr )); } else { #ifdef sun bcopy( (caddr_t)ðerbroadcastaddr, (caddr_t)desten, sizeof( etherbroadcastaddr )); #else /* sun */ bcopy( (caddr_t)etherbroadcastaddr, (caddr_t)desten, sizeof( etherbroadcastaddr )); #endif /* sun */ } return( 1 ); } s = splimp(); AARPTAB_LOOK( aat, destsat->sat_addr ); if ( aat == 0 ) { /* No entry */ aat = aarptnew( &destsat->sat_addr ); if ( aat == 0 ) { panic( "aarpresolve: no free entry" ); } aat->aat_hold = m; aarpwhohas( ac, destsat ); splx( s ); return( 0 ); } /* found an entry */ aat->aat_timer = 0; if ( aat->aat_flags & ATF_COM ) { /* entry is COMplete */ bcopy( (caddr_t)aat->aat_enaddr, (caddr_t)desten, sizeof( aat->aat_enaddr )); splx( s ); return( 1 ); } /* entry has not completed */ if ( aat->aat_hold ) { m_freem( aat->aat_hold ); } aat->aat_hold = m; aarpwhohas( ac, destsat ); splx( s ); return( 0 ); } aarpinput( ac, m ) struct arpcom *ac; struct mbuf *m; { struct arphdr *ar; if ( ac->ac_if.if_flags & IFF_NOARP ) goto out; #ifndef BSD4_4 IF_ADJ( m ); #endif /* BSD4_4 */ if ( m->m_len < sizeof( struct arphdr )) { goto out; } ar = mtod( m, struct arphdr *); if ( ntohs( ar->ar_hrd ) != AARPHRD_ETHER ) { goto out; } if ( m->m_len < sizeof( struct arphdr ) + 2 * ar->ar_hln + 2 * ar->ar_pln ) { goto out; } switch( ntohs( ar->ar_pro )) { case ETHERTYPE_AT : at_aarpinput( ac, m ); return; default: break; } out: m_freem( m ); } at_aarpinput( ac, m ) struct arpcom *ac; struct mbuf *m; { struct mbuf *m0; struct ether_aarp *ea; struct at_ifaddr *aa; struct aarptab *aat; struct ether_header *eh; struct llc *llc; struct sockaddr_at sat; struct sockaddr sa; struct at_addr spa, tpa, ma; int op, s; u_short net; ea = mtod( m, struct ether_aarp *); /* Check to see if from my hardware address */ #ifdef sun if ( !bcmp(( caddr_t )ea->aarp_sha, ( caddr_t )&ac->ac_enaddr, sizeof( ac->ac_enaddr ))) { m_freem( m ); return; } #else /* sun */ if ( !bcmp(( caddr_t )ea->aarp_sha, ( caddr_t )ac->ac_enaddr, sizeof( ac->ac_enaddr ))) { m_freem( m ); return; } #endif /* sun */ /* * Check if from broadcast address. This could be a more robust * check, since we could look for multicasts. */ #ifdef sun if ( !bcmp(( caddr_t )ea->aarp_sha, ( caddr_t )ðerbroadcastaddr, sizeof( etherbroadcastaddr ))) { log( LOG_ERR, "aarp: source is broadcast!\n" ); m_freem( m ); return; } #else /* sun */ if ( !bcmp(( caddr_t )ea->aarp_sha, ( caddr_t )etherbroadcastaddr, sizeof( etherbroadcastaddr ))) { #ifndef _IBMR2 #ifdef ultrix mprintf( LOG_ERR, #else /* ultrix */ log( LOG_ERR, #endif /* ultrix */ "aarp: source is broadcast!\n" ); #endif /* ! _IBMR2 */ m_freem( m ); return; } #endif /* sun */ op = ntohs( ea->aarp_op ); bcopy( ea->aarp_tpnet, &net, sizeof( net )); if ( net != 0 ) { sat.sat_family = AF_APPLETALK; sat.sat_addr.s_net = net; if (( aa = (struct at_ifaddr *)at_ifawithnet( &sat, ac->ac_if.if_addrlist )) == NULL ) { m_freem( m ); return; } bcopy( ea->aarp_spnet, &spa.s_net, sizeof( spa.s_net )); bcopy( ea->aarp_tpnet, &tpa.s_net, sizeof( tpa.s_net )); } else { /* * Since we don't know the net, we just look for the first * phase 1 address on the interface. */ for ( aa = (struct at_ifaddr *)ac->ac_if.if_addrlist; aa; aa = (struct at_ifaddr *)aa->aa_ifa.ifa_next ) { if ( AA_SAT( aa )->sat_family == AF_APPLETALK && ( aa->aa_flags & AFA_PHASE2 ) == 0 ) { break; } } if ( aa == NULL ) { m_freem( m ); return; } tpa.s_net = spa.s_net = AA_SAT( aa )->sat_addr.s_net; } spa.s_node = ea->aarp_spnode; tpa.s_node = ea->aarp_tpnode; ma.s_net = AA_SAT( aa )->sat_addr.s_net; ma.s_node = AA_SAT( aa )->sat_addr.s_node; /* * This looks like it's from us. */ if ( spa.s_net == ma.s_net && spa.s_node == ma.s_node ) { if ( aa->aa_flags & AFA_PROBING ) { /* * We're probing, someone either responded to our probe, or * probed for the same address we'd like to use. Change the * address we're probing for. */ untimeout( aarpprobe, ac ); wakeup( aa ); m_freem( m ); return; } else if ( op != AARPOP_PROBE ) { /* * This is not a probe, and we're not probing. This means * that someone's saying they have the same source address * as the one we're using. Get upset... */ #ifndef _IBMR2 #ifdef ultrix mprintf( LOG_ERR, #else /* ultrix */ log( LOG_ERR, #endif /* ultrix */ "aarp: duplicate AT address!! %x:%x:%x:%x:%x:%x\n", ea->aarp_sha[ 0 ], ea->aarp_sha[ 1 ], ea->aarp_sha[ 2 ], ea->aarp_sha[ 3 ], ea->aarp_sha[ 4 ], ea->aarp_sha[ 5 ]); #endif /* ! _IBMR2 */ m_freem( m ); return; } } AARPTAB_LOOK( aat, spa ); if ( aat ) { if ( op == AARPOP_PROBE ) { /* * Someone's probing for spa, dealocate the one we've got, * so that if the prober keeps the address, we'll be able * to arp for him. */ aarptfree( aat ); m_freem( m ); return; } bcopy(( caddr_t )ea->aarp_sha, ( caddr_t )aat->aat_enaddr, sizeof( ea->aarp_sha )); aat->aat_flags |= ATF_COM; if ( aat->aat_hold ) { #ifdef _IBMR2 /* * Like in ddp_output(), we can't rely on the if_output * routine to resolve AF_APPLETALK addresses, on the rs6k. * So, we fill the destination ethernet address here. * * This should really be replaced with something like * rsif_output(). XXX Will have to be for phase 2. */ /* XXX maybe fill in the rest of the frame header */ sat.sat_family = AF_UNSPEC; bcopy( aat->aat_enaddr, (*(struct sockaddr *)&sat).sa_data, sizeof( aat->aat_enaddr )); #else /* _IBMR2 */ sat.sat_family = AF_APPLETALK; sat.sat_addr = spa; #endif /* _IBMR2 */ (*ac->ac_if.if_output)( &ac->ac_if, aat->aat_hold, (struct sockaddr *)&sat ); aat->aat_hold = 0; } } if ( aat == 0 && tpa.s_net == ma.s_net && tpa.s_node == ma.s_node && op != AARPOP_PROBE ) { if ( aat = aarptnew( &spa )) { bcopy(( caddr_t )ea->aarp_sha, ( caddr_t )aat->aat_enaddr, sizeof( ea->aarp_sha )); aat->aat_flags |= ATF_COM; } } /* * Don't respond to responses, and never respond if we're * still probing. */ if ( tpa.s_net != ma.s_net || tpa.s_node != ma.s_node || op == AARPOP_RESPONSE || ( aa->aa_flags & AFA_PROBING )) { m_freem( m ); return; } bcopy(( caddr_t )ea->aarp_sha, ( caddr_t )ea->aarp_tha, sizeof( ea->aarp_sha )); #ifdef sun bcopy(( caddr_t )&ac->ac_enaddr, ( caddr_t )ea->aarp_sha, sizeof( ea->aarp_sha )); #else /* sun */ bcopy(( caddr_t )ac->ac_enaddr, ( caddr_t )ea->aarp_sha, sizeof( ea->aarp_sha )); #endif /* sun */ eh = (struct ether_header *)sa.sa_data; #ifdef sun bcopy(( caddr_t )ea->aarp_tha, ( caddr_t )&eh->ether_dhost, sizeof( eh->ether_dhost )); #else /* sun */ bcopy(( caddr_t )ea->aarp_tha, ( caddr_t )eh->ether_dhost, sizeof( eh->ether_dhost )); #endif /* sun */ if ( aa->aa_flags & AFA_PHASE2 ) { #if defined( sun ) && defined( i386 ) eh->ether_type = htons( sizeof( struct llc ) + sizeof( struct ether_aarp )); #else /* sun && i386 */ eh->ether_type = sizeof( struct llc ) + sizeof( struct ether_aarp ); #endif /* sun && i386 */ #ifdef BSD4_4 M_PREPEND( m, sizeof( struct llc ), M_DONTWAIT ); if ( m == NULL ) { m_freem( m ); return; } #else /* BSD4_4 */ MGET( m0, M_DONTWAIT, MT_HEADER ); if ( m0 == NULL ) { m_freem( m ); return; } m0->m_next = m; m = m0; m->m_off = MMAXOFF - sizeof( struct llc ); m->m_len = sizeof ( struct llc ); #endif /* BSD4_4 */ llc = mtod( m, struct llc *); llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP; llc->llc_control = LLC_UI; bcopy( aarp_org_code, llc->llc_org_code, sizeof( aarp_org_code )); llc->llc_ether_type = htons( ETHERTYPE_AARP ); bcopy( ea->aarp_spnet, ea->aarp_tpnet, sizeof( ea->aarp_tpnet )); bcopy( &ma.s_net, ea->aarp_spnet, sizeof( ea->aarp_spnet )); } else { #if defined( sun ) && defined( i386 ) eh->ether_type = htons( ETHERTYPE_AARP ); #else /* sun && i386 */ eh->ether_type = ETHERTYPE_AARP; #endif /* sun && i386 */ } ea->aarp_tpnode = ea->aarp_spnode; ea->aarp_spnode = ma.s_node; ea->aarp_op = htons( AARPOP_RESPONSE ); #ifdef BSD4_4 sa.sa_len = sizeof( struct sockaddr ); #endif /* BSD4_4 */ sa.sa_family = AF_UNSPEC; (*ac->ac_if.if_output)( &ac->ac_if, m, &sa ); return; } aarptfree( aat ) struct aarptab *aat; { if ( aat->aat_hold ) m_freem( aat->aat_hold ); aat->aat_hold = 0; aat->aat_timer = aat->aat_flags = 0; aat->aat_ataddr.s_net = 0; aat->aat_ataddr.s_node = 0; } struct aarptab * aarptnew( addr ) struct at_addr *addr; { int n; int oldest = -1; struct aarptab *aat, *aato = NULL; static int first = 1; if ( first ) { first = 0; timeout( aarptimer, (caddr_t)0, hz ); } aat = &aarptab[ AARPTAB_HASH( *addr ) * AARPTAB_BSIZ ]; for ( n = 0; n < AARPTAB_BSIZ; n++, aat++ ) { if ( aat->aat_flags == 0 ) goto out; if ( aat->aat_flags & ATF_PERM ) continue; if ((int) aat->aat_timer > oldest ) { oldest = aat->aat_timer; aato = aat; } } if ( aato == NULL ) return( NULL ); aat = aato; aarptfree( aat ); out: aat->aat_ataddr = *addr; aat->aat_flags = ATF_INUSE; return( aat ); } aarpprobe( ac ) struct arpcom *ac; { struct mbuf *m; struct ether_header *eh; struct ether_aarp *ea; struct at_ifaddr *aa; struct llc *llc; struct sockaddr sa; /* * We need to check whether the output ethernet type should * be phase 1 or 2. We have the interface that we'll be sending * the aarp out. We need to find an AppleTalk network on that * interface with the same address as we're looking for. If the * net is phase 2, generate an 802.2 and SNAP header. */ for ( aa = (struct at_ifaddr *)ac->ac_if.if_addrlist; aa; aa = (struct at_ifaddr *)aa->aa_ifa.ifa_next ) { if ( AA_SAT( aa )->sat_family == AF_APPLETALK && ( aa->aa_flags & AFA_PROBING )) { break; } } if ( aa == NULL ) { /* serious error XXX */ printf( "aarpprobe why did this happen?!\n" ); return; } if ( aa->aa_probcnt <= 0 ) { aa->aa_flags &= ~AFA_PROBING; wakeup( aa ); return; } else { timeout( aarpprobe, (caddr_t)ac, hz / 5 ); } #ifdef BSD4_4 if (( m = m_gethdr( M_DONTWAIT, MT_DATA )) == NULL ) { return; } m->m_len = sizeof( *ea ); m->m_pkthdr.len = sizeof( *ea ); MH_ALIGN( m, sizeof( *ea )); #else /* BSD4_4 */ if (( m = m_get( M_DONTWAIT, MT_DATA )) == NULL ) { return; } m->m_len = sizeof( *ea ); m->m_off = MMAXOFF - sizeof( *ea ); #endif /* BSD4_4 */ ea = mtod( m, struct ether_aarp *); bzero((caddr_t)ea, sizeof( *ea )); ea->aarp_hrd = htons( AARPHRD_ETHER ); ea->aarp_pro = htons( ETHERTYPE_AT ); ea->aarp_hln = sizeof( ea->aarp_sha ); ea->aarp_pln = sizeof( ea->aarp_spu ); ea->aarp_op = htons( AARPOP_PROBE ); #ifdef sun bcopy((caddr_t)&ac->ac_enaddr, (caddr_t)ea->aarp_sha, sizeof( ea->aarp_sha )); #else /* sun */ bcopy((caddr_t)ac->ac_enaddr, (caddr_t)ea->aarp_sha, sizeof( ea->aarp_sha )); #endif /* sun */ eh = (struct ether_header *)sa.sa_data; if ( aa->aa_flags & AFA_PHASE2 ) { #ifdef sun bcopy((caddr_t)atmulticastaddr, (caddr_t)&eh->ether_dhost, sizeof( eh->ether_dhost )); #else /* sun */ bcopy((caddr_t)atmulticastaddr, (caddr_t)eh->ether_dhost, sizeof( eh->ether_dhost )); #endif /* sun */ #if defined( sun ) && defined( i386 ) eh->ether_type = htons( sizeof( struct llc ) + sizeof( struct ether_aarp )); #else /* sun && i386 */ eh->ether_type = sizeof( struct llc ) + sizeof( struct ether_aarp ); #endif /* sun && i386 */ #ifdef BSD4_4 M_PREPEND( m, sizeof( struct llc ), M_WAIT ); #else /* BSD4_4 */ m->m_len += sizeof( struct llc ); m->m_off -= sizeof( struct llc ); #endif /* BSD4_4 */ llc = mtod( m, struct llc *); llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP; llc->llc_control = LLC_UI; bcopy( aarp_org_code, llc->llc_org_code, sizeof( aarp_org_code )); llc->llc_ether_type = htons( ETHERTYPE_AARP ); bcopy( &AA_SAT( aa )->sat_addr.s_net, ea->aarp_spnet, sizeof( ea->aarp_spnet )); bcopy( &AA_SAT( aa )->sat_addr.s_net, ea->aarp_tpnet, sizeof( ea->aarp_tpnet )); ea->aarp_spnode = ea->aarp_tpnode = AA_SAT( aa )->sat_addr.s_node; } else { #ifdef sun bcopy((caddr_t)ðerbroadcastaddr, (caddr_t)&eh->ether_dhost, sizeof( eh->ether_dhost )); #else /* sun */ bcopy((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost, sizeof( eh->ether_dhost )); #endif /* sun */ #if defined( sun ) && defined( i386 ) eh->ether_type = htons( ETHERTYPE_AARP ); #else /* sun && i386 */ eh->ether_type = ETHERTYPE_AARP; #endif /* sun && i386 */ ea->aarp_spa = ea->aarp_tpa = AA_SAT( aa )->sat_addr.s_node; } #ifdef BSD4_4 sa.sa_len = sizeof( struct sockaddr ); #endif /* BSD4_4 */ sa.sa_family = AF_UNSPEC; (*ac->ac_if.if_output)(&ac->ac_if, m, &sa ); aa->aa_probcnt--; } aarp_clean() { struct aarptab *aat; int i; untimeout( aarptimer, 0 ); for ( i = 0, aat = aarptab; i < AARPTAB_SIZE; i++, aat++ ) { if ( aat->aat_hold ) { m_freem( aat->aat_hold ); } } } netatalk-2.2.2/sys/netatalk/at_proto.c0000644000175200017500000000252711655731130014667 00000000000000/* * $Id: at_proto.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * * All Rights Reserved. See COPYRIGHT. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include "at.h" extern int ddp_usrreq(); extern int ddp_output(); extern int ddp_init(); #ifdef ultrix extern int ddp_ifoutput(); extern int ddp_ifinput(); extern int ddp_ifioctl(); #endif /* ultrix */ struct protosw atalksw[] = { { /* Identifiers */ SOCK_DGRAM, &atalkdomain, ATPROTO_DDP, PR_ATOMIC|PR_ADDR, /* * protocol-protocol interface. * fields are pr_input, pr_output, pr_ctlinput, and pr_ctloutput. * pr_input can be called from the udp protocol stack for iptalk * packets bound for a local socket. * pr_output can be used by higher level appletalk protocols, should * they be included in the kernel. */ 0, ddp_output, 0, 0, /* socket-protocol interface. */ ddp_usrreq, /* utility routines. */ ddp_init, 0, 0, 0, #ifdef ultrix /* interface hooks */ ddp_ifoutput, ddp_ifinput, ddp_ifioctl, 0, #endif /* ultrix */ }, }; struct domain atalkdomain = { AF_APPLETALK, "appletalk", 0, 0, 0, atalksw, &atalksw[ sizeof( atalksw ) / sizeof( atalksw[ 0 ] ) ] }; netatalk-2.2.2/sys/ultrix/0000777000175200017500000000000011704770433012502 500000000000000netatalk-2.2.2/sys/ultrix/Makefile.am0000644000175200017500000000007711655731130014452 00000000000000EXTRA_DIST = Makefile.kernel at_ultrix.c kpatch-4.1 kpatch-4.2 netatalk-2.2.2/sys/ultrix/Makefile.in0000644000175200017500000002627711703521731014473 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = sys/ultrix DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = Makefile.kernel at_ultrix.c kpatch-4.1 kpatch-4.2 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sys/ultrix/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign sys/ultrix/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/sys/ultrix/at_ultrix.c0000644000175200017500000001266511655731130014603 00000000000000/* * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Mike Clark * 535 W. William Street * Ann Arbor, Michigan * +1-313-763-0525 * netatalk@itd.umich.edu */ #include #include #include #include #include #include #include #include #include #include #include #undef s_net #include #include "at.h" #include "at_var.h" extern u_char at_org_code[ 3 ]; extern u_char aarp_org_code[ 3 ]; /* * This is the magic input routine, for all AppleTalk related packets. * It will pick up *all* packets received, on all interfaces, apparently. * If it turns out that receiving all packets in this fashion causes * DLI to not receive packets what it should, we may need to call DLI * directly from within the AppleTalk input routines. Ick. */ struct mbuf * ddp_ifinput( m, ifp, inq, eh ) struct mbuf *m; struct ifnet *ifp; struct ifqueue **inq; struct ether_header *eh; { struct llc llc; struct if_family *ifam; switch ( eh->ether_type ) { case ETHERTYPE_AT : *inq = &atintrq1; smp_lock( &(*inq)->lk_ifqueue, LK_RETRY ); schednetisr( NETISR_AT ); return( m ); case ETHERTYPE_AARP : aarpinput( ifp, m ); return( 0 ); default : if ( eh->ether_type <= ETHERMTU ) { /* ieee802 */ if ( m->m_len < sizeof( struct llc )) { break; } bcopy( mtod( m, caddr_t ), &llc, sizeof( struct llc )); if ( llc.llc_dsap != LLC_SNAP_LSAP || llc.llc_ssap != LLC_SNAP_LSAP || llc.llc_control != LLC_UI ) { break; } if ( bcmp( llc.llc_org_code, at_org_code, sizeof( at_org_code )) == 0 && ntohs( llc.llc_ether_type ) == ETHERTYPE_AT ) { m_adj( m, sizeof( struct llc )); *inq = &atintrq2; smp_lock( &(*inq)->lk_ifqueue, LK_RETRY ); schednetisr( NETISR_AT ); return( m ); } if ( bcmp( llc.llc_org_code, aarp_org_code, sizeof( aarp_org_code )) == 0 && ntohs( llc.llc_ether_type ) == ETHERTYPE_AARP ) { m_adj( m, sizeof( struct llc )); aarpinput( ifp, m ); return( 0 ); } } } /* * Check is anyone else wants this packet. */ for ( ifam = if_family; ifam->domain != -1; ifam++ ) { if (( eh->ether_type == ifam->if_type || ifam->if_type == -1 ) && ifam->prswitch && ifam->prswitch->pr_ifinput != (int (*)())ddp_ifinput ) { break; } } if ( ifam->domain != -1 && ifam->prswitch->pr_ifinput ) { return( (struct mbuf *)(*ifam->prswitch->pr_ifinput)( m, ifp, inq, eh )); } m_freem( m ); return( 0 ); } /* * Fill in type and odst. odst is the media output address, i.e. * the MAC layer address. Type is the MAC type. Should be 0 to * indicate IEEE addressing. * * Stupidly enough, there's no way to say "can't send this now." * So, we just let the first packet go into the air. Not much * else to be done, except maybe bitch at DEC. Note: we're not * passing the mbuf to aarpresolve() -- that way it doesn't get * mfree-ed twice. */ ddp_ifoutput( ifp, m, dst, type, odst ) struct ifnet *ifp; struct mbuf *m; struct sockaddr_at *dst; short *type; char *odst; { struct at_ifaddr *aa; struct llc *llc; struct mbuf *m0; if ( !aarpresolve( ifp, 0, dst, odst )) { *type = 0xffff; return( 0 ); } if (( aa = (struct at_ifaddr *)at_ifawithnet( dst, ifp->if_addrlist )) == 0 ) { *type = 0xffff; return( 0 ); } if ( aa->aa_flags & AFA_PHASE2 ) { /* * This code needs to be modeled after the similar code in * at_sun.c -- you can't just MGET() and bcopy(), since we might be * dealing with mbufs which are really pages. */ MGET( m0, M_WAIT, MT_HEADER ); if ( m0 == 0 ) { *type = 0xffff; return( 0 ); } m0->m_next = m->m_next; m0->m_off = m->m_off; m0->m_len = m->m_len; bcopy( mtod( m, caddr_t ), mtod( m0, caddr_t ), m->m_len ); m->m_next = m0; m->m_off = MMINOFF; m->m_len = sizeof( struct llc ); llc = mtod( m, struct llc *); llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP; llc->llc_control = LLC_UI; bcopy( at_org_code, llc->llc_org_code, sizeof( at_org_code )); llc->llc_ether_type = htons( ETHERTYPE_AT ); /* * Set the type to be the length of the packet, instead of 0. * Ultrix used to put the length in the packet when we set type * to 0, however, now we do it ourselves. */ for ( *type = 0; m; m = m->m_next ) { *type += m->m_len; } } else { *type = ETHERTYPE_AT; } return( 1 ); } ddp_ifioctl( ifp, cmd, data ) struct ifnet *ifp; int cmd; caddr_t data; { switch( cmd ) { case SIOCSIFADDR : aarpwhohas((struct arpcom *)ifp, &AA_SAT((struct ifaddr *)data)->sat_addr ); break; default : return( EINVAL ); } return( 0 ); } netatalk-2.2.2/sys/ultrix/kpatch-4.20000644000175200017500000000731711655731130014120 00000000000000*** ../sys.old/conf/files Wed Jun 19 14:23:30 1991 --- ./conf/files Fri Mar 6 18:06:45 1992 *************** *** 75,80 **** --- 75,87 ---- net/netinet/tcp_timer.c optional inet Binary net/netinet/tcp_usrreq.c optional inet Binary net/netinet/udp_usrreq.c optional inet Binary + net/netatalk/aarp.c optional atalk + net/netatalk/at_control.c optional atalk + net/netatalk/at_proto.c optional atalk + net/netatalk/at_ultrix.c optional atalk + net/netatalk/ddp_input.c optional atalk + net/netatalk/ddp_output.c optional atalk + net/netatalk/ddp_usrreq.c optional atalk net/netbsc/bsc_pcb.c optional bsc Binary net/netbsc/bsc_proto.c optional bsc net/netbsc/bsc_states.c optional bsc Binary *** ../sys.old/data/af_data.c Mon Apr 29 15:45:53 1991 --- ./data/af_data.c Sun Mar 8 22:25:15 1992 *************** *** 69,74 **** --- 69,82 ---- #define AFNS AFNULL #endif NS + #ifdef ATALK + extern int atalk_hash(), atalk_netmatch(); + #define AFATALK \ + { atalk_hash, atalk_netmatch } + #else + #define AFATALK AFNULL + #endif + #ifdef BINARY extern struct afswitch afswitch[]; *************** *** 78,83 **** struct afswitch afswitch[AF_MAX] = { AFNULL, AFNULL, AFINET, AFINET, AFPUP, AFNULL, AFNS, AFNULL, AFNULL, AFNULL, ! AFNULL }; #endif --- 86,92 ---- struct afswitch afswitch[AF_MAX] = { AFNULL, AFNULL, AFINET, AFINET, AFPUP, AFNULL, AFNS, AFNULL, AFNULL, AFNULL, ! AFNULL, AFNULL, AFNULL, AFNULL, AFNULL, ! AFNULL, AFATALK, AFNULL, AFNULL, AFNULL, }; #endif *** ../sys.old/data/if_to_proto_data.c Mon Apr 29 15:46:34 1991 --- ./data/if_to_proto_data.c Thu Jun 3 11:53:44 1993 *************** *** 125,130 **** --- 125,143 ---- { ETHERTYPE_RC, AF_DLI, 0, 0 } #endif + /* + * Hook for netatalk. We receive all packets. If we're not interested + * in the packet, we do a normal search on if_family for someone else + * who might want the packet. + */ + #ifdef ATALK + #include "atalk.h" + #undef s_net + #include "../net/netatalk/at.h" + #define ETHER_ATALK \ + { -1, AF_APPLETALK, ATPROTO_DDP, 0 } + #endif ATALK + #ifdef BINARY extern struct if_family if_family[]; *************** *** 134,139 **** --- 148,156 ---- /* INET specific stuff is kept in drivers for now */ struct if_family if_family[] = { + #ifdef ETHER_ATALK + ETHER_ATALK, + #endif #ifdef ETHER_DECNET ETHER_DECNET, #endif *** ../sys.old/data/uipc_domain_data.c Mon Apr 29 15:47:08 1991 --- ./data/uipc_domain_data.c Mon Mar 2 15:24:28 1992 *************** *** 123,128 **** --- 123,132 ---- ADDDOMAIN(x25); #endif XXXVNATV #endif X25_DONE + #ifdef ATALK + #include "atalk.h" + ADDDOMAIN(atalk); + #endif ATALK #endif *** ../sys.old/net/net/conf_net.c Mon Apr 29 16:16:23 1991 --- ./net/net/conf_net.c Sun Mar 8 22:28:32 1992 *************** *** 233,238 **** --- 233,242 ---- extern int ddpintr(); #endif + #ifdef ATALK + extern int atintr(); + #endif + #include "../net/net/netisr.h" /* * table of interrupt vectors - scanned in locore when sofware *************** *** 272,277 **** --- 276,284 ---- #if NLAT == 1 {NETISR_LAT,latintr}, #endif /* NLAT */ + #ifdef ATALK + {NETISR_AT,atintr}, + #endif ATALK #ifdef APPLETALK {NETISR_DDP,ddpintr}, #endif APPLETALK *** ../sys.old/net/net/netisr.h Mon Apr 29 16:16:21 1991 --- ./net/net/netisr.h Sun Mar 8 22:29:04 1992 *************** *** 72,77 **** --- 72,78 ---- #define NETISR_DLI 13 /* same as AF_DLI */ #define NETISR_LAT 14 /* same as AF_LAT */ #define NETISR_BSC 15 /* same as AF_BSC */ + #define NETISR_AT 16 /* same as AF_APPLETALK */ #define NETISR_DLO 19 /* same as AF_OSI */ #define schednetisr(anisr) { set_bit_atomic(anisr,&netisr); setsoftnet(); } netatalk-2.2.2/sys/ultrix/Makefile.kernel0000644000175200017500000001032511655731130015332 00000000000000# Ultrix specific defines, passed to subdirectories. # i believe that the current setup will break with this. #DEFS= DEFS=-I../../sys/generic -DUSE_OLD_RQUOTA OPTOPTS= #CC= cc CC = gcc CSHAREDFLAGS= -fPIC LDSHARED= gcc LDSHAREDFLAGS= -shared LDFLAGS_EXPORT=-rdynamic INSTALL= install LIBSHARED= -ldl AFPLIBS= ADDLIBS= INCPATH = -I../../include -I../netatalk CFLAGS= ${DEFS} ${OPTOPTS} ${INCPATH} ALL= ../../libatalk ../../include ../../bin ../../etc ../../man oops: @echo "Read README again. Don't type 'make' here." @exit 1 all: ${ALL} ../../bin ../../etc: ../../libatalk ${ALL}: FRC cd $@; ${MAKE} ${MFLAGS} CC="${CC}" \ ADDLIBS="${ADDLIBS}" DEFS="${DEFS}" OPTOPTS="${OPTOPTS}" \ SBINDIR="${SBINDIR}" BINDIR="${BINDIR}" RESDIR="${RESDIR}" \ ETCDIR="${ETCDIR}" LIBDIR="${LIBDIR}" INCDIR="${INCDIR}" \ DESTDIR="${DESTDIR}" AFSDIR="${AFSDIR}" KRBDIR="${KRBDIR}" \ AFPLIBS="${AFPLIBS}" LDSHARED="${LDSHARED}" \ LDFLAGS_EXPORT="${LDFLAGS_EXPORT}" \ LDSHAREDFLAGS="${LDSHAREDFLAGS}" CSHAREDFLAGS="${CSHAREDFLAGS}" \ LIBSHARED="${LIBSHARED}" \ all FRC: kpatch-4.3 kpatch-4.4 kpatch-4.3: -ln -s kpatch-4.2 kpatch-4.3 kpatch-4.4: -ln -s kpatch-4.2 kpatch-4.4 install : -mkdir ${DESTDIR} for i in ${ALL}; \ do (cd $$i; ${MAKE} ${MFLAGS} CC="${CC}" \ ADDLIBS="${ADDLIBS}" DEFS="${DEFS}" OPTOPTS="${OPTOPTS}" \ SBINDIR="${SBINDIR}" BINDIR="${BINDIR}" RESDIR="${RESDIR}" \ ETCDIR="${ETCDIR}" LIBDIR="${LIBDIR}" INCDIR="${INCDIR}" \ DESTDIR="${DESTDIR}" MANDIR="${MANDIR}" \ AFSDIR="${AFSDIR}" KRBDIR="${KRBDIR}" AFPLIBS="${AFPLIBS}" \ LDSHARED="${LDSHARED}" LDFLAGS_EXPORT="${LDFLAGS_EXPORT}" \ LDSHAREDFLAGS="${LDSHAREDFLAGS}" \ CSHAREDFLAGS="${CSHAREDFLAGS}" LIBSHARED="${LIBSHARED}" \ INSTALL="${INSTALL}" $@); \ done rm -f ${ETCDIR}/rc.atalk sed -e s@:DESTDIR:@${DESTDIR}@ -e s@:SBINDIR:@${SBINDIR}@ \ -e s@:BINDIR:@${BINDIR}@ -e s@:RESDIR:@${RESDIR}@ \ -e s@:ETCDIR:@${ETCDIR}@ -e s@:LIBDIR:@${LIBDIR}@ \ -e s@:INCDIR:@${INCDIR}@ \ < ../../distrib/initscripts/rc.atalk.bsd > ${ETCDIR}/rc.atalk @echo @echo "Install is done. Don't forget to add lines from" @echo "services.atalk to /etc/services and to call rc.atalk @echo "in /etc/rc. Next, install the kernel patches." @echo "See README.ULTRIX for more information." kpatch : @echo "WARNING!!! This patches your kernel!!!" @echo -n "(hit control-c with in 10 seconds, to stop)" @sleep 10 @echo @echo @if grep -s -w atalk /sys/conf/files; then \ echo "You already have a version of netatalk installed."; \ echo "You will have to remove this old version. See"; \ echo "README.ULTRIX for specific instructions."; \ exit 1; \ else \ case `/bin/uname -r` in \ 4.1) echo -n "Applying 4.1 patches..."; \ patch -s -d /sys -p0 < kpatch-4.1; \ echo " done."; \ ;; \ 4.2|4.3|4.4) echo -n "Applying 4.2/4.3/4.4 patches..."; \ patch -s -d /sys -p0 < kpatch-4.2; \ echo " done."; \ ;; \ *) echo "Unknown release of Ultrix"; exit 1; \ ;; \ esac; \ fi @echo @echo "Next, install the netatalk kernel files. See README.ULTRIX" @echo "for specific instructions." kinstall : @echo "Copying netatalk to kernel building area..." -mkdir /sys/net/netatalk cp ../netatalk/*.[ch] *.[ch] /sys/net/netatalk @echo "Done." @echo @echo "Next, make a new kernel. See README.ULTRIX" @echo "for specific instructions." clean : for i in ${ALL}; \ do (cd $$i; ${MAKE} ${MFLAGS} clean); \ done sysclean : depend : for i in ${ALL}; \ do (cd $$i; ${MAKE} ${MFLAGS} DEFS="${DEFS}" depend); \ done for i in ${SRC} ; do \ ${CC} -M ${DEFS} ${INCPATH} $$i | \ awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ else rec = rec " " $$2 } } \ END { print rec } ' >> makedep; done sed -n '1,/^# DO NOT DELETE THIS LINE/p' Makefile > Makefile.tmp cat makedep >> Makefile.tmp rm makedep echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile.tmp echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile.tmp echo '# see make depend above' >> Makefile.tmp rm -f Makefile.bak cp Makefile Makefile.bak mv Makefile.tmp Makefile # DO NOT DELETE THIS LINE netatalk-2.2.2/sys/ultrix/kpatch-4.10000644000175200017500000000764711655731130014125 00000000000000*** ../sys.old/conf/files Fri Jul 6 10:19:49 1990 --- ./conf/files Thu Mar 12 17:33:58 1992 *************** *** 75,80 **** --- 75,87 ---- net/netinet/tcp_timer.c optional inet Binary net/netinet/tcp_usrreq.c optional inet Binary net/netinet/udp_usrreq.c optional inet Binary + net/netatalk/aarp.c optional atalk + net/netatalk/at_control.c optional atalk + net/netatalk/at_proto.c optional atalk + net/netatalk/at_ultrix.c optional atalk + net/netatalk/ddp_input.c optional atalk + net/netatalk/ddp_output.c optional atalk + net/netatalk/ddp_usrreq.c optional atalk net/netbsc/bsc_pcb.c optional bsc Binary net/netbsc/bsc_proto.c optional bsc net/netbsc/bsc_states.c optional bsc Binary *** ../sys.old/data/af_data.c Fri Jul 6 09:40:50 1990 --- ./data/af_data.c Thu Mar 12 17:34:03 1992 *************** *** 69,74 **** --- 69,82 ---- #define AFNS AFNULL #endif NS + #ifdef ATALK + extern int atalk_hash(), atalk_netmatch(); + #define AFATALK \ + { atalk_hash, atalk_netmatch } + #else + #define AFATALK AFNULL + #endif + #ifdef BINARY extern struct afswitch afswitch[]; *************** *** 78,83 **** struct afswitch afswitch[AF_MAX] = { AFNULL, AFNULL, AFINET, AFINET, AFPUP, AFNULL, AFNS, AFNULL, AFNULL, AFNULL, ! AFNULL }; #endif --- 86,92 ---- struct afswitch afswitch[AF_MAX] = { AFNULL, AFNULL, AFINET, AFINET, AFPUP, AFNULL, AFNS, AFNULL, AFNULL, AFNULL, ! AFNULL, AFNULL, AFNULL, AFNULL, AFNULL, ! AFNULL, AFATALK, AFNULL, AFNULL, AFNULL, }; #endif *** ../sys.old/data/if_to_proto_data.c Fri Jul 6 09:40:26 1990 --- ./data/if_to_proto_data.c Thu Jun 3 11:53:44 1993 *************** *** 135,140 **** --- 135,156 ---- { ETHERTYPE_RC, AF_DLI, 0, 0 } #endif + /* + * Hook for netatalk. We receive all packets. If we're not interested + * in the packet, we do a normal search on if_family for someone else + * who might want the packet. + * (Not yet. XXX) + */ + #ifdef ATALK + #include "atalk.h" + #undef s_net + #include "../net/netatalk/at.h" + #define ETHER_ATALK \ + { -1, AF_APPLETALK, ATPROTO_DDP, 0 } + #else ATALK + #define ETHER_ATALK IFNULL + #endif ATALK + #ifdef BINARY extern struct if_family if_family[]; *************** *** 145,151 **** struct if_family if_family[] = { ! ETHER_DECNET, ETHER_LAT, ETHER_APPLE, ETHER_APPLEARP, ETHER_NS, ETHER_DLI, IFEND }; #endif --- 162,168 ---- struct if_family if_family[] = { ! ETHER_ATALK, ETHER_DECNET, ETHER_LAT, ETHER_APPLE, ETHER_APPLEARP, ETHER_NS, ETHER_DLI, IFEND }; #endif *** ../sys.old/data/uipc_domain_data.c Fri Jul 6 09:40:44 1990 --- ./data/uipc_domain_data.c Thu Mar 12 17:38:18 1992 *************** *** 107,112 **** --- 107,116 ---- ADDDOMAIN(ccitt); #endif CCITT #endif + #ifdef ATALK + #include "atalk.h" + ADDDOMAIN(atalk); + #endif ATALK for (dp = domains; dp; dp = dp->dom_next) for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) *** ../sys.old/net/net/conf_net.c Fri Jul 6 10:03:25 1990 --- ./net/net/conf_net.c Thu Mar 12 17:39:11 1992 *************** *** 236,241 **** --- 236,245 ---- extern int ddpintr(); #endif + #ifdef ATALK + extern int atintr(); + #endif + #include "../net/net/netisr.h" /* * table of interrupt vectors - scanned in locore when sofware *************** *** 280,285 **** --- 284,292 ---- #ifdef OSI {NETISR_OSI,osiintr}, #endif OSI + #ifdef ATALK + {NETISR_AT,atintr}, + #endif ATALK {-1 ,0} }; *** ../sys.old/net/net/netisr.h Fri Jul 6 10:03:28 1990 --- ./net/net/netisr.h Thu Mar 12 17:39:45 1992 *************** *** 66,71 **** --- 66,72 ---- #define NETISR_DLI 13 /* same as AF_DLI */ #define NETISR_LAT 14 /* same as AF_LAT */ #define NETISR_BSC 15 /* same as AF_BSC */ + #define NETISR_AT 16 /* same as AF_APPLETALK */ #define NETISR_OSI 19 /* same as AF_OSI */ #define schednetisr(anisr) { set_bit_atomic(anisr,&netisr); setsoftnet(); } netatalk-2.2.2/contrib/0000777000175200017500000000000011704770431011773 500000000000000netatalk-2.2.2/contrib/printing/0000777000175200017500000000000011704770431013625 500000000000000netatalk-2.2.2/contrib/printing/Makefile.am0000644000175200017500000000017511655731126015603 00000000000000# Makefile.am for contrib/printing/ bin_SCRIPTS = add_netatalk_printer EXTRA_DIST = netatalk.template add_netatalk_printer netatalk-2.2.2/contrib/printing/Makefile.in0000644000175200017500000003034011703521724015604 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for contrib/printing/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = contrib/printing DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ bin_SCRIPTS = add_netatalk_printer EXTRA_DIST = netatalk.template add_netatalk_printer all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/printing/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/printing/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binSCRIPTS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-binSCRIPTS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/contrib/printing/add_netatalk_printer0000644000175200017500000002466411655731126017661 00000000000000#! /bin/sh # # $Id: add_netatalk_printer,v 1.7 2003-02-23 03:16:34 srittau Exp $ # # A lovely script to add netatalk printers # #ident "@(#)netatalk 0.5 99/06/22 job@uchicago.edu" /* Netatalk 1.4*/ # # This File is released under the Perl Artistic Licence. # See http://www.perl.org for details # # Or you can use it under the licence that accompanies Netatalk 1.3 =) # # This file is maintained by Job Bogan # Please contact me at this address for bug reports, problems, etc. # Please do not bother the netatalk maintainers with problems from # this program. # # # # Exit Codes ... 1 for missed path or user input # 2 for an aborted run (by not saying yes to a 'are you sure?' # 3 for failed lpadmin commands # 4 for possible security problem # make base name for temp files. TMP_STUFF="/tmp/`basename $0`.$$" export TMP_STUFF rm -rf ${TMP_STUFF} mkdir -m 700 ${TMP_STUFF} || exit 4 trap 'rm -f $TMP_STUFF > /dev/null 2>&1' 0 trap 'exit' 1 2 3 # grab the pathname the script was called w/ # if it was run by ./add... then make the path == `pwd` RUNHOME=`dirname $0` if [ "$RUNHOME" = "." ]; then RUNHOME=`pwd` fi # allow for the env NETATALKHOME to override the guessed one from above NETATALKHOME=${NETATALKHOME:-$RUNHOME} export NETATALKHOME PATH=/bin:${PATH}:${NETATALKHOME}/bin:${NETATALKHOME}/etc:${NETATALKHOME}/libexec:/usr/lib:/usr/sbin if [ ! -x ${NETATALKHOME}/bin/pap ]; then echo "OOPS: I don't see ${NETATALKHOME}/bin/pap ," echo ' Check that it is executable or set ${NETATALKHOME}' echo ' so i can find pap at ${NETATALKHOME}/bin/pap' echo '[We are guessing the location of the binary from the' echo 'path that was used to run this script or $NETATALKHOME]' exit 1 fi # get the user to tell us where to look for things, and list things there. echo '' echo "Enter Appletalk zone [default: local]: \c" read ZONE echo "" echo "Looking for LaserWriters in Zone ${ZONE} ..." ${NETATALKHOME}/bin/nbplkup ":LaserWriter@${ZONE}" echo "" echo "Enter AppleTalk printer name: \c" read DEST if [ "$DEST" = "" ]; then echo "OOPS: you need to tell me a printer name" exit 1 fi echo "checking nbplkup ${DEST}:LaserWriter@${ZONE}" echo "" TestDEST=`${NETATALKHOME}/bin/nbplkup "${DEST}:LaserWriter@${ZONE}"` echo "${TestDEST}" echo "" if [ "${TestDEST}" = "" ]; then echo "I don't see that printer on the network. You may have entered an incorrect" echo "printer name - if so, exit and restart." echo "[You should only enter the printer name, not the :LaserWriter portion]" sleep 3 fi unset TestDEST NBPNAME="${DEST}@${ZONE}" echo "" echo "" # scrunch all of the whitespace and / out of the appletalk name and suggest # that as the unix name SUGGEST=`echo "$DEST" | cut -d: -f1 | sed 's/ //g' | sed 's#/##g` ; export SUGGEST # truncate the suggested name to 14 chars to conform to lp specs. SUGGEST1=`expr ${SUGGEST} : '\(..............\)'` SUGGEST=${SUGGEST1:-$SUGGEST} echo "Enter Unix printer name - [default: ${SUGGEST}] : \c" read UNIXPRINT echo '' if [ "${UNIXPRINT}" = "" ]; then UNIXPRINT="${SUGGEST}" fi export UNIXPRINT ##### # Here we check for legal names again. >14 chars ##### UNIXPRINT1=`expr "${UNIXPRINT}" : '\(..............\)'` # if UNIXPRINT is shorter than 14chars, UNIXPRINT1 ends up null ("") # if UNIXPRINT was longer, then we get a 14char version of it. bleah. if [ "${UNIXPRINT1}" = "" ]; then UNIXPRINT1="${UNIXPRINT}" else #if [ "${UNIXPRINT1}" != "${UNIXPRINT}" ]; then echo "Oops, that name was too long... Truncating to 14 chars." echo "setting printer name to '${UNIXPRINT}'" UNIXPRINT="${UNIXPRINT1}" fi echo "Enter a description for this printer. [The Appletalk name will" echo "be included by default, and must be included for the printing" echo "filters to work.] : \c" read DESC DESC="${DESC} [${NBPNAME}]" echo "" echo "Do you want all print jobs to print out in reversed page order?" echo "This is usually only desired if this printer stacks jobs" echo "face up in the output bin. [N/y] \c" read REV case ${REV} in [Yy]*) REV="Netatalk-R" ;; *) REV="Netatalk" ;; esac export REV if lpstat -p ${UNIXPRINT} >/dev/null 2>&1 ; then echo '' echo "OOPS: There already exists a printer named '${UNIXPRINT}'" echo " here are the comments from /etc/lp/printers/${UNIXPRINT}/comment" cat /etc/lp/printers/${UNIXPRINT}/comment echo "" echo "Do you still want to do this? This will flush " echo "all pending jobs! [Y/n]? \c" read DOTHIS case ${DOTHIS} in [Yy]*) ;; *) exit 2 ;; esac echo "Rejecting all new jobs for ${UNIXPRINT}" reject -r "Making ${UNIXPRINT} a netatalk printer" ${UNIXPRINT} echo "Disabling and Flushing the ${UNIXPRINT} queue" disable -c -r "Making ${UNIXPRINT} a netatalk printer" ${UNIXPRINT} fi ##### # Check if we need to do silly tricks to share the printer... only on 5.5.1 or older ##### if [ "`uname -r`" -lt "5.6" ]; then echo "" echo "Do you want to share this printer with other machines [Y/n]?\c" read SHARE else echo "You're running SunOS 5.6 or higher... skipping 'sacadm' and 'pmadm'" fi if nistest printers.org_dir; then echo "Do you want to add this printer to your NIS printer map? [y/N]" echo "(You will need to share this printer with other machines)" read NIS case ${NIS} in [Yy]*) ADD_NIS=1 ;; *) ;; esac fi echo "Do you want to save the error messages from pap in" echo "'/var/spool/lp/tmp/Netatalk/${UNIXPRINT}' [y/N]" echo "(If you answer N, error messages will go to /dev/null.)" read SAVEerr case ${SAVEerr} in [Yy]*) SAVEerr=1 ;; *) unset SAVEerr ;; esac echo "Making ${UNIXPRINT} print to ${DEST} via netatalk" if [ "${SAVEerr}" = "" ]; then LOCKDEV=/dev/null else LOCKS=/var/spool/lp/tmp/Netatalk if [ ! -d ${LOCKS} ]; then mkdir -m 0771 ${LOCKS} chown lp ${LOCKS} chgrp lp ${LOCKS} fi LOCKDEV=${LOCKS}/${UNIXPRINT} touch ${LOCKDEV} chown lp:lp ${LOCKDEV} chmod 600 ${LOCKDEV} fi echo "" if [ ! -r /etc/lp/filter.table ]; then echo "Setting up the existing print filters..." for i in `ls /etc/lp/fd | sed 's/.fd$//'`; do lpfilter -f ${i} -F/etc/lp/fd/${i}.fd done fi if lpfilter -f netatalk -l > /dev/null 2>&1 ; then echo 'Looks like you have a Netatalk printer filter defined. Good!' else echo "Humm... You need a Netatalk printer filter..." echo "... making you one ..." cat > /etc/lp/fd/netatalk.fd << EOF #ident "@(#)netatalk.fd 0.2 97/09/04 job@uchicago.edu" /* Netatalk 1.4 */ Input types: postscript Output types: PS Printer types: Netatalk Printers: any Filter type: fast Command: ${NETATALKHOME}/libexec/ifpap 2>&1 > /dev/null EOF chown lp:lp /etc/lp/fd/netatalk.fd chmod 664 /etc/lp/fd/netatalk.fd lpfilter -f netatalk -F /etc/lp/fd/netatalk.fd fi if lpfilter -f netatalk-r -l 2>&1 > /dev/null ; then echo 'Looks like you have a Reverse Netatalk printer filter defined. Good!' else echo "Humm... You need a Reverse Netatalk printer filter..." echo "... making you one ..." cat > /etc/lp/fd/netatalk-r.fd << EOF #ident "@(#)netatalk-r.fd 0.2 97/09/04 job@uchicago.edu" /* Netatalk 1.4 */ Input types: postscript Output types: PS Printer types: Netatalk-R Printers: any Filter type: fast Command: "/usr/lib/lp/postscript/postreverse | ${NETATALKHOME}/libexec/ifpap 2>&1 >/dev/null" EOF chown lp:lp /etc/lp/fd/netatalk-r.fd chmod 664 /etc/lp/fd/netatalk-r.fd lpfilter -f netatalk-r -F /etc/lp/fd/netatalk-r.fd fi if [ ! -r /usr/share/lib/terminfo/N/Netatalk ]; then echo "Making a Terminfo entry for Netatalk printers" cat > ${TMP_STUFF}/terminfo << EOF Netatalk, cols#80, lines#66, cpi=null, csnm=^D, lpi=null, scs=^D, slines=^D, u9=^D, EOF tic ${TMP_STUFF}/terminfo chown bin:bin /usr/share/lib/terminfo/N/Netatalk chmod 644 /usr/share/lib/terminfo/N/Netatalk fi if [ ! -r /usr/share/lib/terminfo/N/Netatalk-R ]; then echo "Making a Terminfo entry for Reversed Netatalk printers" cat > ${TMP_STUFF}/terminfoR << EOF Netatalk-R, cols#80, lines#66, cpi=null, csnm=^D, lpi=null, scs=^D, slines=^D, u9=^D, EOF tic "${TMP_STUFF}/terminfoR" chown bin:bin /usr/share/lib/terminfo/N/Netatalk-R chmod 644 /usr/share/lib/terminfo/N/Netatalk-R fi ### # this is old cruft... we should not have done this in the 1st place. # we need to edit the template interface file to point to the local netatalk bins #cat ${RUNHOME}/etc/netatalk.template | sed "s#DEFAULT_NETATALK_HOME#${RUNHOME}#g" \ # > "/etc/lp/interfaces/${UNIXPRINT}" #chown lp:lp /etc/lp/interfaces/${UNIXPRINT} #chmod 0775 /etc/lp/interfaces/${UNIXPRINT} # below is the correct way. ### echo "Setting up ${UNIXPRINT} ... Edit options later as you see fit." lpadmin -p ${UNIXPRINT} -D "${DESC}" -T ${REV} \ -i ${RUNHOME}/netatalk.template -I PS -v ${LOCKDEV} -A none || exit 3 accept ${UNIXPRINT} || exit 3 enable ${UNIXPRINT} || exit 3 case ${SHARE} in [Nn]*) exit; ;; *) ;; esac echo "Setting up network sharing for ${UNIXPRINT}" # from p925 in the Solaris Administration Guide, Vol. II (2.5) echo "" if sacadm -l -p tcp > /dev/null; then echo "already running a tcp listener" else echo "Defining tcp listener ..." sacadm -a -p tcp -t listen -c "/usr/lib/saf/listen tcp" \ -v `nlsadmin -V` -n 999 fi # this is extra, but a good idea... LPD_ADDR="\\x`lpsystem -A`" ; export LPD_ADDR ADDR_0=`echo $LPD_ADDR | sed -e 's/\\x00020203/\\x00020ACE/g'`; export ADDR_0 if pmadm -l -p tcp -s 0 > /dev/null; then echo "<0> service is already defined." else echo "Defining <0>/tcp service ..." pmadm -a -p tcp -s 0 -i root \ -m `nlsadmin -c /usr/lib/saf/nlps_server -A ${ADDR_0}` \ -v `nlsadmin -V` fi # again from the solaris book noted above. if pmadm -l -p tcp -s lp > /dev/null; then echo " service is already defined." else echo "Defining /tcp service ..." pmadm -a -p tcp -s lp -i root \ -m `nlsadmin -o /var/spool/lp/fifos/listenS5` \ -v `nlsadmin -V` fi if pmadm -l -p tcp -s lpd > /dev/null; then echo " service is already defined." else echo "Defining /tcp service ..." pmadm -a -p tcp -s lpd -i root \ -m `nlsadmin -o /var/spool/lp/fifos/listenBSD -A ${LPD_ADDR}` \ -v `nlsadmin -V` fi if [ "${ADD_NIS}" = 1 ] ; then if nistest "[printer_name=${UNIXPRINT}]printers.org_dir"; then nistbladm -m printer_host=`uname -n` \ "[printer_name=${UNIXPRINT}]printers.org_dir" description="$DESC" else nistbladm -a printer_name=${UNIXPRINT} \ description="$DESC" printer_host=`uname -n` printers.org_dir fi fi netatalk-2.2.2/contrib/printing/netatalk.template0000644000175200017500000003671511655731126017120 00000000000000#ident "@(#)netatalk 0.7 99/06/22 job@uchicago.edu" /* Netatalk 1.4*/ ##### # User configuration: # # Set timeout for pap($time) and papstatus($time2). both are in seconds. # extraneous if you do not have NETATALKHOME/bin/timeout # set how many times to loop before we just abort entirely ($attempts) # what flags pap is run w/. -c makes pap claim to have been waiting forever ##### time=1800 time2=60 attempts=3 pap_flags="-c" ##### # this should get "fixed" to something like # NETATALKHOME=/opt ; export NETATALKHOME # by the add_netatalk_printer script # # DO NOT use the user's env for this or the PATH above. ##### NETATALKHOME=DEFAULT_NETATALK_HOME ; export NETATALKHOME #NETATALKHOME=/opt ; export NETATALKHOME if [ "${NETATALKHOME}" = "DEFAULT_NETATALK_HOME" ]; then echo "bleah, NETATALKHOME not set, exiting..." ; exit 5 fi ##### # BUGS/TODO: # move all TMP stuff to use a directory for security reasons # run nbplkup to check if the reason we cannot print, is that it's not on # the net # move to "${foo}" from $foo and ${foo} # add debuging info that gets sent to "logger lpd.debug" # if we timeout while printing the banner page, we do not keep trying to print. # perhaps filter_timeout should only complain once per job; like badfile. # check if the timeout messages are duplicated by the lp system # psa will not drop in for pap to use accting. perhaps lp does not need it? # make pap print all the files at once; kill for file in ($files) # move badfile error to printfile function ##### # This File is released under the Perl Artistic Licence. # See http://www.perl.org for details # # Or you can use it under the licence that accompanies Netatalk 1.3 =) ########### ## Netatalk printer interface. Heavily modified from ## /usr/lib/lp/model/standard on Sparc Solaris 2.5.1 (May 97) ## ## Meant to be used w/ add_netatalk_printer ########### ##### # This program is invoked as # # ${SPOOLDIR}/.../printer request-id user title copies options files... # # The first three arguments are simply reprinted on the banner page, # the fourth (copies) is used to control the number of copies to print, # the fifth (options) is a blank separated list (in a single argument) # of user or Spooler supplied options (without the -o prefix), # and the last argument(s) is/are the file(s) to print. ##### ##### # # The protocol between the interface program and the Spooler # is fairly simple: # # All standard error output is assumed to indicate a # fault WITH THE REQUEST. The output is mailed to the # user who submitted the print request and the print # request is finished. # # If the interface program sets a zero exit code, # it is assumed that the file printed correctly. # If the interface program sets a non-zero exit code # less than 128, it is assumed that the file did not # print correctly, and the user will be notified. # In either case the print request is finished. # # If the interface program sets an exit code greater # than 128, it is assumed that the file did not print # because of a printer fault. If an alert isn't already # active (see below) one will be activated. (Exit code # 128 should not be used at all. The shell, which executes # this program, turns SIGTERM, used to kill this program # for a cancellation or disabling, into exit 128. The # Spooler thus interpretes 128 as SIGTERM.) # # A message sent to the standard input of the ${LPTELL} # program is assumed to describe a fault WITH THE PRINTER. # The output is used in an alert (if alerts are defined). # If the fault recovery is "wait" or "begin", the printer # is disabled (killing the interface program if need be), # and the print request is left on the queue. # If the fault recovery is "continue", the interface program # is allowed to wait for the printer fault to be cleared so # it can resume printing. # ##### ########################################################################### # # Set up the basic traps. and other important things # ########################################################################### ##### # For the time being, just exit if we are poked. ##### # SIGTERM handler trap 'exit' 15 ##### # We can be clever about getting a hangup or interrupt, though, at least # until the filter runs. Do this early, even though $LPTELL # isn't defined, so that we're covered. ##### trap 'catch_hangup; exit_code=129 exit 129' 1 trap 'catch_interrupt; exit_code=129 exit 129' 2 3 ##### # VARIBLE DECLARED - put here so we don't ever run the trap below w/o # TMPPREFIX defined. We hard code /tmp for the moment, but fix that later # # Use ${TMPPREFIX} as the prefix for all temporary files, so # that cleanup is easy. The prefix may be up to 13 characters # long, so you only have space for one more character to make # a file name. If necessary, make a directory using this prefix # for better management of unique temporary file names. ##### TMPPREFIX=/tmp/`uname -n`$$ ##### # Before exiting, set ${exit_code} to the value with which to exit. # Otherwise, the exit from this script will be 0. ##### trap 'rm -fr ${TMPPREFIX}*; exit ${exit_code}' 0 catch_hangup () { if [ -n "${LPTELL}" ] then echo \ "Humm, we got a SIGHUP. Not sure what it means, but... we'll keep going anyway" \ | ${LPTELL} "${printer}" fi return 0 } catch_interrupt () { if [ -n "${LPTELL}" ] then echo \ "Received an interrupt from the printer. The reason is unknown." \ | ${LPTELL} "${printer}" fi return 0 } ##### # Most of the time we don't want the standard error to be captured # by the Spooler, mainly to avoid "Terminated" messages that the # shell puts out when we get a SIGTERM. We'll save the standard # error channel under another number, so we can use it when it # should be captured. # # Open another channel to the printer port, for use when the # regular standard output won't be directed there, such as in # command substitution (`cmd`). ##### exec 5>&2 2>/dev/null 3>&1 ########################################################################### # # Define local varibles and such # ########################################################################### ##### # There is one more varible set by the shell that execs us. # FILTER The filter to run ; we ignore this directive ##### ##### # Use the user set env, or else default to standard values. ##### : ${SPOOLDIR:=/usr/spool/lp} : ${TMPDIR:=/tmp} ; export TMPDIR : ${LOCALPATH:=${SPOOLDIR}/bin} ; export LOCALPATH PATH="/bin:/usr/bin:${LOCALPATH}:${NETATALKHOME}/bin:${NETATALKHOME}/etc" export PATH TMPPREFIX=${TMPDIR}/`uname -n`$$ ##### # Error levels for the errmsg() func. ##### LP_ERR_LABEL="UX:lp" ; export LP_ERR_LABEL E_IP_ARGS=1 E_IP_OPTS=2 E_IP_UNKNOWN=5 E_IP_BADFILE=6 ##### # Error message formatter: # # Invoke as # # errmsg severity message-number problem help # # where severity is "ERROR" or "WARNING", message-number is # a unique identifier, problem is a short description of the # problem, and help is a short suggestion for fixing the problem. ##### errmsg () { case $1 in ERROR ) sev=" ERROR"; ;; WARNING ) sev="WARNING"; ;; esac echo "${LP_ERR_LABEL}: ${sev}: $3 TO FIX: $4" >&5 } parse () { echo "`expr \"$1\" : \"^[^=]*=\(.*\)\"`" } ##### # die quickly if we do not have the right number of arguments. ##### if [ $# -lt 5 ] then errmsg ERROR ${E_IP_ARGS} \ "wrong number of arguments to interface program" \ "consult your system administrator" exit 1 fi printer=`basename $0` request_id=$1 # this will formated be machine!username, so we want to split that up... user_name=$2 machine=`echo $user_name | cut -d! -f1` user_name=`echo $user_name | cut -d! -f2` title=$3 copies=$4 option_list=$5 shift 5 files="$*" nobanner="yes" inlist= for i in ${option_list} do case "${inlist}${i}" in nobanner ) nobanner="yes" ;; banner ) nobanner="no" ;; ##### # # If you want to add simple options (e.g. -o simple) # identify them here. ##### # simple ) # simple="yes" ;; ##### # These get ignored, but would matter little anyway since all we see # here is PS anyway. ##### cpi=* ) # cpi=`parse ${i}` ;; true ;; lpi=* ) # lpi=`parse ${i}` ;; true ;; length=* ) # length=`parse ${i}` ;; true ;; width=* ) # width=`parse ${i}` ;; true ;; ##### # If you want to add simple-value options (e.g. -o value=a) # identify them here. ##### #value=* ) # value=`parse ${i}` ;; flist=* ) flist=`parse ${i}` ;; input* ) true ;; * ) errmsg WARNING ${E_IP_OPTS} \ "unrecognized \"-o ${i}\" option" \ "check the option, resubmit if necessary printing continues" ;; esac done ##### # A bit ugly, but grabs the appletalk printer name from the lp system printer # description, so it's right up there in admintool. the appletalk name must # be delimited by [ and ]. # # eg - 'this is the printer [hp-mrsec-l114:lasershared@Research Insitutes] that i use.' ##### PAPDEST="`lpstat -D -p "${printer}" | grep -i descrip | sed 's/.*Description:.*\[//g' | sed 's/\].*//g'`" export PAPDEST ########################################################################### # # Define our local functions (parse is declared above option parsing) # ########################################################################### banner () { echo "##### User: ${user_name}" echo "" echo "##### Machine: ${user_name}" echo "" if [ -n "${title}" ] then echo "##### Title: ${title}" echo "" fi echo "##### Files: ${flist}" echo "" ##### # this should deal w/ the year 2000 ok. But will die in 2038. =) ##### YEAR=`date '+%y'` YEAR=`expr 1900 + ${YEAR}` echo "##### Date: `date '+%a %H:%M %h %d,'` ${YEAR}" echo "" echo "##### Job: ${request_id}" echo "" } print_banner() { if [ -x ${NETATALKHOME}/bin/timeout ] then banner | ${NETATALKHOME}/etc/psf \ | ${NETATALKHOME}/bin/timeout "${time}" ${NETATALKHOME}/bin/pap -c -p "${PAPDEST}" else banner | ${NETATALKHOME}/etc/psf \ | ${NETATALKHOME}/bin/pap -c -p "{PAPDEST}" fi if [ ${?} -ne 0 ] then filter_timeout fi } ##### # ${LPTELL} is the name of a program that will send its # standard input to the Spooler. It is used to forward # the description of a printer fault to the Spooler, # which uses it in an alert to the administrator. ##### if [ ! -x "${LPTELL:=${LOCALPATH}/lp.tell}" ] then fake_lptell(){ header="no" while read line do if [ "no" = "${header}" ] then errmsg ERROR ${E_IP_UNKNOWN} \ "unknown printer/interface failure" \ "consult your system administrator; \ reasons for failure (if any) follow:" header=yes fi echo "${line}" >&2 done return 1 } LPTELL=fake_lptell fi ##### # timeout catcher for the printing filter ##### filter_timeout() { cat > ${TMPPREFIX}D <&1 >> ${TMPPREFIX}D paperr=${?} errmsg WARNING ${E_IP_UNKNOWN} "`cat ${TMPPREFIX}D`" "printing continues" ##### # This ought to deal w/ the problem of nonexistent appletalk names, but... # for the moment, it calls filter_death. But it sends the papstatus # info to LPTELL anyhow, so you should be able to see the error. ##### if [ ${paperr} -ne 0 -o ${too_many} = "1" ]; then paperr= filter_death fi paperr= echo "serverdict begin 0 exitserver systemdict /quit get exec" | \ ${NETATALKHOME}/bin/pap -c -p "${PAPDEST}" return 0 } ##### # Death catcher for filter_timeout ##### filter_death() { cat > ${TMPPREFIX}Z < #include #include #include #include #include #include #include #include #ifdef HAVE_SGTTY_H #include #endif /* HAVE_SGTTY_H */ #include #include #include #include #include #ifdef HAVE_NETDB_H #include #endif /* HAVE_NETDB_H */ #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #ifdef HAVE_SYS_FCNTL_H #include #endif /* HAVE_SYS_FCNTL_H */ #ifdef HAVE_TERMIOS_H #include #endif /* HAVE_TERMIOS_H */ #ifdef HAVE_SYS_TERMIOS_H #include #endif /* HAVE_SYS_TERMIOS_H */ #define TL_OK '\0' #define TL_EOF '\1' int debug = 0; char *bad = "Bad request!"; char buf[ 4624 ]; char *server; int32_t fileoff; long a2bootreq(char *fname); void usage( char *p ) { char *s; if (( s = rindex( p, '/' )) == NULL ) { s = p; } else { s++; } fprintf( stderr, "Usage:\t%s -d -n nbpname\n", s ); exit( 1 ); } /* * Unregister ourself on signal. */ void goaway(int signal) { int regerr; regerr = nbp_unrgstr( server, "Apple //gs", "*", NULL ); regerr += nbp_unrgstr( server, "Apple //e Boot", "*", NULL ); regerr += nbp_unrgstr( server, "ProDOS16 Image", "*", NULL ); if ( regerr < 0 ) { LOG(log_error, logtype_default, "Can't unregister Apple II boot files %s", server ); exit( 1 ); } LOG(log_info, logtype_default, "going down" ); exit( 0 ); } int main( int ac, char **av ) { ATP atp; struct sockaddr_at sat; struct atp_block atpb; struct iovec iov; char hostname[ MAXHOSTNAMELEN ]; char *p; int c; int32_t req, resp; int regerr; extern char *optarg; extern int optind; if ( gethostname( hostname, sizeof( hostname )) < 0 ) { perror( "gethostname" ); exit( 1 ); } if (( server = index( hostname, '.' )) != 0 ) { *server = '\0'; } server = hostname; while (( c = getopt( ac, av, "dn:" )) != EOF ) { switch ( c ) { case 'd' : debug++; break; case 'n' : server = optarg; break; default : fprintf( stderr, "Unknown option -- '%c'\n", c ); usage( *av ); } } /* * Disassociate from controlling tty. */ if ( !debug ) { int i, dt; switch ( fork()) { case 0 : dt = getdtablesize(); for ( i = 0; i < dt; i++ ) { (void)close( i ); } if (( i = open( "/dev/tty", O_RDWR )) >= 0 ) { (void)ioctl( i, TIOCNOTTY, 0 ); setpgid( 0, getpid()); (void)close( i ); } break; case -1 : perror( "fork" ); exit( 1 ); default : exit( 0 ); } } if (( p = rindex( *av, '/' )) == NULL ) { p = *av; } else { p++; } #ifdef ultrix openlog( p, LOG_PID ); #else /* ultrix */ set_processname(p); syslog_setup(log_debug, logtype_default, logoption_ndelay|logoption_pid, logfacility_daemon ); #endif /* ultrix */ /* allocate memory */ memset (&sat.sat_addr, 0, sizeof (sat.sat_addr)); /* force port 3 as the semi-official ATP access port MJ 2002 */ if (( atp = atp_open( (u_int8_t)3, &sat.sat_addr )) == NULL ) { LOG(log_error, logtype_default, "main: atp_open: %s", strerror( errno ) ); exit( 1 ); } regerr = nbp_rgstr( atp_sockaddr( atp ), server, "Apple //gs", "*" ); regerr += nbp_rgstr( atp_sockaddr( atp ), server, "Apple //e Boot", "*" ); regerr += nbp_rgstr( atp_sockaddr( atp ), server, "ProDOS16 Image", "*" ); if ( regerr < 0 ) { LOG(log_error, logtype_default, "Can't register Apple II boot files %s", server ); exit( 1 ); } LOG(log_info, logtype_default, "%s:Apple 2 Boot started", server ); signal(SIGHUP, goaway); signal(SIGTERM, goaway); for (;;) { /* * Something seriously wrong with atp, since these assigns must * be in the loop... */ atpb.atp_saddr = &sat; atpb.atp_rreqdata = buf; bzero( &sat, sizeof( struct sockaddr_at )); atpb.atp_rreqdlen = sizeof( buf ); if ( atp_rreq( atp, &atpb ) < 0 ) { LOG(log_error, logtype_default, "main: atp_rreq: %s", strerror( errno ) ); exit( 1 ); } p = buf; bcopy( p, &req, sizeof( int32_t )); req = ntohl( req ); p += sizeof( int32_t ); /* LOG(log_info, logtype_default, "req = %08lx",(long)req ); */ /* Byte-swap and multiply by 0x200. Converts block number to file offset. */ fileoff = (( req & 0x00ff0000 ) >> 7 ) | (( req & 0x0000ff00 ) << 9 ); req &= 0xff000000; /* LOG(log_info, logtype_default, " reqblklo = %02x",(int)reqblklo ); LOG(log_info, logtype_default, " reqblkhi = %02x",(int)reqblkhi ); LOG(log_info, logtype_default, " req now = %08lx",(long)req ); */ switch( req ) { case 0x01000000 : /* Apple IIgs both ROM 1 and ROM 3 */ /* LOG(log_info, logtype_default, " Req ProDOS16 Boot Blocks" ); */ resp = a2bootreq(_PATH_A_GS_BLOCKS); break; case 0x02000000 : /* Apple 2 Workstation card */ /* LOG(log_info, logtype_default, " Req Apple //e Boot" ); */ resp = a2bootreq(_PATH_A_2E_BLOCKS); break; case 0x03000000 : /* Apple IIgs both ROM 1 and ROM 3 */ /* LOG(log_info, logtype_default, " Req ProDOS16 Image" ); */ resp = a2bootreq(_PATH_P16_IMAGE); break; default : LOG(log_error, logtype_default, bad ); resp = TL_EOF; *( buf + sizeof( int32_t ) ) = (unsigned char)strlen( bad ); strcpy( buf + 1 + sizeof( int32_t ), bad ); break; } bcopy( &resp, buf, sizeof( int32_t )); iov.iov_len = sizeof( int32_t ) + 512; iov.iov_base = buf; atpb.atp_sresiov = &iov; atpb.atp_sresiovcnt = 1; if ( atp_sresp( atp, &atpb ) < 0 ) { LOG(log_error, logtype_default, "main: atp_sresp: %s", strerror( errno ) ); exit( 1 ); } } } /* below MJ 2002 (initially borrowed from aep_packet */ long a2bootreq(fname) char *fname; { int f,m; int32_t readlen; /* LOG(log_info, logtype_default, " a2bootreq( %s )",fname ); */ f=open(fname,O_RDONLY ); if(f==EOF) { LOG(log_error, logtype_default, "a2boot open error on %s",fname); return close(f); } /* LOG(log_info, logtype_default, "would lseek to %08lx",fileoff); */ lseek(f,fileoff,0); readlen=read(f, buf + sizeof( int32_t ), 512 ); /* LOG(log_info, logtype_default, "length is %08lx", readlen); */ if(readlen < 0x200) { /* LOG(log_info, logtype_default, "Read to EOF"); */ close(f); return TL_EOF; } close(f); return TL_OK; } netatalk-2.2.2/contrib/Makefile.in0000644000175200017500000004164311703521724013762 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for contrib/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @COMPILE_TIMELORD_TRUE@am__append_1 = timelord @COMPILE_A2BOOT_TRUE@am__append_2 = a2boot @USE_APPLETALK_TRUE@am__append_3 = printing subdir = contrib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = macusers misc shell_utils timelord a2boot printing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = macusers misc shell_utils $(am__append_1) $(am__append_2) \ $(am__append_3) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/contrib/shell_utils/0000777000175200017500000000000011704770431014322 500000000000000netatalk-2.2.2/contrib/shell_utils/Makefile.am0000644000175200017500000000071111655731243016274 00000000000000# Makefile for contrib/shell_utils/ pkgconfdir = @PKGCONFDIR@ GENERATED_FILES = lp2pap.sh TEMPLATE_FILES = lp2pap.sh.tmpl PERLSCRIPTS = \ asip-status.pl \ apple_dump SUFFIXES = .tmpl . .tmpl: sed -e s@:BINDIR:@${bindir}@ \ -e s@:SBINDIR:@${sbindir}@ \ -e s@:ETCDIR:@${pkgconfdir}@ \ <$< >$@ CLEANFILES = $(GENERATED_FILES) bin_SCRIPTS = $(PERLSCRIPTS) $(GENERATED_FILES) EXTRA_DIST = $(TEMPLATE_FILES) make-casetable.pl make-precompose.h.pl netatalk-2.2.2/contrib/shell_utils/Makefile.in0000644000175200017500000003171511703521724016310 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile for contrib/shell_utils/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = contrib/shell_utils DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/apple_dump.in $(srcdir)/asip-status.pl.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = apple_dump asip-status.pl am__installdirs = "$(DESTDIR)$(bindir)" binSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgconfdir = @PKGCONFDIR@ GENERATED_FILES = lp2pap.sh TEMPLATE_FILES = lp2pap.sh.tmpl PERLSCRIPTS = \ asip-status.pl \ apple_dump SUFFIXES = .tmpl . CLEANFILES = $(GENERATED_FILES) bin_SCRIPTS = $(PERLSCRIPTS) $(GENERATED_FILES) EXTRA_DIST = $(TEMPLATE_FILES) make-casetable.pl make-precompose.h.pl all: all-am .SUFFIXES: .SUFFIXES: .tmpl . $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/shell_utils/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/shell_utils/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh apple_dump: $(top_builddir)/config.status $(srcdir)/apple_dump.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ asip-status.pl: $(top_builddir)/config.status $(srcdir)/asip-status.pl.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binSCRIPTS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-binSCRIPTS .tmpl: sed -e s@:BINDIR:@${bindir}@ \ -e s@:SBINDIR:@${sbindir}@ \ -e s@:ETCDIR:@${pkgconfdir}@ \ <$< >$@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/contrib/shell_utils/make-casetable.pl0000755000175200017500000002407211655731243017444 00000000000000#!/usr/bin/perl # # usage: make-casetable.pl # make-casetable.pl UnicodeData.txt utf16_casetable.h utf16_case.c # # (c) 2011 by HAT # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # See # http://www.unicode.org/reports/tr44/ # http://www.unicode.org/Public/UNIDATA/UnicodeData.txt # One block has 64 chars. # # BMP # block 0 = dummy # block 1 = U+0000 - U+003F # block 2 = U+0040 - U+007F # ..... # block 1024 = U+FFC0 - U+FFFF # block 1025 = dummy # # Surrogate Pair # block 1024 = dummy # block 1025 = U+010000 - U+01003F # block 1026 = U+010040 - U+01007F # ..... # block 17408 = U+10FFC0 - U+10FFFF # block 17409 = dummy # # Dummy block is for edge detection. # If block include upper/lower chars, block_enable[]=1. use strict; use warnings; our $code0; our $Name1; our $General_Category2; our $Canonical_Combining_Class3; our $Bidi_Class4; our $Decomposition_Mapping5; our $Numeric_Value6; our $Numeric_Value7; our $Numeric_Value8; our $Bidi_Mirrored9; our $Unicode_1_Name10; our $ISO_Comment11; our $Simple_Uppercase_Mapping12; our $Simple_Lowercase_Mapping13; our $Simple_Titlecase_Mapping14; our $hex_code0; our $Mapping; our $hex_Mapping; our $char; our $sp; our $block; our @table; our @table_sp; our @block_enable; our @block_enable_sp; our $table_no; our $block_start; our $block_end; our $char_start; our $char_end; open(CHEADER, ">$ARGV[1]"); open(CSOURCE, ">$ARGV[2]"); printf (CHEADER "\/\*\n"); printf (CHEADER "DO NOT EDIT BY HAND\!\!\!\n"); printf (CHEADER "\n"); printf (CHEADER "This file is generated by\n"); printf (CHEADER " contrib/shell_utils/make-casetable.pl %s %s %s\n", $ARGV[0], $ARGV[1], $ARGV[2]); printf (CHEADER "\n"); printf (CHEADER "%s is got from\n", $ARGV[0]); printf (CHEADER "http\:\/\/www.unicode.org\/Public\/UNIDATA\/UnicodeData.txt\n"); printf (CHEADER "\*\/\n"); printf (CHEADER "\n"); printf (CSOURCE "\/\*\n"); printf (CSOURCE "DO NOT EDIT BY HAND\!\!\!\n"); printf (CSOURCE "\n"); printf (CSOURCE "This file is generated by\n"); printf (CSOURCE " contrib/shell_utils/make-casetable.pl %s %s %s\n", $ARGV[0], $ARGV[1], $ARGV[2]); printf (CSOURCE "\n"); printf (CSOURCE "%s is got from\n", $ARGV[0]); printf (CSOURCE "http\:\/\/www.unicode.org\/Public\/UNIDATA\/UnicodeData.txt\n"); printf (CSOURCE "\*\/\n"); printf (CSOURCE "\n"); printf (CSOURCE "\#include \\n"); printf (CSOURCE "\#include \\n"); printf (CSOURCE "\#include \"%s\"\n", $ARGV[1]); printf (CSOURCE "\n"); &make_array("upper"); &make_array("lower"); printf (CHEADER "\/\* EOF \*\/\n"); printf (CSOURCE "\/\* EOF \*\/\n"); close(CHEADER); close(CSOURCE); ########################################################################### sub make_array{ # init table ----------------------------------------------------- for ($char = 0 ; $char <= 0xFFFF ; $char++) { $table[$char][0] = $char; # mapped char $table[$char][1] = $char; # orig char $table[$char][2] = ""; # char name } for ($char = 0x10000 ; $char <= 0x10FFFF ; $char++) { $sp = ((0xD800 - (0x10000 >> 10) + ($char >> 10)) << 16) + (0xDC00 + ($char & 0x3FF)); $table_sp[$char][0] = $sp; # mapped surrogate pair $table_sp[$char][1] = $sp; # orig surrogate pair $table_sp[$char][2] = $char; # mapped char $table_sp[$char][3] = $char; # orig char $table_sp[$char][4] = ""; # char name } for ($block = 0 ; $block <= 1025 ; $block++) { $block_enable[$block] = 0; } $block_enable[1] = 1; # ASCII block is forcibly included $block_enable[2] = 1; # in the array for Speed-Up. for ($block = 1024 ; $block <= 17409 ; $block++) { $block_enable_sp[$block] = 0; } # write data to table -------------------------------------------- open(UNICODEDATA, "<$ARGV[0]"); while () { chop; ( $code0, $Name1, $General_Category2, $Canonical_Combining_Class3, $Bidi_Class4, $Decomposition_Mapping5, $Numeric_Value6, $Numeric_Value7, $Numeric_Value8, $Bidi_Mirrored9, $Unicode_1_Name10, $ISO_Comment11, $Simple_Uppercase_Mapping12, $Simple_Lowercase_Mapping13, $Simple_Titlecase_Mapping14 ) = split(/\;/); if ($_[0] eq "upper") { $Mapping = $Simple_Uppercase_Mapping12; } elsif ($_[0] eq "lower") { $Mapping = $Simple_Lowercase_Mapping13; } else { exit(1); } next if ($Mapping eq ""); $hex_code0 = hex($code0); $hex_Mapping = hex($Mapping); if ($hex_code0 <= 0xFFFF) { $table[$hex_code0][0] = $hex_Mapping; #table[$hex_code0][1] already set $table[$hex_code0][2] = $Name1; $block_enable[($hex_code0 / 64) +1] = 1; } else { $sp = ((0xD800 - (0x10000 >> 10) + ($hex_Mapping >> 10)) << 16) + (0xDC00 + ($hex_Mapping & 0x3FF)); $table_sp[$hex_code0][0] = $sp; #table_sp[$hex_code0][1] already set $table_sp[$hex_code0][2] = $hex_Mapping; #table_sp[$hex_code0][3] already set $table_sp[$hex_code0][4] = $Name1; $block_enable_sp[($hex_code0 / 64) +1] = 1; } } close(UNICODEDATA); # array for BMP -------------------------------------------------- printf(CSOURCE "\/*******************************************************************\n"); printf(CSOURCE " Convert a wide character to %s case.\n", $_[0]); printf(CSOURCE "*******************************************************************\/\n"); printf(CSOURCE "ucs2\_t to%s\_w\(ucs2\_t val\)\n", $_[0]); printf(CSOURCE "{\n"); $table_no = 1; for ($block = 1 ; $block <= 1024 ; $block++) { # rising edge detection if ($block_enable[$block - 1] == 0 && $block_enable[$block] == 1) { $block_start = $block; } # falling edge detection if ($block_enable[$block] == 1 && $block_enable[$block + 1] == 0) { $block_end = $block; $char_start = ($block_start -1)* 64; $char_end = ($block_end * 64) -1; printf(CHEADER "static const u\_int16\_t %s\_table\_%d\[%d\] \= \{\n", $_[0], $table_no, $char_end - $char_start +1); for ($char = $char_start ; $char <= $char_end ; $char++) { printf(CHEADER " 0x%04X, /*U\+%04X*/ /*%s*/\n", $table[$char][0], $table[$char][1], $table[$char][2] ); } printf(CHEADER "\}\;\n"); printf(CHEADER "\n"); if ($char_start == 0x0000) { printf(CSOURCE " if \( val \<\= 0x%04X)\n", $char_end); printf(CSOURCE " return %s\_table\_%d\[val]\;\n", $_[0], $table_no); } else { printf(CSOURCE " if \( val \>\= 0x%04X \&\& val \<\= 0x%04X)\n", $char_start, $char_end); printf(CSOURCE " return %s\_table\_%d\[val-0x%04X\]\;\n", $_[0], $table_no, $char_start); } printf(CSOURCE "\n"); $table_no++; } } printf(CSOURCE "\treturn \(val\)\;\n"); printf(CSOURCE "\}\n"); printf(CSOURCE "\n"); # array for Surrogate Pair --------------------------------------- printf(CSOURCE "\/*******************************************************************\n"); printf(CSOURCE " Convert a surrogate pair to %s case.\n", $_[0]); printf(CSOURCE "*******************************************************************\/\n"); printf(CSOURCE "uint32\_t to%s\_sp\(uint32\_t val\)\n", $_[0]); printf(CSOURCE "{\n"); $table_no = 1; for ($block = 1025 ; $block <= 17408 ; $block++) { # rising edge detection if ((($block_enable_sp[$block - 1] == 0) || ((($block - 1) & 0xF) == 0)) && ($block_enable_sp[$block] == 1)) { $block_start = $block; } # falling edge detection if (($block_enable_sp[$block] == 1) && ((($block - 1) & 0xF == 0xF) || ($block_enable_sp[$block + 1] == 0))) { $block_end = $block; $char_start = ($block_start -1)* 64; $char_end = ($block_end * 64) -1; printf(CHEADER "static const u\_int32\_t %s\_table\_sp\_%d\[%d\] \= \{\n", $_[0], $table_no, $char_end - $char_start +1); for ($char = $char_start ; $char <= $char_end ; $char++) { printf(CHEADER " 0x%08X, /*0x%08X*/ /*U\+%06X*/ /*U\+%06X*/ /*%s*/\n", $table_sp[$char][0], $table_sp[$char][1], $table_sp[$char][2], $table_sp[$char][3], $table_sp[$char][4] ); } printf(CHEADER "\}\;\n"); printf(CHEADER "\n"); printf(CSOURCE " if \( val \>\= 0x%08X \&\& val \<\= 0x%08X)\n", $table_sp[$char_start][1], $table_sp[$char_end][1]); printf(CSOURCE " return %s\_table\_sp\_%d\[val-0x%08X\]\;\n", $_[0], $table_no, $table_sp[$char_start][1]); printf(CSOURCE "\n"); $table_no++; } } printf(CSOURCE "\treturn \(val\)\;\n"); printf(CSOURCE "\}\n"); printf(CSOURCE "\n"); } # EOF netatalk-2.2.2/contrib/shell_utils/lp2pap.sh.tmpl0000755000175200017500000000022411655731126016747 00000000000000#!/bin/sh # pap script for lp systems chdir "/etc/lp/printers/`basename $0`" if [ -r "$6" ]; then :BINDIR:/pap -E "$6" exit $? fi exit 2 netatalk-2.2.2/contrib/shell_utils/apple_dump.in0000755000175200017500000005501711655731243016732 00000000000000#!@PERL@ # # AppleSingle/AppleDouble dump # # (c) 2009-2010 by HAT # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # # References: # # Applesingle and AppleDouble format internals (version 1) # http://users.phg-online.de/tk/netatalk/doc/Apple/v1/ # # AppleSingle/AppleDouble Formats for Foreign Files Developer's Note (version2) # http://users.phg-online.de/tk/netatalk/doc/Apple/v2/AppleSingle_AppleDouble.pdf # # Inside Macintosh: Macintosh Toolbox Essentials / # Chapter 7 - Finder Interface / Finder Interface Reference # http://developer.apple.com/legacy/mac/library/documentation/mac/toolbox/Toolbox-463.html # # Finder Interface Reference # http://developer.apple.com/legacy/mac/library/documentation/Carbon/Reference/Finder_Interface/Reference/reference.html # # Technical Note TN1150 HFS Plus Volume Format # http://developer.apple.com/mac/library/technotes/tn/tn1150.html#FinderInfo # # CarbonHeaders source # http://www.opensource.apple.com/source/CarbonHeaders/CarbonHeaders-8A428/Finder.h # http://www.opensource.apple.com/source/CarbonHeaders/CarbonHeaders-9A581/Finder.h # # Xcode 3.2.1 # /usr/bin/SetFile # /usr/bin/GetFileInfo # # Mac OS X 10.6.2 kernel source # http://www.opensource.apple.com/source/xnu/xnu-1486.2.11/bsd/vfs/vfs_xattr.c # use File::Basename; use File::Spec; use bigint; # require perl >= 5.8 # parse command line ----------------------------------------------- $finderinfo = 0; # 0: unknown 1: file 2: directory while ($arg = shift @ARGV) { if ($arg =~ /^(-h|-help|--help)$/ ) { printf ("usage: %s [-a] FILE|DIR\n" ,basename($0)); printf (" or: %s -f FILE\n" ,basename($0)); printf (" or: %s -d FILE\n" ,basename($0)); printf (" or: %s -h|-help|--help\n" ,basename($0)); printf (" or: %s -v|-version|--version\n" ,basename($0)); printf ("Dump AppleSingle/AppleDouble format file.\n"); printf ("\n"); printf (" -a (default) Dump a AppleSingle/AppleDouble file for FILE or DIR\n"); printf (" automatically.\n"); printf (" Extrapolate FinderInfo type from absolute path.\n"); printf (" If FILE is not AppleSingle/AppleDouble format,\n"); printf (" look for '.AppleDouble/FILE' and '._FILE'.\n"); printf (" If DIR, look for 'DIR/.AppleDouble/.Parent' and '._DIR'.\n"); printf (" -f Dump FILE. Assume FinderInfo to be FileInfo.\n"); printf (" -d Dump FILE. Assume FinderInfo to be DirInfo.\n"); printf (" -h,-help,--help Display this help and exit\n"); printf (" -v,-version,--version Show version and exit\n"); printf ("\n"); printf ("There is no way to detect whether FinderInfo is FileInfo or DirInfo.\n"); printf ("By default, %s examins whether file or directory,\n" ,basename($0)); printf ("a parent directory is .AppleDouble, filename is ._*, filename is .Parent,\n"); printf ("and so on.\n"); printf ("If setting option -f or -d, %s assume FinderInfo and doesn't look for\n"); printf ("another file.\n"); exit 1; } elsif ($arg =~ /^(-v|-version|--version)$/ ) { printf ("%s \(Netatalk @NETATALK_VERSION@\)\n", basename($0)); exit 1; } elsif ($arg eq "-a") { $finderinfo = 0; } elsif ($arg eq "-f") { $finderinfo = 1; } elsif ($arg eq "-d") { $finderinfo = 2; } elsif ($arg =~ /^-/) { printf (STDERR "%s: invalid option %s\n", basename($0), $arg); printf (STDERR "Try \`%s\ -h' for more information.\n", basename($0)); exit 1; } else { $afile = $arg; } } if (!($afile)) { printf (STDERR "missing file operand.\n"); exit 1; } if (!( -e $afile)) { printf (STDERR "\"%s\" not found.\n", $afile); exit 1; } # detect FinderInfo, and search AppleSingle/AppleDouble file -------------- $abspath = File::Spec->rel2abs($afile); ($basename, $path, $ext) = fileparse($abspath); if ( $finderinfo != 0 ) { ; } elsif ( -f $afile ) { if ( $basename eq ".Parent") { $finderinfo = 2; } elsif ( $path =~ /\/.AppleDouble\/$/ ) { $finderinfo =1; } elsif ( $basename =~ /^._/ ) { if ( -f $path.substr($basename, 2) ) { $finderinfo =1; } elsif ( -d $path.substr($basename, 2) ) { $finderinfo =2; } } if (!open(INFILE, "<$afile")) { printf (STDERR "cannot open %s\n", $afile); exit 1; } read(INFILE,$buf,4); $val = unpack("N", $buf ); close(INFILE); if ($val == 0x00051600 || $val == 0x00051607) { ; } else { printf ("\"%s\" is not AppleSingle/AppleDouble format.\n", $afile); $finderinfo = 1; $netatalkfile = $path.".AppleDouble/".$basename; $osxfile = $path."._".$basename; if (( -e $netatalkfile ) && !( -e $osxfile )) { $afile = $netatalkfile; } elsif (!( -e $netatalkfile ) && ( -e $osxfile )) { $afile = $osxfile; } elsif (( -e $netatalkfile ) && ( -e $osxfile )) { printf ("\"%s\" found.\n", $netatalkfile); printf ("\"%s\" found.\n", $osxfile); printf ("Specify which of file.\n"); exit 1; } else { printf ("\"%s\" not found.\n", $netatalkfile); printf ("\"%s\" not found.\n", $osxfile); exit 1; } } } elsif ( -d $afile) { printf ("\"%s\" is a directory.\n", $afile); $finderinfo =2; $netatalkfile = $path.$basename."/.AppleDouble/.Parent"; $osxfile = $path."._".$basename; if (( -e $netatalkfile ) && !( -e $osxfile )) { $afile = $netatalkfile; } elsif (!( -e $netatalkfile ) && ( -e $osxfile )) { $afile = $osxfile; } elsif (( -e $netatalkfile ) && ( -e $osxfile )) { printf ("\"%s\" found.\n", $netatalkfile); printf ("\"%s\" found.\n", $osxfile); printf ("Specify which of file.\n"); exit 1; } else { printf ("\"%s\" not found.\n", $netatalkfile); printf ("\"%s\" not found.\n", $osxfile); exit 1; } } else { printf (STDERR "unknown error: %s\n", $afile); exit 1; } if (!open(INFILE, "<$afile")) { printf (STDERR "cannot open %s\n", $afile); exit 1; } printf ("%s:\n\n", $afile); # Magic Number ----------------------------------------------- print "-------------------------------------------------------------------------------\n"; read(INFILE,$buf,4); $val = unpack("N", $buf ); printf("MagicNumber: %08X", $val); if ( $val == 0x00051600 ) { printf(" : AppleSingle"); } elsif ( $val == 0x00051607 ) { printf(" : AppleDouble"); } else { printf(" : Unknown" ); } print "\n"; # Version Number --------------------------------------------- read(INFILE,$buf,4); $version = unpack("N", $buf ); printf("Version : %08X", $version); if ( $version == 0x00010000 ) { printf(" : Version 1"); } elsif ( $version == 0x00020000 ) { printf(" : Version 2"); } else { printf(" : Unknown" ); } print "\n"; # v1:Home file system / v2:Filler ---------------------------- read(INFILE,$buf,16); if ( $version == 0x00010000 ) { print "HomeFileSys:"; } else { print "Filler :"; } hexdump($buf, 16, 16, " "); # Number of entities ----------------------------------------- read(INFILE,$buf,2); $entnum = unpack("n", $buf ); printf("Num. of ent: %04X ", $entnum); printf(" : %d", $entnum); print "\n"; # data ------------------------------------------------------- for ( $num = 0 ; $num < $entnum ; $num++) { seek(INFILE, ($num * 12 + 26), 0); # Entry --------------------------------------------------- read(INFILE,$buf,4); $entid = unpack("N", $buf ); print "\n-------------------------------------------------------------------------------\n"; printf("Entry ID : %08X", $entid); if ( $entid == 1 ) { printf(" : Data Fork"); } elsif ( $entid == 2 ) { printf(" : Resource Fork"); } elsif ( $entid == 3 ) { printf(" : Real Name"); } elsif ( $entid == 4 ) { printf(" : Comment"); } elsif ( $entid == 5 ) { printf(" : Icon, B&W"); } elsif ( $entid == 6 ) { printf(" : Icon Color"); } elsif ( $entid == 7 ) { printf(" : File Info"); } elsif ( $entid == 8 ) { printf(" : File Dates Info"); } elsif ( $entid == 9 ) { printf(" : Finder Info"); } elsif ( $entid == 10 ) { printf(" : Macintosh File Info"); } elsif ( $entid == 11 ) { printf(" : ProDOS File Info"); } elsif ( $entid == 12 ) { printf(" : MS-DOS File Info"); } elsif ( $entid == 13 ) { printf(" : Short Name"); } elsif ( $entid == 14 ) { printf(" : AFP File Info"); } elsif ( $entid == 15 ) { printf(" : Directory ID"); } elsif ( $entid == 0x8053567E ) { printf(" : CNID (Netatalk Extended)"); } elsif ( $entid == 0x8053594E ) { printf(" : DB stamp (Netatalk Extended)"); } elsif ( $entid == 0x80444556 ) { printf(" : dev (Netatalk Extended)"); } elsif ( $entid == 0x80494E4F ) { printf(" : inode (Netatalk Extended)"); } else { printf(" : Unknown"); } print "\n"; # Offset ------------------------------------------------- read(INFILE,$buf,4); $ofst = unpack("N", $buf ); printf("Offset : %08X", $ofst); printf(" : %d ", $ofst); # Length ------------------------------------------------- read(INFILE,$buf,4); $len = unpack("N", $buf ); printf("\nLength : %08X", $len); printf(" : %d", $len); $quo = $len >> 4; $rem = $len & 0xF; print "\n"; # Dump for each Entry ID -------------------------------- # if ( $entid == 1 ) { ; } # Data Fork # if ( $entid == 2 ) { ; } # Resource Fork # if ( $entid == 3 ) { ; } # Real Name # if ( $entid == 4 ) { ; } # Comment # if ( $entid == 5 ) { ; } # Icon, B&W # if ( $entid == 6 ) { ; } # Icon Color # if ( $entid == 7 ) { ; } # File Info if ( $entid == 8 ) { filedatesdump($ofst,$len); } elsif ( $entid == 9 ) { finderinfodump($ofst,$len); } # if ( $entid == 10 ) { ; } # Macintosh File Info # if ( $entid == 11 ) { ; } # ProDOS File Info # if ( $entid == 12 ) { ; } # MS-DOS File Info # if ( $entid == 13 ) { ; } # Short Name # if ( $entid == 14 ) { ; } # AFP File Info elsif ( $entid == 15 ) { print "\n"; bedump($ofst,$len); } # Directory ID elsif ( $entid == 0x8053567E ) { print "\n"; bedump($ofst,$len); } # CNID (Netatalk Extended) elsif ( $entid == 0x8053594E ) { print "\n"; bedump($ofst,$len); ledump($ofst,$len); } # DB stamp (Netatalk Extended) elsif ( $entid == 0x80444556 ) { print "\n"; bedump($ofst,$len); ledump($ofst,$len); } # dev (Netatalk Extended) elsif ( $entid == 0x80494E4F ) { print "\n"; bedump($ofst,$len); ledump($ofst,$len); } # inode (Netatalk Extended) # RAW Dump --------------------------------------------------- if ( ($quo > 0) || ($rem > 0)) { print "\n"; print "-RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)\n"; } seek(INFILE, $ofst, 0); rawdump($quo, $rem); } close(INFILE); exit 0; #sub ----------------------------------------------------------- sub filedatesdump { my ($ofst, $len) = @_; my ($datedata); my ($i); my ($datestr); @datetype =('create ', 'modify ', 'backup ', 'access '); seek(INFILE, $ofst, 0); print "\n"; printf ("-DATE------: : (GMT) : (Local)\n"); for ( $i = 0 ; $i < 4 ; $i++) { read(INFILE,$buf,4); $datedata = unpack("N", $buf ); if ($datedata < 0x80000000) { $datestr = gmtime( $datedata + 946684800) ." : " .localtime( $datedata + 946684800); } elsif ($datedata == 0x80000000) { $datestr = "Unknown or Initial"; } else { $datestr = gmtime( $datedata - 3348282496) ." : " .localtime( $datedata - 3348282496); } printf ("%s : %08X : %s\n",$datetype[$i], $datedata, $datestr); } } sub finderinfodump { my ($ofst, $len) = @_; seek(INFILE, $ofst, 0); if ($finderinfo == 0) { print "\n"; print "-NOTE------: cannot detect whether FInfo or DInfo. assume FInfo.\n"; } if ($finderinfo == 0 || $finderinfo == 1) { filefinderinfodump(); } elsif ($finderinfo == 2) { dirfinderinfodump(); } else { print STDERR "unknown FinderInfo type\n" } if ($len > 32) { eadump(); } } sub filefinderinfodump { print "\n"; print "-FInfo-----:\n"; read(INFILE,$buf,4); print "Type : "; hexdump($buf, 4, 4, ""); read(INFILE,$buf,4); print "Creator : "; hexdump($buf, 4, 4, ""); flagsdump(); read(INFILE,$buf,2); $val = unpack("n", $buf ); printf("Location v : %04X", $val); printf(" : %d\n", $val>0x7FFF?$val-0x10000:$val); read(INFILE,$buf,2); $val = unpack("n", $buf ); printf("Location h : %04X", $val); printf(" : %d\n", $val>0x7FFF?$val-0x10000:$val); read(INFILE,$buf,2); print "Fldr : "; hexdump($buf, 2, 4, ""); print "\n"; print "-FXInfo----:\n"; read(INFILE,$buf,2); $val = unpack("n", $buf ); printf("Rsvd|IconID: %04X", $val); printf(" : %d\n", $val>0x7FFF?$val-0x10000:$val); read(INFILE,$buf,2); print "Rsvd : "; hexdump($buf, 2, 4, ""); read(INFILE,$buf,2); print "Rsvd : "; hexdump($buf, 2, 4, ""); read(INFILE,$buf,2); print "Rsvd : "; hexdump($buf, 2, 4, ""); xflagsdump(); read(INFILE,$buf,2); $val = unpack("n", $buf ); printf("Rsvd|commnt: %04X", $val); printf(" : %d\n", $val>0x7FFF?$val-0x10000:$val); read(INFILE,$buf,4); $val = unpack("N", $buf ); printf("PutAway : %08X", $val); printf(" : %d\n", $val>0x7FFFFFFF?$val-0x100000000:$val); # Why SInt32? } sub dirfinderinfodump { print "\n"; print "-DInfo-----:\n"; read(INFILE,$buf,2); $val = unpack("n", $buf ); printf("Rect top : %04X", $val); printf(" : %d\n", $val>0x7FFF?$val-0x10000:$val); read(INFILE,$buf,2); $val = unpack("n", $buf ); printf("Rect left : %04X", $val); printf(" : %d\n", $val>0x7FFF?$val-0x10000:$val); read(INFILE,$buf,2); $val = unpack("n", $buf ); printf("Rect bottom: %04X", $val); printf(" : %d\n", $val>0x7FFF?$val-0x10000:$val); read(INFILE,$buf,2); $val = unpack("n", $buf ); printf("Rect right : %04X", $val); printf(" : %d\n", $val>0x7FFF?$val-0x10000:$val); flagsdump(); read(INFILE,$buf,2); $val = unpack("n", $buf ); printf("Location v : %04X", $val); printf(" : %d\n", $val>0x7FFF?$val-0x10000:$val); read(INFILE,$buf,2); $val = unpack("n", $buf ); printf("Location h : %04X", $val); printf(" : %d\n", $val>0x7FFF?$val-0x10000:$val); read(INFILE,$buf,2); print "View : "; hexdump($buf, 2, 4, ""); print "\n"; print "-DXInfo----:\n"; read(INFILE,$buf,2); $val = unpack("n", $buf ); printf("Scroll v : %04X", $val); printf(" : %d\n", $val>0x7FFF?$val-0x10000:$val); read(INFILE,$buf,2); $val = unpack("n", $buf ); printf("Scroll h : %04X", $val); printf(" : %d\n", $val>0x7FFF?$val-0x10000:$val); read(INFILE,$buf,4); $val = unpack("N", $buf ); printf("Rsvd|OpnChn: %08X", $val); printf(" : %d\n", $val>0x7FFFFFFF?$val-0x100000000:$val); # Why SInt32? xflagsdump(); read(INFILE,$buf,2); print "Comment : "; hexdump($buf, 2, 4, ""); read(INFILE,$buf,4); $val = unpack("N", $buf ); printf("PutAway : %08X", $val); printf(" : %d\n", $val>0x7FFFFFFF?$val-0x100000000:$val); # Why SInt32? } sub flagsdump { @colortype =('none', 'gray', 'green', 'purple', 'blue', 'yellow', 'red', 'orange'); read(INFILE,$buf,2); $flags = unpack("n", $buf ); printf ("isAlias : %d\n", ($flags >> 15) & 1); printf ("Invisible : %d\n", ($flags >> 14) & 1); printf ("hasBundle : %d\n", ($flags >> 13) & 1); printf ("nameLocked : %d\n", ($flags >> 12) & 1); printf ("Stationery : %d\n", ($flags >> 11) & 1); printf ("CustomIcon : %d\n", ($flags >> 10) & 1); printf ("Reserved : %d\n", ($flags >> 9) & 1); printf ("Inited : %d\n", ($flags >> 8) & 1); printf ("NoINITS : %d\n", ($flags >> 7) & 1); printf ("Shared : %d\n", ($flags >> 6) & 1); printf ("SwitchLaunc: %d\n", ($flags >> 5) & 1); printf ("Hidden Ext : %d\n", ($flags >> 4) & 1); printf ("color : %d%d%d : %s\n", ($flags >> 3) & 1, ($flags >> 2) & 1, ($flags >> 1) & 1, @colortype[($flags & 0xE)>>1]); printf ("isOnDesk : %d\n", ($flags >> 0) & 1); } sub xflagsdump { read(INFILE,$buf,2); $flags = unpack("n", $buf ); if (($flags >> 15) == 1) { print "Script : "; hexdump($buf, 1, 4, ""); } else { printf ("AreInvalid : %d\n", ($flags >> 15) & 1); printf ("unknown bit: %d\n", ($flags >> 14) & 1); printf ("unknown bit: %d\n", ($flags >> 13) & 1); printf ("unknown bit: %d\n", ($flags >> 12) & 1); printf ("unknown bit: %d\n", ($flags >> 11) & 1); printf ("unknown bit: %d\n", ($flags >> 10) & 1); printf ("unknown bit: %d\n", ($flags >> 9) & 1); } printf ("CustomBadge: %d\n", ($flags >> 8) & 1); printf ("ObjctIsBusy: %d\n", ($flags >> 7) & 1); printf ("unknown bit: %d\n", ($flags >> 6) & 1); printf ("unknown bit: %d\n", ($flags >> 5) & 1); printf ("unknown bit: %d\n", ($flags >> 4) & 1); printf ("unknown bit: %d\n", ($flags >> 3) & 1); printf ("RoutingInfo: %d\n", ($flags >> 2) & 1); printf ("unknown bit: %d\n", ($flags >> 1) & 1); printf ("unknown bit: %d\n", ($flags >> 0) & 1); } sub eadump { print "\n"; print "-EA--------:\n"; read(INFILE,$buf,2); print "pad : "; hexdump($buf, 2, 4, ""); read(INFILE,$buf,4); print "magic : "; hexdump($buf, 4, 4, ""); read(INFILE,$buf,4); $ea_debug_tag = unpack("N", $buf ); printf("debug_tag : %08X", $ea_debug_tag); printf(" : %d\n", $ea_debug_tag); read(INFILE,$buf,4); $ea_total_size = unpack("N", $buf ); printf("total_size : %08X", $ea_total_size); printf(" : %d\n", $ea_total_size); read(INFILE,$buf,4); $ea_data_start = unpack("N", $buf ); printf("data_start : %08X", $ea_data_start); printf(" : %d\n", $ea_data_start); read(INFILE,$buf,4); $ea_data_length = unpack("N", $buf ); printf("data_length: %08X", $ea_data_length); printf(" : %d\n", $ea_data_length); read(INFILE,$buf,4); print "reserved[0]: "; hexdump($buf, 4, 4, ""); read(INFILE,$buf,4); print "reserved[1]: "; hexdump($buf, 4, 4, ""); read(INFILE,$buf,4); print "reserved[2]: "; hexdump($buf, 4, 4, ""); read(INFILE,$buf,2); print "flags : "; hexdump($buf, 2, 4, ""); read(INFILE,$buf,2); $ea_num_attrs = unpack("n", $buf ); printf("num_attrs : %04X", $ea_num_attrs); printf(" : %d\n", $ea_num_attrs); $pos = tell(INFILE); for ($i = 0 ; $i < $ea_num_attrs ; $i++) { $pos = (($pos & 0x3) == 0) ? ($pos) : ((($pos >> 2) + 1) << 2); seek(INFILE, $pos, 0); print "-EA ENTRY--:\n"; read(INFILE,$buf,4); $ea_offset = unpack("N", $buf ); printf("offset : %08X", $ea_offset); printf(" : %d\n", $ea_offset); read(INFILE,$buf,4); $ea_length = unpack("N", $buf ); printf("length : %08X", $ea_length); printf(" : %d\n", $ea_length); read(INFILE,$buf,2); print "flags : "; hexdump($buf, 2, 4, ""); read(INFILE,$buf,1); $ea_namelen = unpack("C", $buf ); printf("namelen : %02X", $ea_namelen); printf(" : %d\n", $ea_namelen); $ea_namequo = $ea_namelen >> 4; $ea_namerem = $ea_namelen & 0xF; print "-EA NAME---: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)\n"; rawdump($ea_namequo, $ea_namerem); $pos = tell(INFILE); seek(INFILE, $ea_offset, 0); $ea_quo = $ea_length >> 4; $ea_rem = $ea_length & 0xF; print "-EA VALUE--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)\n"; rawdump($ea_quo, $ea_rem); } } sub bedump { my ($ofst, $len) = @_; my ($i); my ($value); seek(INFILE, $ofst, 0); printf("%2dbit-BE : ", $len * 8 ); $value = 0; for ( $i=0 ; $i < $len ; $i++ ) { read(INFILE,$buf,1); $bytedata[$i] = unpack("C", $buf ); $value += $bytedata[$i] << (($len - $i -1) * 8) ; } for ( $i=0 ; $i < $len ; $i++ ) { printf("%02X", $bytedata[$i]); } printf(" : %s", $value); print "\n"; } sub ledump { my ($ofst, $len) = @_; my ($i); my ($value); seek(INFILE, $ofst, 0); printf("%2dbit-LE : ", $len * 8 ); $value = 0; for ( $i=0 ; $i < $len ; $i++ ) { read(INFILE,$buf,1); $bytedata[$len - $i - 1] = unpack("C", $buf ); $value += $bytedata[$len - $i -1] << ($i * 8) ; } for ( $i=0 ; $i < $len ; $i++ ) { printf("%02X", $bytedata[$i]); } printf(" : %s", $value); print "\n"; } sub rawdump { my ($quo, $rem) = @_; my ($addrs, $line, $buf); $addrs = 0; for ( $line = 0 ; $line < $quo ; $line++) { read(INFILE, $buf, 16); printf ( "%08X :", $addrs); hexdump($buf, 16, 16, " "); $addrs = $addrs + 0x10; } if ( $rem != 0 ) { read(INFILE, $buf, $rem); printf ( "%08X :", $addrs); hexdump($buf, $rem, 16, " "); } } sub hexdump { my ($buf, $len, $col, $delimit) = @_; my ($i); $hexstr = ""; $ascstr = ""; for ( $i=0 ; $i < $len ; $i++ ) { $val = substr($buf, $i, 1); $ascval = ord($val); $hexstr .= sprintf("%s%02X", $delimit, $ascval); if (($ascval < 32) || ( $ascval > 126 )) { $val = "."; } $ascstr .= $val; } for ( ; $i < $col ; $i++) { $hexstr .= " ".$delimit; $ascstr .= " "; } printf("%s : %s", $hexstr,$ascstr); print "\n"; } #EOF netatalk-2.2.2/contrib/shell_utils/asip-status.pl.in0000755000175200017500000003234411655731243017471 00000000000000#!@PERL@ # # asip-status - send DSIGetStatus to an AppleShare IP file server (aka # ASIP, aka AFP over TCP port 548). A returned UAM of # "No User Authen" means that the server supports guest access. # # author: James W. Abendschan # license: GPL - http://www.gnu.org/copyleft/gpl.html # url: http://www.jammed.com/~jwa/hacks/security/asip/ # Date: 7 May 1997 (v1.0) - original version # see also: # - http://developer.apple.com/techpubs/macos8/NetworkCommSvcs/AppleShare/ # - http://www2.opendoor.com/asip/ (excellent Mac sharing / security site) # # todo: log in as guest & get a list of shares # # # This edition is a part of netatalk @NETATALK_VERSION@. # use strict; use IO::Socket; # sucks because Timeout doesn't my ($arg); my ($hostport); my ($host); my ($port); while ($arg = shift @ARGV) { $main::show_icon = 1 if ($arg eq "-i"); $main::debug = 1 if ($arg eq "-d"); $main::hexdump = 1 if ($arg eq "-x"); $main::showver = 1 if ($arg eq "-v"); $main::showver = 1 if ($arg eq "-version"); $main::showver = 1 if ($arg eq "--version"); $hostport = $arg if ($arg !~ /^-/); } if ($main::showver ==1) { print "$0\n"; print "Original edition: 7 May 1997 \(v1.0\) James W. Abendschan\n"; print "This edition is a part of Netatalk @NETATALK_VERSION@\n"; exit(-1); } if ($hostport eq "") { print "usage: $0 [-d] [-i] [-x] hostname[:port]\n"; print " $0 -v|-version|--version\n"; print "Queries AFP servers for their capabilities.\n"; print " -d: Enable debug output.\n"; print " -i: Show icon if it exists.\n"; print " -x: Enable hex dump output.\n"; print " -v,-version,--version: Show version.\n"; exit(-1); } ($host, $port) = split(/\:/, $hostport); $port = "548" if ($port eq ""); my ($packet) = build_packet(); my ($code) = sendpacket($host, $port, $packet); exit $code; sub build_packet { my (@packet) = ( 0x00, # 0- request, 1-reply 0x03, # 3- DSIGetStatus 0xde, 0xad, 0x00, # request ID 0x00, 0x00, 0x00, 0x00, # data field 0x00, 0x00, 0x00, 0x00, # length of data stream header 0x00, 0x00, 0x00, 0x00 # reserved ); my ($packet) = pack("C*", @packet); return $packet; } sub sendpacket { my ($host, $port, $packet) = @_; my ($b, $buf); print "opening $host:$port\n" if ($main::debug); my ($asip_sock) = IO::Socket::INET->new( PeerAddr => $host, PeerPort => $port, Proto => 'tcp', Type => SOCK_STREAM, Timeout => 10 ) || die "connect to $host failure: $!"; $asip_sock->autoflush(1); print "sending packet\n" if ($main::debug); my ($count) = syswrite($asip_sock, $packet, length($packet)); if ($count != length($packet)) { print "only wrote $count of " . length($packet) . " bytes?\n"; exit(-1); } # reply can span multiple packets print "sysread: " if ($main::debug); while (sysread($asip_sock, $b, 256)) { $buf .= $b; print "." if ($main::debug); } close ($asip_sock); print " read " . length($buf) . " bytes\n" if ($main::debug); if (length($buf) == 0) { print "empty reply packet?\n"; return -2; } else { print "AFP reply from $host:$port\n"; return (parse_packet($buf)); } } sub parse_packet { my ($buf) = shift @_; my (@packet); my ($i); hexdump($buf) if ($main::hexdump); for ($i=0;$i 0) && ($cmd == 3)) { my (@AFPpacket) = @packet[($edo+16)..($edo+16+$datalen)]; return (parse_FPGetSrvrInfo(@AFPpacket)); } else { print "I don't know how to parse this type of packet.\n"; return(2); } } sub parse_FPGetSrvrInfo() { my (@packet) = @_; my ($i); my ($machinetype_offset) = unpack("n", @packet[0] . @packet[1]); print "Machine type offset in packet: $machinetype_offset\n" if ($main::debug); my ($machinetype) = extract(1, $machinetype_offset, @packet); print "Machine type: $machinetype\n"; my ($afpversioncount_offset) = unpack("n", @packet[2] . @packet[3]); print "AFPversion count offset: $afpversioncount_offset\n" if ($main::debug); my (@afpversions) = extract(0, $afpversioncount_offset, @packet); print "AFP versions: " . join(",", @afpversions) . "\n"; my ($uamcount_offset) = unpack("n", @packet[4] . @packet[5]); print "UAMcount offset: $uamcount_offset\n" if ($main::debug); my (@uams) = extract(0, $uamcount_offset, @packet); print "UAMs: " . join(",", @uams) . "\n"; my ($allow_guest) = 0; $allow_guest = 1 if (grep(/No User Authen/, @uams)); # it would be cute to see the icon. my ($icon_offset) = unpack("n", @packet[6] . @packet[7]); print "Volume Icon & Mask offset: $icon_offset\n" if ($main::debug); print "Volume Icon & Mask: exist\n" if ($icon_offset); my ($flags) = unpack("n", @packet[8] . @packet[9]); my (@flags) = parse_afp_flags($flags); print "Flags: "; print "$flags - " if ($main::debug); print join(",", @flags) . "\n"; # server name starts at offset+10, length byte first. my ($servername_len) = unpack("C1", @packet[10]); my ($servername) = join("", @packet[11..(11+$servername_len-1)]); print "Server name length: $servername_len\n" if ($main::debug); print "Server name: $servername\n"; my ($offset) = 11 + $servername_len; # quietly ++ the $offset to account for the padding that happens # in the reply packet if the field names don't align on an even boundary $offset++ if ($servername_len % 2 == 0); print "New offset: $offset\n" if ($main::debug); my ($signature_offset) = unpack("n2", @packet[$offset] . @packet[$offset+1]); print "Signature offset: $signature_offset\n" if ($main::debug); if ($signature_offset) { my ($signature) = join("", @packet[$signature_offset..$signature_offset+15]); print "Signature:\n"; hexdump($signature); } my ($network_address_count_offset) = unpack("n2", @packet[$offset+2] . @packet[$offset+3]); print "Network address count offset: $network_address_count_offset\n" if ($main::debug); extract_network_address($network_address_count_offset, @packet); $offset += 4; if ($flags & (1<<8)) { # Supports directory services my ($directory_service_offset) = unpack("n2", @packet[$offset] . @packet[$offset+1]); print "Directory service offset: $directory_service_offset\n" if ($main::debug); if ($directory_service_offset) { my (@dirsvcs) = extract(0, $directory_service_offset, @packet); while (@dirsvcs) { printf "Directory Service: %s\n", shift @dirsvcs; } } $offset +=2; } if ($flags & (1<<9)) { # Supports UTF8 servername my ($utf8_name_offset) = unpack("n2", @packet[$offset] . @packet[$offset+1]); print "UTF8 name offset: $utf8_name_offset\n" if ($main::debug); if ($utf8_name_offset) { my ($utf8name) = extract(1, $utf8_name_offset+1, @packet); print "UTF8 Servername: $utf8name\n"; } } draw_icon($icon_offset, @packet) if ($main::show_icon && $icon_offset); return $allow_guest; } # getsrvbyname .. sorta .. sub getasipsrv { my ($what, $code) = @_; if ($what eq "flags") { return "Request" if ($code == 0); return "Reply" if ($code == 1); } if ($what eq "command") { return "DSICloseSession" if ($code == 1); return "DSICommand" if ($code == 2); return "DSIGetStatus" if ($code == 3); return "DSIOpenSession" if ($code == 4); return "DSITickle" if ($code == 5); return "DSIWrite" if ($code == 6); return "DSIAttention" if ($code == 7); } return "[$what/$code] unknown"; } # return "counted" data at @packet[$offset] # when called with a zero as the first argument, this will # look in the packet for the count. Otherwise, it will # assume I know what I'm doing. (hah, what a foolish function..) sub extract { my ($count, $offset, @packet) = @_; my ($i, $j); my (@items, $data); my ($hack); if ($count == 0) { ($count) = unpack("C", @packet[$offset]); return if ($count == 0); $offset++; } else { $hack = 1; } #print ">> extracting $count items from offset $offset\n"; for ($i=0;$i<$count;$i++) { #print "Working on count $i\n"; my ($len) = unpack("C1", @packet[$offset]); $data = join("", @packet[$offset+1..$offset+$len]); #print "$i. [$data] ($len)\n"; push (@items, $data); $offset = $offset + $len + 1; #print "new offset is $offset\n"; } return $data if ($hack); return @items; } sub draw_icon { my ($offset, @packet) = @_; my ($cols); my ($i, $j); # icons are 32x32 bitmaps; 128 byte icon + 128 byte mask # to show the mask, change 128 to 256. for ($i=0;$i<128;$i++) { my ($c) = @packet[$i+$offset]; my ($bin) = unpack ("B*", $c); for ($j=0;$j<8;$j++) { if (substr($bin, $j, 1)) { print "#"; } else { print " "; } } $cols++; if ($cols == 4) { $cols = 0; print "\n"; } } print "\n"; } sub parse_afp_flags { my ($flags) = shift @_; my (@flags); # $flags is a 16 bit little-endian number push (@flags, "SupportsCopyFile") if ($flags & (1<<0)); push (@flags, "SupportsChgPwd") if ($flags & (1<<1)); push (@flags, "DontAllowSavePwd") if ($flags & (1<<2)); push (@flags, "SupportsServerMessages") if ($flags & (1<<3)); push (@flags, "SupportsServerSignature") if ($flags & (1<<4)); push (@flags, "SupportsTCP/IP") if ($flags & (1<<5)); push (@flags, "SupportsSrvrNotifications") if ($flags & (1<<6)); push (@flags, "SupportsReconnect") if ($flags & (1<<7)); push (@flags, "SupportsOpenDirectory") if ($flags & (1<<8)); push (@flags, "SupportsUTF8Servername") if ($flags & (1<<9)); push (@flags, "SupportsUUIDs") if ($flags & (1<<10)); push (@flags, "SupportsSuperClient") if ($flags & (1<<15)); return @flags; } sub hexdump { my ($buf) = @_; my ($p, $c, $pc, $str); my ($i); for ($i=0;$i 31) && ($c < 127)) { $str .= $p; } else { $str .= "."; } if ($pc == 16) { print " $str\n"; undef $str; $pc = 0; } } print " " x (16 - $pc); print " $str \n"; } sub extract_network_address { my ($offset, @packet) = @_; my ($count); my ($i) = 0; my ($data); # get the number of addresses ($count) = unpack("C", @packet[$offset]); return if ($count == 0); $offset++; #print "\n>> extracting $count items from offset $offset\n"; for ($i=0;$i<$count;$i++) { #print "Working on count $i\n"; my ($len) = unpack("C1", @packet[$offset]); #printf "len: %u\n",$len; my ($type) = unpack("C1", @packet[$offset+1]); #printf "type: %u\n",$type; $data = join("", @packet[$offset+2..$offset+$len-1]); #print "$i. [$data] ($len)\n"; $offset = $offset + $len ; #print "new offset is $offset\n"; # 1st byte is 'tag' # 1 - IP address; 4 bytes # 2 - IP address (4) + port (2) # 3 - DDP (2 bytes net, 1 byte node, 1 byte socket) # 4 - DNS address # 5 - IP address (4) + port (2), for SSH tunnel # 6 - IPV6 address (16) # 7 - IPV6 address (16) + port (2) my (@nap) = unpack("C*", $data); if ($type == 1) { # quad my ($ip) = sprintf "%d.%d.%d.%d (TCP/IP address)", $nap[0], $nap[1], @nap[2], @nap[3]; print "Network address: $ip\n"; } elsif ($type == 2) { # quad+port my ($ipport) = sprintf "%d.%d.%d.%d:%d", @nap[0], @nap[1], @nap[2], @nap[3], (@nap[4]*256 + @nap[5]); print "Network address: $ipport (TCP/IP address and port)\n"; } elsif ($type == 3) { printf "Network address: %d.%d (ddp address)\n", (@nap[0] * 256) + @nap[1], @nap[2]; } elsif ($type == 4) { print "Network address: $data (DNS address)\n"; } elsif ($type == 5) { # according to the specs this should be an IP address # however, OSX Server uses the FQDN instead print "Network address: $data (SSH tunnel address)\n"; } elsif ($type == 6 || $type == 7) { print "Network address: "; my ($j) = 0; for ( $j = 0; $j<=13; $j = $j+2) { printf("%.2x%.2x:", @nap[$j], @nap[$j+1]); } printf("%.2x%.2x", @nap[14], @nap[15]); if ($type == 7 ) { printf(":%d", (@nap[16]*256) + @nap[17]); print " (IPv6 address + port)\n"; } else { print " (IPv6 address)\n"; } } else { printf "unsupported address type: %u\n", $type; } } } netatalk-2.2.2/contrib/shell_utils/make-precompose.h.pl0000755000175200017500000001636111655731243020125 00000000000000#!/usr/bin/perl # # usage: make-precompose.h.pl UnicodeData.txt > precompose.h # # (c) 2008-2011 by HAT # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # See # http://www.unicode.org/Public/UNIDATA/UCD.html # http://www.unicode.org/reports/tr15/ # http://www.unicode.org/Public/*/ucd/UnicodeData*.txt # http://www.unicode.org/Public/UNIDATA/UnicodeData.txt # temp files for binary search (compose.TEMP, compose_sp.TEMP) ------------- open(UNICODEDATA, "<$ARGV[0]"); open(COMPOSE_TEMP, ">compose.TEMP"); open(COMPOSE_SP_TEMP, ">compose_sp.TEMP"); while () { chop; ( $code0, $Name1, $General_Category2, $Canonical_Combining_Class3, $Bidi_Class4, $Decomposition_Mapping5, $Numeric_Value6, $Numeric_Value7, $Numeric_Value8, $Bidi_Mirrored9, $Unicode_1_Name10, $ISO_Comment11, $Simple_Uppercase_Mapping12, $Simple_Lowercase_Mapping13, $Simple_Titlecase_Mapping14 ) = split(/\;/); if (($Decomposition_Mapping5 ne "") && ($Decomposition_Mapping5 !~ /\ 0xFFFF) { $code0_sp_hi = 0xD800 - (0x10000 >> 10) + (hex($code0) >> 10); $code0_sp_lo = 0xDC00 + (hex($code0) & 0x3FF); $base_sp_hi = 0xD800 - (0x10000 >> 10) + (hex($base) >> 10); $base_sp_lo = 0xDC00 + (hex($base) & 0x3FF); $comb_sp_hi = 0xD800 - (0x10000 >> 10) + (hex($comb) >> 10); $comb_sp_lo = 0xDC00 + (hex($comb) & 0x3FF); printf(COMPOSE_SP_TEMP "%s0x%04X%04X, 0x%04X%04X, 0x%04X%04X%s\/\* %s \*\/\n", $leftbracket, $code0_sp_hi ,$code0_sp_lo, $base_sp_hi, $base_sp_lo, $comb_sp_hi, $comb_sp_lo, $rightbracket, $Name1); $leftbracket = "\/\*{ "; $rightbracket =" },\*\/ "; } printf(COMPOSE_TEMP "%s0x%08X, 0x%08X, 0x%08X%s\/\* %s \*\/\n", $leftbracket, hex($code0), hex($base), hex($comb), $rightbracket, $Name1); } } close(UNICODEDATA); close(COMPOSE_TEMP); close(COMPOSE_SP_TEMP); # macros for BMP (PRECOMP_COUNT, DECOMP_COUNT, MAXCOMBLEN) ---------------- open(COMPOSE_TEMP, ") { if (m/^\/\*/) { next; } $comp_table[$comp_count][0] = substr($_, 4, 10); $comp_table[$comp_count][1] = substr($_, 16, 10); $comp_count++; } $maxcomblen = 2; # Hangul's maxcomblen is already 2. That is, VT. for ($i = 0 ; $i < $comp_count ; $i++) { $base = $comp_table[$i][1]; $comblen = 1; $j = 0; while ($j < $comp_count) { if ($base ne $comp_table[$j][0]) { $j++; next; } else { $comblen++; $base = $comp_table[$j][1]; $j = 0; } } $maxcomblen = ($maxcomblen > $comblen) ? $maxcomblen : $comblen; } close(COMPOSE_TEMP); # macros for SP (PRECOMP_SP_COUNT,DECOMP_SP_COUNT, MAXCOMBSPLEN) ----------- open(COMPOSE_SP_TEMP, ") { if (m/^\/\*/) { next; } $comp_sp_table[$comp_sp_count][0] = substr($_, 4, 10); $comp_sp_table[$comp_sp_count][1] = substr($_, 16, 10); $comp_sp_count++; } $maxcombsplen = 2; # one char have 2 codepoints, like a D8xx DCxx. for ($i = 0 ; $i < $comp_sp_count ; $i++) { $base_sp = $comp_sp_table[$i][1]; $comblen = 2; $j = 0; while ($j < $comp_sp_count) { if ($base_sp ne $comp_sp_table[$j][0]) { $j++; next; } else { $comblen += 2; $base_sp = $comp_sp_table[$j][1]; $j = 0; } } $maxcombsplen = ($maxcombsplen > $comblen) ? $maxcombsplen : $comblen; } close(COMPOSE_SP_TEMP); # macro for buffer length (COMBBUFLEN) ------------------------------------- $combbuflen = ($maxcomblen > $maxcombsplen) ? $maxcomblen : $maxcombsplen; # sort --------------------------------------------------------------------- system("sort -k 3 compose.TEMP \> precompose.SORT"); system("sort -k 2 compose.TEMP \> decompose.SORT"); system("sort -k 3 compose_sp.TEMP \> precompose_sp.SORT"); system("sort -k 2 compose_sp.TEMP \> decompose_sp.SORT"); # print ------------------------------------------------------------------- print ("\/\* DO NOT EDIT BY HAND\!\!\! \*\/\n"); print ("\/\* This file is generated by \*\/\n"); printf ("\/\* contrib/shell_utils/make-precompose.h.pl %s \*\/\n", $ARGV[0]); print ("\n"); printf ("\/\* %s is got from \*\/\n", $ARGV[0]); print ("\/\* http\:\/\/www.unicode.org\/Public\/UNIDATA\/UnicodeData.txt \*\/\n"); print ("\n"); print ("\#define SBASE 0xAC00\n"); print ("\#define LBASE 0x1100\n"); print ("\#define VBASE 0x1161\n"); print ("\#define TBASE 0x11A7\n"); print ("\#define LCOUNT 19\n"); print ("\#define VCOUNT 21\n"); print ("\#define TCOUNT 28\n"); print ("\#define NCOUNT 588 \/\* (VCOUNT \* TCOUNT) \*\/\n"); print ("\#define SCOUNT 11172 \/\* (LCOUNT \* NCOUNT) \*\/\n"); print ("\n"); printf ("\#define PRECOMP_COUNT %d\n", $comp_count); printf ("\#define DECOMP_COUNT %d\n", $comp_count); printf ("\#define MAXCOMBLEN %d\n", $maxcomblen); print ("\n"); printf ("\#define PRECOMP_SP_COUNT %d\n", $comp_sp_count); printf ("\#define DECOMP_SP_COUNT %d\n", $comp_sp_count); printf ("\#define MAXCOMBSPLEN %d\n", $maxcombsplen); print ("\n"); printf ("\#define COMBBUFLEN %d \/\* max\(MAXCOMBLEN\,MAXCOMBSPLEN\) \*\/\n", $combbuflen); print ("\n"); print ("static const struct \{\n"); print (" unsigned int replacement\;\n"); print (" unsigned int base\;\n"); print (" unsigned int comb\;\n"); print ("\} precompositions\[\] \= \{\n"); system("cat precompose.SORT"); print ("\}\;\n"); print ("\n"); print ("static const struct \{\n"); print (" unsigned int replacement\;\n"); print (" unsigned int base\;\n"); print (" unsigned int comb\;\n"); print ("\} decompositions\[\] \= \{\n"); system("cat decompose.SORT"); print ("\}\;\n"); print ("\n"); print ("static const struct \{\n"); print (" unsigned int replacement_sp\;\n"); print (" unsigned int base_sp\;\n"); print (" unsigned int comb_sp\;\n"); print ("\} precompositions_sp\[\] \= \{\n"); system("cat precompose_sp.SORT"); print ("\}\;\n"); print ("\n"); print ("static const struct \{\n"); print (" unsigned int replacement_sp\;\n"); print (" unsigned int base_sp\;\n"); print (" unsigned int comb_sp\;\n"); print ("\} decompositions_sp\[\] \= \{\n"); system("cat decompose_sp.SORT"); print ("\}\;\n"); print ("\n"); print ("\/\* EOF \*\/\n"); # EOF netatalk-2.2.2/contrib/macusers/0000777000175200017500000000000011704770431013615 500000000000000netatalk-2.2.2/contrib/macusers/Makefile.am0000644000175200017500000000014311655731126015566 00000000000000# Makefile for contrib/macusers/ EXTRA_DIST = macusers.in README.macusers bin_SCRIPTS = macusers netatalk-2.2.2/contrib/macusers/Makefile.in0000644000175200017500000003054311703521724015601 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile for contrib/macusers/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = contrib/macusers DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/macusers.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = macusers am__installdirs = "$(DESTDIR)$(bindir)" binSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = macusers.in README.macusers bin_SCRIPTS = macusers all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/macusers/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/macusers/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh macusers: $(top_builddir)/config.status $(srcdir)/macusers.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binSCRIPTS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-binSCRIPTS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/contrib/macusers/README.macusers0000644000175200017500000000031611655731126016235 00000000000000This script is very similar to the nu script, but it shows more detailed information. However, since ps and lsof outputs vary, it may need some modifications to work in Unixes other than Red Hat linux. netatalk-2.2.2/contrib/macusers/macusers.in0000644000175200017500000001047411655731243015714 00000000000000#!@PERL@ use strict; use Socket; use File::Basename; use vars qw($MAC_PROCESS $PS_STR $MATCH_STR $ASIP_PORT_NO $ASIP_PORT $LSOF); # Written for linux; may have to be modified for your brand of Unix. # Support for FreeBSD added by Joe Clarke . # Support Solaris added by Frank Lahm . # Support has also been added for 16 character usernames. if ($ARGV[0] =~ /^(-v|-version|--version)$/ ) { printf ("%s \(Netatalk @NETATALK_VERSION@\)\n", basename($0)); exit(1); } elsif ($ARGV[0] =~ /^(-h|-help|--help)$/ ) { printf ("usage: %s \[-v|-version|--version|-h|-help|--help\]\n", basename($0)); printf ("Show users connecting via AFP\n"); exit(1); } $MAC_PROCESS = "afpd"; if ($^O eq "freebsd" || $^O eq "openbsd") { $PS_STR = "-awwxouser,pid,ppid,start,command"; $MATCH_STR = '(\w+)\s+(\d+)\s+(\d+)\s+([\d\w:]+)'; } elsif ($^O eq "solaris") { $PS_STR = "-eo user,pid,ppid,c,stime,tty,time,comm"; $MATCH_STR = '\s*(\w+)\s+(\d+)\s+(\d+)\s+\d+\s+([\d\w:]+)'; } else { $PS_STR = "-eo user:32,pid,ppid,c,stime,tty,time,cmd"; $MATCH_STR = '\s*(\w+)\s+(\d+)\s+(\d+)\s+\d+\s+([\d\w:]+)'; } $ASIP_PORT = "afpovertcp"; $ASIP_PORT_NO = 548; # Change to 0 if you don't have lsof $LSOF = 1; my %mac = (); if ($^O eq "freebsd") { open(SOCKSTAT, "sockstat -4 | grep $MAC_PROCESS | grep -v grep |"); while () { next if ($_ !~ /$MAC_PROCESS/); $_ =~ /\S+\s+\S+\s+(\d+)\s+\d+\s+[\w\d]+\s+[\d\.:]+\s+([\d\.]+)/; my ($pid, $addr, $host); $pid = $1; $addr = $2; $host = gethostbyaddr(pack('C4', split (/\./, $addr)), AF_INET); ($host) = ( $host =~ /(^(\d+\.){3}\d+|[\w\d\-]+)/ ); $mac{$pid} = $host; } print "PID UID Username Name Logintime Mac\n"; close(SOCKSTAT); } elsif ($^O eq "solaris") { if ($< != 0) { print "must be run as root\n"; exit(1); } print "PID UID Username Name Logintime Mac\n"; } elsif ($LSOF == 1) { open(LSOF, "lsof -i :$ASIP_PORT |"); while () { next if ($_ !~ /$ASIP_PORT/); $_ =~ /\w+\s+(\d+).*->([\w\.-]+).*/; my ($pid, $host); $pid = $1; $host = $2; ($host) = ( $host =~ /(^(\d+\.){3}\d+|[\w\d\-]+)/ ); $mac{$pid} = $host; } print "PID UID Username Name Logintime Mac\n"; close(LSOF); } else { print "PID UID Username Name Logintime\n"; } open(PS, "ps $PS_STR |") || die "Unable to open a pipe to ``ps''"; while () { next if ($_ !~ /$MAC_PROCESS/); my ($user, $pid, $ppid, $time, $name, $uid, $t, $ip); $_ =~ /$MATCH_STR/; $user = $1; $pid = $2; $ppid = $3; $time = $4; if ($ppid != 1) { if ($^O eq "solaris") { open(PFILES, "pfiles $pid |"); while () { next if ($_ !~ /port: $ASIP_PORT_NO/); while () { next if ($_ !~ /peername/); if ($_ =~ /AF_INET (.*) port/) { $ip = $1; if ($ip =~ /::ffff:(.*)/ ) { $ip = $1; } } $mac{$pid} = $ip; last; } last; } close(PFILES); } ($t, $t, $uid, $t, $t, $t, $name, $t, $t) = getpwnam($user); ($name) = ( $name =~ /(^[^,]+)/ ); printf "%-8d %-8d %-16s %-20s %-9s %s\n", $pid, $uid, $user, $name, $time, $mac{$pid}; } } close(PS); netatalk-2.2.2/contrib/misc/0000777000175200017500000000000011704770431012726 500000000000000netatalk-2.2.2/contrib/misc/Makefile.am0000644000175200017500000000006411655731243014701 00000000000000# Makefile for contrib/misc/ EXTRA_DIST = cnid.lua netatalk-2.2.2/contrib/misc/Makefile.in0000644000175200017500000002627211703521724014716 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile for contrib/misc/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = contrib/misc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = cnid.lua all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/misc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/misc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/contrib/misc/cnid.lua0000644000175200017500000000650611655731243014274 00000000000000-- -- Netatalk DBD protocol -- wireshark -X lua_script:cnid.lua -- don't forget to comment out the line disable_lua = true; do return end; -- in /etc/wireshark/init.lua -- global environment local b = _G -- declare our protocol local dbd_proto = Proto("dbd","Netatalk Dbd Wire Protocol") local cmd = ProtoField.uint32("dbd.cmd", "Request") -- , base.HEX local len = ProtoField.uint32("dbd.name.len", "Name Length") local filename = ProtoField.string("dbd.name", "Name") local error = ProtoField.uint32("dbd.error", "Error code") local cnid = ProtoField.uint32("dbd.cnid", "Cnid") local did = ProtoField.uint32("dbd.did", "Parent Directory Id") local dev = ProtoField.uint64("dbd.dev", "Device number") local ino = ProtoField.uint64("dbd.ino", "Inode number") local type = ProtoField.uint32("dbd.type", "File type") dbd_proto.fields = {cmd, error, cnid, did, dev, ino, type, filename, len} --- Request list local Cmd = { [3] = "add", [4] = "get", [5] = "resolve", [6] = "lookup", [7] = "update", [8] = "delete", [11] = "timestamp" } --- display a filename local function fname(buffer, pinfo, tree, len, ofs) pinfo.cols.info:append(" Name=" .. buffer(ofs +4, len):string()) local subtree = tree:add(buffer(ofs, len +4), buffer(ofs +4, len):string()) subtree:add(filename, buffer(ofs +4, len)) return subtree end -- create a function to dissect it function dbd_proto.dissector(buffer, pinfo, tree) pinfo.cols.protocol = "DBD" local subtree = tree:add(dbd_proto,buffer(),"Netatalk DBD Wire Protocol") if pinfo.dst_port == 4700 then pinfo.cols.info = "Query" local val = buffer(0,4):uint() local item = subtree:add(cmd, buffer(0,4)) if Cmd[val] then item:append_text(" (" .. Cmd[val] .. ")") pinfo.cols.info = Cmd[val] local val = buffer(4,4):uint() if val ~= 0 then pinfo.cols.info:append(" Cnid=" .. val) end subtree:add(cnid, buffer(4, 4)) subtree:add(dev, buffer(8, 8)) subtree:add(ino, buffer(16, 8)) subtree:add(type, buffer(24, 4)) local val = buffer(28,4):uint() if val ~= 0 then pinfo.cols.info:append(" Did=" .. val) end subtree:add(did, buffer(28, 4)) local val = buffer(36,4):uint() if val ~= 0 then item = fname(buffer, pinfo, subtree, val, 36) item:add(len, buffer(36, 4)) end end else pinfo.cols.info = "Reply" local rply = {} local val = buffer(0,4):uint() rply.error = val subtree:add(error, buffer(0,4)) if val ~= 0 then pinfo.cols.info:append(" Error=" .. val) end val = buffer(4,4):uint() rply.cnid = val subtree:add(cnid, buffer(4,4)) if val ~= 0 then pinfo.cols.info:append(" Cnid=" .. val) end val = buffer(8,4):uint() rply.did = val subtree:add(did, buffer(8,4)) if val ~= 0 then pinfo.cols.info:append(" Did=" .. val) end val = buffer(16,4):uint() rply.len = val if rply.error == 0 and rply.did ~= 0 then subtree = fname(buffer, pinfo, subtree, val, 16) subtree:add(len, buffer(16,4)) end end end -- load the tcp.port table local tcp_table = DissectorTable.get("tcp.port") -- register our protocol tcp_table:add(4700, dbd_proto) netatalk-2.2.2/contrib/timelord/0000777000175200017500000000000011704770431013612 500000000000000netatalk-2.2.2/contrib/timelord/Makefile.am0000644000175200017500000000031111655731126015560 00000000000000# Makefile.am for contrib/timelord/ sbin_PROGRAMS = timelord timelord_SOURCES = timelord.c timelord_LDADD = $(top_builddir)/libatalk/libatalk.la LIBS = @LIBS@ EXTRA_DIST = COPYRIGHT README VERSION netatalk-2.2.2/contrib/timelord/Makefile.in0000644000175200017500000004125711703521724015602 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for contrib/timelord/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ sbin_PROGRAMS = timelord$(EXEEXT) subdir = contrib/timelord DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(sbin_PROGRAMS) am_timelord_OBJECTS = timelord.$(OBJEXT) timelord_OBJECTS = $(am_timelord_OBJECTS) timelord_DEPENDENCIES = $(top_builddir)/libatalk/libatalk.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(timelord_SOURCES) DIST_SOURCES = $(timelord_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ timelord_SOURCES = timelord.c timelord_LDADD = $(top_builddir)/libatalk/libatalk.la EXTRA_DIST = COPYRIGHT README VERSION all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/timelord/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/timelord/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done timelord$(EXEEXT): $(timelord_OBJECTS) $(timelord_DEPENDENCIES) @rm -f timelord$(EXEEXT) $(LINK) $(timelord_OBJECTS) $(timelord_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timelord.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-sbinPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-sbinPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-sbinPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/contrib/timelord/VERSION0000644000175200017500000000000411655731126014573 000000000000001.0 netatalk-2.2.2/contrib/timelord/COPYRIGHT0000644000175200017500000000246411655731126015032 00000000000000/* * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation, and that the name of The University * of Michigan not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. This software is supplied as is without expressed or * implied warranties of any kind. * * Research Systems Unix Group * The University of Michigan * c/o Wesley Craig * 535 W. William Street * Ann Arbor, Michigan * +1 313 764 2278 * netatalk@umich.edu */ /* * The "timelord protocol" was reverse engineered from Timelord, * distributed with CAP, Copyright (c) 1990, The University of * Melbourne. The following copyright, supplied by The University * of Melbourne, may apply to this code: * * This version of timelord.c is based on code distributed * by the University of Melbourne as part of the CAP package. * * The tardis/Timelord package for Macintosh/CAP is * Copyright (c) 1990, The University of Melbourne. */ netatalk-2.2.2/contrib/timelord/timelord.c0000644000175200017500000001372511655731126015524 00000000000000/* * $Id: timelord.c,v 1.8 2005-04-28 20:49:36 bfernhomberg Exp $ * * Copyright (c) 1990,1992 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * * The "timelord protocol" was reverse engineered from Timelord, * distributed with CAP, Copyright (c) 1990, The University of * Melbourne. The following copyright, supplied by The University * of Melbourne, may apply to this code: * * This version of timelord.c is based on code distributed * by the University of Melbourne as part of the CAP package. * * The tardis/Timelord package for Macintosh/CAP is * Copyright (c) 1990, The University of Melbourne. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_SGTTY_H #include #endif /* HAVE_SGTTY_H */ #include #include #pragma warn "testing 123" #include #include #include #ifdef HAVE_NETDB_H #include #endif /* HAVE_NETDB_H */ #ifdef HAVE_FCNTL_H #include #endif /* HAVE_FCNTL_H */ #ifdef HAVE_SYS_FCNTL_H #include #endif /* HAVE_SYS_FCNTL_H */ #ifdef HAVE_TERMIOS_H #include #endif /* HAVE_TERMIOS_H */ #ifdef HAVE_SYS_TERMIOS_H #include #endif /* HAVE_SYS_TERMIOS_H */ #define TL_GETTIME 0 #define TL_OK 12 #define TL_BAD 10 #define EPOCH 0x7C25B080 /* 00:00:00 GMT Jan 1, 1970 for Mac */ int debug = 0; char *bad = "Bad request!"; char buf[ 4624 ]; char *server; void usage( char *p ) { char *s; if (( s = rindex( p, '/' )) == NULL ) { s = p; } else { s++; } fprintf( stderr, "Usage:\t%s -d -n nbpname\n", s ); exit( 1 ); } /* * Unregister ourself on signal. */ void goaway(int signal) { if ( nbp_unrgstr( server, "TimeLord", "*", NULL ) < 0 ) { LOG(log_error, logtype_default, "Can't unregister %s", server ); exit( 1 ); } LOG(log_info, logtype_default, "going down" ); exit( 0 ); } int main( int ac, char **av ) { ATP atp; struct sockaddr_at sat; struct atp_block atpb; struct timeval tv; struct timezone tz; struct iovec iov; struct tm *tm; char hostname[ MAXHOSTNAMELEN ]; char *p; int c; long req, mtime, resp; extern char *optarg; extern int optind; if ( gethostname( hostname, sizeof( hostname )) < 0 ) { perror( "gethostname" ); exit( 1 ); } if (( server = index( hostname, '.' )) != 0 ) { *server = '\0'; } server = hostname; while (( c = getopt( ac, av, "dn:" )) != EOF ) { switch ( c ) { case 'd' : debug++; break; case 'n' : server = optarg; break; default : fprintf( stderr, "Unknown option -- '%c'\n", c ); usage( *av ); } } /* * Disassociate from controlling tty. */ if ( !debug ) { int i, dt; switch ( fork()) { case 0 : dt = getdtablesize(); for ( i = 0; i < dt; i++ ) { (void)close( i ); } if (( i = open( "/dev/tty", O_RDWR )) >= 0 ) { (void)ioctl( i, TIOCNOTTY, 0 ); setpgid( 0, getpid()); (void)close( i ); } break; case -1 : perror( "fork" ); exit( 1 ); default : exit( 0 ); } } if (( p = rindex( *av, '/' )) == NULL ) { p = *av; } else { p++; } #ifdef ultrix openlog( p, LOG_PID ); #else /* ultrix */ set_processname(p); syslog_setup(log_debug, logtype_default, logoption_ndelay|logoption_pid, logfacility_daemon ); #endif /* ultrix */ /* allocate memory */ memset (&sat.sat_addr, 0, sizeof (sat.sat_addr)); if (( atp = atp_open( ATADDR_ANYPORT, &sat.sat_addr )) == NULL ) { LOG(log_error, logtype_default, "main: atp_open: %s", strerror( errno ) ); exit( 1 ); } if ( nbp_rgstr( atp_sockaddr( atp ), server, "TimeLord", "*" ) < 0 ) { LOG(log_error, logtype_default, "Can't register %s", server ); exit( 1 ); } LOG(log_info, logtype_default, "%s:TimeLord started", server ); signal(SIGHUP, goaway); signal(SIGTERM, goaway); for (;;) { /* * Something seriously wrong with atp, since these assigns must * be in the loop... */ atpb.atp_saddr = &sat; atpb.atp_rreqdata = buf; bzero( &sat, sizeof( struct sockaddr_at )); atpb.atp_rreqdlen = sizeof( buf ); if ( atp_rreq( atp, &atpb ) < 0 ) { LOG(log_error, logtype_default, "main: atp_rreq: %s", strerror( errno ) ); exit( 1 ); } p = buf; bcopy( p, &req, sizeof( long )); req = ntohl( req ); p += sizeof( long ); switch( req ) { case TL_GETTIME : if ( atpb.atp_rreqdlen > 5 ) { bcopy( p + 1, &mtime, sizeof( long )); mtime = ntohl( mtime ); LOG(log_info, logtype_default, "gettime from %s %s was %lu", (*( p + 5 ) == '\0' ) ? "" : p + 5, ( *p == 0 ) ? "at boot" : "in chooser", mtime ); } else { LOG(log_info, logtype_default, "gettime" ); } if ( gettimeofday( &tv, &tz ) < 0 ) { LOG(log_error, logtype_default, "main: gettimeofday: %s", strerror( errno ) ); exit( 1 ); } if (( tm = gmtime( &tv.tv_sec )) == 0 ) { perror( "localtime" ); exit( 1 ); } mtime = tv.tv_sec + EPOCH; mtime = htonl( mtime ); resp = TL_OK; bcopy( &resp, buf, sizeof( long )); bcopy( &mtime, buf + sizeof( long ), sizeof( long )); iov.iov_len = sizeof( long ) + sizeof( long ); break; default : LOG(log_error, logtype_default, bad ); resp = TL_BAD; bcopy( &resp, buf, sizeof( long )); *( buf + 4 ) = (unsigned char)strlen( bad ); strcpy( buf + 5, bad ); iov.iov_len = sizeof( long ) + 2 + strlen( bad ); break; } iov.iov_base = buf; atpb.atp_sresiov = &iov; atpb.atp_sresiovcnt = 1; if ( atp_sresp( atp, &atpb ) < 0 ) { LOG(log_error, logtype_default, "main: atp_sresp: %s", strerror( errno ) ); exit( 1 ); } } } netatalk-2.2.2/contrib/timelord/README0000644000175200017500000000172111655731126014412 00000000000000$Id: README,v 1.3 2002-02-21 09:59:24 srittau Exp $ This is the README file for timelord 1.0 (previously known as ntimelord), for use with netatalk 1.5. Previous versions of this software were designed to work with netatalk 1.3, but this has been patched to work with netatalk 1.5. Please see the COPYRIGHT file. This package's COPYRIGHT is *not* the same as netatalk's. Building timelord: 1. Run ./configure from the base directory of your netatalk distribution, and add --enable-timelord to your command line options. 2. Run "make all" for netatalk, and timelord will be built along with the rest of netatalk. Installing timelord: 1. To install the binaries, type "make install" from either the base directory of your netatalk distribution or from this directory. This will install all of the binaries in the directory specified by ./configure. 2. The file rc.atalk as distributed with netatalk 1.5 includes lines to start timelord. netatalk-2.2.2/test/0000777000175200017500000000000011704770433011314 500000000000000netatalk-2.2.2/test/Makefile.am0000644000175200017500000000001711655731130013256 00000000000000SUBDIRS = afpd netatalk-2.2.2/test/Makefile.in0000644000175200017500000004121011703521731013265 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = test DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = afpd all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/test/afpd/0000777000175200017500000000000011704770433012226 500000000000000netatalk-2.2.2/test/afpd/Makefile.am0000644000175200017500000000462411655731246014210 00000000000000# Makefile.am for test/afpd/ pkgconfdir = @PKGCONFDIR@ TESTS = test.sh test check_PROGRAMS = test noinst_HEADERS = test.h subtests.h afpfunc_helpers.h EXTRA_DIST = test.sh CLEANFILES = test.default test.conf test_SOURCES = test.c subtests.c afpfunc_helpers.c \ $(top_builddir)/etc/afpd/afp_avahi.c \ $(top_builddir)/etc/afpd/afp_config.c \ $(top_builddir)/etc/afpd/afp_dsi.c \ $(top_builddir)/etc/afpd/afp_options.c \ $(top_builddir)/etc/afpd/afp_util.c \ $(top_builddir)/etc/afpd/afprun.c \ $(top_builddir)/etc/afpd/appl.c \ $(top_builddir)/etc/afpd/auth.c \ $(top_builddir)/etc/afpd/afp_zeroconf.c \ $(top_builddir)/etc/afpd/catsearch.c \ $(top_builddir)/etc/afpd/desktop.c \ $(top_builddir)/etc/afpd/dircache.c \ $(top_builddir)/etc/afpd/directory.c \ $(top_builddir)/etc/afpd/enumerate.c \ $(top_builddir)/etc/afpd/extattrs.c \ $(top_builddir)/etc/afpd/fce_api.c \ $(top_builddir)/etc/afpd/fce_util.c \ $(top_builddir)/etc/afpd/file.c \ $(top_builddir)/etc/afpd/filedir.c \ $(top_builddir)/etc/afpd/fork.c \ $(top_builddir)/etc/afpd/gettok.c \ $(top_builddir)/etc/afpd/hash.c \ $(top_builddir)/etc/afpd/mangle.c \ $(top_builddir)/etc/afpd/messages.c \ $(top_builddir)/etc/afpd/nfsquota.c \ $(top_builddir)/etc/afpd/ofork.c \ $(top_builddir)/etc/afpd/quota.c \ $(top_builddir)/etc/afpd/status.c \ $(top_builddir)/etc/afpd/switch.c \ $(top_builddir)/etc/afpd/uam.c \ $(top_builddir)/etc/afpd/unix.c \ $(top_builddir)/etc/afpd/volume.c if HAVE_ACLS test_SOURCES += $(top_builddir)/etc/afpd/acls.c endif test_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/etc/afpd \ @SLP_CFLAGS@ @ZEROCONF_CFLAGS@ \ -DAPPLCNAME \ -DSERVERTEXT=\"$(SERVERTEXT)/\" \ -D_PATH_AFPDDEFVOL=\"$(pkgconfdir)/AppleVolumes.default\" \ -D_PATH_AFPDSYSVOL=\"$(pkgconfdir)/AppleVolumes.system\" \ -D_PATH_AFPDPWFILE=\"$(pkgconfdir)/afppasswd\" \ -D_PATH_AFPDCONF=\"$(pkgconfdir)/afpd.conf\" \ -D_PATH_AFPDUAMPATH=\"$(UAMS_PATH)/\" \ -D_PATH_ACL_LDAPCONF=\"$(pkgconfdir)/afp_ldap.conf\" \ -D_PATH_AFPDSIGCONF=\"$(pkgconfdir)/afp_signature.conf\" \ -D_PATH_AFPDUUIDCONF=\"$(pkgconfdir)/afp_voluuid.conf\" test_LDADD = $(top_builddir)/libatalk/cnid/libcnid.la \ $(top_builddir)/libatalk/libatalk.la \ @QUOTA_LIBS@ @SLP_LIBS@ @WRAP_LIBS@ @LIBADD_DL@ @ACL_LIBS@ @ZEROCONF_LIBS@ @PTHREAD_LIBS@ test_LDFLAGS = -export-dynamic netatalk-2.2.2/test/afpd/Makefile.in0000644000175200017500000027046011703521732014213 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for test/afpd/ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ TESTS = test.sh test$(EXEEXT) check_PROGRAMS = test$(EXEEXT) @HAVE_ACLS_TRUE@am__append_1 = $(top_builddir)/etc/afpd/acls.c subdir = test/afpd DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/afs-check.m4 \ $(top_srcdir)/macros/cnid-backend.m4 \ $(top_srcdir)/macros/config-checks.m4 \ $(top_srcdir)/macros/cups.m4 $(top_srcdir)/macros/db3-check.m4 \ $(top_srcdir)/macros/grep-check.m4 \ $(top_srcdir)/macros/gssapi-check.m4 \ $(top_srcdir)/macros/iconv.m4 \ $(top_srcdir)/macros/largefile-check.m4 \ $(top_srcdir)/macros/libgcrypt.m4 \ $(top_srcdir)/macros/pam-check.m4 \ $(top_srcdir)/macros/perl-check.m4 \ $(top_srcdir)/macros/ps-check.m4 \ $(top_srcdir)/macros/quota-check.m4 \ $(top_srcdir)/macros/snprintf-check.m4 \ $(top_srcdir)/macros/srvloc.m4 \ $(top_srcdir)/macros/ssl-check.m4 \ $(top_srcdir)/macros/summary.m4 \ $(top_srcdir)/macros/tcp-wrappers.m4 \ $(top_srcdir)/macros/util.m4 $(top_srcdir)/macros/webmin.m4 \ $(top_srcdir)/macros/zeroconf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__test_SOURCES_DIST = test.c subtests.c afpfunc_helpers.c \ $(top_builddir)/etc/afpd/afp_avahi.c \ $(top_builddir)/etc/afpd/afp_config.c \ $(top_builddir)/etc/afpd/afp_dsi.c \ $(top_builddir)/etc/afpd/afp_options.c \ $(top_builddir)/etc/afpd/afp_util.c \ $(top_builddir)/etc/afpd/afprun.c \ $(top_builddir)/etc/afpd/appl.c \ $(top_builddir)/etc/afpd/auth.c \ $(top_builddir)/etc/afpd/afp_zeroconf.c \ $(top_builddir)/etc/afpd/catsearch.c \ $(top_builddir)/etc/afpd/desktop.c \ $(top_builddir)/etc/afpd/dircache.c \ $(top_builddir)/etc/afpd/directory.c \ $(top_builddir)/etc/afpd/enumerate.c \ $(top_builddir)/etc/afpd/extattrs.c \ $(top_builddir)/etc/afpd/fce_api.c \ $(top_builddir)/etc/afpd/fce_util.c \ $(top_builddir)/etc/afpd/file.c \ $(top_builddir)/etc/afpd/filedir.c \ $(top_builddir)/etc/afpd/fork.c \ $(top_builddir)/etc/afpd/gettok.c \ $(top_builddir)/etc/afpd/hash.c \ $(top_builddir)/etc/afpd/mangle.c \ $(top_builddir)/etc/afpd/messages.c \ $(top_builddir)/etc/afpd/nfsquota.c \ $(top_builddir)/etc/afpd/ofork.c \ $(top_builddir)/etc/afpd/quota.c \ $(top_builddir)/etc/afpd/status.c \ $(top_builddir)/etc/afpd/switch.c \ $(top_builddir)/etc/afpd/uam.c $(top_builddir)/etc/afpd/unix.c \ $(top_builddir)/etc/afpd/volume.c \ $(top_builddir)/etc/afpd/acls.c @HAVE_ACLS_TRUE@am__objects_1 = test-acls.$(OBJEXT) am_test_OBJECTS = test-test.$(OBJEXT) test-subtests.$(OBJEXT) \ test-afpfunc_helpers.$(OBJEXT) test-afp_avahi.$(OBJEXT) \ test-afp_config.$(OBJEXT) test-afp_dsi.$(OBJEXT) \ test-afp_options.$(OBJEXT) test-afp_util.$(OBJEXT) \ test-afprun.$(OBJEXT) test-appl.$(OBJEXT) test-auth.$(OBJEXT) \ test-afp_zeroconf.$(OBJEXT) test-catsearch.$(OBJEXT) \ test-desktop.$(OBJEXT) test-dircache.$(OBJEXT) \ test-directory.$(OBJEXT) test-enumerate.$(OBJEXT) \ test-extattrs.$(OBJEXT) test-fce_api.$(OBJEXT) \ test-fce_util.$(OBJEXT) test-file.$(OBJEXT) \ test-filedir.$(OBJEXT) test-fork.$(OBJEXT) \ test-gettok.$(OBJEXT) test-hash.$(OBJEXT) \ test-mangle.$(OBJEXT) test-messages.$(OBJEXT) \ test-nfsquota.$(OBJEXT) test-ofork.$(OBJEXT) \ test-quota.$(OBJEXT) test-status.$(OBJEXT) \ test-switch.$(OBJEXT) test-uam.$(OBJEXT) test-unix.$(OBJEXT) \ test-volume.$(OBJEXT) $(am__objects_1) test_OBJECTS = $(am_test_OBJECTS) test_DEPENDENCIES = $(top_builddir)/libatalk/cnid/libcnid.la \ $(top_builddir)/libatalk/libatalk.la test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(test_CFLAGS) $(CFLAGS) $(test_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(test_SOURCES) DIST_SOURCES = $(am__test_SOURCES_DIST) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACL_LIBS = @ACL_LIBS@ AFS_CFLAGS = @AFS_CFLAGS@ AFS_LIBS = @AFS_LIBS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AVAHI_TPOLL_CFLAGS = @AVAHI_TPOLL_CFLAGS@ AVAHI_TPOLL_LIBS = @AVAHI_TPOLL_LIBS@ AWK = @AWK@ BDB_BIN = @BDB_BIN@ BDB_CFLAGS = @BDB_CFLAGS@ BDB_LIBS = @BDB_LIBS@ BDB_PATH = @BDB_PATH@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILE_64BIT_KMODULE = @COMPILE_64BIT_KMODULE@ COMPILE_KERNEL_GCC = @COMPILE_KERNEL_GCC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPT_LIBS = @CRYPT_LIBS@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LDFLAGS = @CUPS_LDFLAGS@ CUPS_LIBS = @CUPS_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_CNID_SCHEME = @DEFAULT_CNID_SCHEME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ GSSAPI_CFLAGS = @GSSAPI_CFLAGS@ GSSAPI_LIBS = @GSSAPI_LIBS@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KCFLAGS = @KCFLAGS@ KLDFLAGS = @KLDFLAGS@ KRB5_CONFIG = @KRB5_CONFIG@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETATALK_VERSION = @NETATALK_VERSION@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OVERWRITE_CONFIG = @OVERWRITE_CONFIG@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAMDIR = @PAMDIR@ PAM_ACCOUNT = @PAM_ACCOUNT@ PAM_AUTH = @PAM_AUTH@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_DIRECTIVE = @PAM_DIRECTIVE@ PAM_LIBS = @PAM_LIBS@ PAM_PASSWORD = @PAM_PASSWORD@ PAM_SESSION = @PAM_SESSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGCONFDIR = @PKGCONFDIR@ PKG_CONFIG = @PKG_CONFIG@ PS = @PS@ PTHREAD_LIBS = @PTHREAD_LIBS@ QUOTA_LIBS = @QUOTA_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SERVERTEXT = @SERVERTEXT@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLP_CFLAGS = @SLP_CFLAGS@ SLP_LIBS = @SLP_LIBS@ SPOOLDIR = @SPOOLDIR@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UAMS_PATH = @UAMS_PATH@ VERSION = @VERSION@ WEBMIN_PASS = @WEBMIN_PASS@ WEBMIN_PATH = @WEBMIN_PATH@ WEBMIN_PORT = @WEBMIN_PORT@ WEBMIN_USER = @WEBMIN_USER@ WEBMIN_VERSION = @WEBMIN_VERSION@ WRAP_LIBS = @WRAP_LIBS@ ZEROCONF_CFLAGS = @ZEROCONF_CFLAGS@ ZEROCONF_LIBS = @ZEROCONF_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ compiled_backends = @compiled_backends@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgconfdir = @PKGCONFDIR@ noinst_HEADERS = test.h subtests.h afpfunc_helpers.h EXTRA_DIST = test.sh CLEANFILES = test.default test.conf test_SOURCES = test.c subtests.c afpfunc_helpers.c \ $(top_builddir)/etc/afpd/afp_avahi.c \ $(top_builddir)/etc/afpd/afp_config.c \ $(top_builddir)/etc/afpd/afp_dsi.c \ $(top_builddir)/etc/afpd/afp_options.c \ $(top_builddir)/etc/afpd/afp_util.c \ $(top_builddir)/etc/afpd/afprun.c \ $(top_builddir)/etc/afpd/appl.c \ $(top_builddir)/etc/afpd/auth.c \ $(top_builddir)/etc/afpd/afp_zeroconf.c \ $(top_builddir)/etc/afpd/catsearch.c \ $(top_builddir)/etc/afpd/desktop.c \ $(top_builddir)/etc/afpd/dircache.c \ $(top_builddir)/etc/afpd/directory.c \ $(top_builddir)/etc/afpd/enumerate.c \ $(top_builddir)/etc/afpd/extattrs.c \ $(top_builddir)/etc/afpd/fce_api.c \ $(top_builddir)/etc/afpd/fce_util.c \ $(top_builddir)/etc/afpd/file.c \ $(top_builddir)/etc/afpd/filedir.c \ $(top_builddir)/etc/afpd/fork.c \ $(top_builddir)/etc/afpd/gettok.c \ $(top_builddir)/etc/afpd/hash.c \ $(top_builddir)/etc/afpd/mangle.c \ $(top_builddir)/etc/afpd/messages.c \ $(top_builddir)/etc/afpd/nfsquota.c \ $(top_builddir)/etc/afpd/ofork.c \ $(top_builddir)/etc/afpd/quota.c \ $(top_builddir)/etc/afpd/status.c \ $(top_builddir)/etc/afpd/switch.c \ $(top_builddir)/etc/afpd/uam.c $(top_builddir)/etc/afpd/unix.c \ $(top_builddir)/etc/afpd/volume.c $(am__append_1) test_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/etc/afpd \ @SLP_CFLAGS@ @ZEROCONF_CFLAGS@ \ -DAPPLCNAME \ -DSERVERTEXT=\"$(SERVERTEXT)/\" \ -D_PATH_AFPDDEFVOL=\"$(pkgconfdir)/AppleVolumes.default\" \ -D_PATH_AFPDSYSVOL=\"$(pkgconfdir)/AppleVolumes.system\" \ -D_PATH_AFPDPWFILE=\"$(pkgconfdir)/afppasswd\" \ -D_PATH_AFPDCONF=\"$(pkgconfdir)/afpd.conf\" \ -D_PATH_AFPDUAMPATH=\"$(UAMS_PATH)/\" \ -D_PATH_ACL_LDAPCONF=\"$(pkgconfdir)/afp_ldap.conf\" \ -D_PATH_AFPDSIGCONF=\"$(pkgconfdir)/afp_signature.conf\" \ -D_PATH_AFPDUUIDCONF=\"$(pkgconfdir)/afp_voluuid.conf\" test_LDADD = $(top_builddir)/libatalk/cnid/libcnid.la \ $(top_builddir)/libatalk/libatalk.la \ @QUOTA_LIBS@ @SLP_LIBS@ @WRAP_LIBS@ @LIBADD_DL@ @ACL_LIBS@ @ZEROCONF_LIBS@ @PTHREAD_LIBS@ test_LDFLAGS = -export-dynamic all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/afpd/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign test/afpd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) @rm -f test$(EXEEXT) $(test_LINK) $(test_OBJECTS) $(test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-acls.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-afp_avahi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-afp_config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-afp_dsi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-afp_options.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-afp_util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-afp_zeroconf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-afpfunc_helpers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-afprun.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-appl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-auth.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-catsearch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-desktop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dircache.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-directory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-enumerate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-extattrs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fce_api.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fce_util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-filedir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fork.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-gettok.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mangle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-messages.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nfsquota.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ofork.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-quota.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-status.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-subtests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-switch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-uam.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-volume.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< test-test.o: test.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-test.o -MD -MP -MF $(DEPDIR)/test-test.Tpo -c -o test-test.o `test -f 'test.c' || echo '$(srcdir)/'`test.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-test.Tpo $(DEPDIR)/test-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test.c' object='test-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-test.o `test -f 'test.c' || echo '$(srcdir)/'`test.c test-test.obj: test.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-test.obj -MD -MP -MF $(DEPDIR)/test-test.Tpo -c -o test-test.obj `if test -f 'test.c'; then $(CYGPATH_W) 'test.c'; else $(CYGPATH_W) '$(srcdir)/test.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-test.Tpo $(DEPDIR)/test-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test.c' object='test-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-test.obj `if test -f 'test.c'; then $(CYGPATH_W) 'test.c'; else $(CYGPATH_W) '$(srcdir)/test.c'; fi` test-subtests.o: subtests.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-subtests.o -MD -MP -MF $(DEPDIR)/test-subtests.Tpo -c -o test-subtests.o `test -f 'subtests.c' || echo '$(srcdir)/'`subtests.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-subtests.Tpo $(DEPDIR)/test-subtests.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='subtests.c' object='test-subtests.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-subtests.o `test -f 'subtests.c' || echo '$(srcdir)/'`subtests.c test-subtests.obj: subtests.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-subtests.obj -MD -MP -MF $(DEPDIR)/test-subtests.Tpo -c -o test-subtests.obj `if test -f 'subtests.c'; then $(CYGPATH_W) 'subtests.c'; else $(CYGPATH_W) '$(srcdir)/subtests.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-subtests.Tpo $(DEPDIR)/test-subtests.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='subtests.c' object='test-subtests.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-subtests.obj `if test -f 'subtests.c'; then $(CYGPATH_W) 'subtests.c'; else $(CYGPATH_W) '$(srcdir)/subtests.c'; fi` test-afpfunc_helpers.o: afpfunc_helpers.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-afpfunc_helpers.o -MD -MP -MF $(DEPDIR)/test-afpfunc_helpers.Tpo -c -o test-afpfunc_helpers.o `test -f 'afpfunc_helpers.c' || echo '$(srcdir)/'`afpfunc_helpers.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-afpfunc_helpers.Tpo $(DEPDIR)/test-afpfunc_helpers.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afpfunc_helpers.c' object='test-afpfunc_helpers.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-afpfunc_helpers.o `test -f 'afpfunc_helpers.c' || echo '$(srcdir)/'`afpfunc_helpers.c test-afpfunc_helpers.obj: afpfunc_helpers.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-afpfunc_helpers.obj -MD -MP -MF $(DEPDIR)/test-afpfunc_helpers.Tpo -c -o test-afpfunc_helpers.obj `if test -f 'afpfunc_helpers.c'; then $(CYGPATH_W) 'afpfunc_helpers.c'; else $(CYGPATH_W) '$(srcdir)/afpfunc_helpers.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-afpfunc_helpers.Tpo $(DEPDIR)/test-afpfunc_helpers.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='afpfunc_helpers.c' object='test-afpfunc_helpers.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-afpfunc_helpers.obj `if test -f 'afpfunc_helpers.c'; then $(CYGPATH_W) 'afpfunc_helpers.c'; else $(CYGPATH_W) '$(srcdir)/afpfunc_helpers.c'; fi` test-afp_avahi.o: $(top_builddir)/etc/afpd/afp_avahi.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-afp_avahi.o -MD -MP -MF $(DEPDIR)/test-afp_avahi.Tpo -c -o test-afp_avahi.o `test -f '$(top_builddir)/etc/afpd/afp_avahi.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/afp_avahi.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-afp_avahi.Tpo $(DEPDIR)/test-afp_avahi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/afp_avahi.c' object='test-afp_avahi.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-afp_avahi.o `test -f '$(top_builddir)/etc/afpd/afp_avahi.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/afp_avahi.c test-afp_avahi.obj: $(top_builddir)/etc/afpd/afp_avahi.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-afp_avahi.obj -MD -MP -MF $(DEPDIR)/test-afp_avahi.Tpo -c -o test-afp_avahi.obj `if test -f '$(top_builddir)/etc/afpd/afp_avahi.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/afp_avahi.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/afp_avahi.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-afp_avahi.Tpo $(DEPDIR)/test-afp_avahi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/afp_avahi.c' object='test-afp_avahi.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-afp_avahi.obj `if test -f '$(top_builddir)/etc/afpd/afp_avahi.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/afp_avahi.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/afp_avahi.c'; fi` test-afp_config.o: $(top_builddir)/etc/afpd/afp_config.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-afp_config.o -MD -MP -MF $(DEPDIR)/test-afp_config.Tpo -c -o test-afp_config.o `test -f '$(top_builddir)/etc/afpd/afp_config.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/afp_config.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-afp_config.Tpo $(DEPDIR)/test-afp_config.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/afp_config.c' object='test-afp_config.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-afp_config.o `test -f '$(top_builddir)/etc/afpd/afp_config.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/afp_config.c test-afp_config.obj: $(top_builddir)/etc/afpd/afp_config.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-afp_config.obj -MD -MP -MF $(DEPDIR)/test-afp_config.Tpo -c -o test-afp_config.obj `if test -f '$(top_builddir)/etc/afpd/afp_config.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/afp_config.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/afp_config.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-afp_config.Tpo $(DEPDIR)/test-afp_config.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/afp_config.c' object='test-afp_config.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-afp_config.obj `if test -f '$(top_builddir)/etc/afpd/afp_config.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/afp_config.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/afp_config.c'; fi` test-afp_dsi.o: $(top_builddir)/etc/afpd/afp_dsi.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-afp_dsi.o -MD -MP -MF $(DEPDIR)/test-afp_dsi.Tpo -c -o test-afp_dsi.o `test -f '$(top_builddir)/etc/afpd/afp_dsi.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/afp_dsi.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-afp_dsi.Tpo $(DEPDIR)/test-afp_dsi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/afp_dsi.c' object='test-afp_dsi.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-afp_dsi.o `test -f '$(top_builddir)/etc/afpd/afp_dsi.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/afp_dsi.c test-afp_dsi.obj: $(top_builddir)/etc/afpd/afp_dsi.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-afp_dsi.obj -MD -MP -MF $(DEPDIR)/test-afp_dsi.Tpo -c -o test-afp_dsi.obj `if test -f '$(top_builddir)/etc/afpd/afp_dsi.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/afp_dsi.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/afp_dsi.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-afp_dsi.Tpo $(DEPDIR)/test-afp_dsi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/afp_dsi.c' object='test-afp_dsi.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-afp_dsi.obj `if test -f '$(top_builddir)/etc/afpd/afp_dsi.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/afp_dsi.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/afp_dsi.c'; fi` test-afp_options.o: $(top_builddir)/etc/afpd/afp_options.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-afp_options.o -MD -MP -MF $(DEPDIR)/test-afp_options.Tpo -c -o test-afp_options.o `test -f '$(top_builddir)/etc/afpd/afp_options.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/afp_options.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-afp_options.Tpo $(DEPDIR)/test-afp_options.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/afp_options.c' object='test-afp_options.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-afp_options.o `test -f '$(top_builddir)/etc/afpd/afp_options.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/afp_options.c test-afp_options.obj: $(top_builddir)/etc/afpd/afp_options.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-afp_options.obj -MD -MP -MF $(DEPDIR)/test-afp_options.Tpo -c -o test-afp_options.obj `if test -f '$(top_builddir)/etc/afpd/afp_options.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/afp_options.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/afp_options.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-afp_options.Tpo $(DEPDIR)/test-afp_options.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/afp_options.c' object='test-afp_options.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-afp_options.obj `if test -f '$(top_builddir)/etc/afpd/afp_options.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/afp_options.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/afp_options.c'; fi` test-afp_util.o: $(top_builddir)/etc/afpd/afp_util.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-afp_util.o -MD -MP -MF $(DEPDIR)/test-afp_util.Tpo -c -o test-afp_util.o `test -f '$(top_builddir)/etc/afpd/afp_util.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/afp_util.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-afp_util.Tpo $(DEPDIR)/test-afp_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/afp_util.c' object='test-afp_util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-afp_util.o `test -f '$(top_builddir)/etc/afpd/afp_util.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/afp_util.c test-afp_util.obj: $(top_builddir)/etc/afpd/afp_util.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-afp_util.obj -MD -MP -MF $(DEPDIR)/test-afp_util.Tpo -c -o test-afp_util.obj `if test -f '$(top_builddir)/etc/afpd/afp_util.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/afp_util.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/afp_util.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-afp_util.Tpo $(DEPDIR)/test-afp_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/afp_util.c' object='test-afp_util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-afp_util.obj `if test -f '$(top_builddir)/etc/afpd/afp_util.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/afp_util.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/afp_util.c'; fi` test-afprun.o: $(top_builddir)/etc/afpd/afprun.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-afprun.o -MD -MP -MF $(DEPDIR)/test-afprun.Tpo -c -o test-afprun.o `test -f '$(top_builddir)/etc/afpd/afprun.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/afprun.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-afprun.Tpo $(DEPDIR)/test-afprun.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/afprun.c' object='test-afprun.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-afprun.o `test -f '$(top_builddir)/etc/afpd/afprun.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/afprun.c test-afprun.obj: $(top_builddir)/etc/afpd/afprun.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-afprun.obj -MD -MP -MF $(DEPDIR)/test-afprun.Tpo -c -o test-afprun.obj `if test -f '$(top_builddir)/etc/afpd/afprun.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/afprun.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/afprun.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-afprun.Tpo $(DEPDIR)/test-afprun.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/afprun.c' object='test-afprun.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-afprun.obj `if test -f '$(top_builddir)/etc/afpd/afprun.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/afprun.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/afprun.c'; fi` test-appl.o: $(top_builddir)/etc/afpd/appl.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-appl.o -MD -MP -MF $(DEPDIR)/test-appl.Tpo -c -o test-appl.o `test -f '$(top_builddir)/etc/afpd/appl.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/appl.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-appl.Tpo $(DEPDIR)/test-appl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/appl.c' object='test-appl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-appl.o `test -f '$(top_builddir)/etc/afpd/appl.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/appl.c test-appl.obj: $(top_builddir)/etc/afpd/appl.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-appl.obj -MD -MP -MF $(DEPDIR)/test-appl.Tpo -c -o test-appl.obj `if test -f '$(top_builddir)/etc/afpd/appl.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/appl.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/appl.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-appl.Tpo $(DEPDIR)/test-appl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/appl.c' object='test-appl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-appl.obj `if test -f '$(top_builddir)/etc/afpd/appl.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/appl.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/appl.c'; fi` test-auth.o: $(top_builddir)/etc/afpd/auth.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-auth.o -MD -MP -MF $(DEPDIR)/test-auth.Tpo -c -o test-auth.o `test -f '$(top_builddir)/etc/afpd/auth.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/auth.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-auth.Tpo $(DEPDIR)/test-auth.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/auth.c' object='test-auth.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-auth.o `test -f '$(top_builddir)/etc/afpd/auth.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/auth.c test-auth.obj: $(top_builddir)/etc/afpd/auth.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-auth.obj -MD -MP -MF $(DEPDIR)/test-auth.Tpo -c -o test-auth.obj `if test -f '$(top_builddir)/etc/afpd/auth.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/auth.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/auth.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-auth.Tpo $(DEPDIR)/test-auth.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/auth.c' object='test-auth.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-auth.obj `if test -f '$(top_builddir)/etc/afpd/auth.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/auth.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/auth.c'; fi` test-afp_zeroconf.o: $(top_builddir)/etc/afpd/afp_zeroconf.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-afp_zeroconf.o -MD -MP -MF $(DEPDIR)/test-afp_zeroconf.Tpo -c -o test-afp_zeroconf.o `test -f '$(top_builddir)/etc/afpd/afp_zeroconf.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/afp_zeroconf.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-afp_zeroconf.Tpo $(DEPDIR)/test-afp_zeroconf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/afp_zeroconf.c' object='test-afp_zeroconf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-afp_zeroconf.o `test -f '$(top_builddir)/etc/afpd/afp_zeroconf.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/afp_zeroconf.c test-afp_zeroconf.obj: $(top_builddir)/etc/afpd/afp_zeroconf.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-afp_zeroconf.obj -MD -MP -MF $(DEPDIR)/test-afp_zeroconf.Tpo -c -o test-afp_zeroconf.obj `if test -f '$(top_builddir)/etc/afpd/afp_zeroconf.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/afp_zeroconf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/afp_zeroconf.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-afp_zeroconf.Tpo $(DEPDIR)/test-afp_zeroconf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/afp_zeroconf.c' object='test-afp_zeroconf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-afp_zeroconf.obj `if test -f '$(top_builddir)/etc/afpd/afp_zeroconf.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/afp_zeroconf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/afp_zeroconf.c'; fi` test-catsearch.o: $(top_builddir)/etc/afpd/catsearch.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-catsearch.o -MD -MP -MF $(DEPDIR)/test-catsearch.Tpo -c -o test-catsearch.o `test -f '$(top_builddir)/etc/afpd/catsearch.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/catsearch.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-catsearch.Tpo $(DEPDIR)/test-catsearch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/catsearch.c' object='test-catsearch.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-catsearch.o `test -f '$(top_builddir)/etc/afpd/catsearch.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/catsearch.c test-catsearch.obj: $(top_builddir)/etc/afpd/catsearch.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-catsearch.obj -MD -MP -MF $(DEPDIR)/test-catsearch.Tpo -c -o test-catsearch.obj `if test -f '$(top_builddir)/etc/afpd/catsearch.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/catsearch.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/catsearch.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-catsearch.Tpo $(DEPDIR)/test-catsearch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/catsearch.c' object='test-catsearch.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-catsearch.obj `if test -f '$(top_builddir)/etc/afpd/catsearch.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/catsearch.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/catsearch.c'; fi` test-desktop.o: $(top_builddir)/etc/afpd/desktop.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-desktop.o -MD -MP -MF $(DEPDIR)/test-desktop.Tpo -c -o test-desktop.o `test -f '$(top_builddir)/etc/afpd/desktop.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/desktop.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-desktop.Tpo $(DEPDIR)/test-desktop.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/desktop.c' object='test-desktop.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-desktop.o `test -f '$(top_builddir)/etc/afpd/desktop.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/desktop.c test-desktop.obj: $(top_builddir)/etc/afpd/desktop.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-desktop.obj -MD -MP -MF $(DEPDIR)/test-desktop.Tpo -c -o test-desktop.obj `if test -f '$(top_builddir)/etc/afpd/desktop.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/desktop.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/desktop.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-desktop.Tpo $(DEPDIR)/test-desktop.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/desktop.c' object='test-desktop.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-desktop.obj `if test -f '$(top_builddir)/etc/afpd/desktop.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/desktop.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/desktop.c'; fi` test-dircache.o: $(top_builddir)/etc/afpd/dircache.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-dircache.o -MD -MP -MF $(DEPDIR)/test-dircache.Tpo -c -o test-dircache.o `test -f '$(top_builddir)/etc/afpd/dircache.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/dircache.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-dircache.Tpo $(DEPDIR)/test-dircache.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/dircache.c' object='test-dircache.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-dircache.o `test -f '$(top_builddir)/etc/afpd/dircache.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/dircache.c test-dircache.obj: $(top_builddir)/etc/afpd/dircache.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-dircache.obj -MD -MP -MF $(DEPDIR)/test-dircache.Tpo -c -o test-dircache.obj `if test -f '$(top_builddir)/etc/afpd/dircache.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/dircache.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/dircache.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-dircache.Tpo $(DEPDIR)/test-dircache.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/dircache.c' object='test-dircache.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-dircache.obj `if test -f '$(top_builddir)/etc/afpd/dircache.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/dircache.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/dircache.c'; fi` test-directory.o: $(top_builddir)/etc/afpd/directory.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-directory.o -MD -MP -MF $(DEPDIR)/test-directory.Tpo -c -o test-directory.o `test -f '$(top_builddir)/etc/afpd/directory.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/directory.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-directory.Tpo $(DEPDIR)/test-directory.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/directory.c' object='test-directory.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-directory.o `test -f '$(top_builddir)/etc/afpd/directory.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/directory.c test-directory.obj: $(top_builddir)/etc/afpd/directory.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-directory.obj -MD -MP -MF $(DEPDIR)/test-directory.Tpo -c -o test-directory.obj `if test -f '$(top_builddir)/etc/afpd/directory.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/directory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/directory.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-directory.Tpo $(DEPDIR)/test-directory.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/directory.c' object='test-directory.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-directory.obj `if test -f '$(top_builddir)/etc/afpd/directory.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/directory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/directory.c'; fi` test-enumerate.o: $(top_builddir)/etc/afpd/enumerate.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-enumerate.o -MD -MP -MF $(DEPDIR)/test-enumerate.Tpo -c -o test-enumerate.o `test -f '$(top_builddir)/etc/afpd/enumerate.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/enumerate.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-enumerate.Tpo $(DEPDIR)/test-enumerate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/enumerate.c' object='test-enumerate.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-enumerate.o `test -f '$(top_builddir)/etc/afpd/enumerate.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/enumerate.c test-enumerate.obj: $(top_builddir)/etc/afpd/enumerate.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-enumerate.obj -MD -MP -MF $(DEPDIR)/test-enumerate.Tpo -c -o test-enumerate.obj `if test -f '$(top_builddir)/etc/afpd/enumerate.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/enumerate.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/enumerate.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-enumerate.Tpo $(DEPDIR)/test-enumerate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/enumerate.c' object='test-enumerate.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-enumerate.obj `if test -f '$(top_builddir)/etc/afpd/enumerate.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/enumerate.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/enumerate.c'; fi` test-extattrs.o: $(top_builddir)/etc/afpd/extattrs.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-extattrs.o -MD -MP -MF $(DEPDIR)/test-extattrs.Tpo -c -o test-extattrs.o `test -f '$(top_builddir)/etc/afpd/extattrs.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/extattrs.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-extattrs.Tpo $(DEPDIR)/test-extattrs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/extattrs.c' object='test-extattrs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-extattrs.o `test -f '$(top_builddir)/etc/afpd/extattrs.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/extattrs.c test-extattrs.obj: $(top_builddir)/etc/afpd/extattrs.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-extattrs.obj -MD -MP -MF $(DEPDIR)/test-extattrs.Tpo -c -o test-extattrs.obj `if test -f '$(top_builddir)/etc/afpd/extattrs.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/extattrs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/extattrs.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-extattrs.Tpo $(DEPDIR)/test-extattrs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/extattrs.c' object='test-extattrs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-extattrs.obj `if test -f '$(top_builddir)/etc/afpd/extattrs.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/extattrs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/extattrs.c'; fi` test-fce_api.o: $(top_builddir)/etc/afpd/fce_api.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-fce_api.o -MD -MP -MF $(DEPDIR)/test-fce_api.Tpo -c -o test-fce_api.o `test -f '$(top_builddir)/etc/afpd/fce_api.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/fce_api.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-fce_api.Tpo $(DEPDIR)/test-fce_api.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/fce_api.c' object='test-fce_api.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-fce_api.o `test -f '$(top_builddir)/etc/afpd/fce_api.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/fce_api.c test-fce_api.obj: $(top_builddir)/etc/afpd/fce_api.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-fce_api.obj -MD -MP -MF $(DEPDIR)/test-fce_api.Tpo -c -o test-fce_api.obj `if test -f '$(top_builddir)/etc/afpd/fce_api.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/fce_api.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/fce_api.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-fce_api.Tpo $(DEPDIR)/test-fce_api.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/fce_api.c' object='test-fce_api.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-fce_api.obj `if test -f '$(top_builddir)/etc/afpd/fce_api.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/fce_api.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/fce_api.c'; fi` test-fce_util.o: $(top_builddir)/etc/afpd/fce_util.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-fce_util.o -MD -MP -MF $(DEPDIR)/test-fce_util.Tpo -c -o test-fce_util.o `test -f '$(top_builddir)/etc/afpd/fce_util.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/fce_util.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-fce_util.Tpo $(DEPDIR)/test-fce_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/fce_util.c' object='test-fce_util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-fce_util.o `test -f '$(top_builddir)/etc/afpd/fce_util.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/fce_util.c test-fce_util.obj: $(top_builddir)/etc/afpd/fce_util.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-fce_util.obj -MD -MP -MF $(DEPDIR)/test-fce_util.Tpo -c -o test-fce_util.obj `if test -f '$(top_builddir)/etc/afpd/fce_util.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/fce_util.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/fce_util.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-fce_util.Tpo $(DEPDIR)/test-fce_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/fce_util.c' object='test-fce_util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-fce_util.obj `if test -f '$(top_builddir)/etc/afpd/fce_util.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/fce_util.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/fce_util.c'; fi` test-file.o: $(top_builddir)/etc/afpd/file.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-file.o -MD -MP -MF $(DEPDIR)/test-file.Tpo -c -o test-file.o `test -f '$(top_builddir)/etc/afpd/file.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/file.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-file.Tpo $(DEPDIR)/test-file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/file.c' object='test-file.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-file.o `test -f '$(top_builddir)/etc/afpd/file.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/file.c test-file.obj: $(top_builddir)/etc/afpd/file.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-file.obj -MD -MP -MF $(DEPDIR)/test-file.Tpo -c -o test-file.obj `if test -f '$(top_builddir)/etc/afpd/file.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/file.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/file.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-file.Tpo $(DEPDIR)/test-file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/file.c' object='test-file.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-file.obj `if test -f '$(top_builddir)/etc/afpd/file.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/file.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/file.c'; fi` test-filedir.o: $(top_builddir)/etc/afpd/filedir.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-filedir.o -MD -MP -MF $(DEPDIR)/test-filedir.Tpo -c -o test-filedir.o `test -f '$(top_builddir)/etc/afpd/filedir.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/filedir.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-filedir.Tpo $(DEPDIR)/test-filedir.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/filedir.c' object='test-filedir.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-filedir.o `test -f '$(top_builddir)/etc/afpd/filedir.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/filedir.c test-filedir.obj: $(top_builddir)/etc/afpd/filedir.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-filedir.obj -MD -MP -MF $(DEPDIR)/test-filedir.Tpo -c -o test-filedir.obj `if test -f '$(top_builddir)/etc/afpd/filedir.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/filedir.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/filedir.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-filedir.Tpo $(DEPDIR)/test-filedir.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/filedir.c' object='test-filedir.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-filedir.obj `if test -f '$(top_builddir)/etc/afpd/filedir.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/filedir.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/filedir.c'; fi` test-fork.o: $(top_builddir)/etc/afpd/fork.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-fork.o -MD -MP -MF $(DEPDIR)/test-fork.Tpo -c -o test-fork.o `test -f '$(top_builddir)/etc/afpd/fork.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/fork.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-fork.Tpo $(DEPDIR)/test-fork.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/fork.c' object='test-fork.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-fork.o `test -f '$(top_builddir)/etc/afpd/fork.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/fork.c test-fork.obj: $(top_builddir)/etc/afpd/fork.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-fork.obj -MD -MP -MF $(DEPDIR)/test-fork.Tpo -c -o test-fork.obj `if test -f '$(top_builddir)/etc/afpd/fork.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/fork.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/fork.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-fork.Tpo $(DEPDIR)/test-fork.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/fork.c' object='test-fork.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-fork.obj `if test -f '$(top_builddir)/etc/afpd/fork.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/fork.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/fork.c'; fi` test-gettok.o: $(top_builddir)/etc/afpd/gettok.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-gettok.o -MD -MP -MF $(DEPDIR)/test-gettok.Tpo -c -o test-gettok.o `test -f '$(top_builddir)/etc/afpd/gettok.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/gettok.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-gettok.Tpo $(DEPDIR)/test-gettok.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/gettok.c' object='test-gettok.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-gettok.o `test -f '$(top_builddir)/etc/afpd/gettok.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/gettok.c test-gettok.obj: $(top_builddir)/etc/afpd/gettok.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-gettok.obj -MD -MP -MF $(DEPDIR)/test-gettok.Tpo -c -o test-gettok.obj `if test -f '$(top_builddir)/etc/afpd/gettok.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/gettok.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/gettok.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-gettok.Tpo $(DEPDIR)/test-gettok.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/gettok.c' object='test-gettok.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-gettok.obj `if test -f '$(top_builddir)/etc/afpd/gettok.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/gettok.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/gettok.c'; fi` test-hash.o: $(top_builddir)/etc/afpd/hash.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-hash.o -MD -MP -MF $(DEPDIR)/test-hash.Tpo -c -o test-hash.o `test -f '$(top_builddir)/etc/afpd/hash.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/hash.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-hash.Tpo $(DEPDIR)/test-hash.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/hash.c' object='test-hash.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-hash.o `test -f '$(top_builddir)/etc/afpd/hash.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/hash.c test-hash.obj: $(top_builddir)/etc/afpd/hash.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-hash.obj -MD -MP -MF $(DEPDIR)/test-hash.Tpo -c -o test-hash.obj `if test -f '$(top_builddir)/etc/afpd/hash.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/hash.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/hash.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-hash.Tpo $(DEPDIR)/test-hash.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/hash.c' object='test-hash.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-hash.obj `if test -f '$(top_builddir)/etc/afpd/hash.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/hash.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/hash.c'; fi` test-mangle.o: $(top_builddir)/etc/afpd/mangle.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-mangle.o -MD -MP -MF $(DEPDIR)/test-mangle.Tpo -c -o test-mangle.o `test -f '$(top_builddir)/etc/afpd/mangle.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/mangle.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-mangle.Tpo $(DEPDIR)/test-mangle.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/mangle.c' object='test-mangle.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-mangle.o `test -f '$(top_builddir)/etc/afpd/mangle.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/mangle.c test-mangle.obj: $(top_builddir)/etc/afpd/mangle.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-mangle.obj -MD -MP -MF $(DEPDIR)/test-mangle.Tpo -c -o test-mangle.obj `if test -f '$(top_builddir)/etc/afpd/mangle.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/mangle.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/mangle.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-mangle.Tpo $(DEPDIR)/test-mangle.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/mangle.c' object='test-mangle.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-mangle.obj `if test -f '$(top_builddir)/etc/afpd/mangle.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/mangle.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/mangle.c'; fi` test-messages.o: $(top_builddir)/etc/afpd/messages.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-messages.o -MD -MP -MF $(DEPDIR)/test-messages.Tpo -c -o test-messages.o `test -f '$(top_builddir)/etc/afpd/messages.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/messages.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-messages.Tpo $(DEPDIR)/test-messages.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/messages.c' object='test-messages.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-messages.o `test -f '$(top_builddir)/etc/afpd/messages.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/messages.c test-messages.obj: $(top_builddir)/etc/afpd/messages.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-messages.obj -MD -MP -MF $(DEPDIR)/test-messages.Tpo -c -o test-messages.obj `if test -f '$(top_builddir)/etc/afpd/messages.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/messages.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/messages.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-messages.Tpo $(DEPDIR)/test-messages.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/messages.c' object='test-messages.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-messages.obj `if test -f '$(top_builddir)/etc/afpd/messages.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/messages.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/messages.c'; fi` test-nfsquota.o: $(top_builddir)/etc/afpd/nfsquota.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-nfsquota.o -MD -MP -MF $(DEPDIR)/test-nfsquota.Tpo -c -o test-nfsquota.o `test -f '$(top_builddir)/etc/afpd/nfsquota.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/nfsquota.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-nfsquota.Tpo $(DEPDIR)/test-nfsquota.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/nfsquota.c' object='test-nfsquota.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-nfsquota.o `test -f '$(top_builddir)/etc/afpd/nfsquota.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/nfsquota.c test-nfsquota.obj: $(top_builddir)/etc/afpd/nfsquota.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-nfsquota.obj -MD -MP -MF $(DEPDIR)/test-nfsquota.Tpo -c -o test-nfsquota.obj `if test -f '$(top_builddir)/etc/afpd/nfsquota.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/nfsquota.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/nfsquota.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-nfsquota.Tpo $(DEPDIR)/test-nfsquota.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/nfsquota.c' object='test-nfsquota.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-nfsquota.obj `if test -f '$(top_builddir)/etc/afpd/nfsquota.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/nfsquota.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/nfsquota.c'; fi` test-ofork.o: $(top_builddir)/etc/afpd/ofork.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-ofork.o -MD -MP -MF $(DEPDIR)/test-ofork.Tpo -c -o test-ofork.o `test -f '$(top_builddir)/etc/afpd/ofork.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/ofork.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-ofork.Tpo $(DEPDIR)/test-ofork.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/ofork.c' object='test-ofork.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-ofork.o `test -f '$(top_builddir)/etc/afpd/ofork.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/ofork.c test-ofork.obj: $(top_builddir)/etc/afpd/ofork.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-ofork.obj -MD -MP -MF $(DEPDIR)/test-ofork.Tpo -c -o test-ofork.obj `if test -f '$(top_builddir)/etc/afpd/ofork.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/ofork.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/ofork.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-ofork.Tpo $(DEPDIR)/test-ofork.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/ofork.c' object='test-ofork.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-ofork.obj `if test -f '$(top_builddir)/etc/afpd/ofork.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/ofork.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/ofork.c'; fi` test-quota.o: $(top_builddir)/etc/afpd/quota.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-quota.o -MD -MP -MF $(DEPDIR)/test-quota.Tpo -c -o test-quota.o `test -f '$(top_builddir)/etc/afpd/quota.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/quota.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-quota.Tpo $(DEPDIR)/test-quota.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/quota.c' object='test-quota.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-quota.o `test -f '$(top_builddir)/etc/afpd/quota.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/quota.c test-quota.obj: $(top_builddir)/etc/afpd/quota.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-quota.obj -MD -MP -MF $(DEPDIR)/test-quota.Tpo -c -o test-quota.obj `if test -f '$(top_builddir)/etc/afpd/quota.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/quota.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/quota.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-quota.Tpo $(DEPDIR)/test-quota.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/quota.c' object='test-quota.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-quota.obj `if test -f '$(top_builddir)/etc/afpd/quota.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/quota.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/quota.c'; fi` test-status.o: $(top_builddir)/etc/afpd/status.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-status.o -MD -MP -MF $(DEPDIR)/test-status.Tpo -c -o test-status.o `test -f '$(top_builddir)/etc/afpd/status.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/status.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-status.Tpo $(DEPDIR)/test-status.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/status.c' object='test-status.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-status.o `test -f '$(top_builddir)/etc/afpd/status.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/status.c test-status.obj: $(top_builddir)/etc/afpd/status.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-status.obj -MD -MP -MF $(DEPDIR)/test-status.Tpo -c -o test-status.obj `if test -f '$(top_builddir)/etc/afpd/status.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/status.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/status.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-status.Tpo $(DEPDIR)/test-status.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/status.c' object='test-status.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-status.obj `if test -f '$(top_builddir)/etc/afpd/status.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/status.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/status.c'; fi` test-switch.o: $(top_builddir)/etc/afpd/switch.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-switch.o -MD -MP -MF $(DEPDIR)/test-switch.Tpo -c -o test-switch.o `test -f '$(top_builddir)/etc/afpd/switch.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/switch.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-switch.Tpo $(DEPDIR)/test-switch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/switch.c' object='test-switch.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-switch.o `test -f '$(top_builddir)/etc/afpd/switch.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/switch.c test-switch.obj: $(top_builddir)/etc/afpd/switch.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-switch.obj -MD -MP -MF $(DEPDIR)/test-switch.Tpo -c -o test-switch.obj `if test -f '$(top_builddir)/etc/afpd/switch.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/switch.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/switch.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-switch.Tpo $(DEPDIR)/test-switch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/switch.c' object='test-switch.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-switch.obj `if test -f '$(top_builddir)/etc/afpd/switch.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/switch.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/switch.c'; fi` test-uam.o: $(top_builddir)/etc/afpd/uam.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-uam.o -MD -MP -MF $(DEPDIR)/test-uam.Tpo -c -o test-uam.o `test -f '$(top_builddir)/etc/afpd/uam.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/uam.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-uam.Tpo $(DEPDIR)/test-uam.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/uam.c' object='test-uam.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-uam.o `test -f '$(top_builddir)/etc/afpd/uam.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/uam.c test-uam.obj: $(top_builddir)/etc/afpd/uam.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-uam.obj -MD -MP -MF $(DEPDIR)/test-uam.Tpo -c -o test-uam.obj `if test -f '$(top_builddir)/etc/afpd/uam.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/uam.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/uam.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-uam.Tpo $(DEPDIR)/test-uam.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/uam.c' object='test-uam.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-uam.obj `if test -f '$(top_builddir)/etc/afpd/uam.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/uam.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/uam.c'; fi` test-unix.o: $(top_builddir)/etc/afpd/unix.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-unix.o -MD -MP -MF $(DEPDIR)/test-unix.Tpo -c -o test-unix.o `test -f '$(top_builddir)/etc/afpd/unix.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/unix.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-unix.Tpo $(DEPDIR)/test-unix.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/unix.c' object='test-unix.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-unix.o `test -f '$(top_builddir)/etc/afpd/unix.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/unix.c test-unix.obj: $(top_builddir)/etc/afpd/unix.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-unix.obj -MD -MP -MF $(DEPDIR)/test-unix.Tpo -c -o test-unix.obj `if test -f '$(top_builddir)/etc/afpd/unix.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/unix.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/unix.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-unix.Tpo $(DEPDIR)/test-unix.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/unix.c' object='test-unix.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-unix.obj `if test -f '$(top_builddir)/etc/afpd/unix.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/unix.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/unix.c'; fi` test-volume.o: $(top_builddir)/etc/afpd/volume.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-volume.o -MD -MP -MF $(DEPDIR)/test-volume.Tpo -c -o test-volume.o `test -f '$(top_builddir)/etc/afpd/volume.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/volume.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-volume.Tpo $(DEPDIR)/test-volume.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/volume.c' object='test-volume.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-volume.o `test -f '$(top_builddir)/etc/afpd/volume.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/volume.c test-volume.obj: $(top_builddir)/etc/afpd/volume.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-volume.obj -MD -MP -MF $(DEPDIR)/test-volume.Tpo -c -o test-volume.obj `if test -f '$(top_builddir)/etc/afpd/volume.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/volume.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/volume.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-volume.Tpo $(DEPDIR)/test-volume.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/volume.c' object='test-volume.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-volume.obj `if test -f '$(top_builddir)/etc/afpd/volume.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/volume.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/volume.c'; fi` test-acls.o: $(top_builddir)/etc/afpd/acls.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-acls.o -MD -MP -MF $(DEPDIR)/test-acls.Tpo -c -o test-acls.o `test -f '$(top_builddir)/etc/afpd/acls.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/acls.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-acls.Tpo $(DEPDIR)/test-acls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/acls.c' object='test-acls.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-acls.o `test -f '$(top_builddir)/etc/afpd/acls.c' || echo '$(srcdir)/'`$(top_builddir)/etc/afpd/acls.c test-acls.obj: $(top_builddir)/etc/afpd/acls.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-acls.obj -MD -MP -MF $(DEPDIR)/test-acls.Tpo -c -o test-acls.obj `if test -f '$(top_builddir)/etc/afpd/acls.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/acls.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/acls.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test-acls.Tpo $(DEPDIR)/test-acls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/etc/afpd/acls.c' object='test-acls.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-acls.obj `if test -f '$(top_builddir)/etc/afpd/acls.c'; then $(CYGPATH_W) '$(top_builddir)/etc/afpd/acls.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/etc/afpd/acls.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *$$ws$$tst$$ws*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *$$ws$$tst$$ws*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ echo "SKIP: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ skipped="($$skip tests were not run)"; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: netatalk-2.2.2/test/afpd/test.c0000644000175200017500000000712511655731246013276 00000000000000/* Copyright (c) 2010 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include "file.h" #include "filedir.h" #include "directory.h" #include "dircache.h" #include "hash.h" #include "afp_config.h" #include "volume.h" #include "test.h" #include "subtests.h" #include "afpfunc_helpers.h" /* Stuff from main.c which of cource can't be added as source to testbin */ unsigned char nologin = 0; struct afp_options default_options; static AFPConfig *configs; /* Static variables */ int main(int argc, char **argv) { #define ARGNUM 7 char *args[ARGNUM] = {"test", "-F", "test.conf", "-f", "test.default", "-s" ,"test.system"}; int reti; uint16_t vid; struct vol *vol; struct dir *retdir; struct path *path; /* initialize */ afp_version = 32; printf("Initializing\n============\n"); TEST(setuplog("default log_note /dev/tty")); TEST(afp_options_init(&default_options)); TEST_int(afp_options_parse( ARGNUM, args, &default_options), 1); TEST_expr(configs = configinit(&default_options), configs != NULL); TEST(cnid_init()); TEST(load_volumes(&configs->obj)); TEST_int(dircache_init(8192), 0); printf("\n"); /* now run tests */ printf("Running tests\n=============\n"); TEST_expr(vid = openvol(&configs->obj, "test"), vid != 0); TEST_expr(vol = getvolbyvid(vid), vol != NULL); /* test directory.c stuff */ TEST_expr(retdir = dirlookup(vol, DIRDID_ROOT_PARENT), retdir != NULL); TEST_expr(retdir = dirlookup(vol, DIRDID_ROOT), retdir != NULL); TEST_expr(path = cname(vol, retdir, cnamewrap("Network Trash Folder")), path != NULL); TEST_expr(retdir = dirlookup(vol, DIRDID_ROOT), retdir != NULL); TEST_int(getfiledirparms(&configs->obj, vid, DIRDID_ROOT_PARENT, "test"), 0); TEST_int(getfiledirparms(&configs->obj, vid, DIRDID_ROOT, ""), 0); TEST_expr(reti = createdir(&configs->obj, vid, DIRDID_ROOT, "dir1"), reti == 0 || reti == AFPERR_EXIST); TEST_int(getfiledirparms(&configs->obj, vid, DIRDID_ROOT, "dir1"), 0); /* FIXME: this doesn't work although it should. "//" get translated to \000 \000 at means ".." ie this should getfiledirparms for DIRDID_ROOT_PARENT -- at least afair! TEST_int(getfiledirparms(&configs->obj, vid, DIRDID_ROOT, "//"), 0); */ TEST_int(createfile(&configs->obj, vid, DIRDID_ROOT, "dir1/file1"), 0); TEST_int(delete(&configs->obj, vid, DIRDID_ROOT, "dir1/file1"), 0); TEST_int(delete(&configs->obj, vid, DIRDID_ROOT, "dir1"), 0); TEST_int(createfile(&configs->obj, vid, DIRDID_ROOT, "file1"), 0); TEST_int(getfiledirparms(&configs->obj, vid, DIRDID_ROOT, "file1"), 0); TEST_int(delete(&configs->obj, vid, DIRDID_ROOT, "file1"), 0); /* test enumerate.c stuff */ TEST_int(enumerate(&configs->obj, vid, DIRDID_ROOT), 0); } netatalk-2.2.2/test/afpd/afpfunc_helpers.h0000644000175200017500000000330211655731246015461 00000000000000/* $Id: afpfunc_helpers.h,v 1.1.2.1 2010-02-01 10:56:08 franklahm Exp $ Copyright (c) 2010 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef AFPFUNC_HELPERS #define AFPFUNC_HELPERS #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include "file.h" #include "filedir.h" #include "directory.h" #include "dircache.h" #include "hash.h" #include "afp_config.h" #include "volume.h" #include "test.h" #include "subtests.h" extern char **cnamewrap(const char *name); extern int getfiledirparms(AFPObj *obj, uint16_t vid, cnid_t did, const char *name); extern int createdir(AFPObj *obj, uint16_t vid, cnid_t did, const char *name); extern int createfile(AFPObj *obj, uint16_t vid, cnid_t did, const char *name); extern int delete(AFPObj *obj, uint16_t vid, cnid_t did, const char *name); extern int enumerate(AFPObj *obj, uint16_t vid, cnid_t did); extern uint16_t openvol(AFPObj *obj, const char *name); #endif /* AFPFUNC_HELPERS */ netatalk-2.2.2/test/afpd/test.h0000644000175200017500000000433511655731246013303 00000000000000/* $Id: test.h,v 1.1.2.1 2010-02-01 10:56:08 franklahm Exp $ Copyright (c) 2010 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef TEST_H #define TEST_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include "directory.h" #include "dircache.h" #include "hash.h" #include "afp_config.h" #include "volume.h" #include "subtests.h" static inline void alignok(int len) { int i = 1; if (len < 80) i = 80 - len; while (i--) printf(" "); } #define TEST(a) \ printf("Testing: %s ... ", (#a) ); \ alignok(strlen(#a)); \ a; \ printf("[ok]\n"); #define TEST_int(a, b) \ printf("Testing: %s ... ", (#a) ); \ alignok(strlen(#a)); \ if ((reti = (a)) != b) { \ printf("[error]\n"); \ exit(1); \ } else { printf("[ok]\n"); } #define TEST_expr(a, b) \ printf("Testing: %s ... ", (#a) ); \ alignok(strlen(#a)); \ a; \ if (b) { \ printf("[ok]\n"); \ } else { \ printf("[error]\n"); \ exit(1); \ } #endif /* TEST_H */ netatalk-2.2.2/test/afpd/subtests.c0000644000175200017500000000344111655731246014170 00000000000000/* Copyright (c) 2010 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include "directory.h" #include "dircache.h" #include "hash.h" #include "afp_config.h" #include "volume.h" #include "test.h" #include "subtests.h" static int reti; /* for the TEST_int macro */ int test001_add_x_dirs(const struct vol *vol, cnid_t start, cnid_t end) { struct dir *dir; char dirname[20]; while (start++ < end) { sprintf(dirname, "dir%04u", start); dir = dir_new(dirname, dirname, vol, DIRDID_ROOT, htonl(start), bfromcstr(vol->v_path), 0); if (dir == NULL) return -1; if (dircache_add(vol, dir) != 0) return -1; } return 0; } int test002_rem_x_dirs(const struct vol *vol, cnid_t start, cnid_t end) { struct dir *dir; while (start++ < end) { if ((dir = dircache_search_by_did(vol, htonl(start)))) if (dir_remove(vol, dir) != 0) return -1; } return 0; } netatalk-2.2.2/test/afpd/test.sh0000755000175200017500000000100311655731130013446 00000000000000#!/bin/sh if [ ! -d /tmp/AFPtestvolume ] ; then mkdir -p /tmp/AFPtestvolume if [ $? -ne 0 ] ; then echo Error creating AFP test volume /tmp/AFPtestvolume exit 1 fi fi if [ ! -f test.conf ] ; then echo -n "Creating configuration template ... " cat > test.conf < test.default < This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef SUBTESTS_H #define SUBTESTS_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include "directory.h" #include "dircache.h" #include "hash.h" #include "afp_config.h" #include "volume.h" extern int test001_add_x_dirs(const struct vol *vol, cnid_t start, cnid_t end); extern int test002_rem_x_dirs(const struct vol *vol, cnid_t start, cnid_t end); #endif /* SUBTESTS_H */ netatalk-2.2.2/test/afpd/afpfunc_helpers.c0000644000175200017500000001335311655731246015463 00000000000000/* $Id: afpfunc_helpers.c,v 1.1.2.1 2010-02-01 10:56:08 franklahm Exp $ Copyright (c) 2010 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include "file.h" #include "filedir.h" #include "directory.h" #include "dircache.h" #include "hash.h" #include "afp_config.h" #include "volume.h" #include "test.h" #include "subtests.h" #define rbufsize 128000 static char rbuf[rbufsize]; static size_t rbuflen; #define ADD(a, b, c) (a) += (c); \ (b) += (c) #define PUSHBUF(p, val, size, len) \ memcpy((p), (val), (size)); \ (p) += (size); \ (len) += (size) #define PUSHVAL(p, type, val, len) \ { \ type type = val; \ memcpy(p, &type, sizeof(type)); \ (p) += sizeof(type); \ (len) += sizeof(type); \ } static int push_path(char **bufp, const char *name) { int len = 0; int slen = strlen(name); char *p = *bufp; PUSHVAL(p, uint8_t, 3, len); /* path type */ PUSHVAL(p, uint32_t, kTextEncodingUTF8, len); /* text encoding hint */ PUSHVAL(p, uint16_t, htons(slen), len); if (slen) { for (int i = 0; i < slen; i++) { if (name[i] == '/') p[i] = 0; else p[i] = name[i]; } len += slen; } *bufp += len; return len; } /*********************************************************************************** * Interface ***********************************************************************************/ char **cnamewrap(const char *name) { static char buf[256]; static char *p = buf; int len = 0; PUSHVAL(p, uint8_t, 3, len); /* path type */ PUSHVAL(p, uint32_t, kTextEncodingUTF8, len); /* text encoding hint */ PUSHVAL(p, uint16_t, ntohs(strlen(name)), len); strcpy(p, name); p = buf; return &p; } int getfiledirparms(AFPObj *obj, uint16_t vid, cnid_t did, const char *name) { const int bufsize = 256; char buf[bufsize]; char *p = buf; int len = 0; ADD(p, len , 2); PUSHVAL(p, uint16_t, vid, len); PUSHVAL(p, cnid_t, did, len); PUSHVAL(p, uint16_t, htons(FILPBIT_FNUM | FILPBIT_PDINFO), len); PUSHVAL(p, uint16_t, htons(DIRPBIT_DID | DIRPBIT_PDINFO), len); len += push_path(&p, name); return afp_getfildirparams(obj, buf, len, rbuf, &rbuflen); } int createdir(AFPObj *obj, uint16_t vid, cnid_t did, const char *name) { const int bufsize = 256; char buf[bufsize]; char *p = buf; int len = 0; ADD(p, len , 2); PUSHVAL(p, uint16_t, vid, len); PUSHVAL(p, cnid_t, did, len); len += push_path(&p, name); return afp_createdir(obj, buf, len, rbuf, &rbuflen); } int createfile(AFPObj *obj, uint16_t vid, cnid_t did, const char *name) { const int bufsize = 256; char buf[bufsize]; char *p = buf; int len = 0; PUSHVAL(p, uint16_t, htons(128), len); /* hard create */ PUSHVAL(p, uint16_t, vid, len); PUSHVAL(p, cnid_t, did, len); len += push_path(&p, name); return afp_createfile(obj, buf, len, rbuf, &rbuflen); } int delete(AFPObj *obj, uint16_t vid, cnid_t did, const char *name) { const int bufsize = 256; char buf[bufsize]; char *p = buf; int len = 0; PUSHVAL(p, uint16_t, htons(128), len); /* hard create */ PUSHVAL(p, uint16_t, vid, len); PUSHVAL(p, cnid_t, did, len); len += push_path(&p, name); return afp_delete(obj, buf, len, rbuf, &rbuflen); } int enumerate(AFPObj *obj, uint16_t vid, cnid_t did) { const int bufsize = 256; char buf[bufsize]; char *p = buf; int len = 0; ADD(p, len , 2); PUSHVAL(p, uint16_t, vid, len); PUSHVAL(p, cnid_t, did, len); PUSHVAL(p, uint16_t, htons(FILPBIT_PDID | FILPBIT_FNUM | FILPBIT_PDINFO), len); PUSHVAL(p, uint16_t, htons(DIRPBIT_PDID | DIRPBIT_DID | DIRPBIT_PDINFO), len); PUSHVAL(p, uint16_t, htons(20), len); /* reqcount */ PUSHVAL(p, uint32_t, htonl(1), len); /* startindex */ PUSHVAL(p, uint32_t, htonl(rbufsize), len); /* max replysize */ len += push_path(&p, ""); return afp_enumerate_ext2(obj, buf, len, rbuf, &rbuflen); } uint16_t openvol(AFPObj *obj, const char *name) { int ret; uint16_t bitmap; uint16_t vid; const int bufsize = 32; char buf[bufsize]; char *p = buf; char len = strlen(name); memset(p, 0, bufsize); p += 2; /* bitmap */ bitmap = htons(1<