]> arthur.barton.de Git - netatalk.git/commitdiff
Reintroduce file extension type/creator mapping
authorFrank Lahm <franklahm@googlemail.com>
Sun, 14 Oct 2012 12:53:51 +0000 (14:53 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Mon, 15 Oct 2012 08:13:24 +0000 (10:13 +0200)
NEWS
config/Makefile.am
config/extmap.conf [new file with mode: 0644]
etc/afpd/file.c
etc/afpd/file.h
include/atalk/globals.h
include/atalk/netatalk_conf.h
include/atalk/volume.h
libatalk/libatalk-3.0.1dev.abi
libatalk/util/netatalk_conf.c
man/man5/afp.conf.5.tmpl

diff --git a/NEWS b/NEWS
index 2b943b34619820e6af83ceb523451b6366797aa5..e1a68c436a8e96af037e30cb88ba0b0020e10d9e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
 Changes in 3.0.2
 ================
+* NEW: afpd: Put file extension type/creator mapping back in which had
+       been removed in 3.0.
 * UPD: ignore duplicated or nested volume path.
 * FIX: "path" parameter value may contain symlink.
 * FIX: "basedir regex" was never able to treat symlink.
index 4763046063a2ce5cd491e74dd8f0c46a831fa96c..db57476d12b6e0c49af381a7a9bb8fd7b903c65b 100644 (file)
@@ -10,7 +10,7 @@ EXTRA_DIST = afp.conf.tmpl
 
 OVERWRITE_CONFIG = @OVERWRITE_CONFIG@
 
-CONFFILES = 
+CONFFILES = extmap.conf
 
 pkgconfdir = @PKGCONFDIR@
 #
diff --git a/config/extmap.conf b/config/extmap.conf
new file mode 100644 (file)
index 0000000..44ccec5
--- /dev/null
@@ -0,0 +1,308 @@
+# Netatalk file extension -> OS X type/creator mapping configuration file
+#
+# Delete a '#' character at the head of line to uncomment and enable a mapping
+#
+### Default translation:
+#.         "????"  "????"      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
+#.fla      "SPA "  "MFL2"      Flash source                   Macromedia Flash
+#.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
+
+# 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
index 8cd5f456947333a38372e90487aa78c7819eae70..8d5d0ad0e5c607b3b37ceaa0b4e503d6336a5743 100644 (file)
@@ -77,6 +77,7 @@ static int default_type(void *finder)
 /* 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;
 
@@ -85,6 +86,9 @@ void *get_finderinfo(const struct vol *vol, const char *upath, struct adouble *a
 
     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);
@@ -105,6 +109,12 @@ void *get_finderinfo(const struct vol *vol, const char *upath, struct adouble *a
         memcpy((char *)data + FINDERINFO_FRCREATOFF,"rhap",4); 
     }
 
+    /** 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;
 }
 
@@ -1002,6 +1012,17 @@ int setfilparams(const AFPObj *obj, struct vol *vol,
             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 :
index aa9f3b4449a8ea386adf328e8b3f97d39cf759b6..ec811596b9a0d3c813028c822410c5fdfdf4a45c 100644 (file)
@@ -51,12 +51,6 @@ extern const u_char  ufinderi[];
 #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 {
index 36508e17cc470b1431ef549b1e398c1ce4e475a1..a8313a36b6d24f34875c36479aecd2bd8e5de0b6 100644 (file)
@@ -86,7 +86,7 @@ struct afp_options {
     char *uampath, *fqdn;
     char *sigconffile;
     char *uuidconf;
-    char *guest, *loginmesg, *keyfile, *passwdfile;
+    char *guest, *loginmesg, *keyfile, *passwdfile, *extmapfile;
     char *uamlist;
     char *signatureopt;
     unsigned char signature[16];
index 33459b3188b70a4c1e3732bcc5a2b808e9000d77..cadb0aa3d963b69691092b8dd11a75bf57ea84d6 100644 (file)
@@ -31,4 +31,9 @@ extern struct vol *getvolbypath(AFPObj *obj, const char *path);
 extern struct vol *getvolbyname(const char *name);
 extern void       volume_free(struct vol *vol);
 extern void       volume_unlink(struct vol *volume);
+
+/* Extension type/creator mapping */
+struct extmap *getdefextmap(void);
+struct extmap *getextmap(const char *path);
+
 #endif
index 116a4ceca336e947c6ea9e21038ab267ddbb7249..e7f87724ad1da4a0aff63644f857ef9d18f6de73 100644 (file)
 
 typedef uint64_t VolSpace;
 
+/* This should belong in a file.h */
+struct extmap {
+    char               *em_ext;
+    char               em_creator[4];
+    char               em_type[4];
+};
+
 struct vol {
     struct vol      *v_next;
     AFPObj          *v_obj;
index fd06b366579413bc28518d8de3fc53a2c19653dd..f671fcab824d92d5388a7ac0c7f86dbdb5a33a87 100644 (file)
@@ -281,8 +281,10 @@ _fini: <text variable, no debug info>
 freeifacelist: void (char **)
 fullpathname: const char *(const char *)
 getcwdpath: const char *(void)
+getdefextmap: struct extmap *(void)
 get_eacontent: int (const struct vol *, char *, size_t *, const char *, int, const char *, int)
 get_easize: int (const struct vol *, char *, size_t *, const char *, int, const char *)
+getextmap: struct extmap *(const char *)
 getifacelist: char **(void)
 getip_port: unsigned int (const struct sockaddr *)
 getip_string: const char *(const struct sockaddr *)
index b1d054c865b9bf95ccf06fc25160159af44b3bc1..2e861a06aba2b94304dbe351fc400775c4da6a6e 100644 (file)
@@ -1081,6 +1081,159 @@ EC_CLEANUP:
     EC_EXIT;
 }
 
+static struct extmap    *Extmap = NULL, *Defextmap = NULL;
+static int              Extmap_cnt;
+
+static int setextmap(char *ext, char *type, char *creator)
+{
+    EC_INIT;
+    struct extmap *em;
+    int           cnt;
+
+    if (Extmap == NULL) {
+        EC_NULL_LOG( Extmap = calloc(1, sizeof( struct extmap )) );
+    }
+
+    ext++;
+
+    for (em = Extmap, cnt = 0; em->em_ext; em++, cnt++)
+        if ((strdiacasecmp(em->em_ext, ext)) == 0)
+            goto EC_CLEANUP;
+
+    EC_NULL_LOG( Extmap = realloc(Extmap, sizeof(struct extmap) * (cnt + 2)) );
+    (Extmap + cnt + 1)->em_ext = NULL;
+    em = Extmap + cnt;
+
+    EC_NULL( em->em_ext = strdup(ext) );
+
+    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 ));
+    }
+
+EC_CLEANUP:
+    EC_EXIT;
+}
+
+/* -------------------------- */
+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 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 );
+}
+
+static int readextmap(const char *file)
+{
+    EC_INIT;
+    FILE        *fp;
+    char        ext[256];
+    char        buf[256];
+    char        type[5], creator[5];
+
+    LOG(log_debug, logtype_afpd, "readextmap: loading \"%s\"", file);
+
+    EC_NULL_LOGSTR( fp = fopen(file, "r"), "Couldn't open extension maping file %s", file);
+
+    while (fgets(buf, sizeof(buf), fp) != NULL) {
+        initline(strlen(buf), buf);
+        parseline(sizeof(ext) - 1, ext);
+
+        switch (ext[0]) {
+        case '.' :
+            parseline(sizeof(type) - 1, type);
+            parseline(sizeof(creator) - 1, creator);
+            setextmap(ext, type, creator);
+            LOG(log_debug, logtype_afpd, "readextmap: mapping: '%s' -> %s/%s", ext, type, creator);
+            break;
+        }
+    }
+
+    sortextmap();
+    EC_ZERO( fclose(fp) );
+
+    LOG(log_debug, logtype_afpd, "readextmap: done", file);
+
+EC_CLEANUP:
+    EC_EXIT;
+}
+
 /**************************************************************
  * API functions
  **************************************************************/
