]> arthur.barton.de Git - netatalk.git/commitdiff
remove old codepage/nls support
authorbfernhomberg <bfernhomberg>
Sat, 13 Sep 2003 02:46:27 +0000 (02:46 +0000)
committerbfernhomberg <bfernhomberg>
Sat, 13 Sep 2003 02:46:27 +0000 (02:46 +0000)
14 files changed:
config/AppleVolumes.default
configure.in
etc/afpd/Makefile.am
etc/afpd/afp_options.c
etc/afpd/codepage.c [deleted file]
etc/afpd/codepage.h [deleted file]
etc/afpd/globals.h
etc/afpd/nls/.cvsignore [deleted file]
etc/afpd/nls/Makefile.am [deleted file]
etc/afpd/nls/makecode.c [deleted file]
etc/afpd/nls/parsecode.c [deleted file]
etc/afpd/volume.c
etc/afpd/volume.h
macros/config-checks.m4

index b9e26ee8d94c3e9f3faef0fdfa0baf30090dd184..fcfa577272937cdaf7ba649a4fddec65c3f402cb 100644 (file)
@@ -4,7 +4,7 @@
 # 
 # volume format:
 # :DEFAULT: [all of the default options except volume name]
-# path [name] [casefold:x] [codepage:y] [options:z,l,j] \
+# 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] 
@@ -91,7 +91,6 @@
 # upriv               -> use unix privilege.  
 #
 #
-# codepage:filename   -> load filename from nls directory.
 # dbpath:path         -> store the database stuff in the following path.
 # password:password   -> set a volume password (8 characters max)
 #
index 7cf3d36340d8607925c7b35a884240b482bcc9b2..891c9c04229301c3f2696b113db1f1771a63a106 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.179.2.3.2.3 2003-09-12 18:44:16 didg Exp $
+dnl $Id: configure.in,v 1.179.2.3.2.4 2003-09-13 02:46:27 bfernhomberg Exp $
 dnl configure.in for netatalk
 
 AC_INIT(bin/adv1tov2/adv1tov2.c)