@@ -1495,7 +1648,8 @@ int afp_config_parse(AFPObj *AFPObj, char *processname)
     /* figure out options w values */
     options->loginmesg      = iniparser_getstrdup(config, INISEC_GLOBAL, "login message",  NULL);
     options->guest          = iniparser_getstrdup(config, INISEC_GLOBAL, "guest account",  "nobody");
-    options->passwdfile     = iniparser_getstrdup(config, INISEC_GLOBAL, "passwd file",_PATH_AFPDPWFILE);
+    options->extmapfile     = iniparser_getstrdup(config, INISEC_GLOBAL, "extmap file",    _PATH_CONFDIR "afp_extmap.conf");
+    options->passwdfile     = iniparser_getstrdup(config, INISEC_GLOBAL, "passwd file",    _PATH_AFPDPWFILE);
     options->uampath        = iniparser_getstrdup(config, INISEC_GLOBAL, "uam path",       _PATH_AFPDUAMPATH);
     options->uamlist        = iniparser_getstrdup(config, INISEC_GLOBAL, "uam list",       "uams_dhx.so uams_dhx2.so");
     options->port           = iniparser_getstrdup(config, INISEC_GLOBAL, "afp port",       "548");
@@ -1626,6 +1780,8 @@ int afp_config_parse(AFPObj *AFPObj, char *processname)
     options->maccharset = CH_MAC;
     LOG(log_debug, logtype_afpd, "Global mac charset is %s", options->maccodepage);
 
+    EC_ZERO_LOG( readextmap(options->extmapfile) );
+
     /* Check for sane values */
     if (options->tickleval <= 0)
         options->tickleval = 30;
index 50e6f81e8d611b844144e26d99b69d8d309faa71..b915b7791f02ab2833a8922647fa645e8c0ec57b 100644 (file)
@@ -611,6 +611,11 @@ Maximum possible entries in the directory cache\&. The cache stores directories
 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
+extmap file = \fIpath\fR \fB(G)\fR
+.RS 4
+Sets the path to the file which defines file extension type/creator mappings\&. (default is :ETCDIR:/extmap\&.conf)\&.
+.RE
+.PP
 fce listener = \fIhost[:port]\fR \fB(G)\fR
 .RS 4
 Enables sending FCE events to the specified