@@ -581,7 +581,6 @@ AC_ARG_ENABLE(fhs,
                sysconfdir="/etc"
                PKGCONFDIR=${sysconfdir}/netatalk
                SERVERTEXT="${PKGCONFDIR}/msg"
-               NLSDIR="${PKGCONFDIR}/nls"
                use_pam_so=yes
                mandir="/usr/share/man"
                AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
@@ -901,7 +900,6 @@ AC_OUTPUT([Makefile
        doc/Makefile
        etc/Makefile
        etc/afpd/Makefile
-       etc/afpd/nls/Makefile
        etc/atalkd/Makefile
        etc/cnid_dbd/Makefile
        etc/uams/Makefile
index e8418e08710194838c64a4e520d31ece70576f39..3c53db7f7aae0641dcad89483537a20f1b3a04c3 100644 (file)
@@ -1,22 +1,19 @@
 # Makefile.am for etc/afpd/
 
 pkgconfdir = @PKGCONFDIR@
-nlsdir = @NLSDIR@
-
-SUBDIRS = nls
 
 sbin_PROGRAMS = afpd
 
 afpd_SOURCES = unix.c ofork.c main.c switch.c auth.c volume.c directory.c \
         file.c enumerate.c desktop.c filedir.c fork.c appl.c gettok.c \
         mangle.c status.c afp_options.c afp_asp.c afp_dsi.c messages.c  \
-        afp_config.c nfsquota.c codepage.c quota.c uam.c afs.c uid.c  \
-        afp_util.c catsearch.c afprun.c
+        afp_config.c nfsquota.c quota.c uam.c afs.c uid.c afp_util.c \
+         catsearch.c afprun.c
 
 afpd_LDADD = $(top_builddir)/libatalk/libatalk.la
 afpd_LDFLAGS = -export-dynamic
 
-noinst_HEADERS = auth.h codepage.h afp_config.h desktop.h directory.h file.h \
+noinst_HEADERS = auth.h afp_config.h desktop.h directory.h file.h \
         filedir.h fork.h globals.h icon.h mangle.h misc.h status.h switch.h \
         uam_auth.h uid.h unix.h volume.h
 
@@ -31,7 +28,6 @@ CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/sys \
         -D_PATH_AFPDPWFILE=\"$(pkgconfdir)/afppasswd\" \
         -D_PATH_AFPDCONF=\"$(pkgconfdir)/afpd.conf\" \
         -D_PATH_AFPDUAMPATH=\"$(UAMS_PATH)/\" \
-        -D_PATH_AFPDNLSPATH=\"$(nlsdir)/\" \
         -DAFPD_MTAB_FILE=\"$(pkgconfdir)/afpd.mtab\" \
         -DAPPLCNAME \
         -DSERVERTEXT=\"$(SERVERTEXT)/\"
index e95cf9087c373750674150d9268d73a3fcf3ff78..9a52d9581b5b7e93e65e67a019660f05601c716a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_options.c,v 1.30.2.2.2.1 2003-09-09 16:42:19 didg Exp $
+ * $Id: afp_options.c,v 1.30.2.2.2.2 2003-09-13 02:46:28 bfernhomberg Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -133,8 +133,6 @@ void afp_options_free(struct afp_options *opt,
         free(opt->uampath);
     if (opt->uamlist && (opt->uamlist != save->uamlist))
         free(opt->uamlist);
-    if (opt->nlspath && (opt->nlspath != save->nlspath))
-        free(opt->nlspath);
     if (opt->passwdfile && (opt->passwdfile != save->passwdfile))
         free(opt->passwdfile);
     if (opt->signature && (opt->signature != save->signature))
@@ -160,7 +158,6 @@ void afp_options_init(struct afp_options *options)
     options->defaultvol.name = _PATH_AFPDDEFVOL;
     options->systemvol.name = _PATH_AFPDSYSVOL;
     options->configfile = _PATH_AFPDCONF;
-    options->nlspath = _PATH_AFPDNLSPATH;
     options->uampath = _PATH_AFPDUAMPATH;
     options->uamlist = "uams_clrtxt.so,uams_dhx.so";
     options->guest = "nobody";
@@ -433,8 +430,6 @@ int afp_options_parseline(char *buf, struct afp_options *options)
         options->uampath = opt;
     if ((c = getoption(buf, "-uamlist")) && (opt = strdup(c)))
         options->uamlist = opt;
-    if ((c = getoption(buf, "-nlspath")) && (opt = strdup(c)))
-        options->nlspath = opt;
 
     if ((c = getoption(buf, "-ipaddr"))) {
         struct in_addr inaddr;
diff --git a/etc/afpd/codepage.c b/etc/afpd/codepage.c
deleted file mode 100644 (file)
index cde0171..0000000
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- * $Id: codepage.c,v 1.8 2002-03-24 01:23:40 sibaz Exp $
- *
- * Copyright (c) 2000 Adrian Sun
- * All Rights Reserved. See COPYRIGHT.
- *
- * codepage support (based initially on some code from
- * julian@whistle.com)
- *
- * the strategy:
- * for single-byte maps, the codepage support devolves to a lookup
- * table for all possible 8-bit values. for double-byte maps, 
- * the first byte is used as a hash index followed by a linked list of
- * values.
- *
- * the badumap specifies illegal characters. these are 8-bit values
- * with an associated rule field. here are the rules:
- *   
- * illegal values: 0 is the only illegal value. no translation will
- * occur in those cases.  
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif /* HAVE_FCNTL_H */
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-#include <atalk/logger.h>
-
-#include <netatalk/endian.h>
-
-#include "globals.h"
-#include "volume.h"
-#include "codepage.h"
-
-#define MAPSIZE 256
-
-/* deal with linked lists */
-#define CP_INIT(a) (a)->next = (a)->prev = (a)
-#define CP_ADD(a, b) do { \
-  (b)->next = (a)->next; \
-  (b)->prev = (a); \
-  (a)->next = (b); \
-} while (0)
-#define CP_REMOVE(a) do {  \
-  (a)->prev->next = (a)->next; \
-  (a)->next->prev = (a)->prev; \
-} while (0)
-
-/* search for stuff */
-#if 0
-static __inline__ unsigned char *codepage_find(struct codepage *page,
-        unsigned char *from)
-{
-}
-#endif
-
-static int add_code(struct codepage *page, unsigned char *from,
-                    unsigned char *to)
-{
-#if 0
-    union codepage_val *ptr;
-#endif /* 0 */
-
-    if (page->quantum < 1) /* no quantum given. don't do anything */
-        return 1;
-
-    if (page->quantum == 1) {
-        page->map[*from].value = *to;
-        return 0;
-    }
-
-#if 0
-    if (ptr = codepage_find(page->map, from)) {
-
-    } else {
-        unsigned char *space;
-        ptr = map[*from].hash;
-
-        space = (unsigned char *) malloc(sizeof(unsigned char)*quantum);
-        if (!ptr->from) {
-        } else {
-        }
-
-        map[*from].hash
-    }
-#endif /* 0 */
-    return 0;
-}
-
-static struct codepage *init_codepage(const int quantum)
-{
-    struct codepage *cp;
-
-    cp = (struct codepage *) malloc(sizeof(struct codepage));
-    if (!cp)
-        return NULL;
-
-    if ((cp->map = (union codepage_val *)
-                   calloc(MAPSIZE, sizeof(union codepage_val))) == NULL) {
-        free(cp);
-        return NULL;
-    }
-
-    cp->quantum = quantum;
-    return cp;
-}
-
-
-static void free_codepage(struct codepage *cp)
-{
-    int i;
-
-    if (!cp)
-        return;
-
-    if (cp->map) {
-        if (cp->quantum > 1) {
-            /* deal with any linked lists that may exist */
-            for (i = 0; i < MAPSIZE; i++) {
-                struct codepage_hash *ptr, *h;
-
-                h = &cp->map[i].hash; /* we don't free this one */
-                while ((ptr = h->prev) != h) {
-                    CP_REMOVE(ptr);
-                    free(ptr);
-                }
-            }
-        }
-        free(cp->map);
-    }
-    free(cp);
-}
-
-
-
-/* this is used by both codepages and generic mapping utilities. we
- * allocate enough space to map all 8-bit characters if necessary.
- * for double-byte mappings, we just use the table as a hash lookup.
- * if we don't match, we don't convert.
- */
-int codepage_init(struct vol *vol, const int rules,
-                  const int quantum)
-{
-    if ((rules & CODEPAGE_RULE_UTOM) && !vol->v_utompage) {
-        vol->v_utompage = init_codepage(quantum);
-        if (!vol->v_utompage)
-            goto err_utompage;
-    }
-
-    if ((rules & CODEPAGE_RULE_MTOU) && !vol->v_mtoupage) {
-        vol->v_mtoupage = init_codepage(quantum);
-        if (!vol->v_mtoupage) {
-            goto err_mtoupage;
-        }
-    }
-
-    if ((rules & CODEPAGE_RULE_BADU)  && !vol->v_badumap) {
-        vol->v_badumap = init_codepage(quantum);
-        if (!vol->v_badumap)
-            goto err_mtoupage;
-    }
-    return 0;
-
-err_mtoupage:
-    free_codepage(vol->v_mtoupage);
-    vol->v_mtoupage = NULL;
-
-err_utompage:
-    free_codepage(vol->v_utompage);
-    vol->v_utompage = NULL;
-    return -1;
-}
-
-void codepage_free(struct vol *vol)
-{
-    if (vol->v_utompage) {
-        free_codepage(vol->v_utompage);
-        vol->v_utompage = NULL;
-    }
-
-    if (vol->v_mtoupage) {
-        free_codepage(vol->v_mtoupage);
-        vol->v_mtoupage = NULL;
-    }
-
-    if (vol->v_badumap) {
-        free_codepage(vol->v_badumap);
-        vol->v_badumap = NULL;
-    }
-}
-
-
-int codepage_read(struct vol *vol, const char *path)
-{
-    unsigned char buf[CODEPAGE_FILE_HEADER_SIZE], *cur;
-    u_int16_t id;
-    int fd, i, quantum, rules;
-
-    if ((fd = open(path, O_RDONLY)) < 0) {
-        LOG(log_error, logtype_afpd, "%s: failed to open codepage", path);
-        return -1;
-    }
-
-    /* Read the codepage file header. */
-    if(read(fd, buf, sizeof(buf)) != sizeof(buf)) {
-        LOG(log_error, logtype_afpd, "%s: failed to read codepage header", path);
-        goto codepage_fail;
-    }
-
-    /* Check the file id */
-    cur = buf;
-    memcpy(&id, cur, sizeof(id));
-    cur += sizeof(id);
-    id = ntohs(id);
-    if (id != CODEPAGE_FILE_ID) {
-        LOG(log_error, logtype_afpd, "%s: not a codepage", path);
-        goto codepage_fail;
-    }
-
-    /* check the version number */
-    if (*cur++ != CODEPAGE_FILE_VERSION) {
-        LOG(log_error, logtype_afpd, "%s: codepage version not supported", path);
-        goto codepage_fail;
-    }
-
-    /* ignore namelen */
-    cur++;
-
-    /* find out the data quantum size. default to 1 if nothing's given. */
-    quantum = *cur ? *cur : 1;
-    cur++;
-
-    /* rules used in this file. */
-    rules = *cur++;
-
-    if (codepage_init(vol, rules, quantum) < 0) {
-        LOG(log_error, logtype_afpd, "%s: Unable to allocate memory", path);
-        goto codepage_fail;
-    }
-
-    /* offset to data */
-
-    /* skip to the start of the data */
-    memcpy(&id, cur , sizeof(id));
-    id = ntohs(id);
-    lseek(fd, id, SEEK_SET);
-
-    /* mtoupage is the the equivalent of samba's unix2dos. utompage is
-     * the equivalent of dos2unix. it's a little confusing due to a
-     * desire to match up with mtoupath and utompath. 
-     * NOTE: we allow codepages to specify 7-bit mappings if they want. 
-     */
-    i = 1 + 2*quantum;
-    while (read(fd, buf, i) == i) {
-        if (*buf & CODEPAGE_RULE_MTOU) {
-            if (add_code(vol->v_mtoupage, buf + 1, buf + 1 + quantum) < 0) {
-                LOG(log_error, logtype_afpd, "unable to allocate memory for mtoupage");
-                break;
-            }
-        }
-
-        if (*buf & CODEPAGE_RULE_UTOM) {
-            if (add_code(vol->v_utompage, buf + 1 + quantum, buf + 1) < 0) {
-                LOG(log_error, logtype_afpd, "unable to allocate memory for utompage");
-                break;
-            }
-        }
-
-        /* we only look at the first character here. if we need to
-         * do so, we can always use the quantum to expand the 
-         * available flags. */
-        if (*buf & CODEPAGE_RULE_BADU)
-            vol->v_badumap->map[*(buf + 1)].value = *(buf + 1 + quantum);
-    }
-    close(fd);
-    return 0;
-
-codepage_fail:
-    close(fd);
-    return -1;
-}
diff --git a/etc/afpd/codepage.h b/etc/afpd/codepage.h
deleted file mode 100644 (file)
index f7456a7..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * $Id: codepage.h,v 1.3 2001-12-03 05:03:38 jmarcus Exp $
- */
-
-#ifndef AFPD_CODEPAGE_H
-#define AFPD_CODEPAGE_H 1
-
-/*
- * header of a codepage --
- * file magic:                   2 bytes
- * file version:                 1 byte
- * size of name:                 1 byte
- * quantum:                      1 byte
- * rules:                        1 byte
- * offset to data:               2 bytes (network byte order)
- * size of data:                 2 bytes (network byte order)
- * name:                         strlen(name) bytes (padded)
- * 
- * data for a version 2 codepage --
- * mapping rule: 1 byte
- * mac/bad code:     <quantum> bytes
- * xlate/rule code:  <quantum> bytes
- * ...
- */
-
-#define CODEPAGE_FILE_ID 0xCFAF
-#define CODEPAGE_FILE_VERSION 0x02
-#define CODEPAGE_FILE_HEADER_SIZE 10
-
-/* m->u and u->m mappings */
-#define CODEPAGE_RULE_MTOU       (1 << 0)
-#define CODEPAGE_RULE_UTOM       (1 << 1)
-#define CODEPAGE_RULE_BADU       (1 << 2)
-
-/* rules for bad character assignment.
- *
- * bit assignments:
- * bit 0 set:  it's an illegal character
- *     unset:  it's okay
- *
- * bit 1 set:  bad anywhere
- *     unset:  only check at the beginning of each quantum. 
- *
- * bit 2 set:  all quanta are the same length
- *     unset:  quanta beginning with ascii characters are 1-byte long  
- *
- */
-#define CODEPAGE_BADCHAR_SET      (1 << 0) 
-#define CODEPAGE_BADCHAR_ANYWHERE (1 << 1)  
-#define CODEPAGE_BADCHAR_QUANTUM  (1 << 2) 
-
-#endif
index 458c1a3e556e31279a4260694cede749da817586..0dd2c5dbc91bca727ad3e08a3fee1454ec739d88 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: globals.h,v 1.18.2.2.2.1 2003-09-09 16:42:20 didg Exp $
+ * $Id: globals.h,v 1.18.2.2.2.2 2003-09-13 02:46:28 bfernhomberg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -62,7 +62,7 @@ struct afp_options {
     u_int32_t server_quantum;
     char hostname[MAXHOSTNAMELEN + 1], *server, *ipaddr, *configfile;
     struct at_addr ddpaddr;
-    char *uampath, *nlspath, *fqdn;
+    char *uampath, *fqdn;
     char *pidfile;
     struct afp_volume_name defaultvol, systemvol, uservol;
 
diff --git a/etc/afpd/nls/.cvsignore b/etc/afpd/nls/.cvsignore
deleted file mode 100644 (file)
index df423a7..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Makefile
-Makefile.in
-makecode
-parsecode
-.deps
-.libs
-maccode.*
diff --git a/etc/afpd/nls/Makefile.am b/etc/afpd/nls/Makefile.am
deleted file mode 100644 (file)
index 752701a..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-# Makefile.am for etc/afpd/nls/
-
-pkgconfdir = @PKGCONFDIR@
-nlsdir = @NLSDIR@
-
-bin_PROGRAMS = makecode parsecode
-
-makecode_SOURCES = makecode.c
-parsecode_SOURCES = parsecode.c
-
-MACCODES =                             \
-       maccode.437                     \
-       maccode.850                     \
-       maccode.iso8859-1               \
-       maccode.iso8859-1.adapted       \
-       maccode.koi8-r
-
-CFLAGS = -I$(top_srcdir)/sys -I$(top_srcdir)/etc/afpd @CFLAGS@
-
-$(MACCODES): makecode
-       ./makecode $@
-
-#
-# install/install-strip:
-#
-
-install-data-local: $(MACCODES)
-       mkdir -p $(DESTDIR)$(nlsdir); \
-       for f in $(MACCODES); do \
-               $(INSTALL_DATA) $$f $(DESTDIR)$(nlsdir)/; \
-       done
-
-#
-# cleanup
-#
-
-CLEANFILES = $(MACCODES)
diff --git a/etc/afpd/nls/makecode.c b/etc/afpd/nls/makecode.c
deleted file mode 100644 (file)
index ae958ee..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * $Id: makecode.c,v 1.7 2002-12-01 00:44:12 srittau Exp $
- *
- * quick-and-dirty way of creating code pages
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <netatalk/endian.h>
-#include "codepage.h"
-
-/* map of cp10000 (mac roman) to iso-latin-1 */
-static const unsigned char mac_to_isolatin1_map[] = {
-    0xC4, 0xC5, 0xC7, 0xC9, 0xD1, 0xD6, 0xDC, 0xE1,
-    0xE0, 0xE2, 0xE4, 0xE3, 0xE5, 0xE7, 0xE9, 0xE8,
-    0xEA, 0xEB, 0xED, 0xEC, 0xEE, 0xEF, 0xF1, 0xF3,
-    0xF2, 0xF4, 0xF6, 0xF5, 0xFA, 0xF9, 0xFB, 0xFC,
-    0x00, 0xB0, 0xA2, 0xA3, 0xA7, 0xB7, 0xB6, 0xDF,
-    0xAE, 0xA9, 0x00, 0xB4, 0xA8, 0x00, 0xC6, 0xD8,
-    0x00, 0xB1, 0x00, 0x00, 0xA5, 0xB5, 0xF0, 0x00,
-    0x00, 0x00, 0x00, 0xAA, 0xBA, 0x00, 0xE6, 0xF8,
-    0xBF, 0xA1, 0xAC, 0x00, 0x00, 0x00, 0x00, 0xAB,
-    0xBB, 0x00, 0xA0, 0xC0, 0xC3, 0xD5, 0x00, 0x00,
-    0xAD, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF7, 0x00,
-    0xFF, 0x00, 0x00, 0xA4, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0xB8, 0x00, 0x00, 0xC2, 0xCA, 0xC1,
-    0xCB, 0xC8, 0xCD, 0xCE, 0xCF, 0xCC, 0xD3, 0xD4,
-    0x00, 0xD2, 0xDA, 0xDB, 0xD9
-    /*, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-      0x00, 0x00, 0x00, 0x00, 0x00 */
-};
-
-/* map of cp10000 (mac roman) to iso-latin-1 adapted */
-static const unsigned char mac_to_isolatin1_adapted_map[] = {
-    0xC4, 0xC5, 0xC7, 0xC9, 0xD1, 0xD6, 0xDC, 0xE1,
-    0xE0, 0xE2, 0xE4, 0xE3, 0xE5, 0xE7, 0xE9, 0xE8,
-    0xEA, 0xEB, 0xED, 0xEC, 0xEE, 0xEF, 0xF1, 0xF3,
-    0xF2, 0xF4, 0xF6, 0xF5, 0xFA, 0xF9, 0xFB, 0xFC,
-    0x00, 0xB0, 0xA2, 0xA3, 0xA7, 0xB7, 0xB6, 0xDF,
-    0xAE, 0xA9, 0xFE, 0xB4, 0xA8, 0x00, 0xC6, 0xD8,
-    0x00, 0xB1, 0x00, 0x00, 0xA5, 0xB5, 0xF0, 0x00,
-    0x00, 0x00, 0x00, 0xAA, 0xBA, 0x00, 0xE6, 0xF8,
-    0xBF, 0xA1, 0xAC, 0x00, 0xFD, 0x00, 0x00, 0xAB,
-    0xBB, 0x00, 0xA0, 0xC0, 0xC3, 0xD5, 0x00, 0x00,
-    0xAD, 0xAF, 0xB2, 0xB3, 0xDD, 0xDE, 0xF7, 0xB0,
-    0xFF, 0x00, 0x00, 0xA4, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0xB8, 0x00, 0x00, 0xC2, 0xCA, 0xC1,
-    0xCB, 0xC8, 0xCD, 0xCE, 0xCF, 0xCC, 0xD3, 0xD4,
-    0x00, 0xD2, 0xDA, 0xDB, 0xD9
-    /*, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-      0x00, 0x00, 0x00, 0x00, 0x00 */
-};
-
-/* Map of CP10000 (Mac Roman) to MSDOS CP 437 */
-static const unsigned char mac_to_cp437_map[] = {
-    0x8e, 0x8f, 0x80, 0x90, 0xa5, 0x99, 0x9a, 0xa0,
-    0x85, 0x83, 0x84, 0xe0, 0x86, 0x87, 0x82, 0x8a,
-    0x88, 0x89, 0xa1, 0x8d, 0x8c, 0x8b, 0xa4, 0xa2,
-    0x95, 0x93, 0x94, 0xe5, 0xa3, 0x97, 0x96, 0x81,
-    0xc5, 0xf8, 0x9b, 0x9c, 0xb6, 0xf9, 0xb8, 0xe1,
-    0xc9, 0xe9, 0xcb, 0xd9, 0xc0, 0xd8, 0x92, 0xe8,
-    0xec, 0xf1, 0xf3, 0xf2, 0x9d, 0xe6, 0xeb, 0xe4,
-    0xef, 0xe3, 0xf4, 0xa6, 0xa7, 0xea, 0x91, 0xed,
-    0xa8, 0xad, 0xaa, 0xfb, 0x9f, 0xf7, 0xdd, 0xae,
-    0xaf, 0xb0, 0xff, 0xd6, 0xd2, 0xb1, 0xb2, 0xb7,
-    0xb4, 0xc4, 0xb5, 0xb9, 0xba, 0xbb, 0xf6, 0xbc,
-    0x98, 0xbd, 0xf5, 0xfe, 0xbe, 0xbf, 0xc1, 0xc2,
-    0xce, 0xfa, 0xc3, 0xc6, 0xc7, 0xc8, 0xee, 0xca,
-    0xcc, 0xcd, 0xb3, 0xd7, 0xcf, 0xd0, 0xd1, 0xd3,
-    0xdb, 0xda, 0xa9, 0xab, 0xac, 0xd4, 0xd5, 0xdc,
-    0xde, 0xdf, 0xfc, 0xfd, 0xe7, 0xe2, 0xf0, 0x9e
-};
-
-/* Map of CP10000 (Mac Roman) to MSDOS CP 850 */
-static const unsigned char mac_to_cp850_map[] = {
-    0x8e, 0x8f, 0x80, 0x90, 0xa5, 0x99, 0x9a, 0xa0,
-    0x85, 0x83, 0x84, 0xc6, 0x86, 0x87, 0x82, 0x8a,
-    0x88, 0x89, 0xa1, 0x8d, 0x8c, 0x8b, 0xa4, 0xa2,
-    0x95, 0x93, 0x94, 0xe4, 0xa3, 0x97, 0x96, 0x81,
-    0xc5, 0xf8, 0xbd, 0x9c, 0xf5, 0xb0, 0xf4, 0xe1,
-    0xa9, 0xb8, 0xb1, 0xef, 0xf9, 0xca, 0x92, 0x9d,
-    0xb2, 0xf1, 0xb3, 0xb4, 0xbe, 0xe6, 0xd0, 0xba,
-    0xbb, 0xcb, 0xdd, 0xa6, 0xa7, 0xbc, 0x91, 0x9b,
-    0xa8, 0xad, 0xaa, 0xd9, 0x9f, 0xf2, 0xfe, 0xae,
-    0xaf, 0xdc, 0xff, 0xb7, 0xc7, 0xe5, 0xc0, 0xc1,
-    0xc2, 0xc4, 0xc3, 0x9e, 0xab, 0xac, 0xf6, 0xbf,
-    0x98, 0xed, 0xc8, 0xcf, 0xc9, 0xcc, 0xcd, 0xce,
-    0xd1, 0xfa, 0xd5, 0xda, 0xdb, 0xb6, 0xd2, 0xb5,
-    0xd3, 0xd4, 0xd6, 0xd7, 0xd8, 0xde, 0xe0, 0xe2,
-    0xf0, 0xe3, 0xe9, 0xea, 0xeb, 0xfb, 0xdf, 0xe7,
-    0xee, 0xe8, 0xec, 0xf3, 0xf7, 0xfc, 0xfd, 0xb9
-};
-
-
-
-/* Map of CP10000 (Mac Roman) to koi8-r */
-static const unsigned char mac_to_koi8_r_map[] = {
-    225, 226, 247, 231, 228, 229, 246, 250,
-    233, 234, 235, 236, 237, 238, 239, 240,
-    242, 243, 244, 245, 230, 232, 227, 254,
-    251, 253, 255, 249, 248, 252, 224, 241,
-    160, 161, 162, 163, 164, 165, 166, 167,
-    168, 191, 170, 171, 172, 173, 174, 175,
-    176, 177, 178, 179, 180, 181, 182, 183,
-    184, 185, 186, 187, 188, 189, 190, 191,
-    192, 193, 194, 195, 196, 197, 198, 199,
-    200, 201, 202, 203, 204, 205, 206, 207,
-    208, 209, 210, 211, 212, 213, 214, 215,
-    216, 217, 218, 219, 220, 179, 163, 209,
-    193, 194, 215, 199, 196, 197, 214, 218,
-    201, 202, 203, 204, 205, 206, 207, 208,
-    210, 211, 212, 213, 198, 200, 195, 222,
-    219, 221, 223, 217, 216, 220, 192, 255
-};
-
-struct mac_code {
-    char *m_name;
-    const unsigned char *m_map;
-    u_int16_t m_len;
-    const char *m_id;
-};
-
-static struct mac_code names[] = {
-                                     {"maccode.437", mac_to_cp437_map, sizeof(mac_to_cp437_map), "cp437"},
-                                     {"maccode.850", mac_to_cp850_map, sizeof(mac_to_cp850_map), "cp850"},
-                                     {"maccode.iso8859-1", mac_to_isolatin1_map, sizeof(mac_to_isolatin1_map), "iso8859-1"},
-                                     {"maccode.iso8859-1.adapted", mac_to_isolatin1_adapted_map, sizeof(mac_to_isolatin1_adapted_map), "iso8859-1-adapted"},
-                                     {"maccode.koi8-r",mac_to_koi8_r_map,sizeof(mac_to_koi8_r_map),"koi8-r"},
-                                     {NULL, NULL, 0, NULL}
-                                 };
-
-int main(int argc, char **argv)
-{
-    unsigned char buf[CODEPAGE_FILE_HEADER_SIZE];
-    u_int16_t id;
-    int i, j;
-    FILE *fp;
-
-    if (argc != 2) {
-        fprintf(stderr, "Usage: %s MACCODE\n", argv[0]);
-        return 1;
-    }
-
-    for (i = 0; names[i].m_name; i++) {
-        if (!strcmp(names[i].m_name, argv[1]))
-            break;
-    }
-
-    if (!names[i].m_name) {
-        fprintf(stderr, "unknown codepage\n");
-        return 1;
-    }
-
-
-    if ((fp = fopen(names[i].m_name, "w")) == NULL) {
-        fprintf(stderr, "can't open %s: %s\n",
-                names[i].m_name, strerror(errno));
-        return 1;
-    }
-
-    memset(buf, 0, CODEPAGE_FILE_HEADER_SIZE);
-
-    id = htons(CODEPAGE_FILE_ID); /* file id */
-    memcpy(buf, &id, sizeof(id));
-    *(buf + 2) = CODEPAGE_FILE_VERSION; /* version */
-    if ((j = strlen(names[i].m_id)) & 1) /* pad to even boundary */
-        j++;
-    *(buf + 3) = j; /* length of name */
-
-    *(buf + 4) = 1; /* default quantum. this should be modified to
-                     * deal with multibyte characters */
-
-    /* rules */
-    *(buf + 5) = CODEPAGE_RULE_MTOU | CODEPAGE_RULE_UTOM;
-
-    /* offset to data */
-    id = htons(CODEPAGE_FILE_HEADER_SIZE + j);
-    memcpy(buf + 6, &id, sizeof(id));
-
-    /* size of data */
-    id = htons(names[i].m_len);
-    memcpy(buf + 8, &id, sizeof(id));
-
-    /* write it out */
-    fwrite(buf, CODEPAGE_FILE_HEADER_SIZE, 1, fp);
-
-    /* we either keep or drop the null byte to keep the name on an
-     * even boundary */
-    fwrite(names[i].m_id, j, 1, fp);
-
-    /* we typically only map characters > 0x7F */
-    for (j = 0; j < names[i].m_len; j++) {
-        buf[0] = CODEPAGE_RULE_MTOU | CODEPAGE_RULE_UTOM;
-        buf[1] = j + 0x80;
-        buf[2] = names[i].m_map[j];
-        fwrite(buf, 3, 1, fp);
-    }
-    fclose(fp);
-
-    return 0;
-}
diff --git a/etc/afpd/nls/parsecode.c b/etc/afpd/nls/parsecode.c
deleted file mode 100644 (file)
index dcb1bf5..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <netatalk/endian.h>
-#include "codepage.h"
-
-int main(int argc, char **argv)
-{
-    unsigned char name[255 + 1], buf[CODEPAGE_FILE_HEADER_SIZE];
-    unsigned char quantum, rules;
-    u_int16_t id;
-    FILE *fp;
-
-    if (argc != 2) {
-        fprintf(stderr, "%s <codepage>\n", *argv);
-        return -1;
-    }
-
-    if ((fp = fopen(argv[1], "r")) == NULL) {
-        fprintf(stderr, "%s: can't open file.\n", *argv);
-        return -1;
-    }
-
-    if (fread(buf, CODEPAGE_FILE_HEADER_SIZE, 1, fp) != 1) {
-        fprintf(stderr, "%s: can't get header.\n", *argv);
-        goto fail_end;
-    }
-
-    /* id */
-    memcpy(&id, buf, sizeof(id));
-    id = ntohs(id);
-    if (id != CODEPAGE_FILE_ID) {
-        fprintf(stderr, "%s: wrong file type.\n", *argv);
-        goto fail_end;
-    }
-
-    /* version */
-    if (*(buf + 2) != CODEPAGE_FILE_VERSION) {
-        fprintf(stderr, "%s: wrong file version.\n", *argv);
-        goto fail_end;
-    }
-
-    /* size of name */
-    id = *(buf + 3);
-
-    /* quantum and rules */
-    quantum = *(buf + 4);
-    rules = *(buf + 5);
-
-    fread(name, id, 1, fp);
-    if (name[id - 1] != '\0') /* name isn't null-padded */
-        name[id] = '\0';
-    printf("codepage: %s [", name);
-
-    /* move to the data */
-    memcpy(&id, buf + 6, sizeof(id));
-    id = ntohs(id);
-    fseek(fp, id, SEEK_SET);
-
-    /* size of data */
-    memcpy(&id, buf + 8, sizeof(id));
-    id = ntohs(id);
-    printf("size=%d]\n", id);
-    printf("---------\n");
-
-    while (fread(buf, 1 + 2*quantum, 1, fp) == 1) {
-        printf("0x%02x: 0x%02X 0x%02X\n", buf[0], buf[1], buf[1 + quantum]);
-    }
-    fclose(fp);
-    return 0;
-
-fail_end:
-    fclose(fp);
-    return -1;
-}
index 35d4e1eeb5eec8d621f3079955355ac048f2860e..09737f98c5a5dc7c6dfc52e7f340116e45f20dc5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.c,v 1.51.2.7.2.1 2003-09-09 16:42:20 didg Exp $
+ * $Id: volume.c,v 1.51.2.7.2.2 2003-09-13 02:46:28 bfernhomberg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -89,12 +89,11 @@ static void             free_extmap(void);
 #define VOLOPT_DENY       1  /* user deny list */
 #define VOLOPT_RWLIST     2  /* user rw list */
 #define VOLOPT_ROLIST     3  /* user ro list */
-#define VOLOPT_CODEPAGE   4  /* codepage */
-#define VOLOPT_PASSWORD   5  /* volume password */
-#define VOLOPT_CASEFOLD   6  /* character case mangling */
-#define VOLOPT_FLAGS      7  /* various flags */
-#define VOLOPT_DBPATH     8  /* path to database */
-#define VOLOPT_MAPCHARS   9  /* does mtou and utom mappings. syntax:
+#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_MAPCHARS   8  /* does mtou and utom mappings. syntax:
 m and u can be double-byte hex
 strings if necessary.
 m=u -> map both ways
@@ -310,28 +309,6 @@ static int optionok(const char *buf, const char *opt, const char *val)
     return 1;    
 }
 
-static __inline__ char *get_codepage_path(const char *path, const char *name)
-{
-    char *page;
-    int len;
-
-    if (path) {
-        page = (char *) malloc((len = strlen(path)) + strlen(name) + 2);
-        if (page) {
-            strcpy(page, path);
-            if (path[len - 1] != '/') /* add a / */
-                strcat(page, "/");
-            strcat(page, name);
-        }
-    } else {
-        page = strdup(name);
-    }
-
-    /* debug: show which codepage directory we are using */
-    LOG(log_debug, logtype_afpd, "using codepage directory: %s", page);
-
-    return page;
-}
 
 /* -------------------- */
 static void setoption(struct vol_option *options, struct vol_option *save, int opt, const char *val)
@@ -345,7 +322,7 @@ static void setoption(struct vol_option *options, struct vol_option *save, int o
    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 *nlspath, const char *tmp)
+                   const char *tmp)
 {
     char *val;
 
@@ -372,11 +349,9 @@ static void volset(struct vol_option *options, struct vol_option *save,
         setoption(options, save, VOLOPT_ROLIST, val);
 
     } else if (optionok(tmp, "codepage:", val)) {
-        if (options[VOLOPT_CODEPAGE].c_value && 
-                (!save || options[VOLOPT_CODEPAGE].c_value != save[VOLOPT_CODEPAGE].c_value)) {
-            free(options[VOLOPT_CODEPAGE].c_value);
-        }
-        options[VOLOPT_CODEPAGE].c_value = get_codepage_path(nlspath, val + 1);
+       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 (-1);
     } else if (optionok(tmp, "volcharset:", val)) {
         setoption(options, save, VOLOPT_ENCODING, val);
     } else if (optionok(tmp, "maccharset:", val)) {
@@ -412,10 +387,6 @@ static void volset(struct vol_option *options, struct vol_option *save,
                 options[VOLOPT_FLAGS].i_value |= AFPVOL_A2VOL;
             else if (strcasecmp(p, "mswindows") == 0) {
                 options[VOLOPT_FLAGS].i_value |= AFPVOL_MSWINDOWS;
-                if (!options[VOLOPT_CODEPAGE].c_value)
-                    options[VOLOPT_CODEPAGE].c_value =
-                        get_codepage_path(nlspath, MSWINDOWS_CODEPAGE);
-
             } else if (strcasecmp(p, "crlf") == 0)
                 options[VOLOPT_FLAGS].i_value |= AFPVOL_CRLF;
             else if (strcasecmp(p, "noadouble") == 0)
@@ -568,10 +539,6 @@ static int creatvol(AFPObj *obj, struct passwd *pwd,
         /* shift in some flags */
         volume->v_flags = options[VOLOPT_FLAGS].i_value;
 
-        /* read in the code pages */
-        if (options[VOLOPT_CODEPAGE].c_value)
-            codepage_read(volume, options[VOLOPT_CODEPAGE].c_value);
-
         if (options[VOLOPT_PASSWORD].c_value)
             volume->v_password = strdup(options[VOLOPT_PASSWORD].c_value);
 
@@ -884,7 +851,7 @@ struct passwd *pwent;
                                    path + VOLOPT_DEFAULT_LEN) < 0)
                         break;
                     volset(save_options, NULL, tmp, sizeof(tmp) - 1,
-                           obj->options.nlspath, path + VOLOPT_DEFAULT_LEN);
+                           path + VOLOPT_DEFAULT_LEN);
                 }
             }
             break;
@@ -947,7 +914,7 @@ struct passwd *pwent;
                 if (parseline( sizeof( tmp ) - 1, tmp ) < 0)
                     break;
 
-                volset(options, save_options, volname, sizeof(volname) - 1,obj->options.nlspath, tmp);
+                volset(options, save_options, volname, sizeof(volname) - 1, tmp);
             }
 
             /* check allow/deny lists:
@@ -999,7 +966,6 @@ static void volume_free(struct vol *vol)
     free(vol->v_name);
     vol->v_name = NULL;
     free(vol->v_path);
-    codepage_free(vol);
     free(vol->v_password);
     free(vol->v_veto);
     free(vol->v_volcodepage);
index 82cd29eb05ab7aa67b8b924469773ee14f452d24..92185d2ac2d3e112a3210065be5eb44ba3f09a7f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.h,v 1.19.2.5.2.1 2003-09-09 16:42:20 didg Exp $
+ * $Id: volume.h,v 1.19.2.5.2.2 2003-09-13 02:46:28 bfernhomberg Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
 
 #include <atalk/cnid.h>
 
-struct codepage_hash {
-    unsigned char *from, *to;
-    struct codepage_hash *next, *prev;
-};
-
-union codepage_val {
-    struct codepage_hash hash; /* hash for multibyte values */
-    unsigned char value; /* single byte value/rule */
-};
-
-struct codepage {
-    union codepage_val *map;
-    int quantum;
-};
-
-#define CP_HASH(a)    (*(a))
-
 struct vol {
     struct vol         *v_next;
     char               *v_name;
@@ -56,7 +39,6 @@ struct vol {
     int                 v_nfs;
     
     int                 v_casefold;
-    struct codepage     *v_mtoupage, *v_utompage, *v_badumap;
     size_t              max_filename;
     
     char                *v_password;
@@ -140,7 +122,6 @@ this is going away. */
 #define AFPVOL_ULOWERMUPPER    (AFPVOL_MTOULOWER | AFPVOL_UTOMUPPER)
 
 #define MSWINDOWS_BADCHARS ":\t\\/<>*?|\""
-#define MSWINDOWS_CODEPAGE "maccode.iso8859-1"
 
 int wincheck(const struct vol *vol, const char *path);
 
@@ -187,12 +168,6 @@ extern struct vol  *getvolbyvid __P((const u_int16_t));
 extern int              ustatfs_getvolspace __P((const struct vol *,
             VolSpace *, VolSpace *,
             u_int32_t *));
-extern int              codepage_init __P((struct vol *, const int,
-            const int));
-extern void             codepage_free __P((struct vol *vol));
-
-extern int              codepage_read __P((struct vol *, const char *));
-extern union codepage_val codepage_find __P(());
 extern void             setvoltime __P((AFPObj *, struct vol *));
 extern int              pollvoltime __P((AFPObj *));
 extern void             load_volumes __P((AFPObj *obj));
index fe399d7615ac7d126546c9d4e745f4d5cda09b76..b1370358959df027fadf0ab27d11079ec489b211 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: config-checks.m4,v 1.3.4.1 2003-09-03 20:40:51 didg Exp $
+dnl $Id: config-checks.m4,v 1.3.4.1.2.1 2003-09-13 02:46:28 bfernhomberg Exp $
 dnl Autoconf macro to set the configuration directories.
 
 AC_DEFUN([NETATALK_CONFIG_DIRS], [
@@ -14,16 +14,6 @@ AC_DEFUN([NETATALK_CONFIG_DIRS], [
                ]
        )
 
-       NLSDIR="${datadir}/netatalk/nls"
-
-       AC_ARG_WITH(nls-dir,
-               [  --with-nls-dir=PATH     path to NLS files [DATA/netatalk/nls]],
-               [
-                       if test "x$withval" != "x"; then
-                               NLSDIR="$withval"
-                       fi
-               ]
-       )
 
        SERVERTEXT="${PKGCONFDIR}/msg"
 
@@ -39,6 +29,5 @@ AC_DEFUN([NETATALK_CONFIG_DIRS], [
        )
 
        AC_SUBST(PKGCONFDIR)
-       AC_SUBST(NLSDIR)
        AC_SUBST(SERVERTEXT)
 ])